public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_big_fb: Test 8bpp
@ 2019-05-29  8:36 Ville Syrjala
  2019-05-29 10:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ville Syrjala @ 2019-05-29  8:36 UTC (permalink / raw)
  To: igt-dev

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

Now that igt_fb has some support for C8 we can enable
the 8bpp subtests.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_big_fb.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index b8813a333643..5989c5b291f0 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -206,6 +206,34 @@ static void cleanup_fb(data_t *data)
 	data->big_fb.fb_id = 0;
 }
 
+static void set_c8_lut(data_t *data)
+{
+	igt_pipe_t *pipe = &data->display.pipes[data->pipe];
+	struct drm_color_lut *lut;
+	int i, lut_size = 256;
+
+	lut = calloc(lut_size, sizeof(lut[0]));
+
+	/* igt_fb uses RGB332 for C8 */
+	for (i = 0; i < lut_size; i++) {
+		lut[i].red = ((i & 0xe0) >> 5) * 0xffff / 0x7;
+		lut[i].green = ((i & 0x1c) >> 2) * 0xffff / 0x7;
+		lut[i].blue = ((i & 0x03) >> 0) * 0xffff / 0x3;
+	}
+
+	igt_pipe_obj_replace_prop_blob(pipe, IGT_CRTC_GAMMA_LUT, lut,
+				       lut_size * sizeof(lut[0]));
+
+	free(lut);
+}
+
+static void unset_lut(data_t *data)
+{
+	igt_pipe_t *pipe = &data->display.pipes[data->pipe];
+
+	igt_pipe_obj_replace_prop_blob(pipe, IGT_CRTC_GAMMA_LUT, NULL, 0);
+}
+
 static bool test_plane(data_t *data)
 {
 	igt_plane_t *plane = data->plane;
@@ -355,6 +383,9 @@ static bool test_pipe(data_t *data)
 		igt_remove_fb(data->drm_fd, &fb);
 	}
 
+	if (data->format == DRM_FORMAT_C8)
+		set_c8_lut(data);
+
 	igt_display_commit2(&data->display, data->display.is_atomic ?
 			    COMMIT_ATOMIC : COMMIT_UNIVERSAL);
 
@@ -367,6 +398,9 @@ static bool test_pipe(data_t *data)
 			break;
 	}
 
+	if (data->format == DRM_FORMAT_C8)
+		unset_lut(data);
+
 	igt_pipe_crc_free(data->pipe_crc);
 
 	igt_output_set_pipe(data->output, PIPE_ANY);
@@ -545,7 +579,6 @@ static const struct {
 	uint32_t format;
 	uint8_t bpp;
 } formats[] = {
-	/* FIXME igt_fb doesn't support C8 currently */
 	{ DRM_FORMAT_C8, 8, },
 	{ DRM_FORMAT_RGB565, 16, },
 	{ DRM_FORMAT_XRGB8888, 32, },
@@ -654,7 +687,8 @@ igt_main
 
 				igt_subtest_f("%s-%dbpp-rotate-%d", modifiers[i].name,
 					      formats[j].bpp, rotations[k].angle) {
-					igt_require(igt_fb_supported_format(data.format));
+					igt_require(data.format == DRM_FORMAT_C8 ||
+						    igt_fb_supported_format(data.format));
 					igt_require(igt_display_has_format_mod(&data.display, data.format, data.modifier));
 					test_scanout(&data);
 				}
-- 
2.21.0

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

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

end of thread, other threads:[~2019-06-05 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-29  8:36 [igt-dev] [PATCH i-g-t] tests/kms_big_fb: Test 8bpp Ville Syrjala
2019-05-29 10:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-29 14:39 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-06-05 14:32 ` [igt-dev] [PATCH i-g-t] " Maarten Lankhorst
2019-06-05 15:56   ` Ville Syrjälä

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