[Intel-gfx] [PATCH i-g-t 4/6] lib/igt_kms: don't store background property id twice

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Mar 23 14:49:47 UTC 2016


Now that we load all properties regardless of atomic, the background
color property id is redundant.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 lib/igt_kms.c                     | 7 ++++---
 lib/igt_kms.h                     | 7 ++++++-
 tests/kms_crtc_background_color.c | 2 +-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 6cae6c4..76ac221 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1269,7 +1269,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 
 			get_crtc_property(display->drm_fd, pipe->crtc_id,
 					  "background_color",
-					  &pipe->background_property,
+					  NULL,
 					  &prop_value,
 					  NULL);
 			pipe->background = (uint32_t)prop_value;
@@ -1849,8 +1849,9 @@ static int igt_output_commit(igt_output_t *output,
 	pipe = igt_output_get_driving_pipe(output);
 
 	if (pipe->background_changed) {
-		igt_crtc_set_property(output, pipe->background_property,
-			pipe->background);
+		igt_crtc_set_property(output,
+				      pipe->properties[IGT_CRTC_BACKGROUND],
+				      pipe->background);
 
 		pipe->background_changed = false;
 	}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 30b6131..e45412b 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -254,7 +254,6 @@ struct igt_pipe {
 	igt_plane_t planes[IGT_MAX_PLANES];
 	uint64_t background; /* Background color MSB BGR 16bpc LSB */
 	uint32_t background_changed : 1;
-	uint32_t background_property;
 
 	uint64_t degamma_blob;
 	uint32_t degamma_property;
@@ -330,6 +329,12 @@ void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
 void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	uint32_t w, uint32_t h);
 
+static inline bool igt_pipe_supports_background(igt_pipe_t *pipe)
+{
+	return pipe->properties[IGT_CRTC_BACKGROUND] != 0;
+}
+
+
 void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
 
 #define for_each_connected_output(display, output)		\
diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c
index b496625..055f935 100644
--- a/tests/kms_crtc_background_color.c
+++ b/tests/kms_crtc_background_color.c
@@ -140,7 +140,7 @@ static void test_crtc_background(data_t *data)
 		igt_output_set_pipe(output, pipe);
 
 		plane = igt_output_get_plane(output, IGT_PLANE_PRIMARY);
-		igt_require(plane->pipe->background_property);
+		igt_require(igt_pipe_supports_background (plane->pipe));
 
 		prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);
 
-- 
2.8.0.rc3



More information about the Intel-gfx mailing list