Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_ccs: Move fbs out from data
@ 2018-01-26 19:51 Ville Syrjala
  2018-01-26 19:51 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCS Ville Syrjala
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ville Syrjala @ 2018-01-26 19:51 UTC (permalink / raw)
  To: igt-dev; +Cc: Gabriel Krisman Bertazi

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

There's no need to house fb and fb_sprite in the data_t. Just suck
them into try_config(). Much cleaner since we no longer have to match
the fb setup done in try_config() in test_output(). Also I think doing
multiple try_config()s (like done by TEST_CRC) would leak one of the
primary fbs.

Cc: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_ccs.c | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index ebf4212e770e..b142d3e5a7cb 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -53,8 +53,6 @@ enum test_fb_flags {
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb fb;
-	struct igt_fb fb_sprite;
 	igt_output_t *output;
 	enum pipe pipe;
 	enum test_flags flags;
@@ -394,6 +392,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,
 	igt_plane_t *primary;
 	drmModeModeInfo *drm_mode = igt_output_get_mode(data->output);
 	enum igt_commit_style commit;
+	struct igt_fb fb, fb_sprite;
 	int ret;
 
 	if (data->display.is_atomic)
@@ -407,12 +406,12 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,
 
 	if (data->plane && fb_flags & FB_COMPRESSED) {
 		plane_require_ccs(data, data->plane, DRM_FORMAT_XRGB8888);
-		generate_fb(data, &data->fb, drm_mode->hdisplay,
+		generate_fb(data, &fb, drm_mode->hdisplay,
 			    drm_mode->vdisplay,
 			    (fb_flags & ~FB_COMPRESSED) | FB_HAS_PLANE);
-		generate_fb(data, &data->fb_sprite, 256, 256, fb_flags);
+		generate_fb(data, &fb_sprite, 256, 256, fb_flags);
 	} else {
-		generate_fb(data, &data->fb, drm_mode->hdisplay,
+		generate_fb(data, &fb, drm_mode->hdisplay,
 			    drm_mode->vdisplay, fb_flags);
 	}
 
@@ -421,12 +420,12 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,
 
 	igt_plane_set_position(primary, 0, 0);
 	igt_plane_set_size(primary, drm_mode->hdisplay, drm_mode->vdisplay);
-	igt_plane_set_fb(primary, &data->fb);
+	igt_plane_set_fb(primary, &fb);
 
 	if (data->plane && fb_flags & FB_COMPRESSED) {
 		igt_plane_set_position(data->plane, 0, 0);
 		igt_plane_set_size(data->plane, 256, 256);
-		igt_plane_set_fb(data->plane, &data->fb_sprite);
+		igt_plane_set_fb(data->plane, &fb_sprite);
 	}
 
 	if (data->flags & TEST_ROTATE_180)
@@ -450,14 +449,20 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,
 		igt_plane_set_position(data->plane, 0, 0);
 		igt_plane_set_size(data->plane, 0, 0);
 		igt_plane_set_fb(data->plane, NULL);
-		igt_remove_fb(display->drm_fd, &data->fb_sprite);
+		igt_remove_fb(display->drm_fd, &fb_sprite);
 	}
+
+	igt_plane_set_fb(primary, NULL);
+	igt_plane_set_rotation(primary, IGT_ROTATION_0);
+	igt_display_commit2(display, commit);
+
+	if (data->flags & TEST_CRC)
+		igt_remove_fb(data->drm_fd, &fb);
 }
 
 static void test_output(data_t *data)
 {
 	igt_display_t *display = &data->display;
-	igt_plane_t *primary;
 	igt_crc_t crc, ref_crc;
 	enum test_fb_flags fb_flags = 0;
 
@@ -495,17 +500,8 @@ static void test_output(data_t *data)
 		try_config(data, fb_flags | FB_COMPRESSED | FB_ZERO_AUX_STRIDE , NULL);
 	}
 
-	primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
-	igt_plane_set_fb(primary, NULL);
-	igt_plane_set_rotation(primary, IGT_ROTATION_0);
-	if (!display->is_atomic)
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
-
 	igt_output_set_pipe(data->output, PIPE_ANY);
 	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
-
-	if (data->flags & TEST_CRC)
-		igt_remove_fb(data->drm_fd, &data->fb);
 }
 
 static data_t data;
-- 
2.13.6

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-09 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-26 19:51 [igt-dev] [PATCH i-g-t 1/2] tests/kms_ccs: Move fbs out from data Ville Syrjala
2018-01-26 19:51 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCS Ville Syrjala
2018-02-07 14:15   ` Lofstedt, Marta
2018-02-09 20:43     ` Ville Syrjälä
2018-01-26 20:11 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_ccs: Move fbs out from data Patchwork
2018-01-26 21:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-02-07 14:15 ` [igt-dev] [PATCH i-g-t 1/2] " Lofstedt, Marta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox