Skip to contentSkip to conversation

lib/igt_kms: Convert properties to be more atomic-like.

PATCH In review Maarten Lankhorst 4 participants 25 messages Sep 29, 2017 – Oct 4, 2017 Library code

lore
Share & tools
lore
#0 lore raw

v4 cover lib/igt_kms: Convert properties to be more atomic-like.

Instead of having to special case each property when it's added, I want to make sure that any test can add arbitrary properties without having to add too much code. Some of the members I want to expose directly, and I also add a way to set a blob as property for planes and pipes, which will be useful for the upcoming plane color management stuff.

With all the feedback from i-g-t applied.

Maarten Lankhorst (7):
tests: Stop looking at plane private members lib/igt_kms: Change output->pending_crtc_idx_mask to

    output->pending_pipe

lib/igt_kms: Commit primary plane when a modeset is forced on a pipe lib/igt_kms: Rework connector properties to be more atomic, v2. lib/igt_kms: Rework plane properties to be more atomic, v4. lib/igt_kms: Rework pipe properties to be more atomic, v4.1. igt/kms_rotation_crc : Fix flip tests for sprite plane

 lib/igt_kms.c                     | 592 ++++++++++++++++++--------------------
 lib/igt_kms.h                     | 154 +++++-----
 tests/kms_atomic_interruptible.c  |  24 +-
 tests/kms_atomic_transition.c     | 123 ++++----
 tests/kms_busy.c                  |   7 +-
 tests/kms_concurrent.c            |   4 +-
 tests/kms_crtc_background_color.c |   2 +-
 tests/kms_cursor_legacy.c         |   8 +-
 tests/kms_fbc_crc.c               |   3 +-
 tests/kms_panel_fitting.c         |  16 +-
 tests/kms_plane_lowres.c          |   2 +-
 tests/kms_plane_scaling.c         |  14 +-
 tests/kms_rmfb.c                  |   2 +-
 tests/kms_rotation_crc.c          |  37 +--
 14 files changed, 468 insertions(+), 520 deletions(-)
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v4 1/7 tests: Stop looking at plane private members

Most of these tests have no reason to look at those members, so try other ways of getting the information.

---
 lib/igt_kms.h                 |  21 ++++++++
 tests/kms_atomic_transition.c | 117 +++++++++++++++++++++---------------------
 tests/kms_busy.c              |   5 +-
 tests/kms_concurrent.c        |   4 +-
 tests/kms_cursor_legacy.c     |   6 +--
 tests/kms_fbc_crc.c           |   3 +-
 tests/kms_panel_fitting.c     |  14 +----
 tests/kms_plane_scaling.c     |  14 +----
 tests/kms_rmfb.c              |   2 +-
 tests/kms_rotation_crc.c      |  10 ----
 10 files changed, 93 insertions(+), 103 deletions(-)
lib/igt_kms.h +21 -0
index 3d1061fa08c8..62197dcfea7b 100644
@@ -556,6 +556,27 @@ static inline bool igt_output_is_connected(igt_output_t *output)
 	igt_assert_lt(0, drmModeAtomicAddProperty(req, output->config.connector->connector_id,\
 						  output->config.atomic_props_connector[prop], value))
 
+/*
+ * igt_pipe_refresh:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: Pipe to refresh
+ * @force: Should be set to true if mode_blob is no longer considered
+ * to be valid, for example after doing an atomic commit during fork or closing display fd.
+ *
+ * Requests the pipe to be part of the state on next update.
+ * This is useful when state may have been out of sync after
+ * a fork, or we just want to be sure the pipe is included
+ * in the next commit.
+ */
+static inline void
+igt_pipe_refresh(igt_display_t *display, enum pipe pipe, bool force)
+{
+	if (force)
+		display->pipes[pipe].mode_blob = 0;
+
+	display->pipes[pipe].mode_changed = true;
+}
+
 void igt_enable_connectors(void);
 void igt_reset_connectors(void);
 
tests/kms_atomic_transition.c +59 -58

254 lines not on this page · raw message

tests/kms_busy.c +4 -1
index 7e31c2c82dc5..f430beaf7373 100644
@@ -146,7 +146,10 @@ static void flip_to_fb(igt_display_t *dpy, int pipe,
 
 	if (modeset) {
 		igt_set_module_param_int("enable_hangcheck", 1);
-		dpy->pipes[pipe].mode_blob = 0;
+
+		/* Clear old mode blob. */
+		igt_pipe_refresh(dpy, pipe, true);
+
 		igt_output_set_pipe(output, pipe);
 		igt_display_commit2(dpy, COMMIT_ATOMIC);
 	}
tests/kms_concurrent.c +2 -2
index 5d1e0bc5ad19..7f44c596b4c4 100644
@@ -91,7 +91,7 @@ static void test_fini(data_t *data, enum pipe pipe, int n_planes,
 {
 	int i;
 
-	data->display.pipes[pipe].mode_blob = 0;
+	igt_pipe_refresh(&data->display, pipe, true);
 
 	for (i = 0; i < n_planes; i++) {
 		igt_plane_t *plane = data->plane[i];
@@ -292,7 +292,7 @@ test_resolution_with_output(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	i = 0;
 	while (i < iterations || loop_forever) {
-		data->display.pipes[pipe].mode_blob = 0;
+		igt_pipe_refresh(&data->display, pipe, true);
 
 		mode_hi = igt_output_get_mode(output);
 		mode_lo = get_lowres_mode(data, mode_hi, output);
tests/kms_cursor_legacy.c +3 -3
index ba7c3f51ba21..65a001a9dec0 100644
@@ -784,7 +784,7 @@ static bool skip_on_unsupported_nonblocking_modeset(igt_display_t *display)
 
 	/* Force the next state to update all crtc's, to synchronize with the nonblocking modeset. */
 	for_each_pipe(display, pipe)
-		display->pipes[pipe].mode_changed = true;
+		igt_pipe_refresh(display, pipe, false);
 
 	return false;
 }
@@ -971,8 +971,8 @@ static void two_screens_flip_vs_cursor(igt_display_t *display, int nloops, bool
 
 		if (modeset) {
 			/* wait for pending modeset and page flip to complete, to prevent -EBUSY */
-			display->pipes[pipe].mode_changed = true;
-			display->pipes[pipe2].mode_changed = true;
+			igt_pipe_refresh(display, pipe, false);
+			igt_pipe_refresh(display, pipe2, false);
 			igt_display_commit2(display, COMMIT_ATOMIC);
 		}
 	}
tests/kms_fbc_crc.c +1 -2
index 08abb8b4b95e..06234566c232 100644
@@ -461,8 +461,7 @@ static void reset_display(data_t *data)
         igt_pipe_t *pipe = &display->pipes[pipe_id];
 		igt_plane_t *plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
 
-		if (plane->fb)
-			igt_plane_set_fb(plane, NULL);
+		igt_plane_set_fb(plane, NULL);
 	}
 
 	for_each_connected_output(display, data->output)
tests/kms_panel_fitting.c +1 -13
index 5266862a70cf..85a231e60ea2 100644
@@ -84,19 +84,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	}
 
 	igt_plane_set_fb(plane, &data->fb1);
-	if (s == COMMIT_LEGACY) {
-		int ret;
-		ret = drmModeSetCrtc(data->drm_fd,
-				plane->pipe->crtc_id,
-				data->fb_id1,
-				plane->src_x, plane->src_y,
-				&output->id,
-				1,
-				mode);
-		igt_assert_eq(ret, 0);
-	} else {
-		igt_display_commit2(display, s);
-	}
+	igt_display_commit2(display, s);
 }
 
 static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
tests/kms_plane_scaling.c +1 -13
index 1457894aaa10..5ed69f35f267 100644
@@ -93,19 +93,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	}
 
 	igt_plane_set_fb(plane, &data->fb1);
-	if (s == COMMIT_LEGACY) {
-		int ret;
-		ret = drmModeSetCrtc(data->drm_fd,
-				plane->pipe->crtc_id,
-				data->fb_id1,
-				plane->src_x, plane->src_y,
-				&output->id,
-				1,
-				mode);
-		igt_assert_eq(ret, 0);
-	} else {
-		igt_display_commit2(display, s);
-	}
+	igt_display_commit2(display, s);
 }
 
 static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
tests/kms_rmfb.c +1 -1
index 9f1f564e54aa..c97adceea761 100644
@@ -102,7 +102,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo
 		drmSetClientCap(data->drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
 		drmSetClientCap(data->drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);
 
-		data->display.pipes[pipe].mode_blob = 0;
+		igt_pipe_refresh(&data->display, pipe, true);
 	} else {
 		igt_remove_fb(data->drm_fd, &fb);
 		igt_remove_fb(data->drm_fd, &argb_fb);
tests/kms_rotation_crc.c +0 -10
index 21e264addc09..4d2ef1c184f0 100644
@@ -465,12 +465,6 @@ static void test_plane_rotation_ytiled_obj(data_t *data,
 	igt_plane_set_fb(plane, &data->fb);
 	igt_plane_set_size(plane, h, w);
 
-	if (commit < COMMIT_ATOMIC)
-		drmModeObjectSetProperty(fd, plane->drm_plane->plane_id,
-					DRM_MODE_OBJECT_PLANE,
-					plane->rotation_property,
-					plane->rotation);
-
 	ret = igt_display_try_commit2(display, commit);
 
 	igt_output_set_pipe(output, PIPE_NONE);
@@ -562,10 +556,6 @@ static void test_plane_rotation_exhaust_fences(data_t *data,
 		igt_plane_set_rotation(plane, IGT_ROTATION_90);
 		igt_plane_set_size(plane, h, w);
 
-		drmModeObjectSetProperty(fd, plane->drm_plane->plane_id,
-					 DRM_MODE_OBJECT_PLANE,
-					 plane->rotation_property,
-					 plane->rotation);
 		igt_display_commit2(display, commit);
 		if (ret) {
 			igt_warn("failed to commit hardware rotated fb: %i\n", ret);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 1/7
#2 lore raw

Re: [PATCH i-g-t v4 1/7] tests: Stop looking at plane private members

Quoted 4 lines · Maarten Lankhorst

Most of these tests have no reason to look at those members, so try other ways of getting the information.

Quoted 572 lines

---
 lib/igt_kms.h                 |  21 ++++++++ tests/kms_atomic_transition.c | 117 +++++++++++++++++++++-----------
----------
 tests/kms_busy.c              |   5 +- tests/kms_concurrent.c        |   4 +- tests/kms_cursor_legacy.c     |   6 +-- tests/kms_fbc_crc.c           |   3 +- tests/kms_panel_fitting.c     |  14 +---- tests/kms_plane_scaling.c     |  14 +---- tests/kms_rmfb.c              |   2 +- tests/kms_rotation_crc.c      |  10 ----

 10 files changed, 93 insertions(+), 103 deletions(-)
lib/igt_kms.h +0 -0
index 3d1061fa08c8..62197dcfea7b 100644
@@ -556,6 +556,27 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)

  igt_assert_lt(0, drmModeAtomicAddProperty(req, output-

Quoted 1 line

config.connector->connector_id,\

    output-

Quoted 1 line

config.atomic_props_connector[prop], value))


+/*
+ * igt_pipe_refresh:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: Pipe to refresh
+ * @force: Should be set to true if mode_blob is no longer considered
+ * to be valid, for example after doing an atomic commit during fork or closing display fd.
+ *
+ * Requests the pipe to be part of the state on next update.
+ * This is useful when state may have been out of sync after
+ * a fork, or we just want to be sure the pipe is included
+ * in the next commit.
+ */

lib/igt_kms.h +9 -0
+static inline void
+igt_pipe_refresh(igt_display_t *display, enum pipe pipe, bool force)
+{
+	if (force)
+		display->pipes[pipe].mode_blob = 0;
+
+	display->pipes[pipe].mode_changed = true;
+}
+

 void igt_enable_connectors(void);
 void igt_reset_connectors(void);

tests/kms_atomic_transition.c +0 -0
index e22763bdf94b..48823a09aed2 100644
@@ -46,6 +46,11 @@ struct plane_parms {


 #define hweight32 __builtin_popcount

tests/kms_atomic_transition.c +5 -0
+/* globals for fence support */
+int *timeline;
+pthread_t *thread;
+int *seqno;
+

 static void
 run_primary_test(igt_display_t *display, enum pipe pipe, igt_output_t *output)
 {

tests/kms_atomic_transition.c +0 -0
@@ -89,9 +94,34 @@ run_primary_test(igt_display_t *display, enum pipe
 pipe, igt_output_t *output)
  	igt_remove_fb(display->drm_fd, &fb);
  }

tests/kms_atomic_transition.c +22 -0
+static void *fence_inc_thread(void *arg)
+{
+	int t = *((int *) arg);
+
+	pthread_detach(pthread_self());
+
+	usleep(5000);
+	sw_sync_timeline_inc(t, 1);
+	return NULL;
+}
+
+static void configure_fencing(igt_plane_t *plane)
+{
+	int i, fd, ret;
+
+	i = plane->index;
+
+	seqno[i]++;
+	fd = sw_sync_timeline_create_fence(timeline[i], seqno[i]);
+	igt_plane_set_fence_fd(plane, fd);
+	close(fd);
+	ret = pthread_create(&thread[i], NULL, fence_inc_thread,

&timeline[i]);

tests/kms_atomic_transition.c +3 -0
+	igt_assert_eq(ret, 0);
+}
+

 static void
 wm_setup_plane(igt_display_t *display, enum pipe pipe,

tests/kms_atomic_transition.c +1 -1
-	       uint32_t mask, struct plane_parms *parms)
+	       uint32_t mask, struct plane_parms *parms, bool

fencing)
 {
  igt_plane_t *plane;

tests/kms_atomic_transition.c +0 -0
@@ -108,6 +138,9 @@ wm_setup_plane(igt_display_t *display, enum pipe
 pipe,
  			continue;
  		}

tests/kms_atomic_transition.c +3 -0
+		if (fencing)
+			configure_fencing(plane);
+

  igt_plane_set_fb(plane, parms[i].fb); igt_fb_set_size(parms[i].fb, plane, parms[i].width, parms[i].height);
  igt_plane_set_size(plane, parms[i].width, parms[i].height);

tests/kms_atomic_transition.c +0 -0
@@ -136,7 +169,7 @@ static bool
 skip_on_unsupported_nonblocking_modeset(igt_display_t *display)


  /* Force the next state to update all crtc's, to synchronize with the nonblocking modeset. */
  for_each_pipe(display, pipe)

tests/kms_atomic_transition.c +1 -1
-		display->pipes[pipe].mode_changed = true;
+		igt_pipe_refresh(display, pipe, false);


  return false;
 }

tests/kms_atomic_transition.c +0 -0
@@ -183,6 +216,7 @@ static void set_sprite_wh(igt_display_t *display,
 enum pipe pipe,


 static void setup_parms(igt_display_t *display, enum pipe pipe, const drmModeModeInfo *mode,

tests/kms_atomic_transition.c +1 -0
+			struct igt_fb *primary_fb,

  struct igt_fb *argb_fb, struct igt_fb *sprite_fb, struct plane_parms *parms)

tests/kms_atomic_transition.c +0 -0
@@ -205,7 +239,7 @@ static void setup_parms(igt_display_t *display,
 enum pipe pipe,
  		int i = plane->index;


  if (plane->type == DRM_PLANE_TYPE_PRIMARY) {

tests/kms_atomic_transition.c +1 -1
-			parms[i].fb = plane->fb;
+			parms[i].fb = primary_fb;

  parms[i].width = mode->hdisplay; parms[i].height = mode->vdisplay; } else if (plane->type == DRM_PLANE_TYPE_CURSOR) {

tests/kms_atomic_transition.c +0 -0
@@ -242,7 +276,7 @@ retry:
  		set_sprite_wh(display, pipe, parms, sprite_fb,
  			      alpha, sprite_width, sprite_height);

tests/kms_atomic_transition.c +0 -1
-		wm_setup_plane(display, pipe, (1 << n_planes) - 1,

parms);

tests/kms_atomic_transition.c +1 -0
+		wm_setup_plane(display, pipe, (1 << n_planes) - 1,

parms, false);
  ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
  if (ret == -EINVAL) {

tests/kms_atomic_transition.c +0 -0
@@ -300,10 +334,6 @@ retry:
  		 sprite_width, sprite_height, alpha);
  }

tests/kms_atomic_transition.c +0 -4
-int *timeline;
-pthread_t *thread;
-int *seqno;
-

 static void prepare_fencing(igt_display_t *display, enum pipe pipe) {
  igt_plane_t *plane;

tests/kms_atomic_transition.c +0 -0
@@ -335,44 +365,10 @@ static void unprepare_fencing(igt_display_t
 *display, enum pipe pipe)
  	free(seqno);
  }

tests/kms_atomic_transition.c +0 -12
-static void *fence_inc_thread(void *arg)
-{
-	int t = *((int *) arg);
-
-	pthread_detach(pthread_self());
-
-	usleep(5000);
-	sw_sync_timeline_inc(t, 1);
-	return NULL;
-}
-
-static void configure_fencing(igt_display_t *display, enum pipe

pipe)

tests/kms_atomic_transition.c +0 -13
-{
-	igt_plane_t *plane;
-	int i, fd, ret;
-
-	for_each_plane_on_pipe(display, pipe, plane) {
-
-		if (!plane->fb)
-			continue;
-
-		i = plane->index;
-
-		seqno[i]++;
-		fd = sw_sync_timeline_create_fence(timeline[i],

seqno[i]);

tests/kms_atomic_transition.c +0 -3
-		igt_plane_set_fence_fd(plane, fd);
-		close(fd);
-		ret = pthread_create(&thread[i], NULL,

fence_inc_thread, &timeline[i]);

tests/kms_atomic_transition.c +0 -4
-		igt_assert_eq(ret, 0);
-	}
-}
-

 static void atomic_commit(igt_display_t *display, enum pipe pipe, unsigned int flags, void *data, bool fencing)
 {

tests/kms_atomic_transition.c +1 -2
-	if (fencing) {
-		configure_fencing(display, pipe);
+	if (fencing)

  igt_pipe_request_out_fence(&display->pipes[pipe]);

tests/kms_atomic_transition.c +0 -1
-	}


  igt_display_commit_atomic(display, flags, data); }

tests/kms_atomic_transition.c +0 -0
@@ -445,7 +441,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output

  igt_output_set_pipe(output, pipe);

tests/kms_atomic_transition.c +1 -1
-	wm_setup_plane(display, pipe, 0, NULL);
+	wm_setup_plane(display, pipe, 0, NULL, false);


  if (flags & DRM_MODE_ATOMIC_ALLOW_MODESET) { skip_test = nonblocking && skip_on_unsupported_nonblocking_modeset(display);

tests/kms_atomic_transition.c +0 -0
@@ -461,7 +457,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output

  igt_display_commit2(display, COMMIT_ATOMIC);

tests/kms_atomic_transition.c +0 -1
-	setup_parms(display, pipe, mode, &argb_fb, &sprite_fb,

parms);

tests/kms_atomic_transition.c +1 -0
+	setup_parms(display, pipe, mode, &fb, &argb_fb, &sprite_fb,

parms);

  /*
   * In some configurations the tests may not run to completion with all

tests/kms_atomic_transition.c +0 -0
@@ -469,7 +465,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output
   * planes to fix this
   */
  while (1) {

tests/kms_atomic_transition.c +1 -1
-		wm_setup_plane(display, pipe, iter_max - 1, parms);
+		wm_setup_plane(display, pipe, iter_max - 1, parms,

false);

  if (fencing) igt_pipe_request_out_fence(pipe_obj);

tests/kms_atomic_transition.c +0 -0
@@ -504,7 +500,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output
  if (type == TRANSITION_AFTER_FREE) {
  int fence_fd = -1;

tests/kms_atomic_transition.c +1 -1
-		wm_setup_plane(display, pipe, 0, parms);
+		wm_setup_plane(display, pipe, 0, parms, fencing);


  atomic_commit(display, pipe, flags, (void *)(unsigned long)0, fencing);
  if (fencing) {

tests/kms_atomic_transition.c +0 -0
@@ -512,8 +508,9 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output pipe_obj->out_fence_fd = -1; }

tests/kms_atomic_transition.c +1 -0
+		/* force planes to be part of commit */

  for_each_plane_on_pipe(display, pipe, plane)

tests/kms_atomic_transition.c +1 -1
-			plane->fb_changed = true;
+			igt_plane_set_position(plane, 0, 0);


  igt_display_commit2(display, COMMIT_ATOMIC);

tests/kms_atomic_transition.c +0 -0
@@ -530,7 +527,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output
  for (i = 0; i < iter_max; i++) { igt_output_set_pipe(output, pipe);

tests/kms_atomic_transition.c +1 -1
-		wm_setup_plane(display, pipe, i, parms);
+		wm_setup_plane(display, pipe, i, parms, fencing);


  atomic_commit(display, pipe, flags, (void *)(unsigned long)i, fencing); wait_for_transition(display, pipe, nonblocking, fencing);

tests/kms_atomic_transition.c +0 -0
@@ -538,7 +535,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output
  if (type == TRANSITION_MODESET_DISABLE) { igt_output_set_pipe(output, PIPE_NONE);

tests/kms_atomic_transition.c +1 -1
-			wm_setup_plane(display, pipe, 0, parms);
+			wm_setup_plane(display, pipe, 0, parms,

fencing);

  atomic_commit(display, pipe, flags, (void *) 0UL, fencing);
  wait_for_transition(display, pipe, nonblocking, fencing);

tests/kms_atomic_transition.c +0 -0
@@ -547,7 +544,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output

  /* i -> i+1 will be done when i increases, can be skipped here */
  for (j = iter_max - 1; j > i + 1; j--) {

tests/kms_atomic_transition.c +0 -1
-				wm_setup_plane(display, pipe, j,

parms);

tests/kms_atomic_transition.c +1 -0
+				wm_setup_plane(display, pipe, j,

parms, fencing);

  if (type == TRANSITION_MODESET) igt_output_override_mode(out put, &override_mode);

tests/kms_atomic_transition.c +0 -0
@@ -555,7 +552,7 @@ run_transition_test(igt_display_t *display, enum

pipe pipe, igt_output_t *output
  atomic_commit(display, pipe, flags, (void *)(unsigned long) j, fencing); wait_for_transition(display, pipe, nonblocking, fencing);

tests/kms_atomic_transition.c +0 -1
-				wm_setup_plane(display, pipe, i,

parms);

tests/kms_atomic_transition.c +1 -0
+				wm_setup_plane(display, pipe, i,

parms, fencing);
  if (type == TRANSITION_MODESET) igt_output_override_mode(out put, NULL);

tests/kms_atomic_transition.c +0 -0
@@ -666,15 +663,19 @@ static unsigned set_combinations(igt_display_t
 *display, unsigned mask, struct i
  	return event_mask;
  }

tests/kms_atomic_transition.c +1 -1
-static void refresh_primaries(igt_display_t *display)
+static void refresh_primaries(igt_display_t *display, int mask)

 {
  enum pipe pipe;
  igt_plane_t *plane;

tests/kms_atomic_transition.c +4 -1
-	for_each_pipe(display, pipe)
+	for_each_pipe(display, pipe) {
+		if (!((1 << pipe) & mask))
+			continue;
+

  for_each_plane_on_pipe(display, pipe, plane)

tests/kms_atomic_transition.c +0 -1
-			if (plane->type == DRM_PLANE_TYPE_PRIMARY &&

plane->fb)

tests/kms_atomic_transition.c +3 -1
-				plane->fb_changed = true;
+			if (plane->type == DRM_PLANE_TYPE_PRIMARY)
+				igt_plane_set_position(plane, 0, 0);
+	}

 }

 static void collect_crcs_mask(igt_pipe_crc_t **pipe_crcs, unsigned mask, igt_crc_t *crcs)

tests/kms_atomic_transition.c +0 -0
@@ -783,7 +784,7 @@ static void run_modeset_tests(igt_display_t
 *display, int howmany, bool nonblock


  collect_crcs_mask(pipe_crcs, j, crcs[1]);

tests/kms_atomic_transition.c +1 -1
-			refresh_primaries(display);
+			refresh_primaries(display, j);

  commit_display(display, j, nonblocking); collect_crcs_mask(pipe_crcs, j, crcs[2]);

tests/kms_atomic_transition.c +0 -0
@@ -794,7 +795,7 @@ static void run_modeset_tests(igt_display_t
 *display, int howmany, bool nonblock
  			commit_display(display, event_mask,
 nonblocking);
  			collect_crcs_mask(pipe_crcs, i, crcs[3]);

tests/kms_atomic_transition.c +1 -1
-			refresh_primaries(display);
+			refresh_primaries(display, i);

  commit_display(display, i, nonblocking); collect_crcs_mask(pipe_crcs, i, crcs[4]);

tests/kms_busy.c +0 -0
index 7e31c2c82dc5..f430beaf7373 100644
@@ -146,7 +146,10 @@ static void flip_to_fb(igt_display_t *dpy, int
 pipe,


  if (modeset) { igt_set_module_param_int("enable_hangcheck", 1);

tests/kms_busy.c +4 -1
-		dpy->pipes[pipe].mode_blob = 0;
+
+		/* Clear old mode blob. */
+		igt_pipe_refresh(dpy, pipe, true);
+

  igt_output_set_pipe(output, pipe); igt_display_commit2(dpy, COMMIT_ATOMIC); }

tests/kms_concurrent.c +0 -0
index 5d1e0bc5ad19..7f44c596b4c4 100644
@@ -91,7 +91,7 @@ static void test_fini(data_t *data, enum pipe pipe,
 int n_planes,
  {
  	int i;

tests/kms_concurrent.c +1 -1
-	data->display.pipes[pipe].mode_blob = 0;
+	igt_pipe_refresh(&data->display, pipe, true);


  for (i = 0; i < n_planes; i++) { igt_plane_t *plane = data->plane[i];

tests/kms_concurrent.c +0 -0
@@ -292,7 +292,7 @@ test_resolution_with_output(data_t *data, enum
 pipe pipe, igt_output_t *output)


  i = 0;
  while (i < iterations || loop_forever) {

tests/kms_concurrent.c +1 -1
-		data->display.pipes[pipe].mode_blob = 0;
+		igt_pipe_refresh(&data->display, pipe, true);


  mode_hi = igt_output_get_mode(output); mode_lo = get_lowres_mode(data, mode_hi, output);

tests/kms_cursor_legacy.c +0 -0
index ba7c3f51ba21..65a001a9dec0 100644
@@ -784,7 +784,7 @@ static bool
 skip_on_unsupported_nonblocking_modeset(igt_display_t *display)


  /* Force the next state to update all crtc's, to synchronize with the nonblocking modeset. */
  for_each_pipe(display, pipe)

tests/kms_cursor_legacy.c +1 -1
-		display->pipes[pipe].mode_changed = true;
+		igt_pipe_refresh(display, pipe, false);


  return false;
 }

tests/kms_cursor_legacy.c +0 -0
@@ -971,8 +971,8 @@ static void

two_screens_flip_vs_cursor(igt_display_t *display, int nloops, bool
  if (modeset) {
  /* wait for pending modeset and page flip to complete, to prevent -EBUSY */

tests/kms_cursor_legacy.c +2 -2
-			display->pipes[pipe].mode_changed = true;
-			display->pipes[pipe2].mode_changed = true;
+			igt_pipe_refresh(display, pipe, false);
+			igt_pipe_refresh(display, pipe2, false);

  igt_display_commit2(display, COMMIT_ATOMIC); }
  }

tests/kms_fbc_crc.c +0 -0
index 08abb8b4b95e..06234566c232 100644
@@ -461,8 +461,7 @@ static void reset_display(data_t *data)
          igt_pipe_t *pipe = &display->pipes[pipe_id];
  		igt_plane_t *plane = igt_pipe_get_plane_type(pipe,
 DRM_PLANE_TYPE_PRIMARY);

tests/kms_fbc_crc.c +1 -2
-		if (plane->fb)
-			igt_plane_set_fb(plane, NULL);
+		igt_plane_set_fb(plane, NULL);

  }

  for_each_connected_output(display, data->output)

tests/kms_panel_fitting.c +0 -0
index 5266862a70cf..85a231e60ea2 100644
@@ -84,19 +84,7 @@ static void prepare_crtc(data_t *data,
 igt_output_t *output, enum pipe pipe,
  	}


  igt_plane_set_fb(plane, &data->fb1);

tests/kms_panel_fitting.c +1 -13
-	if (s == COMMIT_LEGACY) {
-		int ret;
-		ret = drmModeSetCrtc(data->drm_fd,
-				plane->pipe->crtc_id,
-				data->fb_id1,
-				plane->src_x, plane->src_y,
-				&output->id,
-				1,
-				mode);
-		igt_assert_eq(ret, 0);
-	} else {
-		igt_display_commit2(display, s);
-	}
+	igt_display_commit2(display, s);

 }

 static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)

tests/kms_plane_scaling.c +0 -0
index 1457894aaa10..5ed69f35f267 100644
@@ -93,19 +93,7 @@ static void prepare_crtc(data_t *data,
 igt_output_t *output, enum pipe pipe,
  	}


  igt_plane_set_fb(plane, &data->fb1);

tests/kms_plane_scaling.c +1 -13
-	if (s == COMMIT_LEGACY) {
-		int ret;
-		ret = drmModeSetCrtc(data->drm_fd,
-				plane->pipe->crtc_id,
-				data->fb_id1,
-				plane->src_x, plane->src_y,
-				&output->id,
-				1,
-				mode);
-		igt_assert_eq(ret, 0);
-	} else {
-		igt_display_commit2(display, s);
-	}
+	igt_display_commit2(display, s);

 }

 static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)

tests/kms_rmfb.c +0 -0
index 9f1f564e54aa..c97adceea761 100644
@@ -102,7 +102,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t
 *output, enum pipe pipe, bool reo
  		drmSetClientCap(data->drm_fd,
 DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
  		drmSetClientCap(data->drm_fd, DRM_CLIENT_CAP_ATOMIC,
 1);

tests/kms_rmfb.c +1 -1
-		data->display.pipes[pipe].mode_blob = 0;
+		igt_pipe_refresh(&data->display, pipe, true);

  } else {
  igt_remove_fb(data->drm_fd, &fb); igt_remove_fb(data->drm_fd, &argb_fb);

tests/kms_rotation_crc.c +0 -0
index 21e264addc09..4d2ef1c184f0 100644
@@ -465,12 +465,6 @@ static void
 test_plane_rotation_ytiled_obj(data_t *data,
  	igt_plane_set_fb(plane, &data->fb);
  	igt_plane_set_size(plane, h, w);

tests/kms_rotation_crc.c +0 -2
-	if (commit < COMMIT_ATOMIC)
-		drmModeObjectSetProperty(fd, plane->drm_plane-
Quoted 1 line

plane_id,

tests/kms_rotation_crc.c +0 -4
-					DRM_MODE_OBJECT_PLANE,
-					plane->rotation_property,
-					plane->rotation);
-

  ret = igt_display_try_commit2(display, commit);
  igt_output_set_pipe(output, PIPE_NONE);

tests/kms_rotation_crc.c +0 -0
@@ -562,10 +556,6 @@ static void
 test_plane_rotation_exhaust_fences(data_t *data,
  		igt_plane_set_rotation(plane, IGT_ROTATION_90);
  		igt_plane_set_size(plane, h, w);

tests/kms_rotation_crc.c +0 -1
-		drmModeObjectSetProperty(fd, plane->drm_plane-
Quoted 1 line

plane_id,

tests/kms_rotation_crc.c +0 -3
-					 DRM_MODE_OBJECT_PLANE,
-					 plane->rotation_property,
-					 plane->rotation);

  igt_display_commit2(display, commit);
  if (ret) {
  igt_warn("failed to commit hardware rotated
fb: %i\n", ret);

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH i-g-t v4 1/7] tests: Stop looking at plane private members

Op 29-09-17 om 15:13 schreef Mika Kahola:

Quoted 6 lines · Maarten Lankhorst
Quoted 4 lines

Most of these tests have no reason to look at those members, so try other ways of getting the information.

Thanks, patch 1 & 7 pushed. :)

~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH v4 2/7 lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipe

In reply to Maarten Lankhorst

igt_output_set_pipe with PIPE_ANY used to mean that we bind the output to any pipe, but this is now a deprecated alias for PIPE_NONE, and means the output will be unbound.

Because of this it's better to change output->pending_crtc_idx_mask to an enum pipe, because only a single choice may be given for a pipe.

---
 lib/igt_kms.c                 | 46 ++++++++++++++++++++-----------------------
 lib/igt_kms.h                 |  2 +-
 tests/kms_atomic_transition.c |  4 ++--
 tests/kms_busy.c              |  2 +-
 tests/kms_cursor_legacy.c     |  2 +-
 5 files changed, 26 insertions(+), 30 deletions(-)
lib/igt_kms.c +21 -25
index 7bcafc072f70..a5db6bc493c2 100644
@@ -1561,9 +1561,10 @@ static void igt_display_log_shift(igt_display_t *display, int shift)
 static void igt_output_refresh(igt_output_t *output)
 {
 	igt_display_t *display = output->display;
-	unsigned long crtc_idx_mask;
+	unsigned long crtc_idx_mask = 0;
 
-	crtc_idx_mask = output->pending_crtc_idx_mask;
+	if (output->pending_pipe != PIPE_NONE)
+		crtc_idx_mask = 1 << output->pending_pipe;
 
 	kmstest_free_connector_config(&output->config);
 
@@ -1587,11 +1588,8 @@ static void igt_output_refresh(igt_output_t *output)
 						    BROADCAST_RGB_FULL);
 	}
 
-	if (output->config.pipe == PIPE_NONE)
-		return;
-
 	LOG(display, "%s: Selecting pipe %s\n", output->name,
-	    kmstest_pipe_name(output->config.pipe));
+	    kmstest_pipe_name(output->pending_pipe));
 }
 
 static bool
@@ -1830,7 +1828,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		 * a pipe is set with igt_output_set_pipe().
 		 */
 		output->force_reprobe = true;
-		output->pending_crtc_idx_mask = 0;
+		output->pending_pipe = PIPE_NONE;
 		output->id = resources->connectors[i];
 		output->display = display;
 
@@ -1960,10 +1958,12 @@ static void igt_display_refresh(igt_display_t *display)
 	for (i = 0; i < display->n_outputs; i++) {
 		output = &display->outputs[i];
 
-		if (pipes_in_use & output->pending_crtc_idx_mask)
-			goto report_dup;
+		if (output->pending_pipe != PIPE_NONE) {
+			if (pipes_in_use & (1 << output->pending_pipe))
+				goto report_dup;
 
-		pipes_in_use |= output->pending_crtc_idx_mask;
+			pipes_in_use |= 1 << output->pending_pipe;
+		}
 
 		if (output->force_reprobe)
 			igt_output_refresh(output);
@@ -1975,11 +1975,11 @@ report_dup:
 	for (; i > 0; i--) {
 		igt_output_t *b = &display->outputs[i - 1];
 
-		igt_assert_f(output->pending_crtc_idx_mask !=
-			     b->pending_crtc_idx_mask,
+		igt_assert_f(output->pending_pipe !=
+			     b->pending_pipe,
 			     "%s and %s are both trying to use pipe %s\n",
 			     igt_output_name(output), igt_output_name(b),
-			     kmstest_pipe_name(ffs(b->pending_crtc_idx_mask) - 1));
+			     kmstest_pipe_name(output->pending_pipe));
 	}
 }
 
@@ -1988,7 +1988,7 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
 	igt_display_t *display = output->display;
 	enum pipe pipe;
 
-	if (!output->pending_crtc_idx_mask) {
+	if (output->pending_pipe == PIPE_NONE) {
 		/*
 		 * The user hasn't specified a pipe to use, return none.
 		 */
@@ -1998,7 +1998,7 @@ static igt_pipe_t *igt_output_get_driving_pipe(igt_output_t *output)
 		 * Otherwise, return the pending pipe (ie the pipe that should
 		 * drive this output after the commit()
 		 */
-		pipe = ffs(output->pending_crtc_idx_mask) - 1;
+		pipe = output->pending_pipe;
 	}
 
 	igt_assert(pipe >= 0 && pipe < display->n_pipes);
@@ -2051,7 +2051,7 @@ static igt_output_t *igt_pipe_get_output(igt_pipe_t *pipe)
 	for (i = 0; i < display->n_outputs; i++) {
 		igt_output_t *output = &display->outputs[i];
 
-		if (output->pending_crtc_idx_mask == (1 << pipe->pipe))
+		if (output->pending_pipe == pipe->pipe)
 			return output;
 	}
 
@@ -2860,22 +2860,18 @@ void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 
 	igt_assert(output->name);
 
-	if (output->pending_crtc_idx_mask) {
+	if (output->pending_pipe != PIPE_NONE) {
 		old_pipe = igt_output_get_driving_pipe(output);
 
 		old_pipe->mode_changed = true;
 	}
 
-	if (pipe == PIPE_NONE) {
-		LOG(display, "%s: set_pipe(any)\n", igt_output_name(output));
-		output->pending_crtc_idx_mask = 0;
-	} else {
-		LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
-		    kmstest_pipe_name(pipe));
-		output->pending_crtc_idx_mask = 1 << pipe;
+	LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
+	    kmstest_pipe_name(pipe));
+	output->pending_pipe = pipe;
 
+	if (pipe != PIPE_NONE)
 		display->pipes[pipe].mode_changed = true;
-	}
 
 	output->config.pipe_changed = true;
 
lib/igt_kms.h +1 -1
index 62197dcfea7b..8dc118c961b7 100644
@@ -361,7 +361,7 @@ typedef struct {
 	struct kmstest_connector_config config;
 	char *name;
 	bool force_reprobe;
-	unsigned long pending_crtc_idx_mask;
+	enum pipe pending_pipe;
 	bool use_override_mode;
 	drmModeModeInfo override_mode;
 } igt_output_t;
tests/kms_atomic_transition.c +2 -2
index 48823a09aed2..2ae75f2d6630 100644
@@ -644,7 +644,7 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct i
 		event_mask |= 1 << pipe;
 
 		for_each_valid_output_on_pipe(display, pipe, output) {
-			if (output->pending_crtc_idx_mask)
+			if (output->pending_pipe != PIPE_NONE)
 				continue;
 
 			mode = igt_output_get_mode(output);
@@ -726,7 +726,7 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblock
 			pipe_crcs[i] = igt_pipe_crc_new(display->drm_fd, i, INTEL_PIPE_CRC_SOURCE_AUTO);
 
 		for_each_valid_output_on_pipe(display, i, output) {
-			if (output->pending_crtc_idx_mask)
+			if (output->pending_pipe != PIPE_NONE)
 				continue;
 
 			igt_output_set_pipe(output, i);
tests/kms_busy.c +1 -1
index f430beaf7373..0828a8b38a06 100644
@@ -41,7 +41,7 @@ set_fb_on_crtc(igt_display_t *dpy, int pipe, struct igt_fb *fb)
 		drmModeModeInfoPtr mode;
 		igt_plane_t *primary;
 
-		if (output->pending_crtc_idx_mask)
+		if (output->pending_pipe != PIPE_NONE)
 			continue;
 
 		igt_output_set_pipe(output, pipe);
tests/kms_cursor_legacy.c +1 -1
index 65a001a9dec0..fc7526833673 100644
@@ -155,7 +155,7 @@ static igt_output_t *set_fb_on_crtc(igt_display_t *display, enum pipe pipe, stru
 		drmModeModeInfoPtr mode;
 		igt_plane_t *primary;
 
-		if (output->pending_crtc_idx_mask)
+		if (output->pending_pipe != PIPE_NONE)
 			continue;
 
 		igt_output_set_pipe(output, pipe);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 2/7
#5 lore raw

Re: [PATCH i-g-t v4 2/7] lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipe

Quoted 10 lines · Maarten Lankhorst

igt_output_set_pipe with PIPE_ANY used to mean that we bind the output
to any pipe, but this is now a deprecated alias for PIPE_NONE, and means the output will be unbound.

Because of this it's better to change output->pending_crtc_idx_mask to
an enum pipe, because only a single choice may be given for a pipe.

Quoted 221 lines

---
 lib/igt_kms.c                 | 46 ++++++++++++++++++++-------------
----------
 lib/igt_kms.h                 |  2 +- tests/kms_atomic_transition.c |  4 ++--
 tests/kms_busy.c              |  2 +- tests/kms_cursor_legacy.c     |  2 +-

 5 files changed, 26 insertions(+), 30 deletions(-)
lib/igt_kms.c +1 -1
index 7bcafc072f70..a5db6bc493c2 100644
@@ -1561,9 +1561,10 @@ static void
 igt_display_log_shift(igt_display_t *display, int shift)
  static void igt_output_refresh(igt_output_t *output)
  {
  	igt_display_t *display = output->display;
-	unsigned long crtc_idx_mask;
+	unsigned long crtc_idx_mask = 0;

lib/igt_kms.c +2 -1
-	crtc_idx_mask = output->pending_crtc_idx_mask;
+	if (output->pending_pipe != PIPE_NONE)
+		crtc_idx_mask = 1 << output->pending_pipe;

kmstest_free_connector_config(&output->config);

lib/igt_kms.c +0 -0
@@ -1587,11 +1588,8 @@ static void igt_output_refresh(igt_output_t
 *output)

      BROADCAST_RGB_FU LL);
  }

lib/igt_kms.c +0 -3
-	if (output->config.pipe == PIPE_NONE)
-		return;
-

  LOG(display, "%s: Selecting pipe %s\n", output->name,

lib/igt_kms.c +1 -1
-	    kmstest_pipe_name(output->config.pipe));
+	    kmstest_pipe_name(output->pending_pipe));

 }

 static bool

lib/igt_kms.c +1 -1
@@ -1830,7 +1828,7 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
  		 * a pipe is set with igt_output_set_pipe().
  		 */
  		output->force_reprobe = true;
-		output->pending_crtc_idx_mask = 0;
+		output->pending_pipe = PIPE_NONE;
  		output->id = resources->connectors[i];
  		output->display = display;

lib/igt_kms.c +0 -0
@@ -1960,10 +1958,12 @@ static void igt_display_refresh(igt_display_t
 *display)
  	for (i = 0; i < display->n_outputs; i++) {
  		output = &display->outputs[i];

lib/igt_kms.c +2 -2
-		if (pipes_in_use & output->pending_crtc_idx_mask)
-			goto report_dup;
+		if (output->pending_pipe != PIPE_NONE) {
+			if (pipes_in_use & (1 << output-
Quoted 1 line

pending_pipe))

lib/igt_kms.c +1 -0
+				goto report_dup;

lib/igt_kms.c +2 -1
-		pipes_in_use |= output->pending_crtc_idx_mask;
+			pipes_in_use |= 1 << output->pending_pipe;
+		}


  if (output->force_reprobe) igt_output_refresh(output);

lib/igt_kms.c +0 -0
@@ -1975,11 +1975,11 @@ report_dup:
  	for (; i > 0; i--) {
  		igt_output_t *b = &display->outputs[i - 1];

lib/igt_kms.c +2 -2
-		igt_assert_f(output->pending_crtc_idx_mask !=
-			     b->pending_crtc_idx_mask,
+		igt_assert_f(output->pending_pipe !=
+			     b->pending_pipe,

       "%s and %s are both trying to use pipe %s\n",
       igt_output_name(output), igt_output_name(b),

lib/igt_kms.c +0 -1
-			     kmstest_pipe_name(ffs(b-
Quoted 1 line

pending_crtc_idx_mask) - 1));

lib/igt_kms.c +1 -0
+			     kmstest_pipe_name(output-
Quoted 1 line

pending_pipe));

  }
 }

lib/igt_kms.c +0 -0
@@ -1988,7 +1988,7 @@ static igt_pipe_t
 *igt_output_get_driving_pipe(igt_output_t *output)
  	igt_display_t *display = output->display;
  	enum pipe pipe;

lib/igt_kms.c +1 -1
-	if (!output->pending_crtc_idx_mask) {
+	if (output->pending_pipe == PIPE_NONE) {

  /*
   * The user hasn't specified a pipe to use, return none.
   */

lib/igt_kms.c +0 -0
@@ -1998,7 +1998,7 @@ static igt_pipe_t
 *igt_output_get_driving_pipe(igt_output_t *output)
  		 * Otherwise, return the pending pipe (ie the pipe

that should
   * drive this output after the commit() */

lib/igt_kms.c +1 -1
-		pipe = ffs(output->pending_crtc_idx_mask) - 1;
+		pipe = output->pending_pipe;

  }

  igt_assert(pipe >= 0 && pipe < display->n_pipes);

lib/igt_kms.c +0 -0
@@ -2051,7 +2051,7 @@ static igt_output_t
 *igt_pipe_get_output(igt_pipe_t *pipe)
  	for (i = 0; i < display->n_outputs; i++) {
  		igt_output_t *output = &display->outputs[i];

lib/igt_kms.c +0 -1
-		if (output->pending_crtc_idx_mask == (1 << pipe-
Quoted 1 line

pipe))

lib/igt_kms.c +1 -0
+		if (output->pending_pipe == pipe->pipe)

  return output;
  }

lib/igt_kms.c +0 -0
@@ -2860,22 +2860,18 @@ void igt_output_set_pipe(igt_output_t
 *output, enum pipe pipe)


  igt_assert(output->name);

lib/igt_kms.c +1 -1
-	if (output->pending_crtc_idx_mask) {
+	if (output->pending_pipe != PIPE_NONE) {

  old_pipe = igt_output_get_driving_pipe(output);
  old_pipe->mode_changed = true;
  }

lib/igt_kms.c +0 -2
-	if (pipe == PIPE_NONE) {
-		LOG(display, "%s: set_pipe(any)\n",

igt_output_name(output));

lib/igt_kms.c +0 -3
-		output->pending_crtc_idx_mask = 0;
-	} else {
-		LOG(display, "%s: set_pipe(%s)\n",

igt_output_name(output),

lib/igt_kms.c +3 -2
-		    kmstest_pipe_name(pipe));
-		output->pending_crtc_idx_mask = 1 << pipe;
+	LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
+	    kmstest_pipe_name(pipe));
+	output->pending_pipe = pipe;

lib/igt_kms.c +1 -0
+	if (pipe != PIPE_NONE)

  display->pipes[pipe].mode_changed = true;

lib/igt_kms.c +0 -1
-	}


  output->config.pipe_changed = true;

lib/igt_kms.h +1 -1
index 62197dcfea7b..8dc118c961b7 100644
@@ -361,7 +361,7 @@ typedef struct {
  	struct kmstest_connector_config config;
  	char *name;
  	bool force_reprobe;
-	unsigned long pending_crtc_idx_mask;
+	enum pipe pending_pipe;
  	bool use_override_mode;
  	drmModeModeInfo override_mode;
  } igt_output_t;
tests/kms_atomic_transition.c +0 -0
index 48823a09aed2..2ae75f2d6630 100644
@@ -644,7 +644,7 @@ static unsigned set_combinations(igt_display_t
 *display, unsigned mask, struct i
  		event_mask |= 1 << pipe;


  for_each_valid_output_on_pipe(display, pipe, output) {

tests/kms_atomic_transition.c +1 -1
-			if (output->pending_crtc_idx_mask)
+			if (output->pending_pipe != PIPE_NONE)

  continue;

  mode = igt_output_get_mode(output);

tests/kms_atomic_transition.c +0 -0
@@ -726,7 +726,7 @@ static void run_modeset_tests(igt_display_t
 *display, int howmany, bool nonblock

  pipe_crcs[i] = igt_pipe_crc_new(display-

Quoted 1 line

drm_fd, i, INTEL_PIPE_CRC_SOURCE_AUTO);


  for_each_valid_output_on_pipe(display, i, output) {

tests/kms_atomic_transition.c +1 -1
-			if (output->pending_crtc_idx_mask)
+			if (output->pending_pipe != PIPE_NONE)

  continue;

  igt_output_set_pipe(output, i);

tests/kms_busy.c +0 -0
index f430beaf7373..0828a8b38a06 100644
@@ -41,7 +41,7 @@ set_fb_on_crtc(igt_display_t *dpy, int pipe, struct
 igt_fb *fb)
  		drmModeModeInfoPtr mode;
  		igt_plane_t *primary;

tests/kms_busy.c +1 -1
-		if (output->pending_crtc_idx_mask)
+		if (output->pending_pipe != PIPE_NONE)

  continue;

  igt_output_set_pipe(output, pipe);

tests/kms_cursor_legacy.c +0 -0
index 65a001a9dec0..fc7526833673 100644
@@ -155,7 +155,7 @@ static igt_output_t *set_fb_on_crtc(igt_display_t
 *display, enum pipe pipe, stru
  		drmModeModeInfoPtr mode;
  		igt_plane_t *primary;

tests/kms_cursor_legacy.c +1 -1
-		if (output->pending_crtc_idx_mask)
+		if (output->pending_pipe != PIPE_NONE)

  continue;

  igt_output_set_pipe(output, pipe);

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v4 3/7 lib/igt_kms: Commit primary plane when a modeset is forced on a pipe

In reply to Maarten Lankhorst

In between tests, some tests can do the following sequence:

(pipe C configured with FB)
igt_plane_set_fb(primary (pipe C), NULL);
/* Clear rotation property first */
igt_display_commit2(display, COMMIT_UNIVERSAL);

/* disable pipe */
igt_display_commit2(display, COMMIT_LEGACY);

This would result in PIPE_C not being properly disabled, which will cause an error on the next mode. This can be seen when running the full kms_rotation_crc testcase without --subtest, it will fail on exhaust-fences because the bad-tiling subtest wasn't able to disable pipe C correctly.

Testcase: kms_rotation_crc

---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +1 -1
index a5db6bc493c2..d25090b05c70 100644
@@ -2332,7 +2332,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	igt_assert(!primary->rotation_changed);
 
 	if (!primary->fb_changed && !primary->position_changed &&
-	    !primary->size_changed)
+	    !primary->size_changed && !primary->pipe->mode_changed)
 		return 0;
 
 	crtc_id = pipe->crtc_id;
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 3/7
#7 lore raw

Re: [PATCH i-g-t v4 3/7] lib/igt_kms: Commit primary plane when a modeset is forced on a pipe

Quoted 10 lines · Maarten Lankhorst

In between tests, some tests can do the following sequence:

(pipe C configured with FB)
igt_plane_set_fb(primary (pipe C), NULL);
/* Clear rotation property first */
igt_display_commit2(display, COMMIT_UNIVERSAL);

/* disable pipe */
igt_display_commit2(display, COMMIT_LEGACY);

Quoted 8 lines

This would result in PIPE_C not being properly disabled, which will cause an error on the next mode. This can be seen when running the full kms_rotation_crc testcase without --subtest, it will fail on exhaust-fences because the bad-tiling subtest wasn't able to disable pipe C correctly.

Testcase: kms_rotation_crc

Quoted 18 lines

---
 lib/igt_kms.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.c +0 -0
index a5db6bc493c2..d25090b05c70 100644
@@ -2332,7 +2332,7 @@ static int
 igt_primary_plane_commit_legacy(igt_plane_t *primary,
  	igt_assert(!primary->rotation_changed);


  if (!primary->fb_changed && !primary->position_changed &&

lib/igt_kms.c +1 -1
-	    !primary->size_changed)
+	    !primary->size_changed && !primary->pipe->mode_changed)

  return 0;

  crtc_id = pipe->crtc_id;

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH v4 4/7 lib/igt_kms: Rework connector properties to be more atomic, v2.

In reply to Maarten Lankhorst

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changs since v1:
- Mention which properties we set to what.
- Assert the property to be set is valid.

---
 lib/igt_kms.c                    | 44 +++++++++++++++++++---------------------
 lib/igt_kms.h                    | 35 +++++++++++++++++++-------------
 tests/kms_atomic_interruptible.c |  4 ++--
 tests/kms_panel_fitting.c        |  2 +-
 4 files changed, 45 insertions(+), 40 deletions(-)
lib/igt_kms.c +21 -23
index d25090b05c70..07d2074c2b1a 100644
@@ -248,7 +248,7 @@ igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
 			if (strcmp(prop->name, conn_prop_names[j]) != 0)
 				continue;
 
-			output->config.atomic_props_connector[j] = props->props[i];
+			output->props[j] = props->props[i];
 			break;
 		}
 
@@ -1834,7 +1834,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 
 		igt_output_refresh(output);
 
-		output->config.pipe_changed = true;
+		igt_output_set_prop_changed(output, IGT_CONNECTOR_CRTC_ID);
 	}
 
 	drmModeFreePlaneResources(plane_resources);
@@ -2514,23 +2514,24 @@ static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe
 static void igt_atomic_prepare_connector_commit(igt_output_t *output, drmModeAtomicReq *req)
 {
 
-	struct kmstest_connector_config *config = &output->config;
+	int i;
 
-	if (config->connector_scaling_mode_changed)
-		igt_atomic_populate_connector_req(req, output, IGT_CONNECTOR_SCALING_MODE, config->connector_scaling_mode);
+	for (i = 0; i < IGT_NUM_CONNECTOR_PROPS; i++) {
+		if (!igt_output_is_prop_changed(output, i))
+			continue;
 
-	if (config->pipe_changed) {
-		uint32_t crtc_id = 0;
+		/* it's an error to try an unsupported feature */
+		igt_assert(output->props[i]);
 
-		if (output->config.pipe != PIPE_NONE)
-			crtc_id = output->config.crtc->crtc_id;
+		igt_debug("%s: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			  igt_output_name(output), igt_connector_prop_names[i],
+			  output->values[i], output->values[i]);
 
-		igt_atomic_populate_connector_req(req, output, IGT_CONNECTOR_CRTC_ID, crtc_id);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req,
+					  output->config.connector->connector_id,
+					  output->props[i],
+					  output->values[i]));
 	}
-	/*
-	 *	TODO: Add all other connector level properties here
-	 */
-
 }
 
 /*
@@ -2625,11 +2626,10 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 	for (i = 0; i < display->n_outputs; i++) {
 		igt_output_t *output = &display->outputs[i];
 
-		if (s != COMMIT_UNIVERSAL)
-			output->config.pipe_changed = false;
-
 		if (s == COMMIT_ATOMIC)
-			output->config.connector_scaling_mode_changed = false;
+			output->changed = 0;
+		else if (s != COMMIT_UNIVERSAL)
+			igt_output_clear_prop_changed(output, IGT_CONNECTOR_CRTC_ID);
 	}
 }
 
@@ -2873,18 +2873,16 @@ void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 	if (pipe != PIPE_NONE)
 		display->pipes[pipe].mode_changed = true;
 
-	output->config.pipe_changed = true;
+	igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID, pipe == PIPE_NONE ? 0 : display->pipes[pipe].crtc_id);
 
 	igt_output_refresh(output);
 }
 
 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)
 {
-	output->config.connector_scaling_mode_changed = true;
-
-	output->config.connector_scaling_mode = scaling_mode;
+	igt_output_set_prop_value(output, IGT_CONNECTOR_SCALING_MODE, scaling_mode);
 
-	igt_require(output->config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE]);
+	igt_require(output->props[IGT_CONNECTOR_SCALING_MODE]);
 }
 
 igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx)
lib/igt_kms.h +21 -14
index 8dc118c961b7..1ef10e7d525c 100644
@@ -131,10 +131,7 @@ struct kmstest_connector_config {
 	drmModeConnector *connector;
 	drmModeEncoder *encoder;
 	drmModeModeInfo default_mode;
-	uint64_t connector_scaling_mode;
-	bool connector_scaling_mode_changed;
-	bool pipe_changed;
-	uint32_t atomic_props_connector[IGT_NUM_CONNECTOR_PROPS];
+
 	int pipe;
 	unsigned valid_crtc_idx_mask;
 };
@@ -364,6 +361,12 @@ typedef struct {
 	enum pipe pending_pipe;
 	bool use_override_mode;
 	drmModeModeInfo override_mode;
+
+	/* bitmask of changed properties */
+	uint64_t changed;
+
+	uint32_t props[IGT_NUM_CONNECTOR_PROPS];
+	uint64_t values[IGT_NUM_CONNECTOR_PROPS];
 } igt_output_t;
 
 struct igt_display {
@@ -545,16 +548,20 @@ static inline bool igt_output_is_connected(igt_output_t *output)
 #define igt_atomic_populate_crtc_req(req, pipe, prop, value) \
 	igt_assert_lt(0, drmModeAtomicAddProperty(req, pipe->crtc_id,\
 						  pipe->atomic_props_crtc[prop], value))
-/**
- * igt_atomic_populate_connector_req:
- * @req: A pointer to drmModeAtomicReq
- * @output: A pointer igt_output_t
- * @prop: one of igt_atomic_connector_properties
- * @value: the value to add
- */
-#define igt_atomic_populate_connector_req(req, output, prop, value) \
-	igt_assert_lt(0, drmModeAtomicAddProperty(req, output->config.connector->connector_id,\
-						  output->config.atomic_props_connector[prop], value))
+
+#define igt_output_is_prop_changed(output, prop) \
+	(!!((output)->changed & (1 << (prop))))
+#define igt_output_set_prop_changed(output, prop) \
+	(output)->changed |= 1 << (prop)
+
+#define igt_output_clear_prop_changed(output, prop) \
+	(output)->changed &= ~(1 << (prop))
+
+#define igt_output_set_prop_value(output, prop, value) \
+	do { \
+		(output)->values[prop] = (value); \
+		igt_output_set_prop_changed(output, prop); \
+	} while (0)
 
 /*
  * igt_pipe_refresh:
tests/kms_atomic_interruptible.c +2 -2
index 4e06ee4e2d6b..2d19fe967809 100644
@@ -159,7 +159,7 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 					plane->pipe->atomic_props_crtc[IGT_CRTC_MODE_ID],
 					plane->pipe->atomic_props_crtc[IGT_CRTC_ACTIVE],
 					/* connector: 1 prop */
-					output->config.atomic_props_connector[IGT_CONNECTOR_CRTC_ID],
+					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
 					plane->atomic_props_plane[IGT_PLANE_CRTC_ID],
 					plane->atomic_props_plane[IGT_PLANE_FB_ID],
@@ -204,7 +204,7 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 			case test_legacy_dpms: {
 				struct drm_mode_connector_set_property prop = {
 					.value = DRM_MODE_DPMS_OFF,
-					.prop_id = output->config.atomic_props_connector[IGT_CONNECTOR_DPMS],
+					.prop_id = output->props[IGT_CONNECTOR_DPMS],
 					.connector_id = output->id,
 				};
 
tests/kms_panel_fitting.c +1 -1
index 85a231e60ea2..e4ea355611c3 100644
@@ -275,7 +275,7 @@ static void test_atomic_fastset(igt_display_t *display)
 	igt_require(intel_gen(intel_get_drm_devid(display->drm_fd)) >= 5);
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
-		if (!output->config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE])
+		if (!output->props[IGT_CONNECTOR_SCALING_MODE])
 			continue;
 
 		test_panel_fitting_fastset(display, pipe, output);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 4/7
#9 lore raw

Re: [PATCH i-g-t v4 4/7] lib/igt_kms: Rework connector properties to be more atomic, v2.

Quoted 11 lines · Maarten Lankhorst

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changs since v1:
- Mention which properties we set to what.
- Assert the property to be set is valid.

Quoted 243 lines

---
 lib/igt_kms.c                    | 44 +++++++++++++++++++-----------
----------
 lib/igt_kms.h                    | 35 +++++++++++++++++++----------- --
 tests/kms_atomic_interruptible.c |  4 ++-- tests/kms_panel_fitting.c        |  2 +-

 4 files changed, 45 insertions(+), 40 deletions(-)
lib/igt_kms.c +0 -0
index d25090b05c70..07d2074c2b1a 100644
@@ -248,7 +248,7 @@ igt_atomic_fill_connector_props(igt_display_t
 *display, igt_output_t *output,
  			if (strcmp(prop->name, conn_prop_names[j])
 != 0)
  				continue;

lib/igt_kms.c +0 -1
-			output->config.atomic_props_connector[j] =

props->props[i];

lib/igt_kms.c +1 -0
+			output->props[j] = props->props[i];

  break;
  }

lib/igt_kms.c +0 -0
@@ -1834,7 +1834,7 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)


  igt_output_refresh(output);

lib/igt_kms.c +1 -1
-		output->config.pipe_changed = true;
+		igt_output_set_prop_changed(output,

IGT_CONNECTOR_CRTC_ID);
  }
drmModeFreePlaneResources(plane_resources);

lib/igt_kms.c +0 -0
@@ -2514,23 +2514,24 @@ static void

igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe static void igt_atomic_prepare_connector_commit(igt_output_t *output, drmModeAtomicReq *req)
 {

lib/igt_kms.c +1 -1
-	struct kmstest_connector_config *config = &output->config;
+	int i;

lib/igt_kms.c +0 -2
-	if (config->connector_scaling_mode_changed)
-		igt_atomic_populate_connector_req(req, output,

IGT_CONNECTOR_SCALING_MODE, config->connector_scaling_mode);

lib/igt_kms.c +3 -0
+	for (i = 0; i < IGT_NUM_CONNECTOR_PROPS; i++) {
+		if (!igt_output_is_prop_changed(output, i))
+			continue;

lib/igt_kms.c +2 -2
-	if (config->pipe_changed) {
-		uint32_t crtc_id = 0;
+		/* it's an error to try an unsupported feature */
+		igt_assert(output->props[i]);

lib/igt_kms.c +1 -2
-		if (output->config.pipe != PIPE_NONE)
-			crtc_id = output->config.crtc->crtc_id;
+		igt_debug("%s: Setting property \"%s\" to

0x%"PRIx64"/%"PRIi64"\n",

lib/igt_kms.c +1 -0
+			  igt_output_name(output),

igt_connector_prop_names[i],

lib/igt_kms.c +1 -0
+			  output->values[i], output->values[i]);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_connector_req(req, output,

IGT_CONNECTOR_CRTC_ID, crtc_id);

lib/igt_kms.c +2 -0
+		igt_assert_lt(0, drmModeAtomicAddProperty(req,
+					  output->config.connector-
Quoted 1 line

connector_id,

lib/igt_kms.c +2 -0
+					  output->props[i],
+					  output->values[i]));

  }

lib/igt_kms.c +0 -2
-	/*
-	 *	TODO: Add all other connector level properties

here

lib/igt_kms.c +0 -2
-	 */
-

 }

 /*

lib/igt_kms.c +0 -0
@@ -2625,11 +2626,10 @@ display_commit_changed(igt_display_t
 *display, enum igt_commit_style s)
  	for (i = 0; i < display->n_outputs; i++) {
  		igt_output_t *output = &display->outputs[i];

lib/igt_kms.c +0 -3
-		if (s != COMMIT_UNIVERSAL)
-			output->config.pipe_changed = false;
-

  if (s == COMMIT_ATOMIC)

lib/igt_kms.c +0 -1
-			output-
Quoted 1 line

config.connector_scaling_mode_changed = false;

lib/igt_kms.c +3 -0
+			output->changed = 0;
+		else if (s != COMMIT_UNIVERSAL)
+			igt_output_clear_prop_changed(output,

IGT_CONNECTOR_CRTC_ID);
  }
 }

lib/igt_kms.c +0 -0
@@ -2873,18 +2873,16 @@ void igt_output_set_pipe(igt_output_t
 *output, enum pipe pipe)
  	if (pipe != PIPE_NONE)
  		display->pipes[pipe].mode_changed = true;

lib/igt_kms.c +1 -1
-	output->config.pipe_changed = true;
+	igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID,

pipe == PIPE_NONE ? 0 : display->pipes[pipe].crtc_id);
  igt_output_refresh(output);
 }

 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)
 {

lib/igt_kms.c +1 -3
-	output->config.connector_scaling_mode_changed = true;
-
-	output->config.connector_scaling_mode = scaling_mode;
+	igt_output_set_prop_value(output,

IGT_CONNECTOR_SCALING_MODE, scaling_mode);

lib/igt_kms.c +0 -1
-	igt_require(output-
Quoted 1 line

config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE]);

lib/igt_kms.c +1 -0
+	igt_require(output->props[IGT_CONNECTOR_SCALING_MODE]);

 }

 igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx)

lib/igt_kms.h +7 -4
index 8dc118c961b7..1ef10e7d525c 100644
@@ -131,10 +131,7 @@ struct kmstest_connector_config {
  	drmModeConnector *connector;
  	drmModeEncoder *encoder;
  	drmModeModeInfo default_mode;
-	uint64_t connector_scaling_mode;
-	bool connector_scaling_mode_changed;
-	bool pipe_changed;
-	uint32_t atomic_props_connector[IGT_NUM_CONNECTOR_PROPS];
+
  	int pipe;
  	unsigned valid_crtc_idx_mask;
  };
@@ -364,6 +361,12 @@ typedef struct {
  	enum pipe pending_pipe;
  	bool use_override_mode;
  	drmModeModeInfo override_mode;
+
+	/* bitmask of changed properties */
+	uint64_t changed;
+
+	uint32_t props[IGT_NUM_CONNECTOR_PROPS];
+	uint64_t values[IGT_NUM_CONNECTOR_PROPS];
  } igt_output_t;


 struct igt_display {

lib/igt_kms.h +0 -0
@@ -545,16 +548,20 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)
  #define igt_atomic_populate_crtc_req(req, pipe, prop, value) \

  igt_assert_lt(0, drmModeAtomicAddProperty(req, pipe-

Quoted 1 line

crtc_id,\

    pipe-

Quoted 1 line

atomic_props_crtc[prop], value))

lib/igt_kms.h +0 -8
-/**
- * igt_atomic_populate_connector_req:
- * @req: A pointer to drmModeAtomicReq
- * @output: A pointer igt_output_t
- * @prop: one of igt_atomic_connector_properties
- * @value: the value to add
- */
-#define igt_atomic_populate_connector_req(req, output, prop, value)

\

lib/igt_kms.h +0 -1
-	igt_assert_lt(0, drmModeAtomicAddProperty(req, output-
Quoted 1 line

config.connector->connector_id,\

lib/igt_kms.h +0 -1
-						  output-
Quoted 1 line

config.atomic_props_connector[prop], value))

lib/igt_kms.h +14 -0
+
+#define igt_output_is_prop_changed(output, prop) \
+	(!!((output)->changed & (1 << (prop))))
+#define igt_output_set_prop_changed(output, prop) \
+	(output)->changed |= 1 << (prop)
+
+#define igt_output_clear_prop_changed(output, prop) \
+	(output)->changed &= ~(1 << (prop))
+
+#define igt_output_set_prop_value(output, prop, value) \
+	do { \
+		(output)->values[prop] = (value); \
+		igt_output_set_prop_changed(output, prop); \
+	} while (0)


 /*
  * igt_pipe_refresh:

tests/kms_atomic_interruptible.c +0 -0
index 4e06ee4e2d6b..2d19fe967809 100644
@@ -159,7 +159,7 @@ static void run_plane_test(igt_display_t
 *display, enum pipe pipe, igt_output_t

  plane->pipe-

Quoted 1 line

atomic_props_crtc[IGT_CRTC_MODE_ID],

  plane->pipe-

Quoted 1 line

atomic_props_crtc[IGT_CRTC_ACTIVE],

  /* connector: 1 prop */

tests/kms_atomic_interruptible.c +0 -1
-					output-
Quoted 1 line

config.atomic_props_connector[IGT_CONNECTOR_CRTC_ID],

tests/kms_atomic_interruptible.c +1 -0
+					output-
Quoted 1 line

props[IGT_CONNECTOR_CRTC_ID],

  /* plane: remainder props */ plane-

Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_ID],

  plane-

Quoted 1 line

atomic_props_plane[IGT_PLANE_FB_ID],

tests/kms_atomic_interruptible.c +0 -0
@@ -204,7 +204,7 @@ static void run_plane_test(igt_display_t
 *display, enum pipe pipe, igt_output_t
  			case test_legacy_dpms: {

  struct drm_mode_connector_set_property prop = {
  .value = DRM_MODE_DPMS_OFF,

tests/kms_atomic_interruptible.c +0 -1
-					.prop_id = output-
Quoted 1 line

config.atomic_props_connector[IGT_CONNECTOR_DPMS],

tests/kms_atomic_interruptible.c +1 -0
+					.prop_id = output-
Quoted 1 line

props[IGT_CONNECTOR_DPMS],

  .connector_id = output->id, };

tests/kms_panel_fitting.c +0 -0
index 85a231e60ea2..e4ea355611c3 100644
@@ -275,7 +275,7 @@ static void test_atomic_fastset(igt_display_t
 *display)
  	igt_require(intel_gen(intel_get_drm_devid(display->drm_fd))
 >= 5);


  for_each_pipe_with_valid_output(display, pipe, output) {

tests/kms_panel_fitting.c +0 -1
-		if (!output-
Quoted 1 line

config.atomic_props_connector[IGT_CONNECTOR_SCALING_MODE])

tests/kms_panel_fitting.c +1 -0
+		if (!output->props[IGT_CONNECTOR_SCALING_MODE])

  continue;

  test_panel_fitting_fastset(display, pipe, output);

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH v4 5/7 lib/igt_kms: Rework plane properties to be more atomic, v4.

In reply to Maarten Lankhorst

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changes since v1:
- Remove special dumping of src and crtc coordinates.
- Dump all modified coordinates.
Changes since v2:
- Move igt_plane_set_prop_changed up slightly.
Changes since v3:
- Fix wrong ordering of set_position in kms_plane_lowres causing a test failure.

---
 lib/igt_kms.c                    | 293 +++++++++++++++++----------------------
 lib/igt_kms.h                    |  59 ++++----
 tests/kms_atomic_interruptible.c |  12 +-
 tests/kms_plane_lowres.c         |   2 +-
 tests/kms_rotation_crc.c         |   4 +-
 5 files changed, 160 insertions(+), 210 deletions(-)
lib/igt_kms.c +127 -166
index 07d2074c2b1a..6e0052ebe7a7 100644
@@ -192,11 +192,11 @@ const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 
 /*
  * Retrieve all the properies specified in props_name and store them into
- * plane->atomic_props_plane.
+ * plane->props.
  */
 static void
-igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
-			int num_props, const char **prop_names)
+igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
+		     int num_props, const char **prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -214,7 +214,7 @@ igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
 			if (strcmp(prop->name, prop_names[j]) != 0)
 				continue;
 
-			plane->atomic_props_plane[j] = props->props[i];
+			plane->props[j] = props->props[i];
 			break;
 		}
 
@@ -1659,7 +1659,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	drmModeRes *resources;
 	drmModePlaneRes *plane_resources;
 	int i;
-	int is_atomic = 0;
 
 	memset(display, 0, sizeof(igt_display_t));
 
@@ -1679,7 +1678,9 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	igt_assert_f(display->pipes, "Failed to allocate memory for %d pipes\n", display->n_pipes);
 
 	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	is_atomic = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);
+	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+		display->is_atomic = 1;
+
 	plane_resources = drmModeGetPlaneResources(display->drm_fd);
 	igt_assert(plane_resources);
 
@@ -1776,19 +1777,19 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 			plane->type = type;
 			plane->pipe = pipe;
 			plane->drm_plane = drm_plane;
-			plane->fence_fd = -1;
+			plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
 
-			if (is_atomic == 0) {
-				display->is_atomic = 1;
-				igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
-			}
+			igt_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
 
 			get_plane_property(display->drm_fd, drm_plane->plane_id,
 					   "rotation",
-					   &plane->rotation_property,
-					   &prop_value,
+					   &plane->props[IGT_PLANE_ROTATION],
+					   &plane->values[IGT_PLANE_ROTATION],
 					   NULL);
-			plane->rotation = (igt_rotation_t)prop_value;
+
+			/* Clear any residual framebuffer on first commit. */
+			igt_plane_set_prop_changed(plane, IGT_PLANE_FB_ID);
+			igt_plane_set_prop_changed(plane, IGT_PLANE_CRTC_ID);
 		}
 
 		/*
@@ -1805,9 +1806,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 
 		pipe->n_planes = n_planes;
 
-		for_each_plane_on_pipe(display, i, plane)
-			plane->fb_changed = true;
-
 		pipe->mode_changed = true;
 	}
 
@@ -2070,18 +2068,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
 
 static uint32_t igt_plane_get_fb_id(igt_plane_t *plane)
 {
-	if (plane->fb)
-		return plane->fb->fb_id;
-	else
-		return 0;
-}
-
-static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
-{
-	if (plane->fb)
-		return plane->fb->gem_handle;
-	else
-		return 0;
+	return plane->values[IGT_PLANE_FB_ID];
 }
 
 #define CHECK_RETURN(r, fail) {	\
@@ -2090,9 +2077,6 @@ static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
 	igt_assert_eq(r, 0);	\
 }
 
-
-
-
 /*
  * Add position and fb changes of a plane to the atomic property set
  */
@@ -2101,63 +2085,31 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_pipe_t *pipe,
 	drmModeAtomicReq *req)
 {
 	igt_display_t *display = pipe->display;
-	uint32_t fb_id, crtc_id;
+	int i;
 
 	igt_assert(plane->drm_plane);
 
-	/* it's an error to try an unsupported feature */
-	igt_assert(igt_plane_supports_rotation(plane) ||
-			!plane->rotation_changed);
-
-	fb_id = igt_plane_get_fb_id(plane);
-	crtc_id = pipe->crtc_id;
-
 	LOG(display,
 	    "populating plane data: %s.%d, fb %u\n",
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index,
-	    fb_id);
-
-	if (plane->fence_fd >= 0) {
-		uint64_t fence_fd = (int64_t) plane->fence_fd;
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_IN_FENCE_FD, fence_fd);
-	}
+	    igt_plane_get_fb_id(plane));
 
-	if (plane->fb_changed) {
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
-	}
-
-	if (plane->position_changed || plane->size_changed) {
-		uint32_t src_x = IGT_FIXED(plane->src_x, 0); /* src_x */
-		uint32_t src_y = IGT_FIXED(plane->src_y, 0); /* src_y */
-		uint32_t src_w = IGT_FIXED(plane->src_w, 0); /* src_w */
-		uint32_t src_h = IGT_FIXED(plane->src_h, 0); /* src_h */
-		int32_t crtc_x = plane->crtc_x;
-		int32_t crtc_y = plane->crtc_y;
-		uint32_t crtc_w = plane->crtc_w;
-		uint32_t crtc_h = plane->crtc_h;
+	for (i = 0; i < IGT_NUM_PLANE_PROPS; i++) {
+		if (!igt_plane_is_prop_changed(plane, i))
+			continue;
 
-		LOG(display,
-		"src = (%d, %d) %u x %u "
-		"dst = (%d, %d) %u x %u\n",
-		src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
-		crtc_x, crtc_y, crtc_w, crtc_h);
+		/* it's an error to try an unsupported feature */
+		igt_assert(plane->props[i]);
 
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_X, src_x);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_Y, src_y);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_W, src_w);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_H, src_h);
+		igt_debug("plane %s.%d: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			kmstest_pipe_name(pipe->pipe), plane->index, igt_plane_prop_names[i],
+			plane->values[i], plane->values[i]);
 
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_X, crtc_x);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_Y, crtc_y);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_W, crtc_w);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_H, crtc_h);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req, plane->drm_plane->plane_id,
+						  plane->props[i],
+						  plane->values[i]));
 	}
-
-	if (plane->rotation_changed)
-		igt_atomic_populate_plane_req(req, plane,
-			IGT_PLANE_ROTATION, plane->rotation);
 }
 
 
@@ -2183,17 +2135,20 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 	int32_t crtc_y;
 	uint32_t crtc_w;
 	uint32_t crtc_h;
+	bool setplane =
+		igt_plane_is_prop_changed(plane, IGT_PLANE_FB_ID) ||
+		plane->changed & IGT_PLANE_COORD_CHANGED_MASK;
 
 	igt_assert(plane->drm_plane);
 
 	/* it's an error to try an unsupported feature */
 	igt_assert(igt_plane_supports_rotation(plane) ||
-		   !plane->rotation_changed);
+		   !igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION));
 
 	fb_id = igt_plane_get_fb_id(plane);
 	crtc_id = pipe->crtc_id;
 
-	if ((plane->fb_changed || plane->size_changed) && fb_id == 0) {
+	if (setplane && fb_id == 0) {
 		LOG(display,
 		    "SetPlane pipe %s, plane %d, disabling\n",
 		    kmstest_pipe_name(pipe->pipe),
@@ -2212,16 +2167,15 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 				      IGT_FIXED(0,0) /* src_h */);
 
 		CHECK_RETURN(ret, fail_on_error);
-	} else if (plane->fb_changed || plane->position_changed ||
-		plane->size_changed) {
-		src_x = IGT_FIXED(plane->src_x,0); /* src_x */
-		src_y = IGT_FIXED(plane->src_y,0); /* src_y */
-		src_w = IGT_FIXED(plane->src_w,0); /* src_w */
-		src_h = IGT_FIXED(plane->src_h,0); /* src_h */
-		crtc_x = plane->crtc_x;
-		crtc_y = plane->crtc_y;
-		crtc_w = plane->crtc_w;
-		crtc_h = plane->crtc_h;
+	} else if (setplane) {
+		src_x = plane->values[IGT_PLANE_SRC_X];
+		src_y = plane->values[IGT_PLANE_SRC_Y];
+		src_w = plane->values[IGT_PLANE_SRC_W];
+		src_h = plane->values[IGT_PLANE_SRC_H];
+		crtc_x = plane->values[IGT_PLANE_CRTC_X];
+		crtc_y = plane->values[IGT_PLANE_CRTC_Y];
+		crtc_w = plane->values[IGT_PLANE_CRTC_W];
+		crtc_h = plane->values[IGT_PLANE_CRTC_H];
 
 		LOG(display,
 		    "SetPlane %s.%d, fb %u, src = (%d, %d) "
@@ -2245,9 +2199,10 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (plane->rotation_changed) {
-		ret = igt_plane_set_property(plane, plane->rotation_property,
-				       plane->rotation);
+	if (igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION)) {
+		ret = igt_plane_set_property(plane,
+					     plane->props[IGT_PLANE_ROTATION],
+					     plane->values[IGT_PLANE_ROTATION]);
 
 		CHECK_RETURN(ret, fail_on_error);
 	}
@@ -2269,35 +2224,30 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor,
 	uint32_t crtc_id = pipe->crtc_id;
 	int ret;
 
-	if (cursor->fb_changed) {
-		uint32_t gem_handle = igt_plane_get_fb_gem_handle(cursor);
-
-		if (gem_handle) {
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_FB_ID)) {
+		if (cursor->gem_handle)
 			LOG(display,
 			    "SetCursor pipe %s, fb %u %dx%d\n",
 			    kmstest_pipe_name(pipe->pipe),
-			    gem_handle,
-			    cursor->crtc_w, cursor->crtc_h);
-
-			ret = drmModeSetCursor(display->drm_fd, crtc_id,
-					       gem_handle,
-					       cursor->crtc_w,
-					       cursor->crtc_h);
-		} else {
+			    cursor->gem_handle,
+			    (unsigned)cursor->values[IGT_PLANE_CRTC_W],
+			    (unsigned)cursor->values[IGT_PLANE_CRTC_H]);
+		else
 			LOG(display,
 			    "SetCursor pipe %s, disabling\n",
 			    kmstest_pipe_name(pipe->pipe));
 
-			ret = drmModeSetCursor(display->drm_fd, crtc_id,
-					       0, 0, 0);
-		}
-
+		ret = drmModeSetCursor(display->drm_fd, crtc_id,
+				       cursor->gem_handle,
+				       cursor->values[IGT_PLANE_CRTC_W],
+				       cursor->values[IGT_PLANE_CRTC_H]);
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (cursor->position_changed) {
-		int x = cursor->crtc_x;
-		int y = cursor->crtc_y;
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_X) ||
+	    igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_Y)) {
+		int x = cursor->values[IGT_PLANE_CRTC_X];
+		int y = cursor->values[IGT_PLANE_CRTC_Y];
 
 		LOG(display,
 		    "MoveCursor pipe %s, (%d, %d)\n",
@@ -2326,13 +2276,14 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	int ret;
 
 	/* Primary planes can't be windowed when using a legacy commit */
-	igt_assert((primary->crtc_x == 0 && primary->crtc_y == 0));
+	igt_assert((primary->values[IGT_PLANE_CRTC_X] == 0 && primary->values[IGT_PLANE_CRTC_Y] == 0));
 
 	/* nor rotated */
-	igt_assert(!primary->rotation_changed);
+	igt_assert(!igt_plane_is_prop_changed(primary, IGT_PLANE_ROTATION));
 
-	if (!primary->fb_changed && !primary->position_changed &&
-	    !primary->size_changed && !primary->pipe->mode_changed)
+	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
+	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
+	    !primary->pipe->mode_changed)
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2343,19 +2294,22 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 		mode = NULL;
 
 	if (fb_id) {
+		uint32_t src_x = primary->values[IGT_PLANE_SRC_X] >> 16;
+		uint32_t src_y = primary->values[IGT_PLANE_SRC_Y] >> 16;
+
 		LOG(display,
 		    "%s: SetCrtc pipe %s, fb %u, src (%d, %d), "
 		    "mode %dx%d\n",
 		    igt_output_name(output),
 		    kmstest_pipe_name(pipe->pipe),
 		    fb_id,
-		    primary->src_x, primary->src_y,
+		    src_x, src_y,
 		    mode->hdisplay, mode->vdisplay);
 
 		ret = drmModeSetCrtc(display->drm_fd,
 				     crtc_id,
 				     fb_id,
-				     primary->src_x, primary->src_y,
+				     src_x, src_y,
 				     &output->id,
 				     1,
 				     mode);
@@ -2608,18 +2562,27 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
-			plane->fb_changed = false;
-			plane->position_changed = false;
-			plane->size_changed = false;
+			if (s == COMMIT_ATOMIC) {
+				int fd;
+				plane->changed = 0;
 
-			if (s != COMMIT_LEGACY ||
-			    !(plane->type == DRM_PLANE_TYPE_PRIMARY ||
-			      plane->type == DRM_PLANE_TYPE_CURSOR))
-				plane->rotation_changed = false;
+				fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+				if (fd != -1)
+					close(fd);
 
-			if (s == COMMIT_ATOMIC)
 				/* reset fence_fd to prevent it from being set for the next commit */
-				igt_plane_set_fence_fd(plane, -1);
+				plane->values[IGT_PLANE_IN_FENCE_FD] = -1;
+			} else {
+				plane->changed &= ~IGT_PLANE_COORD_CHANGED_MASK;
+
+				igt_plane_clear_prop_changed(plane, IGT_PLANE_CRTC_ID);
+				igt_plane_clear_prop_changed(plane, IGT_PLANE_FB_ID);
+
+				if (s != COMMIT_LEGACY ||
+				    !(plane->type == DRM_PLANE_TYPE_PRIMARY ||
+				      plane->type == DRM_PLANE_TYPE_CURSOR))
+					igt_plane_clear_prop_changed(plane, IGT_PLANE_ROTATION);
+			}
 		}
 	}
 
@@ -2913,30 +2876,31 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)
 	LOG(display, "%s.%d: plane_set_fb(%d)\n", kmstest_pipe_name(pipe->pipe),
 	    plane->index, fb ? fb->fb_id : 0);
 
-	plane->fb = fb;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_ID, fb ? pipe->crtc_id : 0);
+	igt_plane_set_prop_value(plane, IGT_PLANE_FB_ID, fb ? fb->fb_id : 0);
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR && fb)
+		plane->gem_handle = fb->gem_handle;
+	else
+		plane->gem_handle = 0;
+
 	/* hack to keep tests working that don't call igt_plane_set_size() */
 	if (fb) {
 		/* set default plane size as fb size */
-		plane->crtc_w = fb->width;
-		plane->crtc_h = fb->height;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, fb->width, fb->height);
 
 		/* set default src pos/size as fb size */
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = fb->width;
-		plane->src_h = fb->height;
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, fb->width, fb->height);
 	} else {
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = 0;
-		plane->src_h = 0;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, 0, 0);
 
-		plane->crtc_w = 0;
-		plane->crtc_h = 0;
+		/* set default src pos/size as fb size */
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, 0, 0);
 	}
-
-	plane->fb_changed = true;
-	plane->size_changed = true;
 }
 
 /**
@@ -2949,12 +2913,19 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)
  */
 void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd)
 {
-	close(plane->fence_fd);
+	int64_t fd;
 
-	if (fcntl(fence_fd, F_GETFD) != -1)
-		plane->fence_fd = dup(fence_fd);
-	else
-		plane->fence_fd = -1;
+	fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+	if (fd != -1)
+		close(fd);
+
+	if (fence_fd != -1) {
+		fd = dup(fence_fd);
+		igt_fail_on(fd == -1);
+	} else
+		fd = -1;
+
+	igt_plane_set_prop_value(plane, IGT_PLANE_IN_FENCE_FD, fd);
 }
 
 void igt_plane_set_position(igt_plane_t *plane, int x, int y)
@@ -2965,10 +2936,8 @@ void igt_plane_set_position(igt_plane_t *plane, int x, int y)
 	LOG(display, "%s.%d: plane_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->crtc_x = x;
-	plane->crtc_y = y;
-
-	plane->position_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_X, x);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_Y, y);
 }
 
 /**
@@ -2989,10 +2958,8 @@ void igt_plane_set_size(igt_plane_t *plane, int w, int h)
 	LOG(display, "%s.%d: plane_set_size (%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->crtc_w = w;
-	plane->crtc_h = h;
-
-	plane->size_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_W, w);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_H, h);
 }
 
 /**
@@ -3014,10 +2981,8 @@ void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->src_x = x;
-	plane->src_y = y;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_X, IGT_FIXED(x, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_Y, IGT_FIXED(y, 0));
 }
 
 /**
@@ -3040,10 +3005,8 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_size(%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->src_w = w;
-	plane->src_h = h;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_W, IGT_FIXED(w, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H, IGT_FIXED(h, 0));
 }
 
 static const char *rotation_name(igt_rotation_t rotation)
@@ -3071,9 +3034,7 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index, rotation_name(rotation));
 
-	plane->rotation = rotation;
-
-	plane->rotation_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, rotation);
 }
 
 /**
lib/igt_kms.h +24 -35

90 lines not on this page · raw message

tests/kms_atomic_interruptible.c +6 -6
index 2d19fe967809..5570854390ea 100644
@@ -161,12 +161,12 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 					/* connector: 1 prop */
 					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
-					plane->atomic_props_plane[IGT_PLANE_CRTC_ID],
-					plane->atomic_props_plane[IGT_PLANE_FB_ID],
-					plane->atomic_props_plane[IGT_PLANE_SRC_W],
-					plane->atomic_props_plane[IGT_PLANE_SRC_H],
-					plane->atomic_props_plane[IGT_PLANE_CRTC_W],
-					plane->atomic_props_plane[IGT_PLANE_CRTC_H]
+					plane->props[IGT_PLANE_CRTC_ID],
+					plane->props[IGT_PLANE_FB_ID],
+					plane->props[IGT_PLANE_SRC_W],
+					plane->props[IGT_PLANE_SRC_H],
+					plane->props[IGT_PLANE_CRTC_W],
+					plane->props[IGT_PLANE_CRTC_H]
 				};
 				uint64_t prop_vals[] = {
 					/* crtc */
tests/kms_plane_lowres.c +1 -1
index b16c8cd433b2..613f68899601 100644
@@ -227,8 +227,8 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags,
 				    1.0, 1.0, 0.0,
 				    &data->fb[i]);
 
-		igt_plane_set_position(data->plane[i], x, y);
 		igt_plane_set_fb(data->plane[i], &data->fb[i]);
+		igt_plane_set_position(data->plane[i], x, y);
 	}
 
 	return mode;
tests/kms_rotation_crc.c +2 -2
index 4d2ef1c184f0..4932a0d44410 100644
@@ -122,11 +122,11 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	igt_plane_set_fb(primary, &data->fb_modeset);
 
 	if (commit < COMMIT_ATOMIC) {
-		primary->rotation_changed = false;
+		igt_plane_clear_prop_changed(primary, IGT_PLANE_ROTATION);
 		igt_display_commit(display);
 
 		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
-			primary->rotation_changed = true;
+			igt_plane_set_prop_changed(primary, IGT_PLANE_ROTATION);
 	}
 
 	igt_plane_set_fb(plane, NULL);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

Re: [PATCH i-g-t v4 5/7] lib/igt_kms: Rework plane properties to be more atomic, v4.

Quoted 794 lines · Maarten Lankhorst

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changes since v1:
- Remove special dumping of src and crtc coordinates.
- Dump all modified coordinates.
Changes since v2:
- Move igt_plane_set_prop_changed up slightly.
Changes since v3:
- Fix wrong ordering of set_position in kms_plane_lowres causing a test failure.

---
 lib/igt_kms.c                    | 293 +++++++++++++++++----------
------------
 lib/igt_kms.h                    |  59 ++++---- tests/kms_atomic_interruptible.c |  12 +- tests/kms_plane_lowres.c         |   2 +- tests/kms_rotation_crc.c         |   4 +-

 5 files changed, 160 insertions(+), 210 deletions(-)
lib/igt_kms.c +0 -0
index 07d2074c2b1a..6e0052ebe7a7 100644
@@ -192,11 +192,11 @@ const char
 *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {


 /*
  * Retrieve all the properies specified in props_name and store them into
- * plane->atomic_props_plane.
+ * plane->props.
  */
 static void
-igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,

lib/igt_kms.c +2 -1
-			int num_props, const char **prop_names)
+igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
+		     int num_props, const char **prop_names)

 {
  drmModeObjectPropertiesPtr props;
  int i, j, fd;

lib/igt_kms.c +0 -0
@@ -214,7 +214,7 @@ igt_atomic_fill_plane_props(igt_display_t
 *display, igt_plane_t *plane,
  			if (strcmp(prop->name, prop_names[j]) != 0)
  				continue;

lib/igt_kms.c +0 -1
-			plane->atomic_props_plane[j] = props-
Quoted 1 line

props[i];

lib/igt_kms.c +1 -0
+			plane->props[j] = props->props[i];

  break;
  }

lib/igt_kms.c +0 -1
@@ -1659,7 +1659,6 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
  	drmModeRes *resources;
  	drmModePlaneRes *plane_resources;
  	int i;
-	int is_atomic = 0;


  memset(display, 0, sizeof(igt_display_t));

lib/igt_kms.c +0 -0
@@ -1679,7 +1678,9 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)

  igt_assert_f(display->pipes, "Failed to allocate memory for %d pipes\n", display->n_pipes);

  drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);

lib/igt_kms.c +0 -1
-	is_atomic = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC,

1);

lib/igt_kms.c +3 -0
+	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+		display->is_atomic = 1;
+

  plane_resources = drmModeGetPlaneResources(display->drm_fd); igt_assert(plane_resources);

lib/igt_kms.c +1 -1
@@ -1776,19 +1777,19 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
  			plane->type = type;
  			plane->pipe = pipe;
  			plane->drm_plane = drm_plane;
-			plane->fence_fd = -1;
+			plane->values[IGT_PLANE_IN_FENCE_FD] =
 ~0ULL;

lib/igt_kms.c +0 -3
-			if (is_atomic == 0) {
-				display->is_atomic = 1;
-				igt_atomic_fill_plane_props(display,

plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);

lib/igt_kms.c +1 -1
-			}
+			igt_fill_plane_props(display, plane,

IGT_NUM_PLANE_PROPS, igt_plane_prop_names);

  get_plane_property(display->drm_fd, drm_plane->plane_id,
     "rotation",

lib/igt_kms.c +0 -1
-					   &plane-
Quoted 1 line

rotation_property,

lib/igt_kms.c +1 -1
-					   &prop_value,
+					   &plane-
Quoted 1 line

props[IGT_PLANE_ROTATION],

lib/igt_kms.c +1 -0
+					   &plane-
Quoted 1 line

values[IGT_PLANE_ROTATION],

     NULL);

lib/igt_kms.c +0 -1
-			plane->rotation =

(igt_rotation_t)prop_value;

lib/igt_kms.c +2 -0
+
+			/* Clear any residual framebuffer on first

commit. */

lib/igt_kms.c +1 -0
+			igt_plane_set_prop_changed(plane,

IGT_PLANE_FB_ID);

lib/igt_kms.c +1 -0
+			igt_plane_set_prop_changed(plane,

IGT_PLANE_CRTC_ID);
  }

  /*

lib/igt_kms.c +0 -0
@@ -1805,9 +1806,6 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)


  pipe->n_planes = n_planes;

lib/igt_kms.c +0 -3
-		for_each_plane_on_pipe(display, i, plane)
-			plane->fb_changed = true;
-

  pipe->mode_changed = true;
  }

lib/igt_kms.c +0 -0
@@ -2070,18 +2068,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe,
 const char *name,


 static uint32_t igt_plane_get_fb_id(igt_plane_t *plane) {

lib/igt_kms.c +1 -12
-	if (plane->fb)
-		return plane->fb->fb_id;
-	else
-		return 0;
-}
-
-static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
-{
-	if (plane->fb)
-		return plane->fb->gem_handle;
-	else
-		return 0;
+	return plane->values[IGT_PLANE_FB_ID];

 }

 #define CHECK_RETURN(r, fail) { \

lib/igt_kms.c +0 -0
@@ -2090,9 +2077,6 @@ static uint32_t
 igt_plane_get_fb_gem_handle(igt_plane_t *plane)
  	igt_assert_eq(r, 0);	\
  }

lib/igt_kms.c +0 -3
-
-
-

 /*
  * Add position and fb changes of a plane to the atomic property set */

lib/igt_kms.c +1 -1
@@ -2101,63 +2085,31 @@ igt_atomic_prepare_plane_commit(igt_plane_t
 *plane, igt_pipe_t *pipe,
  	drmModeAtomicReq *req)
  {
  	igt_display_t *display = pipe->display;
-	uint32_t fb_id, crtc_id;
+	int i;


  igt_assert(plane->drm_plane);

lib/igt_kms.c +0 -7
-	/* it's an error to try an unsupported feature */
-	igt_assert(igt_plane_supports_rotation(plane) ||
-			!plane->rotation_changed);
-
-	fb_id = igt_plane_get_fb_id(plane);
-	crtc_id = pipe->crtc_id;
-

  LOG(display,
      "populating plane data: %s.%d, fb %u\n", kmstest_pipe_name(pipe->pipe), plane->index,

lib/igt_kms.c +0 -5
-	    fb_id);
-
-	if (plane->fence_fd >= 0) {
-		uint64_t fence_fd = (int64_t) plane->fence_fd;
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_IN_FENCE_FD, fence_fd);

lib/igt_kms.c +1 -1
-	}
+	    igt_plane_get_fb_id(plane));

lib/igt_kms.c +0 -2
-	if (plane->fb_changed) {
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_FB_ID, fb_id);

lib/igt_kms.c +0 -4
-	}
-
-	if (plane->position_changed || plane->size_changed) {
-		uint32_t src_x = IGT_FIXED(plane->src_x, 0); /*

src_x */

lib/igt_kms.c +0 -1
-		uint32_t src_y = IGT_FIXED(plane->src_y, 0); /*

src_y */

lib/igt_kms.c +0 -1
-		uint32_t src_w = IGT_FIXED(plane->src_w, 0); /*

src_w */

lib/igt_kms.c +0 -1
-		uint32_t src_h = IGT_FIXED(plane->src_h, 0); /*

src_h */

lib/igt_kms.c +3 -4
-		int32_t crtc_x = plane->crtc_x;
-		int32_t crtc_y = plane->crtc_y;
-		uint32_t crtc_w = plane->crtc_w;
-		uint32_t crtc_h = plane->crtc_h;
+	for (i = 0; i < IGT_NUM_PLANE_PROPS; i++) {
+		if (!igt_plane_is_prop_changed(plane, i))
+			continue;

lib/igt_kms.c +2 -5
-		LOG(display,
-		"src = (%d, %d) %u x %u "
-		"dst = (%d, %d) %u x %u\n",
-		src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
-		crtc_x, crtc_y, crtc_w, crtc_h);
+		/* it's an error to try an unsupported feature */
+		igt_assert(plane->props[i]);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_X, src_x);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_Y, src_y);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_W, src_w);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_H, src_h);

lib/igt_kms.c +1 -0
+		igt_debug("plane %s.%d: Setting property \"%s\" to

0x%"PRIx64"/%"PRIi64"\n",

lib/igt_kms.c +1 -0
+			kmstest_pipe_name(pipe->pipe), plane->index, 

igt_plane_prop_names[i],

lib/igt_kms.c +1 -0
+			plane->values[i], plane->values[i]);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_X, crtc_x);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_Y, crtc_y);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_W, crtc_w);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_H, crtc_h);

lib/igt_kms.c +1 -0
+		igt_assert_lt(0, drmModeAtomicAddProperty(req,

plane->drm_plane->plane_id,

lib/igt_kms.c +2 -0
+						  plane->props[i],
+						  plane-
Quoted 1 line

values[i]));

  }

lib/igt_kms.c +0 -4
-
-	if (plane->rotation_changed)
-		igt_atomic_populate_plane_req(req, plane,
-			IGT_PLANE_ROTATION, plane->rotation);

 }

lib/igt_kms.c +3 -0
@@ -2183,17 +2135,20 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
  	int32_t crtc_y;
  	uint32_t crtc_w;
  	uint32_t crtc_h;
+	bool setplane =
+		igt_plane_is_prop_changed(plane, IGT_PLANE_FB_ID) ||
+		plane->changed & IGT_PLANE_COORD_CHANGED_MASK;


  igt_assert(plane->drm_plane);

  /* it's an error to try an unsupported feature */ igt_assert(igt_plane_supports_rotation(plane) ||

lib/igt_kms.c +1 -1
-		   !plane->rotation_changed);
+		   !igt_plane_is_prop_changed(plane,

IGT_PLANE_ROTATION));

  fb_id = igt_plane_get_fb_id(plane);
  crtc_id = pipe->crtc_id;

lib/igt_kms.c +0 -1
-	if ((plane->fb_changed || plane->size_changed) && fb_id ==

0) {

lib/igt_kms.c +1 -0
+	if (setplane && fb_id == 0) {

  LOG(display,
      "SetPlane pipe %s, plane %d, disabling\n", kmstest_pipe_name(pipe->pipe),

lib/igt_kms.c +0 -0
@@ -2212,16 +2167,15 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
  				      IGT_FIXED(0,0) /* src_h */);


  CHECK_RETURN(ret, fail_on_error);

lib/igt_kms.c +9 -10
-	} else if (plane->fb_changed || plane->position_changed ||
-		plane->size_changed) {
-		src_x = IGT_FIXED(plane->src_x,0); /* src_x */
-		src_y = IGT_FIXED(plane->src_y,0); /* src_y */
-		src_w = IGT_FIXED(plane->src_w,0); /* src_w */
-		src_h = IGT_FIXED(plane->src_h,0); /* src_h */
-		crtc_x = plane->crtc_x;
-		crtc_y = plane->crtc_y;
-		crtc_w = plane->crtc_w;
-		crtc_h = plane->crtc_h;
+	} else if (setplane) {
+		src_x = plane->values[IGT_PLANE_SRC_X];
+		src_y = plane->values[IGT_PLANE_SRC_Y];
+		src_w = plane->values[IGT_PLANE_SRC_W];
+		src_h = plane->values[IGT_PLANE_SRC_H];
+		crtc_x = plane->values[IGT_PLANE_CRTC_X];
+		crtc_y = plane->values[IGT_PLANE_CRTC_Y];
+		crtc_w = plane->values[IGT_PLANE_CRTC_W];
+		crtc_h = plane->values[IGT_PLANE_CRTC_H];


  LOG(display,
      "SetPlane %s.%d, fb %u, src = (%d, %d) "

lib/igt_kms.c +0 -0
@@ -2245,9 +2199,10 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
  		CHECK_RETURN(ret, fail_on_error);
  	}

lib/igt_kms.c +0 -2
-	if (plane->rotation_changed) {
-		ret = igt_plane_set_property(plane, plane-
Quoted 1 line

rotation_property,

lib/igt_kms.c +3 -1
-				       plane->rotation);
+	if (igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION)) {
+		ret = igt_plane_set_property(plane,
+					     plane-
Quoted 1 line

props[IGT_PLANE_ROTATION],

lib/igt_kms.c +1 -0
+					     plane-
Quoted 1 line

values[IGT_PLANE_ROTATION]);


  CHECK_RETURN(ret, fail_on_error);
  }

lib/igt_kms.c +0 -0
@@ -2269,35 +2224,30 @@ static int
 igt_cursor_commit_legacy(igt_plane_t *cursor,
  	uint32_t crtc_id = pipe->crtc_id;
  	int ret;

lib/igt_kms.c +0 -2
-	if (cursor->fb_changed) {
-		uint32_t gem_handle =

igt_plane_get_fb_gem_handle(cursor);

lib/igt_kms.c +2 -2
-
-		if (gem_handle) {
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_FB_ID)) {
+		if (cursor->gem_handle)

  LOG(display,
      "SetCursor pipe %s, fb %u %dx%d\n", kmstest_pipe_name(pipe->pipe),

lib/igt_kms.c +0 -4
-			    gem_handle,
-			    cursor->crtc_w, cursor->crtc_h);
-
-			ret = drmModeSetCursor(display->drm_fd,

crtc_id,

lib/igt_kms.c +2 -4
-					       gem_handle,
-					       cursor->crtc_w,
-					       cursor->crtc_h);
-		} else {
+			    cursor->gem_handle,
+			    (unsigned)cursor-
Quoted 1 line

values[IGT_PLANE_CRTC_W],

lib/igt_kms.c +1 -0
+			    (unsigned)cursor-
Quoted 1 line

values[IGT_PLANE_CRTC_H]);

lib/igt_kms.c +1 -0
+		else

  LOG(display,
      "SetCursor pipe %s, disabling\n", kmstest_pipe_name(pipe->pipe));

lib/igt_kms.c +0 -1
-			ret = drmModeSetCursor(display->drm_fd,

crtc_id,

lib/igt_kms.c +3 -3
-					       0, 0, 0);
-		}
-
+		ret = drmModeSetCursor(display->drm_fd, crtc_id,
+				       cursor->gem_handle,
+				       cursor-
Quoted 1 line

values[IGT_PLANE_CRTC_W],

lib/igt_kms.c +1 -0
+				       cursor-
Quoted 1 line

values[IGT_PLANE_CRTC_H]);

  CHECK_RETURN(ret, fail_on_error);
  }

lib/igt_kms.c +4 -3
-	if (cursor->position_changed) {
-		int x = cursor->crtc_x;
-		int y = cursor->crtc_y;
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_X) ||
+	    igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_Y)) {
+		int x = cursor->values[IGT_PLANE_CRTC_X];
+		int y = cursor->values[IGT_PLANE_CRTC_Y];


  LOG(display,
      "MoveCursor pipe %s, (%d, %d)\n",

lib/igt_kms.c +0 -0
@@ -2326,13 +2276,14 @@ static int
 igt_primary_plane_commit_legacy(igt_plane_t *primary,
  	int ret;


  /* Primary planes can't be windowed when using a legacy commit */

lib/igt_kms.c +1 -1
-	igt_assert((primary->crtc_x == 0 && primary->crtc_y == 0));
+	igt_assert((primary->values[IGT_PLANE_CRTC_X] == 0 &&

primary->values[IGT_PLANE_CRTC_Y] == 0));

  /* nor rotated */

lib/igt_kms.c +1 -1
-	igt_assert(!primary->rotation_changed);
+	igt_assert(!igt_plane_is_prop_changed(primary,

IGT_PLANE_ROTATION));

lib/igt_kms.c +3 -2
-	if (!primary->fb_changed && !primary->position_changed &&
-	    !primary->size_changed && !primary->pipe->mode_changed)
+	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
+	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
+	    !primary->pipe->mode_changed)

  return 0;

  crtc_id = pipe->crtc_id;

lib/igt_kms.c +0 -0
@@ -2343,19 +2294,22 @@ static int
 igt_primary_plane_commit_legacy(igt_plane_t *primary,
  		mode = NULL;


  if (fb_id) {

lib/igt_kms.c +1 -0
+		uint32_t src_x = primary->values[IGT_PLANE_SRC_X] >>

16;

lib/igt_kms.c +1 -0
+		uint32_t src_y = primary->values[IGT_PLANE_SRC_Y] >>

16;
+
  LOG(display,
      "%s: SetCrtc pipe %s, fb %u, src (%d, %d), " "mode %dx%d\n", igt_output_name(output), kmstest_pipe_name(pipe->pipe), fb_id,

lib/igt_kms.c +1 -1
-		    primary->src_x, primary->src_y,
+		    src_x, src_y,

      mode->hdisplay, mode->vdisplay);
  ret = drmModeSetCrtc(display->drm_fd, crtc_id, fb_id,

lib/igt_kms.c +1 -1
-				     primary->src_x, primary->src_y,
+				     src_x, src_y,

       &output->id,
       1,
       mode);

lib/igt_kms.c +0 -0
@@ -2608,18 +2562,27 @@ display_commit_changed(igt_display_t
 *display, enum igt_commit_style s)
  		}


  for_each_plane_on_pipe(display, pipe, plane) {

lib/igt_kms.c +3 -3
-			plane->fb_changed = false;
-			plane->position_changed = false;
-			plane->size_changed = false;
+			if (s == COMMIT_ATOMIC) {
+				int fd;
+				plane->changed = 0;

lib/igt_kms.c +0 -2
-			if (s != COMMIT_LEGACY ||
-			    !(plane->type == DRM_PLANE_TYPE_PRIMARY

||

lib/igt_kms.c +1 -2
-			      plane->type == DRM_PLANE_TYPE_CURSOR))
-				plane->rotation_changed = false;
+				fd = plane-
Quoted 1 line

values[IGT_PLANE_IN_FENCE_FD];

lib/igt_kms.c +2 -0
+				if (fd != -1)
+					close(fd);

lib/igt_kms.c +0 -1
-			if (s == COMMIT_ATOMIC)

  /* reset fence_fd to prevent it from being set for the next commit */

lib/igt_kms.c +1 -1
-				igt_plane_set_fence_fd(plane, -1);
+				plane->values[IGT_PLANE_IN_FENCE_FD] 

= -1;

lib/igt_kms.c +2 -0
+			} else {
+				plane->changed &=

~IGT_PLANE_COORD_CHANGED_MASK;

lib/igt_kms.c +2 -0
+
+				igt_plane_clear_prop_changed(plane,

IGT_PLANE_CRTC_ID);

lib/igt_kms.c +1 -0
+				igt_plane_clear_prop_changed(plane,

IGT_PLANE_FB_ID);

lib/igt_kms.c +3 -0
+
+				if (s != COMMIT_LEGACY ||
+				    !(plane->type ==

DRM_PLANE_TYPE_PRIMARY ||

lib/igt_kms.c +1 -0
+				      plane->type ==

DRM_PLANE_TYPE_CURSOR))

lib/igt_kms.c +1 -0
+					igt_plane_clear_prop_changed

(plane, IGT_PLANE_ROTATION);

lib/igt_kms.c +1 -0
+			}

  }
  }

lib/igt_kms.c +0 -0
@@ -2913,30 +2876,31 @@ void igt_plane_set_fb(igt_plane_t *plane,
 struct igt_fb *fb)
  	LOG(display, "%s.%d: plane_set_fb(%d)\n",
 kmstest_pipe_name(pipe->pipe),
  	    plane->index, fb ? fb->fb_id : 0);

lib/igt_kms.c +1 -1
-	plane->fb = fb;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_ID, fb ?

pipe->crtc_id : 0);

lib/igt_kms.c +1 -0
+	igt_plane_set_prop_value(plane, IGT_PLANE_FB_ID, fb ? fb-
Quoted 1 line

fb_id : 0);

lib/igt_kms.c +6 -0
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR && fb)
+		plane->gem_handle = fb->gem_handle;
+	else
+		plane->gem_handle = 0;
+

  /* hack to keep tests working that don't call igt_plane_set_size() */
  if (fb) {
  /* set default plane size as fb size */

lib/igt_kms.c +2 -2
-		plane->crtc_w = fb->width;
-		plane->crtc_h = fb->height;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, fb->width, fb->height);


  /* set default src pos/size as fb size */

lib/igt_kms.c +2 -4
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = fb->width;
-		plane->src_h = fb->height;
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, fb->width, fb->height);

  } else {

lib/igt_kms.c +2 -4
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = 0;
-		plane->src_h = 0;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, 0, 0);

lib/igt_kms.c +3 -2
-		plane->crtc_w = 0;
-		plane->crtc_h = 0;
+		/* set default src pos/size as fb size */
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, 0, 0);

  }

lib/igt_kms.c +0 -3
-
-	plane->fb_changed = true;
-	plane->size_changed = true;

 }

 /**

lib/igt_kms.c +1 -1
@@ -2949,12 +2913,19 @@ void igt_plane_set_fb(igt_plane_t *plane,
 struct igt_fb *fb)
   */
  void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd)
  {
-	close(plane->fence_fd);
+	int64_t fd;

lib/igt_kms.c +11 -4
-	if (fcntl(fence_fd, F_GETFD) != -1)
-		plane->fence_fd = dup(fence_fd);
-	else
-		plane->fence_fd = -1;
+	fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+	if (fd != -1)
+		close(fd);
+
+	if (fence_fd != -1) {
+		fd = dup(fence_fd);
+		igt_fail_on(fd == -1);
+	} else
+		fd = -1;
+
+	igt_plane_set_prop_value(plane, IGT_PLANE_IN_FENCE_FD, fd);

 }

 void igt_plane_set_position(igt_plane_t *plane, int x, int y)

lib/igt_kms.c +0 -0
@@ -2965,10 +2936,8 @@ void igt_plane_set_position(igt_plane_t
 *plane, int x, int y)
  	LOG(display, "%s.%d: plane_set_position(%d,%d)\n",
  	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);

lib/igt_kms.c +2 -4
-	plane->crtc_x = x;
-	plane->crtc_y = y;
-
-	plane->position_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_X, x);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_Y, y);

 }

 /**

lib/igt_kms.c +0 -0
@@ -2989,10 +2958,8 @@ void igt_plane_set_size(igt_plane_t *plane,
 int w, int h)
  	LOG(display, "%s.%d: plane_set_size (%dx%d)\n",
  	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);

lib/igt_kms.c +2 -4
-	plane->crtc_w = w;
-	plane->crtc_h = h;
-
-	plane->size_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_W, w);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_H, h);

 }

 /**

lib/igt_kms.c +0 -0
@@ -3014,10 +2981,8 @@ void igt_fb_set_position(struct igt_fb *fb,
 igt_plane_t *plane,
  	LOG(display, "%s.%d: fb_set_position(%d,%d)\n",
  	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);

lib/igt_kms.c +1 -4
-	plane->src_x = x;
-	plane->src_y = y;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_X,

IGT_FIXED(x, 0));

lib/igt_kms.c +1 -0
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_Y,

IGT_FIXED(y, 0));
 }

 /**

lib/igt_kms.c +0 -0
@@ -3040,10 +3005,8 @@ void igt_fb_set_size(struct igt_fb *fb,
 igt_plane_t *plane,
  	LOG(display, "%s.%d: fb_set_size(%dx%d)\n",
  	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);

lib/igt_kms.c +1 -4
-	plane->src_w = w;
-	plane->src_h = h;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_W,

IGT_FIXED(w, 0));

lib/igt_kms.c +1 -0
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H,

IGT_FIXED(h, 0));
 }

 static const char *rotation_name(igt_rotation_t rotation)

lib/igt_kms.c +0 -0
@@ -3071,9 +3034,7 @@ void igt_plane_set_rotation(igt_plane_t *plane,
 igt_rotation_t rotation)
  	    kmstest_pipe_name(pipe->pipe),
  	    plane->index, rotation_name(rotation));

lib/igt_kms.c +1 -3
-	plane->rotation = rotation;
-
-	plane->rotation_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION,

rotation);
 }

 /**

lib/igt_kms.h +0 -0
index 1ef10e7d525c..f87f8be31421 100644
@@ -252,6 +252,9 @@ enum igt_atomic_plane_properties {
         IGT_PLANE_CRTC_W,
         IGT_PLANE_CRTC_H,

lib/igt_kms.h +3 -0
+/* Append new properties after IGT_PLANE_COORD_CHANGED_MASK */
+#define IGT_PLANE_COORD_CHANGED_MASK 0xff
+

        IGT_PLANE_FB_ID,
        IGT_PLANE_CRTC_ID,
        IGT_PLANE_IN_FENCE_FD,

lib/igt_kms.h +1 -5
@@ -286,37 +289,19 @@ typedef struct {
  	int index;
  	/* capabilities */
  	int type;
-	/* state tracking */
-	unsigned int fb_changed       : 1;
-	unsigned int position_changed : 1;
-	unsigned int rotation_changed : 1;
-	unsigned int size_changed     : 1;
+
  	/*
  	 * drm_plane can be NULL for primary and cursor planes (when

not
   * using the atomic modeset API)
   */
  drmModePlane *drm_plane;

lib/igt_kms.h +0 -8
-	struct igt_fb *fb;
-
-	uint32_t rotation_property;
-
-	/* position within pipe_src_w x pipe_src_h */
-	int crtc_x, crtc_y;
-	/* size within pipe_src_w x pipe_src_h */
-	int crtc_w, crtc_h;

lib/igt_kms.h +2 -6
-	/* position within the framebuffer */
-	uint32_t src_x;
-	uint32_t src_y;
-	/* size within the framebuffer*/
-	uint32_t src_w;
-	uint32_t src_h;
+	/* gem handle for fb */
+	uint32_t gem_handle;

lib/igt_kms.h +3 -5
-	igt_rotation_t rotation;
-
-	/* in fence fd */
-	int fence_fd;
-	uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS];
+	uint64_t changed;
+	uint32_t props[IGT_NUM_PLANE_PROPS];
+	uint64_t values[IGT_NUM_PLANE_PROPS];

 } igt_plane_t;

 struct igt_pipe {

lib/igt_kms.h +0 -0
@@ -407,7 +392,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe,
 const char *name,


 static inline bool igt_plane_supports_rotation(igt_plane_t *plane) {

lib/igt_kms.h +1 -1
-	return plane->rotation_property != 0;
+	return plane->props[IGT_PLANE_ROTATION] != 0;

 }
 void igt_pipe_request_out_fence(igt_pipe_t *pipe); void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);

lib/igt_kms.h +0 -0
@@ -527,16 +512,20 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)


 #define IGT_FIXED(i,f) ((i) << 16 | (f))

lib/igt_kms.h +0 -9
-/**
- * igt_atomic_populate_plane_req:
- * @req: A pointer to drmModeAtomicReq
- * @plane: A pointer igt_plane_t
- * @prop: one of igt_atomic_plane_properties
- * @value: the value to add
- */
-#define igt_atomic_populate_plane_req(req, plane, prop, value) \
-	igt_assert_lt(0, drmModeAtomicAddProperty(req, plane-
Quoted 1 line

drm_plane->plane_id,\

lib/igt_kms.h +0 -1
-						  plane-
Quoted 1 line

atomic_props_plane[prop], value))

lib/igt_kms.h +14 -0
+#define igt_plane_is_prop_changed(plane, prop) \
+	(!!((plane)->changed & (1 << (prop))))
+
+#define igt_plane_set_prop_changed(plane, prop) \
+	(plane)->changed |= 1 << (prop)
+
+#define igt_plane_clear_prop_changed(plane, prop) \
+	(plane)->changed &= ~(1 << (prop))
+
+#define igt_plane_set_prop_value(plane, prop, value) \
+	do { \
+		plane->values[prop] = value; \
+		igt_plane_set_prop_changed(plane, prop); \
+	} while (0)


 /**
  * igt_atomic_populate_crtc_req:

tests/kms_atomic_interruptible.c +0 -0
index 2d19fe967809..5570854390ea 100644
@@ -161,12 +161,12 @@ static void run_plane_test(igt_display_t
 *display, enum pipe pipe, igt_output_t
  					/* connector: 1 prop */

  output-

Quoted 1 line

props[IGT_CONNECTOR_CRTC_ID],

  /* plane: remainder props */

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_ID],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_FB_ID],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_SRC_W],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_SRC_H],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_W],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_H]

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_ID],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_FB_ID],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_SRC_W],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_SRC_H],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_W],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_H]

  };
  uint64_t prop_vals[] = { /* crtc */

tests/kms_plane_lowres.c +0 -0
index b16c8cd433b2..613f68899601 100644
@@ -227,8 +227,8 @@ test_setup(data_t *data, enum pipe pipe, uint64_t
 modifier, int flags,
  				    1.0, 1.0, 0.0,
  				    &data->fb[i]);

tests/kms_plane_lowres.c +0 -1
-		igt_plane_set_position(data->plane[i], x, y);

  igt_plane_set_fb(data->plane[i], &data->fb[i]);

tests/kms_plane_lowres.c test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, · line 231

Quoted 1 line
tests/kms_plane_lowres.c +1 -0
+		igt_plane_set_position(data->plane[i], x, y);

This part could be split into a separate patch as it fixes an error. BTW why do we need to igt_plane_set_fb() before igt_plane_set_position()

Quoted 24 lines

  }

  return mode;

tests/kms_rotation_crc.c +0 -0
index 4d2ef1c184f0..4932a0d44410 100644
@@ -122,11 +122,11 @@ static void prepare_crtc(data_t *data,
 igt_output_t *output, enum pipe pipe,
  	igt_plane_set_fb(primary, &data->fb_modeset);


  if (commit < COMMIT_ATOMIC) {

tests/kms_rotation_crc.c +1 -1
-		primary->rotation_changed = false;
+		igt_plane_clear_prop_changed(primary,

IGT_PLANE_ROTATION);
  igt_display_commit(display);

  if (plane->type == DRM_PLANE_TYPE_PRIMARY)

tests/kms_rotation_crc.c +1 -1
-			primary->rotation_changed = true;
+			igt_plane_set_prop_changed(primary,

IGT_PLANE_ROTATION);
  }

  igt_plane_set_fb(plane, NULL);

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH i-g-t v4 5/7] lib/igt_kms: Rework plane properties to be more atomic, v4.

Op 03-10-17 om 14:05 schreef Mika Kahola:

Quoted 793 lines · Maarten Lankhorst
Quoted 792 lines

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changes since v1:
- Remove special dumping of src and crtc coordinates.
- Dump all modified coordinates.
Changes since v2:
- Move igt_plane_set_prop_changed up slightly.
Changes since v3:
- Fix wrong ordering of set_position in kms_plane_lowres causing a test failure.

---
 lib/igt_kms.c                    | 293 +++++++++++++++++----------
------------
 lib/igt_kms.h                    |  59 ++++----
 tests/kms_atomic_interruptible.c |  12 +-
 tests/kms_plane_lowres.c         |   2 +-
 tests/kms_rotation_crc.c         |   4 +-
 5 files changed, 160 insertions(+), 210 deletions(-)
lib/igt_kms.c +0 -0
index 07d2074c2b1a..6e0052ebe7a7 100644
@@ -192,11 +192,11 @@ const char
 *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 
 /*
  * Retrieve all the properies specified in props_name and store them

into
- * plane->atomic_props_plane.
+ * plane->props.
*/
static void
-igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,

lib/igt_kms.c +3 -2
-			int num_props, const char **prop_names)
+igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
+		     int num_props, const char **prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -214,7 +214,7 @@ igt_atomic_fill_plane_props(igt_display_t
 *display, igt_plane_t *plane,
 			if (strcmp(prop->name, prop_names[j]) != 0)
 				continue;
 
-			plane->atomic_props_plane[j] = props-
 > props[i];
+			plane->props[j] = props->props[i];
 			break;
lib/igt_kms.c +3 -2
 		}
@@ -1659,7 +1659,6 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
 	drmModeRes *resources;
 	drmModePlaneRes *plane_resources;
 	int i;
-	int is_atomic = 0;
 
 	memset(display, 0, sizeof(igt_display_t));
@@ -1679,7 +1678,9 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
 	igt_assert_f(display->pipes, "Failed to allocate memory for
 %d pipes\n", display->n_pipes);
 
 	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	is_atomic = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC,
 1);
+	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+		display->is_atomic = 1;
+
lib/igt_kms.c +3 -7
 	plane_resources = drmModeGetPlaneResources(display->drm_fd);
 	igt_assert(plane_resources);
@@ -1776,19 +1777,19 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
 			plane->type = type;
 			plane->pipe = pipe;
 			plane->drm_plane = drm_plane;
-			plane->fence_fd = -1;
+			plane->values[IGT_PLANE_IN_FENCE_FD] =
 ~0ULL;
 
-			if (is_atomic == 0) {
-				display->is_atomic = 1;
-				igt_atomic_fill_plane_props(display,
 plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
-			}
+			igt_fill_plane_props(display, plane,
 IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
 
 			get_plane_property(display->drm_fd,
 drm_plane->plane_id,
 					   "rotation",
-					   &plane-
 > rotation_property,
-					   &prop_value,
+					   &plane-
Quoted 1 line

props[IGT_PLANE_ROTATION],

lib/igt_kms.c +1 -0
+					   &plane-
Quoted 1 line

values[IGT_PLANE_ROTATION],

lib/igt_kms.c +0 -1
 					   NULL);
-			plane->rotation =

(igt_rotation_t)prop_value;

lib/igt_kms.c +2 -0
+
+			/* Clear any residual framebuffer on first

commit. */

lib/igt_kms.c +1 -0
+			igt_plane_set_prop_changed(plane,

IGT_PLANE_FB_ID);

lib/igt_kms.c +1 -0
+			igt_plane_set_prop_changed(plane,

IGT_PLANE_CRTC_ID);

lib/igt_kms.c +1 -15
 		}
 
 		/*
@@ -1805,9 +1806,6 @@ void igt_display_init(igt_display_t *display,
 int drm_fd)
 
 		pipe->n_planes = n_planes;
 
-		for_each_plane_on_pipe(display, i, plane)
-			plane->fb_changed = true;
-
 		pipe->mode_changed = true;
 	}
@@ -2070,18 +2068,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe,
 const char *name,
 
 static uint32_t igt_plane_get_fb_id(igt_plane_t *plane)
 {
-	if (plane->fb)
-		return plane->fb->fb_id;
-	else
-		return 0;
-}
-
-static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
-{
-	if (plane->fb)
-		return plane->fb->gem_handle;
-	else
-		return 0;
+	return plane->values[IGT_PLANE_FB_ID];
 }
 

#define CHECK_RETURN(r, fail) { \

lib/igt_kms.c +0 -3
@@ -2090,9 +2077,6 @@ static uint32_t
 igt_plane_get_fb_gem_handle(igt_plane_t *plane)
 	igt_assert_eq(r, 0);	\
 }
 
-
-
-
 /*
  * Add position and fb changes of a plane to the atomic property set

*/

lib/igt_kms.c +2 -21
@@ -2101,63 +2085,31 @@ igt_atomic_prepare_plane_commit(igt_plane_t
 *plane, igt_pipe_t *pipe,
 	drmModeAtomicReq *req)
 {
 	igt_display_t *display = pipe->display;
-	uint32_t fb_id, crtc_id;
+	int i;
 
 	igt_assert(plane->drm_plane);
 
-	/* it's an error to try an unsupported feature */
-	igt_assert(igt_plane_supports_rotation(plane) ||
-			!plane->rotation_changed);
-
-	fb_id = igt_plane_get_fb_id(plane);
-	crtc_id = pipe->crtc_id;
-
 	LOG(display,
 	    "populating plane data: %s.%d, fb %u\n",
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index,
-	    fb_id);
-
-	if (plane->fence_fd >= 0) {
-		uint64_t fence_fd = (int64_t) plane->fence_fd;
-		igt_atomic_populate_plane_req(req, plane,
 IGT_PLANE_IN_FENCE_FD, fence_fd);
-	}
+	    igt_plane_get_fb_id(plane));
 
-	if (plane->fb_changed) {
-		igt_atomic_populate_plane_req(req, plane,
 IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0);
-		igt_atomic_populate_plane_req(req, plane,
 IGT_PLANE_FB_ID, fb_id);
-	}
-
-	if (plane->position_changed || plane->size_changed) {
-		uint32_t src_x = IGT_FIXED(plane->src_x, 0); /*

src_x */

lib/igt_kms.c +0 -1
-		uint32_t src_y = IGT_FIXED(plane->src_y, 0); /*

src_y */

lib/igt_kms.c +0 -1
-		uint32_t src_w = IGT_FIXED(plane->src_w, 0); /*

src_w */

lib/igt_kms.c +0 -1
-		uint32_t src_h = IGT_FIXED(plane->src_h, 0); /*

src_h */

lib/igt_kms.c +5 -10
-		int32_t crtc_x = plane->crtc_x;
-		int32_t crtc_y = plane->crtc_y;
-		uint32_t crtc_w = plane->crtc_w;
-		uint32_t crtc_h = plane->crtc_h;
+	for (i = 0; i < IGT_NUM_PLANE_PROPS; i++) {
+		if (!igt_plane_is_prop_changed(plane, i))
+			continue;
 
-		LOG(display,
-		"src = (%d, %d) %u x %u "
-		"dst = (%d, %d) %u x %u\n",
-		src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
-		crtc_x, crtc_y, crtc_w, crtc_h);
+		/* it's an error to try an unsupported feature */
+		igt_assert(plane->props[i]);
 
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_X, src_x);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_Y, src_y);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_W, src_w);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_SRC_H, src_h);

lib/igt_kms.c +1 -0
+		igt_debug("plane %s.%d: Setting property \"%s\" to

0x%"PRIx64"/%"PRIi64"\n",

lib/igt_kms.c +1 -0
+			kmstest_pipe_name(pipe->pipe), plane->index, 

igt_plane_prop_names[i],

lib/igt_kms.c +1 -1
+			plane->values[i], plane->values[i]);
 
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_X, crtc_x);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_Y, crtc_y);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_W, crtc_w);

lib/igt_kms.c +0 -1
-		igt_atomic_populate_plane_req(req, plane,

IGT_PLANE_CRTC_H, crtc_h);

lib/igt_kms.c +1 -0
+		igt_assert_lt(0, drmModeAtomicAddProperty(req,

plane->drm_plane->plane_id,

lib/igt_kms.c +2 -0
+						  plane->props[i],
+						  plane-
Quoted 1 line

values[i]));

lib/igt_kms.c +5 -6
 	}
-
-	if (plane->rotation_changed)
-		igt_atomic_populate_plane_req(req, plane,
-			IGT_PLANE_ROTATION, plane->rotation);
 }
@@ -2183,17 +2135,20 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
 	int32_t crtc_y;
 	uint32_t crtc_w;
 	uint32_t crtc_h;
+	bool setplane =
+		igt_plane_is_prop_changed(plane, IGT_PLANE_FB_ID) ||
+		plane->changed & IGT_PLANE_COORD_CHANGED_MASK;
 
 	igt_assert(plane->drm_plane);
 
 	/* it's an error to try an unsupported feature */
 	igt_assert(igt_plane_supports_rotation(plane) ||
-		   !plane->rotation_changed);
+		   !igt_plane_is_prop_changed(plane,
 IGT_PLANE_ROTATION));
 
 	fb_id = igt_plane_get_fb_id(plane);
 	crtc_id = pipe->crtc_id;
 
-	if ((plane->fb_changed || plane->size_changed) && fb_id ==
 0) {
+	if (setplane && fb_id == 0) {
lib/igt_kms.c +9 -10
 		LOG(display,
 		    "SetPlane pipe %s, plane %d, disabling\n",
 		    kmstest_pipe_name(pipe->pipe),
@@ -2212,16 +2167,15 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
 				      IGT_FIXED(0,0) /* src_h */);
 
 		CHECK_RETURN(ret, fail_on_error);
-	} else if (plane->fb_changed || plane->position_changed ||
-		plane->size_changed) {
-		src_x = IGT_FIXED(plane->src_x,0); /* src_x */
-		src_y = IGT_FIXED(plane->src_y,0); /* src_y */
-		src_w = IGT_FIXED(plane->src_w,0); /* src_w */
-		src_h = IGT_FIXED(plane->src_h,0); /* src_h */
-		crtc_x = plane->crtc_x;
-		crtc_y = plane->crtc_y;
-		crtc_w = plane->crtc_w;
-		crtc_h = plane->crtc_h;
+	} else if (setplane) {
+		src_x = plane->values[IGT_PLANE_SRC_X];
+		src_y = plane->values[IGT_PLANE_SRC_Y];
+		src_w = plane->values[IGT_PLANE_SRC_W];
+		src_h = plane->values[IGT_PLANE_SRC_H];
+		crtc_x = plane->values[IGT_PLANE_CRTC_X];
+		crtc_y = plane->values[IGT_PLANE_CRTC_Y];
+		crtc_w = plane->values[IGT_PLANE_CRTC_W];
+		crtc_h = plane->values[IGT_PLANE_CRTC_H];
 
 		LOG(display,
lib/igt_kms.c +4 -3
 		    "SetPlane %s.%d, fb %u, src = (%d, %d) "
@@ -2245,9 +2199,10 @@ static int igt_drm_plane_commit(igt_plane_t
 *plane,
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (plane->rotation_changed) {
-		ret = igt_plane_set_property(plane, plane-
 > rotation_property,
-				       plane->rotation);
+	if (igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION)) {
+		ret = igt_plane_set_property(plane,
+					     plane-
 > props[IGT_PLANE_ROTATION],
+					     plane-
Quoted 1 line

values[IGT_PLANE_ROTATION]);

lib/igt_kms.c +14 -19
 		CHECK_RETURN(ret, fail_on_error);
 	}
@@ -2269,35 +2224,30 @@ static int
 igt_cursor_commit_legacy(igt_plane_t *cursor,
 	uint32_t crtc_id = pipe->crtc_id;
 	int ret;
 
-	if (cursor->fb_changed) {
-		uint32_t gem_handle =
 igt_plane_get_fb_gem_handle(cursor);
-
-		if (gem_handle) {
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_FB_ID)) {
+		if (cursor->gem_handle)
 			LOG(display,
 			    "SetCursor pipe %s, fb %u %dx%d\n",
 			    kmstest_pipe_name(pipe->pipe),
-			    gem_handle,
-			    cursor->crtc_w, cursor->crtc_h);
-
-			ret = drmModeSetCursor(display->drm_fd,
 crtc_id,
-					       gem_handle,
-					       cursor->crtc_w,
-					       cursor->crtc_h);
-		} else {
+			    cursor->gem_handle,
+			    (unsigned)cursor-
 > values[IGT_PLANE_CRTC_W],
+			    (unsigned)cursor-
 > values[IGT_PLANE_CRTC_H]);
+		else
 			LOG(display,
 			    "SetCursor pipe %s, disabling\n",
 			    kmstest_pipe_name(pipe->pipe));
 
-			ret = drmModeSetCursor(display->drm_fd,
 crtc_id,
-					       0, 0, 0);
-		}
-
+		ret = drmModeSetCursor(display->drm_fd, crtc_id,
+				       cursor->gem_handle,
+				       cursor-
 > values[IGT_PLANE_CRTC_W],
+				       cursor-
 > values[IGT_PLANE_CRTC_H]);
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (cursor->position_changed) {
-		int x = cursor->crtc_x;
-		int y = cursor->crtc_y;
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_X) ||
+	    igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_Y)) {
+		int x = cursor->values[IGT_PLANE_CRTC_X];
+		int y = cursor->values[IGT_PLANE_CRTC_Y];
 
 		LOG(display,
 		    "MoveCursor pipe %s, (%d, %d)\n",
@@ -2326,13 +2276,14 @@ static int
 igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	int ret;
 
 	/* Primary planes can't be windowed when using a legacy

commit */

lib/igt_kms.c +1 -1
-	igt_assert((primary->crtc_x == 0 && primary->crtc_y == 0));
+	igt_assert((primary->values[IGT_PLANE_CRTC_X] == 0 &&

primary->values[IGT_PLANE_CRTC_Y] == 0));

lib/igt_kms.c +1 -1
 	/* nor rotated */
-	igt_assert(!primary->rotation_changed);
+	igt_assert(!igt_plane_is_prop_changed(primary,

IGT_PLANE_ROTATION));

lib/igt_kms.c +8 -4
-	if (!primary->fb_changed && !primary->position_changed &&
-	    !primary->size_changed && !primary->pipe->mode_changed)
+	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
+	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
+	    !primary->pipe->mode_changed)
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2343,19 +2294,22 @@ static int
 igt_primary_plane_commit_legacy(igt_plane_t *primary,
 		mode = NULL;
 
 	if (fb_id) {
+		uint32_t src_x = primary->values[IGT_PLANE_SRC_X] >>
 16;
+		uint32_t src_y = primary->values[IGT_PLANE_SRC_Y] >>
 16;
+
 		LOG(display,
 		    "%s: SetCrtc pipe %s, fb %u, src (%d, %d), "
 		    "mode %dx%d\n",
 		    igt_output_name(output),
 		    kmstest_pipe_name(pipe->pipe),
 		    fb_id,
-		    primary->src_x, primary->src_y,
+		    src_x, src_y,
 		    mode->hdisplay, mode->vdisplay);
 
 		ret = drmModeSetCrtc(display->drm_fd,
 				     crtc_id,
 				     fb_id,
-				     primary->src_x, primary->src_y,
+				     src_x, src_y,
lib/igt_kms.c +3 -5
 				     &output->id,
 				     1,
 				     mode);
@@ -2608,18 +2562,27 @@ display_commit_changed(igt_display_t
 *display, enum igt_commit_style s)
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
-			plane->fb_changed = false;
-			plane->position_changed = false;
-			plane->size_changed = false;
+			if (s == COMMIT_ATOMIC) {
+				int fd;
+				plane->changed = 0;
 
-			if (s != COMMIT_LEGACY ||
-			    !(plane->type == DRM_PLANE_TYPE_PRIMARY

||

lib/igt_kms.c +1 -2
-			      plane->type == DRM_PLANE_TYPE_CURSOR))
-				plane->rotation_changed = false;
+				fd = plane-
Quoted 1 line

values[IGT_PLANE_IN_FENCE_FD];

lib/igt_kms.c +2 -1
+				if (fd != -1)
+					close(fd);
 
-			if (s == COMMIT_ATOMIC)
 				/* reset fence_fd to prevent it from

being set for the next commit */

lib/igt_kms.c +1 -1
-				igt_plane_set_fence_fd(plane, -1);
+				plane->values[IGT_PLANE_IN_FENCE_FD] 

= -1;

lib/igt_kms.c +2 -0
+			} else {
+				plane->changed &=

~IGT_PLANE_COORD_CHANGED_MASK;

lib/igt_kms.c +2 -0
+
+				igt_plane_clear_prop_changed(plane,

IGT_PLANE_CRTC_ID);

lib/igt_kms.c +1 -0
+				igt_plane_clear_prop_changed(plane,

IGT_PLANE_FB_ID);

lib/igt_kms.c +3 -0
+
+				if (s != COMMIT_LEGACY ||
+				    !(plane->type ==

DRM_PLANE_TYPE_PRIMARY ||

lib/igt_kms.c +1 -0
+				      plane->type ==

DRM_PLANE_TYPE_CURSOR))

lib/igt_kms.c +1 -0
+					igt_plane_clear_prop_changed

(plane, IGT_PLANE_ROTATION);

lib/igt_kms.c +9 -1
+			}
 		}
 	}
@@ -2913,30 +2876,31 @@ void igt_plane_set_fb(igt_plane_t *plane,
 struct igt_fb *fb)
 	LOG(display, "%s.%d: plane_set_fb(%d)\n",
 kmstest_pipe_name(pipe->pipe),
 	    plane->index, fb ? fb->fb_id : 0);
 
-	plane->fb = fb;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_ID, fb ?
 pipe->crtc_id : 0);
+	igt_plane_set_prop_value(plane, IGT_PLANE_FB_ID, fb ? fb-
 > fb_id : 0);
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR && fb)
+		plane->gem_handle = fb->gem_handle;
+	else
+		plane->gem_handle = 0;
+
 	/* hack to keep tests working that don't call

igt_plane_set_size() */

lib/igt_kms.c +21 -20
 	if (fb) {
 		/* set default plane size as fb size */
-		plane->crtc_w = fb->width;
-		plane->crtc_h = fb->height;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, fb->width, fb->height);
 
 		/* set default src pos/size as fb size */
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = fb->width;
-		plane->src_h = fb->height;
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, fb->width, fb->height);
 	} else {
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = 0;
-		plane->src_h = 0;
+		igt_plane_set_position(plane, 0, 0);
+		igt_plane_set_size(plane, 0, 0);
 
-		plane->crtc_w = 0;
-		plane->crtc_h = 0;
+		/* set default src pos/size as fb size */
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, 0, 0);
 	}
-
-	plane->fb_changed = true;
-	plane->size_changed = true;
 }
 
 /**
@@ -2949,12 +2913,19 @@ void igt_plane_set_fb(igt_plane_t *plane,
 struct igt_fb *fb)
  */
 void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd)
 {
-	close(plane->fence_fd);
+	int64_t fd;
 
-	if (fcntl(fence_fd, F_GETFD) != -1)
-		plane->fence_fd = dup(fence_fd);
-	else
-		plane->fence_fd = -1;
+	fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+	if (fd != -1)
+		close(fd);
+
+	if (fence_fd != -1) {
+		fd = dup(fence_fd);
+		igt_fail_on(fd == -1);
+	} else
+		fd = -1;
+
+	igt_plane_set_prop_value(plane, IGT_PLANE_IN_FENCE_FD, fd);
 }
 

void igt_plane_set_position(igt_plane_t *plane, int x, int y)

lib/igt_kms.c +2 -4
@@ -2965,10 +2936,8 @@ void igt_plane_set_position(igt_plane_t
 *plane, int x, int y)
 	LOG(display, "%s.%d: plane_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->crtc_x = x;
-	plane->crtc_y = y;
-
-	plane->position_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_X, x);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_Y, y);
 }
 

/**

lib/igt_kms.c +2 -4
@@ -2989,10 +2958,8 @@ void igt_plane_set_size(igt_plane_t *plane,
 int w, int h)
 	LOG(display, "%s.%d: plane_set_size (%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->crtc_w = w;
-	plane->crtc_h = h;
-
-	plane->size_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_W, w);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_H, h);
 }
 

/**

lib/igt_kms.c +2 -4
@@ -3014,10 +2981,8 @@ void igt_fb_set_position(struct igt_fb *fb,
 igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->src_x = x;
-	plane->src_y = y;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_X,
 IGT_FIXED(x, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_Y,
 IGT_FIXED(y, 0));

}

/**

lib/igt_kms.c +2 -4
@@ -3040,10 +3005,8 @@ void igt_fb_set_size(struct igt_fb *fb,
 igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_size(%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->src_w = w;
-	plane->src_h = h;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_W,
 IGT_FIXED(w, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H,
 IGT_FIXED(h, 0));

}

static const char *rotation_name(igt_rotation_t rotation)

lib/igt_kms.c +1 -3
@@ -3071,9 +3034,7 @@ void igt_plane_set_rotation(igt_plane_t *plane,
 igt_rotation_t rotation)
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index, rotation_name(rotation));
 
-	plane->rotation = rotation;
-
-	plane->rotation_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION,
 rotation);
 }

/**

lib/igt_kms.h +4 -5
index 1ef10e7d525c..f87f8be31421 100644
@@ -252,6 +252,9 @@ enum igt_atomic_plane_properties {
        IGT_PLANE_CRTC_W,
        IGT_PLANE_CRTC_H,
 
+/* Append new properties after IGT_PLANE_COORD_CHANGED_MASK */
+#define IGT_PLANE_COORD_CHANGED_MASK 0xff
+
        IGT_PLANE_FB_ID,
        IGT_PLANE_CRTC_ID,
        IGT_PLANE_IN_FENCE_FD,
@@ -286,37 +289,19 @@ typedef struct {
 	int index;
 	/* capabilities */
 	int type;
-	/* state tracking */
-	unsigned int fb_changed       : 1;
-	unsigned int position_changed : 1;
-	unsigned int rotation_changed : 1;
-	unsigned int size_changed     : 1;
+
 	/*
 	 * drm_plane can be NULL for primary and cursor planes (when

not

lib/igt_kms.h +6 -20
 	 * using the atomic modeset API)
 	 */
 	drmModePlane *drm_plane;
-	struct igt_fb *fb;
-
-	uint32_t rotation_property;
-
-	/* position within pipe_src_w x pipe_src_h */
-	int crtc_x, crtc_y;
-	/* size within pipe_src_w x pipe_src_h */
-	int crtc_w, crtc_h;
 
-	/* position within the framebuffer */
-	uint32_t src_x;
-	uint32_t src_y;
-	/* size within the framebuffer*/
-	uint32_t src_w;
-	uint32_t src_h;
+	/* gem handle for fb */
+	uint32_t gem_handle;
 
-	igt_rotation_t rotation;
-
-	/* in fence fd */
-	int fence_fd;
-	uint32_t atomic_props_plane[IGT_NUM_PLANE_PROPS];
+	uint64_t changed;
+	uint32_t props[IGT_NUM_PLANE_PROPS];
+	uint64_t values[IGT_NUM_PLANE_PROPS];
 } igt_plane_t;
 
 struct igt_pipe {
@@ -407,7 +392,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe,
 const char *name,
 
 static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
 {
-	return plane->rotation_property != 0;
+	return plane->props[IGT_PLANE_ROTATION] != 0;
 }
 void igt_pipe_request_out_fence(igt_pipe_t *pipe);

void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t
length);

lib/igt_kms.h +14 -10
@@ -527,16 +512,20 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)
 
 #define IGT_FIXED(i,f)	((i) << 16 | (f))
 
-/**
- * igt_atomic_populate_plane_req:
- * @req: A pointer to drmModeAtomicReq
- * @plane: A pointer igt_plane_t
- * @prop: one of igt_atomic_plane_properties
- * @value: the value to add
- */
-#define igt_atomic_populate_plane_req(req, plane, prop, value) \
-	igt_assert_lt(0, drmModeAtomicAddProperty(req, plane-
 > drm_plane->plane_id,\
-						  plane-
 > atomic_props_plane[prop], value))
+#define igt_plane_is_prop_changed(plane, prop) \
+	(!!((plane)->changed & (1 << (prop))))
+
+#define igt_plane_set_prop_changed(plane, prop) \
+	(plane)->changed |= 1 << (prop)
+
+#define igt_plane_clear_prop_changed(plane, prop) \
+	(plane)->changed &= ~(1 << (prop))
+
+#define igt_plane_set_prop_value(plane, prop, value) \
+	do { \
+		plane->values[prop] = value; \
+		igt_plane_set_prop_changed(plane, prop); \
+	} while (0)

/**
* igt_atomic_populate_crtc_req:

tests/kms_atomic_interruptible.c +0 -4
index 2d19fe967809..5570854390ea 100644
@@ -161,12 +161,12 @@ static void run_plane_test(igt_display_t
 *display, enum pipe pipe, igt_output_t
 					/* connector: 1 prop */
 					output-
 > props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
-					plane-
 > atomic_props_plane[IGT_PLANE_CRTC_ID],
-					plane-
 > atomic_props_plane[IGT_PLANE_FB_ID],
-					plane-
 > atomic_props_plane[IGT_PLANE_SRC_W],
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_SRC_H],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_W],

tests/kms_atomic_interruptible.c +0 -1
-					plane-
Quoted 1 line

atomic_props_plane[IGT_PLANE_CRTC_H]

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_ID],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_FB_ID],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_SRC_W],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_SRC_H],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_W],

tests/kms_atomic_interruptible.c +1 -0
+					plane-
Quoted 1 line

props[IGT_PLANE_CRTC_H]

tests/kms_atomic_interruptible.c +0 -0
 				};
 				uint64_t prop_vals[] = {
 					/* crtc */
tests/kms_plane_lowres.c +0 -0
index b16c8cd433b2..613f68899601 100644
@@ -227,8 +227,8 @@ test_setup(data_t *data, enum pipe pipe, uint64_t
 modifier, int flags,
 				    1.0, 1.0, 0.0,
 				    &data->fb[i]);
 
Quoted 6 lines

tests/kms_plane_lowres.c test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int flags, · line 231

Quoted 3 lines
tests/kms_plane_lowres.c +1 -1
-		igt_plane_set_position(data->plane[i], x, y);
 		igt_plane_set_fb(data->plane[i], &data->fb[i]);
+		igt_plane_set_position(data->plane[i], x, y);

This part could be split into a separate patch as it fixes an error. BTW why do we need to igt_plane_set_fb() before igt_plane_set_position()

It wasn't an error before, igt_plane_set_fb cleared everything to defaults except position, but with this patch I felt it should clear position too because why keep it special?

Hmm though it seems multiple tests assume that position is untouched by igt_plane_set_fb, I think it might be better to revert this hunk. Perhaps clean it up later..

I'll just drop this part for now. Reality is clashing with ideals again. :(

Quoted 17 lines
Quoted 17 lines
tests/kms_plane_lowres.c +0 -0
 	}
 
tests/kms_plane_lowres.c +0 -0
 	return mode;
tests/kms_rotation_crc.c +1 -1
index 4d2ef1c184f0..4932a0d44410 100644
@@ -122,11 +122,11 @@ static void prepare_crtc(data_t *data,
 igt_output_t *output, enum pipe pipe,
 	igt_plane_set_fb(primary, &data->fb_modeset);
 
 	if (commit < COMMIT_ATOMIC) {
-		primary->rotation_changed = false;
+		igt_plane_clear_prop_changed(primary,
 IGT_PLANE_ROTATION);
 		igt_display_commit(display);
 
Quoted 7 lines

tests/kms_rotation_crc.c static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, · line 132

Quoted 7 lines
tests/kms_rotation_crc.c +1 -1
 		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
-			primary->rotation_changed = true;
+			igt_plane_set_prop_changed(primary,
 IGT_PLANE_ROTATION);
tests/kms_rotation_crc.c +0 -0
 	}
 
 	igt_plane_set_fb(plane, NULL);

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

PATCH 1/1 lib/igt_kms: Rework plane properties to be more atomic, v5.

In reply to Mika Kahola

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

Changes since v1:
- Remove special dumping of src and crtc coordinates.
- Dump all modified coordinates.
Changes since v2:
- Move igt_plane_set_prop_changed up slightly.
Changes since v3:
- Fix wrong ordering of set_position in kms_plane_lowres causing a test failure. Changes since v4:
- Back out resetting crtc position in igt_plane_set_fb() and document it during init. Tests appear to rely on it being preserved.

---
 lib/igt_kms.c                    | 299 +++++++++++++++++----------------------
 lib/igt_kms.h                    |  59 ++++----
 tests/kms_atomic_interruptible.c |  12 +-
 tests/kms_rotation_crc.c         |   4 +-
 4 files changed, 165 insertions(+), 209 deletions(-)
lib/igt_kms.c +133 -166
index e3534ee80659..44d2d9452989 100644
@@ -192,11 +192,11 @@ const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 
 /*
  * Retrieve all the properies specified in props_name and store them into
- * plane->atomic_props_plane.
+ * plane->props.
  */
 static void
-igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
-			int num_props, const char **prop_names)
+igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
+		     int num_props, const char **prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -214,7 +214,7 @@ igt_atomic_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
 			if (strcmp(prop->name, prop_names[j]) != 0)
 				continue;
 
-			plane->atomic_props_plane[j] = props->props[i];
+			plane->props[j] = props->props[i];
 			break;
 		}
 
@@ -1659,7 +1659,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	drmModeRes *resources;
 	drmModePlaneRes *plane_resources;
 	int i;
-	int is_atomic = 0;
 
 	memset(display, 0, sizeof(igt_display_t));
 
@@ -1679,7 +1678,9 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	igt_assert_f(display->pipes, "Failed to allocate memory for %d pipes\n", display->n_pipes);
 
 	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-	is_atomic = drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1);
+	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
+		display->is_atomic = 1;
+
 	plane_resources = drmModeGetPlaneResources(display->drm_fd);
 	igt_assert(plane_resources);
 
@@ -1776,19 +1777,27 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 			plane->type = type;
 			plane->pipe = pipe;
 			plane->drm_plane = drm_plane;
-			plane->fence_fd = -1;
+			plane->values[IGT_PLANE_IN_FENCE_FD] = ~0ULL;
 
-			if (is_atomic == 0) {
-				display->is_atomic = 1;
-				igt_atomic_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
-			}
+			igt_fill_plane_props(display, plane, IGT_NUM_PLANE_PROPS, igt_plane_prop_names);
 
 			get_plane_property(display->drm_fd, drm_plane->plane_id,
 					   "rotation",
-					   &plane->rotation_property,
-					   &prop_value,
+					   &plane->props[IGT_PLANE_ROTATION],
+					   &plane->values[IGT_PLANE_ROTATION],
 					   NULL);
-			plane->rotation = (igt_rotation_t)prop_value;
+
+			/* Clear any residual framebuffer info on first commit. */
+			igt_plane_set_prop_changed(plane, IGT_PLANE_FB_ID);
+			igt_plane_set_prop_changed(plane, IGT_PLANE_CRTC_ID);
+
+			/*
+			 * CRTC_X/Y are not changed in igt_plane_set_fb, so
+			 * force them to be sanitized in case they contain
+			 * garbage.
+			 */
+			igt_plane_set_prop_changed(plane, IGT_PLANE_CRTC_X);
+			igt_plane_set_prop_changed(plane, IGT_PLANE_CRTC_Y);
 		}
 
 		/*
@@ -1805,9 +1814,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 
 		pipe->n_planes = n_planes;
 
-		for_each_plane_on_pipe(display, i, plane)
-			plane->fb_changed = true;
-
 		pipe->mode_changed = true;
 	}
 
@@ -2070,18 +2076,7 @@ bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
 
 static uint32_t igt_plane_get_fb_id(igt_plane_t *plane)
 {
-	if (plane->fb)
-		return plane->fb->fb_id;
-	else
-		return 0;
-}
-
-static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
-{
-	if (plane->fb)
-		return plane->fb->gem_handle;
-	else
-		return 0;
+	return plane->values[IGT_PLANE_FB_ID];
 }
 
 #define CHECK_RETURN(r, fail) {	\
@@ -2090,9 +2085,6 @@ static uint32_t igt_plane_get_fb_gem_handle(igt_plane_t *plane)
 	igt_assert_eq(r, 0);	\
 }
 
-
-
-
 /*
  * Add position and fb changes of a plane to the atomic property set
  */
@@ -2101,63 +2093,31 @@ igt_atomic_prepare_plane_commit(igt_plane_t *plane, igt_pipe_t *pipe,
 	drmModeAtomicReq *req)
 {
 	igt_display_t *display = pipe->display;
-	uint32_t fb_id, crtc_id;
+	int i;
 
 	igt_assert(plane->drm_plane);
 
-	/* it's an error to try an unsupported feature */
-	igt_assert(igt_plane_supports_rotation(plane) ||
-			!plane->rotation_changed);
-
-	fb_id = igt_plane_get_fb_id(plane);
-	crtc_id = pipe->crtc_id;
-
 	LOG(display,
 	    "populating plane data: %s.%d, fb %u\n",
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index,
-	    fb_id);
-
-	if (plane->fence_fd >= 0) {
-		uint64_t fence_fd = (int64_t) plane->fence_fd;
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_IN_FENCE_FD, fence_fd);
-	}
+	    igt_plane_get_fb_id(plane));
 
-	if (plane->fb_changed) {
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_ID, fb_id ? crtc_id : 0);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_FB_ID, fb_id);
-	}
-
-	if (plane->position_changed || plane->size_changed) {
-		uint32_t src_x = IGT_FIXED(plane->src_x, 0); /* src_x */
-		uint32_t src_y = IGT_FIXED(plane->src_y, 0); /* src_y */
-		uint32_t src_w = IGT_FIXED(plane->src_w, 0); /* src_w */
-		uint32_t src_h = IGT_FIXED(plane->src_h, 0); /* src_h */
-		int32_t crtc_x = plane->crtc_x;
-		int32_t crtc_y = plane->crtc_y;
-		uint32_t crtc_w = plane->crtc_w;
-		uint32_t crtc_h = plane->crtc_h;
+	for (i = 0; i < IGT_NUM_PLANE_PROPS; i++) {
+		if (!igt_plane_is_prop_changed(plane, i))
+			continue;
 
-		LOG(display,
-		"src = (%d, %d) %u x %u "
-		"dst = (%d, %d) %u x %u\n",
-		src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
-		crtc_x, crtc_y, crtc_w, crtc_h);
+		/* it's an error to try an unsupported feature */
+		igt_assert(plane->props[i]);
 
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_X, src_x);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_Y, src_y);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_W, src_w);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_SRC_H, src_h);
+		igt_debug("plane %s.%d: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			kmstest_pipe_name(pipe->pipe), plane->index, igt_plane_prop_names[i],
+			plane->values[i], plane->values[i]);
 
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_X, crtc_x);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_Y, crtc_y);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_W, crtc_w);
-		igt_atomic_populate_plane_req(req, plane, IGT_PLANE_CRTC_H, crtc_h);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req, plane->drm_plane->plane_id,
+						  plane->props[i],
+						  plane->values[i]));
 	}
-
-	if (plane->rotation_changed)
-		igt_atomic_populate_plane_req(req, plane,
-			IGT_PLANE_ROTATION, plane->rotation);
 }
 
 
@@ -2183,17 +2143,20 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 	int32_t crtc_y;
 	uint32_t crtc_w;
 	uint32_t crtc_h;
+	bool setplane =
+		igt_plane_is_prop_changed(plane, IGT_PLANE_FB_ID) ||
+		plane->changed & IGT_PLANE_COORD_CHANGED_MASK;
 
 	igt_assert(plane->drm_plane);
 
 	/* it's an error to try an unsupported feature */
 	igt_assert(igt_plane_supports_rotation(plane) ||
-		   !plane->rotation_changed);
+		   !igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION));
 
 	fb_id = igt_plane_get_fb_id(plane);
 	crtc_id = pipe->crtc_id;
 
-	if ((plane->fb_changed || plane->size_changed) && fb_id == 0) {
+	if (setplane && fb_id == 0) {
 		LOG(display,
 		    "SetPlane pipe %s, plane %d, disabling\n",
 		    kmstest_pipe_name(pipe->pipe),
@@ -2212,16 +2175,15 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 				      IGT_FIXED(0,0) /* src_h */);
 
 		CHECK_RETURN(ret, fail_on_error);
-	} else if (plane->fb_changed || plane->position_changed ||
-		plane->size_changed) {
-		src_x = IGT_FIXED(plane->src_x,0); /* src_x */
-		src_y = IGT_FIXED(plane->src_y,0); /* src_y */
-		src_w = IGT_FIXED(plane->src_w,0); /* src_w */
-		src_h = IGT_FIXED(plane->src_h,0); /* src_h */
-		crtc_x = plane->crtc_x;
-		crtc_y = plane->crtc_y;
-		crtc_w = plane->crtc_w;
-		crtc_h = plane->crtc_h;
+	} else if (setplane) {
+		src_x = plane->values[IGT_PLANE_SRC_X];
+		src_y = plane->values[IGT_PLANE_SRC_Y];
+		src_w = plane->values[IGT_PLANE_SRC_W];
+		src_h = plane->values[IGT_PLANE_SRC_H];
+		crtc_x = plane->values[IGT_PLANE_CRTC_X];
+		crtc_y = plane->values[IGT_PLANE_CRTC_Y];
+		crtc_w = plane->values[IGT_PLANE_CRTC_W];
+		crtc_h = plane->values[IGT_PLANE_CRTC_H];
 
 		LOG(display,
 		    "SetPlane %s.%d, fb %u, src = (%d, %d) "
@@ -2245,9 +2207,10 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (plane->rotation_changed) {
-		ret = igt_plane_set_property(plane, plane->rotation_property,
-				       plane->rotation);
+	if (igt_plane_is_prop_changed(plane, IGT_PLANE_ROTATION)) {
+		ret = igt_plane_set_property(plane,
+					     plane->props[IGT_PLANE_ROTATION],
+					     plane->values[IGT_PLANE_ROTATION]);
 
 		CHECK_RETURN(ret, fail_on_error);
 	}
@@ -2269,35 +2232,30 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor,
 	uint32_t crtc_id = pipe->crtc_id;
 	int ret;
 
-	if (cursor->fb_changed) {
-		uint32_t gem_handle = igt_plane_get_fb_gem_handle(cursor);
-
-		if (gem_handle) {
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_FB_ID)) {
+		if (cursor->gem_handle)
 			LOG(display,
 			    "SetCursor pipe %s, fb %u %dx%d\n",
 			    kmstest_pipe_name(pipe->pipe),
-			    gem_handle,
-			    cursor->crtc_w, cursor->crtc_h);
-
-			ret = drmModeSetCursor(display->drm_fd, crtc_id,
-					       gem_handle,
-					       cursor->crtc_w,
-					       cursor->crtc_h);
-		} else {
+			    cursor->gem_handle,
+			    (unsigned)cursor->values[IGT_PLANE_CRTC_W],
+			    (unsigned)cursor->values[IGT_PLANE_CRTC_H]);
+		else
 			LOG(display,
 			    "SetCursor pipe %s, disabling\n",
 			    kmstest_pipe_name(pipe->pipe));
 
-			ret = drmModeSetCursor(display->drm_fd, crtc_id,
-					       0, 0, 0);
-		}
-
+		ret = drmModeSetCursor(display->drm_fd, crtc_id,
+				       cursor->gem_handle,
+				       cursor->values[IGT_PLANE_CRTC_W],
+				       cursor->values[IGT_PLANE_CRTC_H]);
 		CHECK_RETURN(ret, fail_on_error);
 	}
 
-	if (cursor->position_changed) {
-		int x = cursor->crtc_x;
-		int y = cursor->crtc_y;
+	if (igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_X) ||
+	    igt_plane_is_prop_changed(cursor, IGT_PLANE_CRTC_Y)) {
+		int x = cursor->values[IGT_PLANE_CRTC_X];
+		int y = cursor->values[IGT_PLANE_CRTC_Y];
 
 		LOG(display,
 		    "MoveCursor pipe %s, (%d, %d)\n",
@@ -2326,13 +2284,14 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 	int ret;
 
 	/* Primary planes can't be windowed when using a legacy commit */
-	igt_assert((primary->crtc_x == 0 && primary->crtc_y == 0));
+	igt_assert((primary->values[IGT_PLANE_CRTC_X] == 0 && primary->values[IGT_PLANE_CRTC_Y] == 0));
 
 	/* nor rotated */
-	igt_assert(!primary->rotation_changed);
+	igt_assert(!igt_plane_is_prop_changed(primary, IGT_PLANE_ROTATION));
 
-	if (!primary->fb_changed && !primary->position_changed &&
-	    !primary->size_changed && !primary->pipe->mode_changed)
+	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
+	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
+	    !primary->pipe->mode_changed)
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2343,19 +2302,22 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 		mode = NULL;
 
 	if (fb_id) {
+		uint32_t src_x = primary->values[IGT_PLANE_SRC_X] >> 16;
+		uint32_t src_y = primary->values[IGT_PLANE_SRC_Y] >> 16;
+
 		LOG(display,
 		    "%s: SetCrtc pipe %s, fb %u, src (%d, %d), "
 		    "mode %dx%d\n",
 		    igt_output_name(output),
 		    kmstest_pipe_name(pipe->pipe),
 		    fb_id,
-		    primary->src_x, primary->src_y,
+		    src_x, src_y,
 		    mode->hdisplay, mode->vdisplay);
 
 		ret = drmModeSetCrtc(display->drm_fd,
 				     crtc_id,
 				     fb_id,
-				     primary->src_x, primary->src_y,
+				     src_x, src_y,
 				     &output->id,
 				     1,
 				     mode);
@@ -2608,18 +2570,27 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
-			plane->fb_changed = false;
-			plane->position_changed = false;
-			plane->size_changed = false;
+			if (s == COMMIT_ATOMIC) {
+				int fd;
+				plane->changed = 0;
 
-			if (s != COMMIT_LEGACY ||
-			    !(plane->type == DRM_PLANE_TYPE_PRIMARY ||
-			      plane->type == DRM_PLANE_TYPE_CURSOR))
-				plane->rotation_changed = false;
+				fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+				if (fd != -1)
+					close(fd);
 
-			if (s == COMMIT_ATOMIC)
 				/* reset fence_fd to prevent it from being set for the next commit */
-				igt_plane_set_fence_fd(plane, -1);
+				plane->values[IGT_PLANE_IN_FENCE_FD] = -1;
+			} else {
+				plane->changed &= ~IGT_PLANE_COORD_CHANGED_MASK;
+
+				igt_plane_clear_prop_changed(plane, IGT_PLANE_CRTC_ID);
+				igt_plane_clear_prop_changed(plane, IGT_PLANE_FB_ID);
+
+				if (s != COMMIT_LEGACY ||
+				    !(plane->type == DRM_PLANE_TYPE_PRIMARY ||
+				      plane->type == DRM_PLANE_TYPE_CURSOR))
+					igt_plane_clear_prop_changed(plane, IGT_PLANE_ROTATION);
+			}
 		}
 	}
 
@@ -2913,30 +2884,29 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)
 	LOG(display, "%s.%d: plane_set_fb(%d)\n", kmstest_pipe_name(pipe->pipe),
 	    plane->index, fb ? fb->fb_id : 0);
 
-	plane->fb = fb;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_ID, fb ? pipe->crtc_id : 0);
+	igt_plane_set_prop_value(plane, IGT_PLANE_FB_ID, fb ? fb->fb_id : 0);
+
+	if (plane->type == DRM_PLANE_TYPE_CURSOR && fb)
+		plane->gem_handle = fb->gem_handle;
+	else
+		plane->gem_handle = 0;
+
 	/* hack to keep tests working that don't call igt_plane_set_size() */
 	if (fb) {
 		/* set default plane size as fb size */
-		plane->crtc_w = fb->width;
-		plane->crtc_h = fb->height;
+		igt_plane_set_size(plane, fb->width, fb->height);
 
 		/* set default src pos/size as fb size */
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = fb->width;
-		plane->src_h = fb->height;
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, fb->width, fb->height);
 	} else {
-		plane->src_x = 0;
-		plane->src_y = 0;
-		plane->src_w = 0;
-		plane->src_h = 0;
+		igt_plane_set_size(plane, 0, 0);
 
-		plane->crtc_w = 0;
-		plane->crtc_h = 0;
+		/* set default src pos/size as fb size */
+		igt_fb_set_position(fb, plane, 0, 0);
+		igt_fb_set_size(fb, plane, 0, 0);
 	}
-
-	plane->fb_changed = true;
-	plane->size_changed = true;
 }
 
 /**
@@ -2949,12 +2919,19 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)
  */
 void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd)
 {
-	close(plane->fence_fd);
+	int64_t fd;
 
-	if (fcntl(fence_fd, F_GETFD) != -1)
-		plane->fence_fd = dup(fence_fd);
-	else
-		plane->fence_fd = -1;
+	fd = plane->values[IGT_PLANE_IN_FENCE_FD];
+	if (fd != -1)
+		close(fd);
+
+	if (fence_fd != -1) {
+		fd = dup(fence_fd);
+		igt_fail_on(fd == -1);
+	} else
+		fd = -1;
+
+	igt_plane_set_prop_value(plane, IGT_PLANE_IN_FENCE_FD, fd);
 }
 
 void igt_plane_set_position(igt_plane_t *plane, int x, int y)
@@ -2965,10 +2942,8 @@ void igt_plane_set_position(igt_plane_t *plane, int x, int y)
 	LOG(display, "%s.%d: plane_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->crtc_x = x;
-	plane->crtc_y = y;
-
-	plane->position_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_X, x);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_Y, y);
 }
 
 /**
@@ -2989,10 +2964,8 @@ void igt_plane_set_size(igt_plane_t *plane, int w, int h)
 	LOG(display, "%s.%d: plane_set_size (%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->crtc_w = w;
-	plane->crtc_h = h;
-
-	plane->size_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_W, w);
+	igt_plane_set_prop_value(plane, IGT_PLANE_CRTC_H, h);
 }
 
 /**
@@ -3014,10 +2987,8 @@ void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_position(%d,%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, x, y);
 
-	plane->src_x = x;
-	plane->src_y = y;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_X, IGT_FIXED(x, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_Y, IGT_FIXED(y, 0));
 }
 
 /**
@@ -3040,10 +3011,8 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	LOG(display, "%s.%d: fb_set_size(%dx%d)\n",
 	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
 
-	plane->src_w = w;
-	plane->src_h = h;
-
-	plane->fb_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_W, IGT_FIXED(w, 0));
+	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H, IGT_FIXED(h, 0));
 }
 
 static const char *rotation_name(igt_rotation_t rotation)
@@ -3071,9 +3040,7 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
 	    kmstest_pipe_name(pipe->pipe),
 	    plane->index, rotation_name(rotation));
 
-	plane->rotation = rotation;
-
-	plane->rotation_changed = true;
+	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, rotation);
 }
 
 /**
lib/igt_kms.h +24 -35

90 lines not on this page · raw message

tests/kms_atomic_interruptible.c +6 -6
index dcdbc267d3ef..4a2a577412cc 100644
@@ -163,12 +163,12 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 					/* connector: 1 prop */
 					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
-					plane->atomic_props_plane[IGT_PLANE_CRTC_ID],
-					plane->atomic_props_plane[IGT_PLANE_FB_ID],
-					plane->atomic_props_plane[IGT_PLANE_SRC_W],
-					plane->atomic_props_plane[IGT_PLANE_SRC_H],
-					plane->atomic_props_plane[IGT_PLANE_CRTC_W],
-					plane->atomic_props_plane[IGT_PLANE_CRTC_H]
+					plane->props[IGT_PLANE_CRTC_ID],
+					plane->props[IGT_PLANE_FB_ID],
+					plane->props[IGT_PLANE_SRC_W],
+					plane->props[IGT_PLANE_SRC_H],
+					plane->props[IGT_PLANE_CRTC_W],
+					plane->props[IGT_PLANE_CRTC_H]
 				};
 				uint64_t prop_vals[] = {
 					/* crtc */
tests/kms_rotation_crc.c +2 -2
index 5aec8fa39671..b8327dfa0d83 100644
@@ -122,11 +122,11 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	igt_plane_set_fb(primary, &data->fb_modeset);
 
 	if (commit < COMMIT_ATOMIC) {
-		primary->rotation_changed = false;
+		igt_plane_clear_prop_changed(primary, IGT_PLANE_ROTATION);
 		igt_display_commit(display);
 
 		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
-			primary->rotation_changed = true;
+			igt_plane_set_prop_changed(primary, IGT_PLANE_ROTATION);
 	}
 
 	igt_plane_set_fb(plane, NULL);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

PATCH v4 6/7 lib/igt_kms: Rework pipe properties to be more atomic, v4.1.

In reply to Maarten Lankhorst

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

This has been the most involved one, since legacy pipe commit still handles a lot of the properties differently from the rest.

Changes since v1:
- Dump all changed properties on commit.
- Fix bug in igt_pipe_refresh().
Changes since v2:
- Set pipe ACTIVE property changed flag on init. Changes since v3:
- Add a missing igt_pipe_refresh() to kms_atomic_interruptible.

---
 lib/igt_kms.c                     | 217 ++++++++++++++++++++------------------
 lib/igt_kms.h                     |  77 ++++++--------
 tests/kms_atomic_interruptible.c  |   8 +-
 tests/kms_atomic_transition.c     |   2 +-
 tests/kms_crtc_background_color.c |   2 +-
 5 files changed, 151 insertions(+), 155 deletions(-)
lib/igt_kms.c +113 -104
index 6e0052ebe7a7..a81d7998433a 100644
@@ -259,8 +259,8 @@ igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
 }
 
 static void
-igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
-			int num_crtc_props, const char **crtc_prop_names)
+igt_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
+		    int num_crtc_props, const char **crtc_prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -278,7 +278,7 @@ igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
 			if (strcmp(prop->name, crtc_prop_names[j]) != 0)
 				continue;
 
-			pipe->atomic_props_crtc[j] = props->props[i];
+			pipe->props[j] = props->props[i];
 			break;
 		}
 
@@ -1690,7 +1690,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		int p = 1;
 		int j, type;
 		uint8_t last_plane = 0, n_planes = 0;
-		uint64_t prop_value;
 
 		pipe->crtc_id = resources->crtcs[i];
 		pipe->display = display;
@@ -1700,29 +1699,16 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		pipe->planes = NULL;
 		pipe->out_fence_fd = -1;
 
+		igt_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
+
+		/* Force modeset disable on first commit */
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_ACTIVE);
+
 		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				    "background_color",
-				    &pipe->background_property,
-				    &prop_value,
+				    "background_color", NULL,
+				    &pipe->values[IGT_CRTC_BACKGROUND],
 				    NULL);
-		pipe->background = (uint32_t)prop_value;
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "DEGAMMA_LUT",
-				  &pipe->degamma_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "CTM",
-				  &pipe->ctm_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "GAMMA_LUT",
-				  &pipe->gamma_property,
-				  NULL,
-				  NULL);
-
-		igt_atomic_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
 
 		/* count number of valid planes */
 		for (j = 0; j < plane_resources->count_planes; j++) {
@@ -1805,8 +1791,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 			igt_assert_eq(p, n_planes);
 
 		pipe->n_planes = n_planes;
-
-		pipe->mode_changed = true;
 	}
 
 	/*
@@ -2283,7 +2267,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 
 	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
 	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
-	    !primary->pipe->mode_changed)
+	    !igt_pipe_obj_is_prop_changed(primary->pipe, IGT_CRTC_MODE_ID))
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2352,6 +2336,16 @@ static int igt_plane_commit(igt_plane_t *plane,
 	}
 }
 
+static bool is_atomic_prop(enum igt_atomic_crtc_properties prop)
+{
+       if (prop == IGT_CRTC_MODE_ID ||
+	   prop == IGT_CRTC_ACTIVE ||
+	   prop == IGT_CRTC_OUT_FENCE_PTR)
+		return true;
+
+	return false;
+}
+
 /*
  * Commit all plane changes to an output.  Note that if @s is COMMIT_LEGACY,
  * enabling/disabling the primary plane will also enable/disable the CRTC.
@@ -2369,19 +2363,9 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 	int i;
 	int ret;
 
-	if (pipe->background_changed) {
-		igt_crtc_set_property(pipe, pipe->background_property,
-			pipe->background);
-	}
-
-	if (pipe->color_mgmt_changed) {
-		igt_crtc_set_property(pipe, pipe->degamma_property,
-				      pipe->degamma_blob);
-		igt_crtc_set_property(pipe, pipe->ctm_property,
-				      pipe->ctm_blob);
-		igt_crtc_set_property(pipe, pipe->gamma_property,
-				      pipe->gamma_blob);
-	}
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++)
+		if (!is_atomic_prop(i))
+			igt_crtc_set_property(pipe, pipe->props[i], pipe->values[i]);
 
 	for (i = 0; i < pipe->n_planes; i++) {
 		igt_plane_t *plane = &pipe->planes[i];
@@ -2394,9 +2378,10 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 }
 
 static void
-igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length)
+igt_pipe_replace_blob(igt_pipe_t *pipe, enum igt_atomic_crtc_properties prop, void *ptr, size_t length)
 {
 	igt_display_t *display = pipe->display;
+	uint64_t *blob = &pipe->values[prop];
 	uint32_t blob_id = 0;
 
 	if (*blob != 0)
@@ -2408,6 +2393,7 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
 						     ptr, length, &blob_id) == 0);
 
 	*blob = blob_id;
+	igt_pipe_obj_set_prop_changed(pipe, prop);
 }
 
 /*
@@ -2415,51 +2401,23 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
  */
 static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicReq *req)
 {
-	if (pipe_obj->background_changed)
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_BACKGROUND, pipe_obj->background);
-
-	if (pipe_obj->color_mgmt_changed) {
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_DEGAMMA_LUT, pipe_obj->degamma_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_CTM, pipe_obj->ctm_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_GAMMA_LUT, pipe_obj->gamma_blob);
-	}
-
-	if (pipe_obj->mode_changed) {
-		igt_output_t *output = igt_pipe_get_output(pipe_obj);
-
-		if (!output) {
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, NULL, 0);
-
-			LOG(pipe_obj->display, "%s: Setting NULL mode\n",
-			    kmstest_pipe_name(pipe_obj->pipe));
-		} else {
-			drmModeModeInfo *mode = igt_output_get_mode(output);
+	int i;
 
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, mode, sizeof(*mode));
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++) {
+		if (!igt_pipe_obj_is_prop_changed(pipe_obj, i))
+			continue;
 
-			LOG(pipe_obj->display, "%s: Setting mode %s from %s\n",
-			    kmstest_pipe_name(pipe_obj->pipe),
-			    mode->name, igt_output_name(output));
-		}
+		igt_debug("Pipe %s: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			kmstest_pipe_name(pipe_obj->pipe), igt_crtc_prop_names[i],
+			pipe_obj->values[i], pipe_obj->values[i]);
 
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_MODE_ID, pipe_obj->mode_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req, pipe_obj->crtc_id, pipe_obj->props[i], pipe_obj->values[i]));
 	}
 
 	if (pipe_obj->out_fence_fd != -1) {
 		close(pipe_obj->out_fence_fd);
 		pipe_obj->out_fence_fd = -1;
 	}
-
-	if (pipe_obj->out_fence_requested)
-	{
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
-		    (uint64_t)(uintptr_t) &pipe_obj->out_fence_fd);
-	}
-
-	/*
-	 *	TODO: Add all crtc level properties here
-	 */
 }
 
 /*
@@ -2550,15 +2508,21 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 		igt_pipe_t *pipe_obj = &display->pipes[pipe];
 		igt_plane_t *plane;
 
-		pipe_obj->color_mgmt_changed = false;
-		pipe_obj->background_changed = false;
+		if (s == COMMIT_ATOMIC) {
+			if (igt_pipe_obj_is_prop_changed(pipe_obj, IGT_CRTC_OUT_FENCE_PTR))
+				igt_assert(pipe_obj->out_fence_fd >= 0);
 
-		if (s != COMMIT_UNIVERSAL)
-			pipe_obj->mode_changed = false;
-
-		if (s == COMMIT_ATOMIC && pipe_obj->out_fence_requested) {
-			pipe_obj->out_fence_requested = false;
-			igt_assert(pipe_obj->out_fence_fd >= 0);
+			pipe_obj->changed = 0;
+		} else {
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_BACKGROUND);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_CTM);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_DEGAMMA_LUT);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_GAMMA_LUT);
+
+			if (s != COMMIT_UNIVERSAL) {
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_ACTIVE);
+			}
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
@@ -2812,33 +2776,83 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode)
 
 	output->use_override_mode = !!mode;
 
-	if (pipe)
-		pipe->mode_changed = true;
+	if (pipe) {
+		if (output->display->is_atomic)
+			igt_pipe_replace_blob(pipe, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(*mode));
+		else
+			igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+	}
 }
 
 void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 {
 	igt_display_t *display = output->display;
-	igt_pipe_t *old_pipe;
+	igt_pipe_t *old_pipe = NULL, *pipe_obj = NULL;;
 
 	igt_assert(output->name);
 
-	if (output->pending_pipe != PIPE_NONE) {
+	if (output->pending_pipe != PIPE_NONE)
 		old_pipe = igt_output_get_driving_pipe(output);
 
-		old_pipe->mode_changed = true;
-	}
+	if (pipe != PIPE_NONE)
+		pipe_obj = &display->pipes[pipe];
 
 	LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
 	    kmstest_pipe_name(pipe));
 	output->pending_pipe = pipe;
 
-	if (pipe != PIPE_NONE)
-		display->pipes[pipe].mode_changed = true;
+	if (old_pipe) {
+		igt_output_t *old_output;
+
+		old_output = igt_pipe_get_output(old_pipe);
+		if (!old_output) {
+			if (display->is_atomic)
+				igt_pipe_replace_blob(old_pipe, IGT_CRTC_MODE_ID, NULL, 0);
+			else
+				igt_pipe_obj_set_prop_changed(old_pipe, IGT_CRTC_MODE_ID);
+
+			igt_pipe_obj_set_prop_value(old_pipe, IGT_CRTC_ACTIVE, 0);
+		}
+	}
 
 	igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID, pipe == PIPE_NONE ? 0 : display->pipes[pipe].crtc_id);
 
 	igt_output_refresh(output);
+
+	if (pipe_obj) {
+		if (display->is_atomic)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+		else
+			igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+
+		igt_pipe_obj_set_prop_value(pipe_obj, IGT_CRTC_ACTIVE, 1);
+	}
+}
+
+/*
+ * igt_pipe_refresh:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: Pipe to refresh
+ * @force: Should be set to true if mode_blob is no longer considered
+ * to be valid, for example after doing an atomic commit during fork or closing display fd.
+ *
+ * Requests the pipe to be part of the state on next update.
+ * This is useful when state may have been out of sync after
+ * a fork, or we just want to be sure the pipe is included
+ * in the next commit.
+ */
+void igt_pipe_refresh(igt_display_t *display, enum pipe pipe, bool force)
+{
+	igt_pipe_t *pipe_obj = &display->pipes[pipe];
+
+	if (force && display->is_atomic) {
+		igt_output_t *output = igt_pipe_get_output(pipe_obj);
+
+		pipe_obj->values[IGT_CRTC_MODE_ID] = 0;
+		if (output)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+	} else
+		igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
 }
 
 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)
@@ -3046,28 +3060,25 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
  */
 void igt_pipe_request_out_fence(igt_pipe_t *pipe)
 {
-	pipe->out_fence_requested = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_OUT_FENCE_PTR, (ptrdiff_t)&pipe->out_fence_fd);
 }
 
 void
 igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->degamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_DEGAMMA_LUT, ptr, length);
 }
 
 void
 igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->ctm_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_CTM, ptr, length);
 }
 
 void
 igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->gamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_GAMMA_LUT, ptr, length);
 }
 
 /**
@@ -3088,9 +3099,7 @@ void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
 	    kmstest_pipe_name(pipe->pipe),
 	    pipe->pipe, background);
 
-	pipe->background = background;
-
-	pipe->background_changed = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_BACKGROUND, background);
 }
 
 void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int count)
lib/igt_kms.h +30 -47

100 lines not on this page · raw message

tests/kms_atomic_interruptible.c +6 -2
index 5570854390ea..0270c8f870bf 100644
@@ -156,8 +156,8 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 				uint32_t count_props[3] = { 2, 1, 6 };
 				uint32_t props[] = {
 					/* crtc: 2 props */
-					plane->pipe->atomic_props_crtc[IGT_CRTC_MODE_ID],
-					plane->pipe->atomic_props_crtc[IGT_CRTC_ACTIVE],
+					plane->pipe->props[IGT_CRTC_MODE_ID],
+					plane->pipe->props[IGT_CRTC_ACTIVE],
 					/* connector: 1 prop */
 					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
@@ -253,6 +253,10 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 
 	igt_waitchildren();
 
+	/* The mode is unset by the forked helper, force a refresh here */
+	if (test_type == test_legacy_modeset || test_type == test_atomic_modeset)
+		igt_pipe_refresh(display, pipe, true);
+
 	igt_plane_set_fb(plane, NULL);
 	igt_plane_set_fb(primary, NULL);
 	igt_output_set_pipe(output, PIPE_NONE);
tests/kms_atomic_transition.c +1 -1
index 2ae75f2d6630..7ddb65cea183 100644
@@ -633,7 +633,7 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct i
 		drmModeModeInfo *mode = NULL;
 
 		if (!(mask & (1 << pipe))) {
-			if (display->pipes[pipe].mode_blob) {
+			if (igt_pipe_is_prop_changed(display, pipe, IGT_CRTC_ACTIVE)) {
 				event_mask |= 1 << pipe;
 				igt_plane_set_fb(plane, NULL);
 			}
tests/kms_crtc_background_color.c +1 -1
index e12e163449f8..659a30b90219 100644
@@ -137,7 +137,7 @@ static void test_crtc_background(data_t *data)
 		igt_output_set_pipe(output, pipe);
 
 		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(plane->pipe->background_property);
+		igt_require(plane->pipe->props[IGT_CRTC_BACKGROUND]);
 
 		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
 
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

PATCH 1/1 lib/igt_kms: Rework pipe properties to be more atomic, v5.

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

This has been the most involved one, since legacy pipe commit still handles a lot of the properties differently from the rest.

Changes since v1:
- Dump all changed properties on commit.
- Fix bug in igt_pipe_refresh().
Changes since v2:
- Set pipe ACTIVE property changed flag on init. Changes since v3:
- Add a missing igt_pipe_refresh() to kms_atomic_interruptible. Changes since v4:
- Perform error handling when setting custom crtc properties.

---
 lib/igt_kms.c                     | 229 ++++++++++++++++++++------------------
 lib/igt_kms.h                     |  77 +++++--------
 tests/kms_atomic_interruptible.c  |   8 +-
 tests/kms_atomic_transition.c     |   2 +-
 tests/kms_crtc_background_color.c |   2 +-
 5 files changed, 157 insertions(+), 161 deletions(-)
lib/igt_kms.c +119 -110
index 6e0052ebe7a7..fc603af8db67 100644
@@ -259,8 +259,8 @@ igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
 }
 
 static void
-igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
-			int num_crtc_props, const char **crtc_prop_names)
+igt_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
+		    int num_crtc_props, const char **crtc_prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -278,7 +278,7 @@ igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
 			if (strcmp(prop->name, crtc_prop_names[j]) != 0)
 				continue;
 
-			pipe->atomic_props_crtc[j] = props->props[i];
+			pipe->props[j] = props->props[i];
 			break;
 		}
 
@@ -1620,13 +1620,6 @@ get_crtc_property(int drm_fd, uint32_t crtc_id, const char *name,
 				    name, prop_id, value, prop);
 }
 
-static void
-igt_crtc_set_property(igt_pipe_t *pipe, uint32_t prop_id, uint64_t value)
-{
-	drmModeObjectSetProperty(pipe->display->drm_fd,
-		pipe->crtc_id, DRM_MODE_OBJECT_CRTC, prop_id, value);
-}
-
 /*
  * Walk a plane's property list to determine its type.  If we don't
  * find a type property, then the kernel doesn't support universal
@@ -1690,7 +1683,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		int p = 1;
 		int j, type;
 		uint8_t last_plane = 0, n_planes = 0;
-		uint64_t prop_value;
 
 		pipe->crtc_id = resources->crtcs[i];
 		pipe->display = display;
@@ -1700,29 +1692,16 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		pipe->planes = NULL;
 		pipe->out_fence_fd = -1;
 
+		igt_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
+
+		/* Force modeset disable on first commit */
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_ACTIVE);
+
 		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				    "background_color",
-				    &pipe->background_property,
-				    &prop_value,
+				    "background_color", NULL,
+				    &pipe->values[IGT_CRTC_BACKGROUND],
 				    NULL);
-		pipe->background = (uint32_t)prop_value;
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "DEGAMMA_LUT",
-				  &pipe->degamma_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "CTM",
-				  &pipe->ctm_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "GAMMA_LUT",
-				  &pipe->gamma_property,
-				  NULL,
-				  NULL);
-
-		igt_atomic_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
 
 		/* count number of valid planes */
 		for (j = 0; j < plane_resources->count_planes; j++) {
@@ -1805,8 +1784,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 			igt_assert_eq(p, n_planes);
 
 		pipe->n_planes = n_planes;
-
-		pipe->mode_changed = true;
 	}
 
 	/*
@@ -2283,7 +2260,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 
 	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
 	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
-	    !primary->pipe->mode_changed)
+	    !igt_pipe_obj_is_prop_changed(primary->pipe, IGT_CRTC_MODE_ID))
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2352,6 +2329,16 @@ static int igt_plane_commit(igt_plane_t *plane,
 	}
 }
 
+static bool is_atomic_prop(enum igt_atomic_crtc_properties prop)
+{
+       if (prop == IGT_CRTC_MODE_ID ||
+	   prop == IGT_CRTC_ACTIVE ||
+	   prop == IGT_CRTC_OUT_FENCE_PTR)
+		return true;
+
+	return false;
+}
+
 /*
  * Commit all plane changes to an output.  Note that if @s is COMMIT_LEGACY,
  * enabling/disabling the primary plane will also enable/disable the CRTC.
@@ -2369,19 +2356,16 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 	int i;
 	int ret;
 
-	if (pipe->background_changed) {
-		igt_crtc_set_property(pipe, pipe->background_property,
-			pipe->background);
-	}
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++)
+		if (!is_atomic_prop(i)) {
+			igt_assert(pipe->props[i]);
 
-	if (pipe->color_mgmt_changed) {
-		igt_crtc_set_property(pipe, pipe->degamma_property,
-				      pipe->degamma_blob);
-		igt_crtc_set_property(pipe, pipe->ctm_property,
-				      pipe->ctm_blob);
-		igt_crtc_set_property(pipe, pipe->gamma_property,
-				      pipe->gamma_blob);
-	}
+			ret = drmModeObjectSetProperty(pipe->display->drm_fd,
+				pipe->crtc_id, DRM_MODE_OBJECT_CRTC,
+				pipe->props[i], pipe->values[i]);
+
+			CHECK_RETURN(ret, fail_on_error);
+		}
 
 	for (i = 0; i < pipe->n_planes; i++) {
 		igt_plane_t *plane = &pipe->planes[i];
@@ -2394,9 +2378,10 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 }
 
 static void
-igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length)
+igt_pipe_replace_blob(igt_pipe_t *pipe, enum igt_atomic_crtc_properties prop, void *ptr, size_t length)
 {
 	igt_display_t *display = pipe->display;
+	uint64_t *blob = &pipe->values[prop];
 	uint32_t blob_id = 0;
 
 	if (*blob != 0)
@@ -2408,6 +2393,7 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
 						     ptr, length, &blob_id) == 0);
 
 	*blob = blob_id;
+	igt_pipe_obj_set_prop_changed(pipe, prop);
 }
 
 /*
@@ -2415,51 +2401,23 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
  */
 static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicReq *req)
 {
-	if (pipe_obj->background_changed)
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_BACKGROUND, pipe_obj->background);
-
-	if (pipe_obj->color_mgmt_changed) {
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_DEGAMMA_LUT, pipe_obj->degamma_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_CTM, pipe_obj->ctm_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_GAMMA_LUT, pipe_obj->gamma_blob);
-	}
-
-	if (pipe_obj->mode_changed) {
-		igt_output_t *output = igt_pipe_get_output(pipe_obj);
-
-		if (!output) {
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, NULL, 0);
-
-			LOG(pipe_obj->display, "%s: Setting NULL mode\n",
-			    kmstest_pipe_name(pipe_obj->pipe));
-		} else {
-			drmModeModeInfo *mode = igt_output_get_mode(output);
+	int i;
 
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, mode, sizeof(*mode));
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++) {
+		if (!igt_pipe_obj_is_prop_changed(pipe_obj, i))
+			continue;
 
-			LOG(pipe_obj->display, "%s: Setting mode %s from %s\n",
-			    kmstest_pipe_name(pipe_obj->pipe),
-			    mode->name, igt_output_name(output));
-		}
+		igt_debug("Pipe %s: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			kmstest_pipe_name(pipe_obj->pipe), igt_crtc_prop_names[i],
+			pipe_obj->values[i], pipe_obj->values[i]);
 
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_MODE_ID, pipe_obj->mode_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req, pipe_obj->crtc_id, pipe_obj->props[i], pipe_obj->values[i]));
 	}
 
 	if (pipe_obj->out_fence_fd != -1) {
 		close(pipe_obj->out_fence_fd);
 		pipe_obj->out_fence_fd = -1;
 	}
-
-	if (pipe_obj->out_fence_requested)
-	{
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
-		    (uint64_t)(uintptr_t) &pipe_obj->out_fence_fd);
-	}
-
-	/*
-	 *	TODO: Add all crtc level properties here
-	 */
 }
 
 /*
@@ -2550,15 +2508,21 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 		igt_pipe_t *pipe_obj = &display->pipes[pipe];
 		igt_plane_t *plane;
 
-		pipe_obj->color_mgmt_changed = false;
-		pipe_obj->background_changed = false;
+		if (s == COMMIT_ATOMIC) {
+			if (igt_pipe_obj_is_prop_changed(pipe_obj, IGT_CRTC_OUT_FENCE_PTR))
+				igt_assert(pipe_obj->out_fence_fd >= 0);
 
-		if (s != COMMIT_UNIVERSAL)
-			pipe_obj->mode_changed = false;
-
-		if (s == COMMIT_ATOMIC && pipe_obj->out_fence_requested) {
-			pipe_obj->out_fence_requested = false;
-			igt_assert(pipe_obj->out_fence_fd >= 0);
+			pipe_obj->changed = 0;
+		} else {
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_BACKGROUND);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_CTM);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_DEGAMMA_LUT);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_GAMMA_LUT);
+
+			if (s != COMMIT_UNIVERSAL) {
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_ACTIVE);
+			}
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
@@ -2812,33 +2776,83 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode)
 
 	output->use_override_mode = !!mode;
 
-	if (pipe)
-		pipe->mode_changed = true;
+	if (pipe) {
+		if (output->display->is_atomic)
+			igt_pipe_replace_blob(pipe, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(*mode));
+		else
+			igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+	}
 }
 
 void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 {
 	igt_display_t *display = output->display;
-	igt_pipe_t *old_pipe;
+	igt_pipe_t *old_pipe = NULL, *pipe_obj = NULL;;
 
 	igt_assert(output->name);
 
-	if (output->pending_pipe != PIPE_NONE) {
+	if (output->pending_pipe != PIPE_NONE)
 		old_pipe = igt_output_get_driving_pipe(output);
 
-		old_pipe->mode_changed = true;
-	}
+	if (pipe != PIPE_NONE)
+		pipe_obj = &display->pipes[pipe];
 
 	LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
 	    kmstest_pipe_name(pipe));
 	output->pending_pipe = pipe;
 
-	if (pipe != PIPE_NONE)
-		display->pipes[pipe].mode_changed = true;
+	if (old_pipe) {
+		igt_output_t *old_output;
+
+		old_output = igt_pipe_get_output(old_pipe);
+		if (!old_output) {
+			if (display->is_atomic)
+				igt_pipe_replace_blob(old_pipe, IGT_CRTC_MODE_ID, NULL, 0);
+			else
+				igt_pipe_obj_set_prop_changed(old_pipe, IGT_CRTC_MODE_ID);
+
+			igt_pipe_obj_set_prop_value(old_pipe, IGT_CRTC_ACTIVE, 0);
+		}
+	}
 
 	igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID, pipe == PIPE_NONE ? 0 : display->pipes[pipe].crtc_id);
 
 	igt_output_refresh(output);
+
+	if (pipe_obj) {
+		if (display->is_atomic)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+		else
+			igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+
+		igt_pipe_obj_set_prop_value(pipe_obj, IGT_CRTC_ACTIVE, 1);
+	}
+}
+
+/*
+ * igt_pipe_refresh:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: Pipe to refresh
+ * @force: Should be set to true if mode_blob is no longer considered
+ * to be valid, for example after doing an atomic commit during fork or closing display fd.
+ *
+ * Requests the pipe to be part of the state on next update.
+ * This is useful when state may have been out of sync after
+ * a fork, or we just want to be sure the pipe is included
+ * in the next commit.
+ */
+void igt_pipe_refresh(igt_display_t *display, enum pipe pipe, bool force)
+{
+	igt_pipe_t *pipe_obj = &display->pipes[pipe];
+
+	if (force && display->is_atomic) {
+		igt_output_t *output = igt_pipe_get_output(pipe_obj);
+
+		pipe_obj->values[IGT_CRTC_MODE_ID] = 0;
+		if (output)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+	} else
+		igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
 }
 
 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)
@@ -3046,28 +3060,25 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
  */
 void igt_pipe_request_out_fence(igt_pipe_t *pipe)
 {
-	pipe->out_fence_requested = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_OUT_FENCE_PTR, (ptrdiff_t)&pipe->out_fence_fd);
 }
 
 void
 igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->degamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_DEGAMMA_LUT, ptr, length);
 }
 
 void
 igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->ctm_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_CTM, ptr, length);
 }
 
 void
 igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->gamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_GAMMA_LUT, ptr, length);
 }
 
 /**
@@ -3088,9 +3099,7 @@ void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
 	    kmstest_pipe_name(pipe->pipe),
 	    pipe->pipe, background);
 
-	pipe->background = background;
-
-	pipe->background_changed = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_BACKGROUND, background);
 }
 
 void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int count)
lib/igt_kms.h +30 -47

100 lines not on this page · raw message

tests/kms_atomic_interruptible.c +6 -2
index 5570854390ea..0270c8f870bf 100644
@@ -156,8 +156,8 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 				uint32_t count_props[3] = { 2, 1, 6 };
 				uint32_t props[] = {
 					/* crtc: 2 props */
-					plane->pipe->atomic_props_crtc[IGT_CRTC_MODE_ID],
-					plane->pipe->atomic_props_crtc[IGT_CRTC_ACTIVE],
+					plane->pipe->props[IGT_CRTC_MODE_ID],
+					plane->pipe->props[IGT_CRTC_ACTIVE],
 					/* connector: 1 prop */
 					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
@@ -253,6 +253,10 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 
 	igt_waitchildren();
 
+	/* The mode is unset by the forked helper, force a refresh here */
+	if (test_type == test_legacy_modeset || test_type == test_atomic_modeset)
+		igt_pipe_refresh(display, pipe, true);
+
 	igt_plane_set_fb(plane, NULL);
 	igt_plane_set_fb(primary, NULL);
 	igt_output_set_pipe(output, PIPE_NONE);
tests/kms_atomic_transition.c +1 -1
index 2ae75f2d6630..7ddb65cea183 100644
@@ -633,7 +633,7 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct i
 		drmModeModeInfo *mode = NULL;
 
 		if (!(mask & (1 << pipe))) {
-			if (display->pipes[pipe].mode_blob) {
+			if (igt_pipe_is_prop_changed(display, pipe, IGT_CRTC_ACTIVE)) {
 				event_mask |= 1 << pipe;
 				igt_plane_set_fb(plane, NULL);
 			}
tests/kms_crtc_background_color.c +1 -1
index e12e163449f8..659a30b90219 100644
@@ -137,7 +137,7 @@ static void test_crtc_background(data_t *data)
 		igt_output_set_pipe(output, pipe);
 
 		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(plane->pipe->background_property);
+		igt_require(plane->pipe->props[IGT_CRTC_BACKGROUND]);
 
 		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
 
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#16 lore raw

PATCH 1/1 lib/igt_kms: Rework pipe properties to be more atomic, v6.

In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties.

This has been the most involved one, since legacy pipe commit still handles a lot of the properties differently from the rest.

Changes since v1:
- Dump all changed properties on commit.
- Fix bug in igt_pipe_refresh().
Changes since v2:
- Set pipe ACTIVE property changed flag on init. Changes since v3:
- Add a missing igt_pipe_refresh() to kms_atomic_interruptible. Changes since v4:
- Perform error handling when setting custom crtc properties. Changes since v5:
- Only attempt to commit changes properties.

---
 lib/igt_kms.c                     | 230 ++++++++++++++++++++------------------
 lib/igt_kms.h                     |  77 +++++--------
 tests/kms_atomic_interruptible.c  |   8 +-
 tests/kms_atomic_transition.c     |   2 +-
 tests/kms_crtc_background_color.c |   2 +-
 5 files changed, 158 insertions(+), 161 deletions(-)
lib/igt_kms.c +120 -110
index 44d2d9452989..f6f53b8a9a28 100644
@@ -259,8 +259,8 @@ igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
 }
 
 static void
-igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
-			int num_crtc_props, const char **crtc_prop_names)
+igt_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
+		    int num_crtc_props, const char **crtc_prop_names)
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -278,7 +278,7 @@ igt_atomic_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
 			if (strcmp(prop->name, crtc_prop_names[j]) != 0)
 				continue;
 
-			pipe->atomic_props_crtc[j] = props->props[i];
+			pipe->props[j] = props->props[i];
 			break;
 		}
 
@@ -1620,13 +1620,6 @@ get_crtc_property(int drm_fd, uint32_t crtc_id, const char *name,
 				    name, prop_id, value, prop);
 }
 
-static void
-igt_crtc_set_property(igt_pipe_t *pipe, uint32_t prop_id, uint64_t value)
-{
-	drmModeObjectSetProperty(pipe->display->drm_fd,
-		pipe->crtc_id, DRM_MODE_OBJECT_CRTC, prop_id, value);
-}
-
 /*
  * Walk a plane's property list to determine its type.  If we don't
  * find a type property, then the kernel doesn't support universal
@@ -1690,7 +1683,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		int p = 1;
 		int j, type;
 		uint8_t last_plane = 0, n_planes = 0;
-		uint64_t prop_value;
 
 		pipe->crtc_id = resources->crtcs[i];
 		pipe->display = display;
@@ -1700,29 +1692,16 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 		pipe->planes = NULL;
 		pipe->out_fence_fd = -1;
 
+		igt_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
+
+		/* Force modeset disable on first commit */
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+		igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_ACTIVE);
+
 		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				    "background_color",
-				    &pipe->background_property,
-				    &prop_value,
+				    "background_color", NULL,
+				    &pipe->values[IGT_CRTC_BACKGROUND],
 				    NULL);
-		pipe->background = (uint32_t)prop_value;
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "DEGAMMA_LUT",
-				  &pipe->degamma_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "CTM",
-				  &pipe->ctm_property,
-				  NULL,
-				  NULL);
-		get_crtc_property(display->drm_fd, pipe->crtc_id,
-				  "GAMMA_LUT",
-				  &pipe->gamma_property,
-				  NULL,
-				  NULL);
-
-		igt_atomic_fill_pipe_props(display, pipe, IGT_NUM_CRTC_PROPS, igt_crtc_prop_names);
 
 		/* count number of valid planes */
 		for (j = 0; j < plane_resources->count_planes; j++) {
@@ -1813,8 +1792,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 			igt_assert_eq(p, n_planes);
 
 		pipe->n_planes = n_planes;
-
-		pipe->mode_changed = true;
 	}
 
 	/*
@@ -2291,7 +2268,7 @@ static int igt_primary_plane_commit_legacy(igt_plane_t *primary,
 
 	if (!igt_plane_is_prop_changed(primary, IGT_PLANE_FB_ID) &&
 	    !(primary->changed & IGT_PLANE_COORD_CHANGED_MASK) &&
-	    !primary->pipe->mode_changed)
+	    !igt_pipe_obj_is_prop_changed(primary->pipe, IGT_CRTC_MODE_ID))
 		return 0;
 
 	crtc_id = pipe->crtc_id;
@@ -2360,6 +2337,16 @@ static int igt_plane_commit(igt_plane_t *plane,
 	}
 }
 
+static bool is_atomic_prop(enum igt_atomic_crtc_properties prop)
+{
+       if (prop == IGT_CRTC_MODE_ID ||
+	   prop == IGT_CRTC_ACTIVE ||
+	   prop == IGT_CRTC_OUT_FENCE_PTR)
+		return true;
+
+	return false;
+}
+
 /*
  * Commit all plane changes to an output.  Note that if @s is COMMIT_LEGACY,
  * enabling/disabling the primary plane will also enable/disable the CRTC.
@@ -2377,19 +2364,17 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 	int i;
 	int ret;
 
-	if (pipe->background_changed) {
-		igt_crtc_set_property(pipe, pipe->background_property,
-			pipe->background);
-	}
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++)
+		if (igt_pipe_obj_is_prop_changed(pipe, i) &&
+		    !is_atomic_prop(i)) {
+			igt_assert(pipe->props[i]);
 
-	if (pipe->color_mgmt_changed) {
-		igt_crtc_set_property(pipe, pipe->degamma_property,
-				      pipe->degamma_blob);
-		igt_crtc_set_property(pipe, pipe->ctm_property,
-				      pipe->ctm_blob);
-		igt_crtc_set_property(pipe, pipe->gamma_property,
-				      pipe->gamma_blob);
-	}
+			ret = drmModeObjectSetProperty(pipe->display->drm_fd,
+				pipe->crtc_id, DRM_MODE_OBJECT_CRTC,
+				pipe->props[i], pipe->values[i]);
+
+			CHECK_RETURN(ret, fail_on_error);
+		}
 
 	for (i = 0; i < pipe->n_planes; i++) {
 		igt_plane_t *plane = &pipe->planes[i];
@@ -2402,9 +2387,10 @@ static int igt_pipe_commit(igt_pipe_t *pipe,
 }
 
 static void
-igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length)
+igt_pipe_replace_blob(igt_pipe_t *pipe, enum igt_atomic_crtc_properties prop, void *ptr, size_t length)
 {
 	igt_display_t *display = pipe->display;
+	uint64_t *blob = &pipe->values[prop];
 	uint32_t blob_id = 0;
 
 	if (*blob != 0)
@@ -2416,6 +2402,7 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
 						     ptr, length, &blob_id) == 0);
 
 	*blob = blob_id;
+	igt_pipe_obj_set_prop_changed(pipe, prop);
 }
 
 /*
@@ -2423,51 +2410,23 @@ igt_pipe_replace_blob(igt_pipe_t *pipe, uint64_t *blob, void *ptr, size_t length
  */
 static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicReq *req)
 {
-	if (pipe_obj->background_changed)
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_BACKGROUND, pipe_obj->background);
-
-	if (pipe_obj->color_mgmt_changed) {
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_DEGAMMA_LUT, pipe_obj->degamma_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_CTM, pipe_obj->ctm_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_GAMMA_LUT, pipe_obj->gamma_blob);
-	}
-
-	if (pipe_obj->mode_changed) {
-		igt_output_t *output = igt_pipe_get_output(pipe_obj);
-
-		if (!output) {
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, NULL, 0);
-
-			LOG(pipe_obj->display, "%s: Setting NULL mode\n",
-			    kmstest_pipe_name(pipe_obj->pipe));
-		} else {
-			drmModeModeInfo *mode = igt_output_get_mode(output);
+	int i;
 
-			igt_pipe_replace_blob(pipe_obj, &pipe_obj->mode_blob, mode, sizeof(*mode));
+	for (i = 0; i < IGT_NUM_CRTC_PROPS; i++) {
+		if (!igt_pipe_obj_is_prop_changed(pipe_obj, i))
+			continue;
 
-			LOG(pipe_obj->display, "%s: Setting mode %s from %s\n",
-			    kmstest_pipe_name(pipe_obj->pipe),
-			    mode->name, igt_output_name(output));
-		}
+		igt_debug("Pipe %s: Setting property \"%s\" to 0x%"PRIx64"/%"PRIi64"\n",
+			kmstest_pipe_name(pipe_obj->pipe), igt_crtc_prop_names[i],
+			pipe_obj->values[i], pipe_obj->values[i]);
 
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_MODE_ID, pipe_obj->mode_blob);
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output);
+		igt_assert_lt(0, drmModeAtomicAddProperty(req, pipe_obj->crtc_id, pipe_obj->props[i], pipe_obj->values[i]));
 	}
 
 	if (pipe_obj->out_fence_fd != -1) {
 		close(pipe_obj->out_fence_fd);
 		pipe_obj->out_fence_fd = -1;
 	}
-
-	if (pipe_obj->out_fence_requested)
-	{
-		igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
-		    (uint64_t)(uintptr_t) &pipe_obj->out_fence_fd);
-	}
-
-	/*
-	 *	TODO: Add all crtc level properties here
-	 */
 }
 
 /*
@@ -2558,15 +2517,21 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
 		igt_pipe_t *pipe_obj = &display->pipes[pipe];
 		igt_plane_t *plane;
 
-		pipe_obj->color_mgmt_changed = false;
-		pipe_obj->background_changed = false;
+		if (s == COMMIT_ATOMIC) {
+			if (igt_pipe_obj_is_prop_changed(pipe_obj, IGT_CRTC_OUT_FENCE_PTR))
+				igt_assert(pipe_obj->out_fence_fd >= 0);
 
-		if (s != COMMIT_UNIVERSAL)
-			pipe_obj->mode_changed = false;
-
-		if (s == COMMIT_ATOMIC && pipe_obj->out_fence_requested) {
-			pipe_obj->out_fence_requested = false;
-			igt_assert(pipe_obj->out_fence_fd >= 0);
+			pipe_obj->changed = 0;
+		} else {
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_BACKGROUND);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_CTM);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_DEGAMMA_LUT);
+			igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_GAMMA_LUT);
+
+			if (s != COMMIT_UNIVERSAL) {
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+				igt_pipe_obj_clear_prop_changed(pipe_obj, IGT_CRTC_ACTIVE);
+			}
 		}
 
 		for_each_plane_on_pipe(display, pipe, plane) {
@@ -2820,33 +2785,83 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode)
 
 	output->use_override_mode = !!mode;
 
-	if (pipe)
-		pipe->mode_changed = true;
+	if (pipe) {
+		if (output->display->is_atomic)
+			igt_pipe_replace_blob(pipe, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(*mode));
+		else
+			igt_pipe_obj_set_prop_changed(pipe, IGT_CRTC_MODE_ID);
+	}
 }
 
 void igt_output_set_pipe(igt_output_t *output, enum pipe pipe)
 {
 	igt_display_t *display = output->display;
-	igt_pipe_t *old_pipe;
+	igt_pipe_t *old_pipe = NULL, *pipe_obj = NULL;;
 
 	igt_assert(output->name);
 
-	if (output->pending_pipe != PIPE_NONE) {
+	if (output->pending_pipe != PIPE_NONE)
 		old_pipe = igt_output_get_driving_pipe(output);
 
-		old_pipe->mode_changed = true;
-	}
+	if (pipe != PIPE_NONE)
+		pipe_obj = &display->pipes[pipe];
 
 	LOG(display, "%s: set_pipe(%s)\n", igt_output_name(output),
 	    kmstest_pipe_name(pipe));
 	output->pending_pipe = pipe;
 
-	if (pipe != PIPE_NONE)
-		display->pipes[pipe].mode_changed = true;
+	if (old_pipe) {
+		igt_output_t *old_output;
+
+		old_output = igt_pipe_get_output(old_pipe);
+		if (!old_output) {
+			if (display->is_atomic)
+				igt_pipe_replace_blob(old_pipe, IGT_CRTC_MODE_ID, NULL, 0);
+			else
+				igt_pipe_obj_set_prop_changed(old_pipe, IGT_CRTC_MODE_ID);
+
+			igt_pipe_obj_set_prop_value(old_pipe, IGT_CRTC_ACTIVE, 0);
+		}
+	}
 
 	igt_output_set_prop_value(output, IGT_CONNECTOR_CRTC_ID, pipe == PIPE_NONE ? 0 : display->pipes[pipe].crtc_id);
 
 	igt_output_refresh(output);
+
+	if (pipe_obj) {
+		if (display->is_atomic)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+		else
+			igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
+
+		igt_pipe_obj_set_prop_value(pipe_obj, IGT_CRTC_ACTIVE, 1);
+	}
+}
+
+/*
+ * igt_pipe_refresh:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: Pipe to refresh
+ * @force: Should be set to true if mode_blob is no longer considered
+ * to be valid, for example after doing an atomic commit during fork or closing display fd.
+ *
+ * Requests the pipe to be part of the state on next update.
+ * This is useful when state may have been out of sync after
+ * a fork, or we just want to be sure the pipe is included
+ * in the next commit.
+ */
+void igt_pipe_refresh(igt_display_t *display, enum pipe pipe, bool force)
+{
+	igt_pipe_t *pipe_obj = &display->pipes[pipe];
+
+	if (force && display->is_atomic) {
+		igt_output_t *output = igt_pipe_get_output(pipe_obj);
+
+		pipe_obj->values[IGT_CRTC_MODE_ID] = 0;
+		if (output)
+			igt_pipe_replace_blob(pipe_obj, IGT_CRTC_MODE_ID, igt_output_get_mode(output), sizeof(drmModeModeInfo));
+	} else
+		igt_pipe_obj_set_prop_changed(pipe_obj, IGT_CRTC_MODE_ID);
 }
 
 void igt_output_set_scaling_mode(igt_output_t *output, uint64_t scaling_mode)
@@ -3052,28 +3067,25 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
  */
 void igt_pipe_request_out_fence(igt_pipe_t *pipe)
 {
-	pipe->out_fence_requested = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_OUT_FENCE_PTR, (ptrdiff_t)&pipe->out_fence_fd);
 }
 
 void
 igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->degamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_DEGAMMA_LUT, ptr, length);
 }
 
 void
 igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->ctm_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_CTM, ptr, length);
 }
 
 void
 igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
 {
-	igt_pipe_replace_blob(pipe, &pipe->gamma_blob, ptr, length);
-	pipe->color_mgmt_changed = 1;
+	igt_pipe_replace_blob(pipe, IGT_CRTC_GAMMA_LUT, ptr, length);
 }
 
 /**
@@ -3094,9 +3106,7 @@ void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
 	    kmstest_pipe_name(pipe->pipe),
 	    pipe->pipe, background);
 
-	pipe->background = background;
-
-	pipe->background_changed = true;
+	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_BACKGROUND, background);
 }
 
 void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int count)
lib/igt_kms.h +30 -47

100 lines not on this page · raw message

tests/kms_atomic_interruptible.c +6 -2
index 4a2a577412cc..64a005597a21 100644
@@ -158,8 +158,8 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 				uint32_t count_props[3] = { 2, 1, 6 };
 				uint32_t props[] = {
 					/* crtc: 2 props */
-					plane->pipe->atomic_props_crtc[IGT_CRTC_MODE_ID],
-					plane->pipe->atomic_props_crtc[IGT_CRTC_ACTIVE],
+					plane->pipe->props[IGT_CRTC_MODE_ID],
+					plane->pipe->props[IGT_CRTC_ACTIVE],
 					/* connector: 1 prop */
 					output->props[IGT_CONNECTOR_CRTC_ID],
 					/* plane: remainder props */
@@ -255,6 +255,10 @@ static void run_plane_test(igt_display_t *display, enum pipe pipe, igt_output_t
 
 	igt_waitchildren();
 
+	/* The mode is unset by the forked helper, force a refresh here */
+	if (test_type == test_legacy_modeset || test_type == test_atomic_modeset)
+		igt_pipe_refresh(display, pipe, true);
+
 	igt_plane_set_fb(plane, NULL);
 	igt_plane_set_fb(primary, NULL);
 	igt_output_set_pipe(output, PIPE_NONE);
tests/kms_atomic_transition.c +1 -1
index 2ae75f2d6630..7ddb65cea183 100644
@@ -633,7 +633,7 @@ static unsigned set_combinations(igt_display_t *display, unsigned mask, struct i
 		drmModeModeInfo *mode = NULL;
 
 		if (!(mask & (1 << pipe))) {
-			if (display->pipes[pipe].mode_blob) {
+			if (igt_pipe_is_prop_changed(display, pipe, IGT_CRTC_ACTIVE)) {
 				event_mask |= 1 << pipe;
 				igt_plane_set_fb(plane, NULL);
 			}
tests/kms_crtc_background_color.c +1 -1
index e12e163449f8..659a30b90219 100644
@@ -137,7 +137,7 @@ static void test_crtc_background(data_t *data)
 		igt_output_set_pipe(output, pipe);
 
 		plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_require(plane->pipe->background_property);
+		igt_require(plane->pipe->props[IGT_CRTC_BACKGROUND]);
 
 		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
 
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH v4 7/7 igt/kms_rotation_crc : Fix flip tests for sprite plane

In reply to Maarten Lankhorst

This test was flipping the primary plane instead of the sprite plane. Flip the correct plane to make the test pass properly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102691

---
 tests/kms_rotation_crc.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
tests/kms_rotation_crc.c +17 -6
index 4932a0d44410..b8327dfa0d83 100644
@@ -332,6 +332,9 @@ static void test_plane_rotation(data_t *data, int plane_type)
 	enum igt_commit_style commit = COMMIT_LEGACY;
 	int ret;
 
+	if (data->flips && plane_type != DRM_PLANE_TYPE_PRIMARY)
+		igt_require(data->display.is_atomic);
+
 	if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type == DRM_PLANE_TYPE_CURSOR)
 		commit = COMMIT_UNIVERSAL;
 
@@ -390,12 +393,20 @@ static void test_plane_rotation(data_t *data, int plane_type)
 			 * check CRC against that one as well.
 			 */
 			if (data->flips) {
-				ret = drmModePageFlip(data->gfx_fd,
-						      output->config.crtc->crtc_id,
-						      data->fb_flip.fb_id,
-						      DRM_MODE_PAGE_FLIP_EVENT,
-						      NULL);
-				igt_assert_eq(ret, 0);
+				igt_plane_set_fb(plane, &data->fb_flip);
+				if (data->rotation == IGT_ROTATION_90 || data->rotation == IGT_ROTATION_270)
+					igt_plane_set_size(plane, data->fb.height, data->fb.width);
+
+				if (plane_type != DRM_PLANE_TYPE_PRIMARY) {
+					igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK, NULL);
+				} else {
+					ret = drmModePageFlip(data->gfx_fd,
+							output->config.crtc->crtc_id,
+							data->fb_flip.fb_id,
+							DRM_MODE_PAGE_FLIP_EVENT,
+							NULL);
+					igt_assert_eq(ret, 0);
+				}
 				wait_for_pageflip(data->gfx_fd);
 				igt_pipe_crc_collect_crc(data->pipe_crc,
 							 &crc_output);
Signature · 6 lines
2.14.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 7/7
#18 lore raw

Re: [PATCH i-g-t v4 7/7] igt/kms_rotation_crc : Fix flip tests for sprite plane

Quoted 5 lines · Maarten Lankhorst

This test was flipping the primary plane instead of the sprite plane. Flip the correct plane to make the test pass properly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102691

Quoted 59 lines

---
 tests/kms_rotation_crc.c | 23 +++++++++++++++++------

 1 file changed, 17 insertions(+), 6 deletions(-)
tests/kms_rotation_crc.c +0 -0
index 4932a0d44410..b8327dfa0d83 100644
@@ -332,6 +332,9 @@ static void test_plane_rotation(data_t *data, int
 plane_type)
  	enum igt_commit_style commit = COMMIT_LEGACY;
  	int ret;

tests/kms_rotation_crc.c +3 -0
+	if (data->flips && plane_type != DRM_PLANE_TYPE_PRIMARY)
+		igt_require(data->display.is_atomic);
+

  if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type == DRM_PLANE_TYPE_CURSOR)
  commit = COMMIT_UNIVERSAL;

tests/kms_rotation_crc.c +1 -6
@@ -390,12 +393,20 @@ static void test_plane_rotation(data_t *data,
 int plane_type)
  			 * check CRC against that one as well.
  			 */
  			if (data->flips) {
-				ret = drmModePageFlip(data->gfx_fd,
-						      output-
 >config.crtc->crtc_id,
-						      data-
 >fb_flip.fb_id,
-						      DRM_MODE_PAGE_
 FLIP_EVENT,
-						      NULL);
-				igt_assert_eq(ret, 0);
+				igt_plane_set_fb(plane, &data-
Quoted 1 line

fb_flip);

tests/kms_rotation_crc.c +1 -0
+				if (data->rotation ==

IGT_ROTATION_90 || data->rotation == IGT_ROTATION_270)

tests/kms_rotation_crc.c +1 -0
+					igt_plane_set_size(plane,

data->fb.height, data->fb.width);

tests/kms_rotation_crc.c +2 -0
+
+				if (plane_type !=

DRM_PLANE_TYPE_PRIMARY) {

tests/kms_rotation_crc.c +1 -0
+					igt_display_commit_atomic(di

splay, DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK, NULL);

tests/kms_rotation_crc.c +2 -0
+				} else {
+					ret = drmModePageFlip(data-
Quoted 1 line

gfx_fd,

tests/kms_rotation_crc.c +1 -0
+							output-
Quoted 1 line

config.crtc->crtc_id,

tests/kms_rotation_crc.c +1 -0
+							data-
Quoted 1 line

fb_flip.fb_id,

tests/kms_rotation_crc.c +1 -0
+							DRM_MODE_PAG

E_FLIP_EVENT,

tests/kms_rotation_crc.c +3 -0
+							NULL);
+					igt_assert_eq(ret, 0);
+				}

  wait_for_pageflip(data->gfx_fd); igt_pipe_crc_collect_crc(data-

Quoted 3 lines
Quoted 1 line

pipe_crc,

   &crc_output );

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#19 lore raw

✓ Fi.CI.BAT: success for lib/igt_kms: Convert properties to be more atomic-like. (rev8)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev8)
URL : https://patchwork.freedesktop.org/series/30903/
State : success

== Summary ==

IGT patchset tested on top of latest successful build cf3e683a3650c18c89a3322c4171e1db94b5b9f8 igt/gem_exec_nop: Measure high-priority throughput over a bg load

with latest DRM-Tip kernel build CI_DRM_3155
2131a7ba0b2b drm-tip: 2017y-09m-29d-08h-01m-09s UTC integration manifest

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:446s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:470s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:418s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:537s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:505s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:511s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:502s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:494s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:565s
fi-cnl-y         total:118  pass:97   dwarn:0   dfail:0   fail:0   skip:20 
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:419s
fi-glk-1         total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:570s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:431s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:407s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:491s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:469s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:469s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:577s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:599s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:544s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:457s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:760s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:499s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:479s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:571s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:415s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_274/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#20 lore raw

✗ Fi.CI.IGT: failure for lib/igt_kms: Convert properties to be more atomic-like. (rev8)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev8)
URL : https://patchwork.freedesktop.org/series/30903/
State : failure

== Summary ==

Test kms_rotation_crc:

        Subgroup sprite-rotation-180-flip:
                fail       -> PASS       (shard-hsw) fdo#102691
Test gem_eio:
        Subgroup in-flight-external:
                dmesg-warn -> PASS       (shard-hsw) fdo#102886 +2
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-B:
                dmesg-warn -> PASS       (shard-hsw)
Test kms_flip:
        Subgroup wf_vblank-vs-modeset:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912
Test gem_exec_store:
        Subgroup pages-default:
                pass       -> FAIL       (shard-hsw)
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252

fdo#102691 https://bugs.freedesktop.org/show_bug.cgi?id=102691
fdo#102886 https://bugs.freedesktop.org/show_bug.cgi?id=102886
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw total:2429 pass:1334 dwarn:3 dfail:0 fail:9 skip:1083 time:9942s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_274/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#21 lore raw

✗ Fi.CI.BAT: failure for lib/igt_kms: Convert properties to be more atomic-like. (rev9)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev9)
URL : https://patchwork.freedesktop.org/series/30903/
State : failure

== Summary ==

IGT patchset tested on top of latest successful build 1e3db6500dd5c5aa2cc8cb03501b50ef17d06564 lib/igt_kms: Commit primary plane when a modeset is forced on a pipe

with latest DRM-Tip kernel build CI_DRM_3164
94b58b30561d drm-tip: 2017y-10m-03d-07h-32m-14s UTC integration manifest

No testlist changes.

Test chamelium:

        Subgroup dp-crc-fast:
                pass       -> DMESG-FAIL (fi-kbl-7500u) fdo#102514
        Subgroup hdmi-crc-fast:
                pass       -> FAIL       (fi-skl-6700k) fdo#103019
Test kms_busy:
        Subgroup basic-flip-a:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u) fdo#102294 +12
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup basic-flip-b:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi) fdo#103020
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup basic-flip-c:
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205) fdo#102035 +1
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cnl-y)
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
        Subgroup basic-flip-after-cursor-legacy:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
        Subgroup basic-flip-after-cursor-varying-size:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
        Subgroup basic-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
Test kms_force_connector_basic:
        Subgroup force-connector-state:
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup hang-read-crc-pipe-b:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup hang-read-crc-pipe-c:
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-a:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500) fdo#102364 +1
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-b:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-b-frame-sequence:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900) fdo#102619
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-c:
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup nonblocking-crc-pipe-c-frame-sequence:
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-bsw-n3050)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-7567u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup read-crc-pipe-a:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL       (fi-elk-e7500)
                pass       -> FAIL       (fi-ilk-650)
                pass       -> FAIL       (fi-snb-2520m)
                pass       -> FAIL       (fi-snb-2600)
                pass       -> FAIL       (fi-ivb-3520m)
                pass       -> FAIL       (fi-ivb-3770)
                pass       -> FAIL       (fi-byt-j1900)
                pass       -> FAIL       (fi-byt-n2820)
                pass       -> FAIL       (fi-hsw-4770)
                pass       -> FAIL       (fi-hsw-4770r)
                pass       -> FAIL       (fi-bdw-5557u)
                pass       -> FAIL       (fi-bdw-gvtdvm)
                pass       -> FAIL       (fi-skl-6260u)
                pass       -> FAIL       (fi-skl-6700k)
                pass       -> FAIL       (fi-skl-6770hq)
                pass       -> FAIL       (fi-skl-gvtdvm)
                pass       -> FAIL       (fi-bxt-dsi)
                pass       -> FAIL       (fi-bxt-j4205)
                pass       -> FAIL       (fi-kbl-7500u)
                pass       -> FAIL       (fi-kbl-7560u)
                pass       -> FAIL       (fi-kbl-r)
                pass       -> FAIL       (fi-glk-1)
                pass       -> FAIL       (fi-cfl-s)
                pass       -> FAIL       (fi-cnl-y)
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> FAIL       (fi-blb-e6850)
                pass       -> FAIL       (fi-bwr-2160)
                pass       -> FAIL

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_285/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#22 lore raw

Re: ✗ Fi.CI.BAT: failure for lib/igt_kms: Convert properties to be more atomic-like. (rev9)

Quoted 5 lines · Patchwork

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev9)
URL : https://patchwork.freedesktop.org/series/30903/
State : failure

Maarten, why have you been pushing patches from this series without CI ever having a success?

kms_color --r ctm-red-to-blue-pipe1 (and other subtests in kms_color that don't skip) crash now.

Bisect results:

1e3db6500dd5c5aa2cc8cb03501b50ef17d06564 is the first bad commit commit 1e3db6500dd5c5aa2cc8cb03501b50ef17d06564

Author: Maarten Lankhorst <[email protected]>
Date:   Wed Sep 27 18:17:53 2017 +0200

lib/igt_kms: Commit primary plane when a modeset is forced on a pipe

Signature · 5 lines
Petri Latvala
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

✓ Fi.CI.BAT: success for lib/igt_kms: Convert properties to be more atomic-like. (rev11)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev11)
URL : https://patchwork.freedesktop.org/series/30903/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 7f93a2632aae7c5865823b4a2fa4cd8c2a1c0977 Update NEWS, bump version to 1.20.

with latest DRM-Tip kernel build CI_DRM_3174
ce6163933673 drm-tip: 2017y-10m-04d-16h-49m-44s UTC integration manifest

No testlist changes.

Test gem_exec_suspend:

        Subgroup basic-s3:
                dmesg-warn -> PASS       (fi-cfl-s) fdo#103026

fdo#103026 https://bugs.freedesktop.org/show_bug.cgi?id=103026

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:462s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:478s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:393s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:576s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:291s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:529s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:537s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:547s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:532s
fi-cfl-s         total:289  pass:257  dwarn:0   dfail:0   fail:0   skip:32  time:575s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:639s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:444s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:595s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:436s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:421s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:469s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:502s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:476s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:509s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:578s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:499s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:594s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:654s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:619s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:538s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:522s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:480s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:590s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:439s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_297/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#24 lore raw

✗ Fi.CI.IGT: warning for lib/igt_kms: Convert properties to be more atomic-like. (rev11)

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_kms: Convert properties to be more atomic-like. (rev11)
URL : https://patchwork.freedesktop.org/series/30903/
State : warning

== Summary ==

Test kms_flip:

        Subgroup plain-flip-fb-recreate-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test gem_flink_race:
        Subgroup flink_close:
                fail       -> PASS       (shard-hsw) fdo#102655
Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252
Test gem_eio:
        Subgroup in-flight-contexts:
                dmesg-warn -> PASS       (shard-hsw) fdo#102886
Test kms_addfb_basic:
        Subgroup bo-too-small-due-to-tiling:
                pass       -> DMESG-WARN (shard-hsw)
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-render-C:
                pass       -> SKIP       (shard-hsw)

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102655 https://bugs.freedesktop.org/show_bug.cgi?id=102655
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102886 https://bugs.freedesktop.org/show_bug.cgi?id=102886

shard-hsw total:2430 pass:1330 dwarn:7 dfail:0 fail:8 skip:1085 time:10067s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_297/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx