All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges
@ 2019-06-28 19:44 Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Ville Syrjala @ 2019-06-28 19:44 UTC (permalink / raw)
  To: igt-dev

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

This works on IVB, CHV and SKL. I'm curious what this will show for
our cureent ICL iCSC code. I didn't test that one.

Cc: Uma Shankar <uma.shankar@intel.com>

Ville Syrjälä (3):
  lib/igt_fb: Allow creating yuv fbs with different encodings/ranges
  tests/kms_plane: Test all YCbCr encodings/ranges
  tests/kms_plane: Throw away yet another bi

 lib/igt_fb.c                     | 207 +++++++++++++++++++++++++++----
 lib/igt_fb.h                     |  29 ++++-
 tests/kms_flip.c                 |   6 +-
 tests/kms_frontbuffer_tracking.c |   6 +-
 tests/kms_plane.c                | 166 +++++++++++++++++++------
 5 files changed, 347 insertions(+), 67 deletions(-)

-- 
2.21.0

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

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

* [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
@ 2019-06-28 19:44 ` Ville Syrjala
  2019-07-02 14:47   ` Shankar, Uma
  2019-07-02 17:56   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges Ville Syrjala
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 22+ messages in thread
From: Ville Syrjala @ 2019-06-28 19:44 UTC (permalink / raw)
  To: igt-dev

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

Provide alternate versions of the fb creation functions that allow
the caller to specify the yuv color encoding/range.

Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c                     | 207 +++++++++++++++++++++++++++----
 lib/igt_fb.h                     |  29 ++++-
 tests/kms_flip.c                 |   6 +-
 tests/kms_frontbuffer_tracking.c |   6 +-
 4 files changed, 217 insertions(+), 31 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 415a3d65d24b..86988d6ca805 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1415,6 +1415,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
  * @height: height of the framebuffer in pixel
  * @format: drm fourcc pixel format code
  * @modifier: tiling layout of the framebuffer (as framebuffer modifier)
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
  * @fb: pointer to an #igt_fb structure
  * @bo_size: size of the backing bo (0 for automatic size)
  * @bo_stride: stride of the backing bo (0 for automatic stride)
@@ -1432,12 +1434,11 @@ void igt_paint_image(cairo_t *cr, const char *filename,
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
 			   uint32_t format, uint64_t modifier,
+			   enum igt_color_encoding color_encoding,
+			   enum igt_color_range color_range,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride)
 {
-	/* FIXME allow the caller to pass these in */
-	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
-	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
 	uint32_t flags = 0;
 
 	fb_init(fb, fd, width, height, format, modifier,
@@ -1471,6 +1472,38 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 	return fb->fb_id;
 }
 
+/**
+ * igt_create_fb_full:
+ * @fd: open i915 drm file descriptor
+ * @width: width of the framebuffer in pixel
+ * @height: height of the framebuffer in pixel
+ * @format: drm fourcc pixel format code
+ * @modifier: tiling layout of the framebuffer
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
+ * @fb: pointer to an #igt_fb structure
+ *
+ * This function allocates a gem buffer object suitable to back a framebuffer
+ * with the requested properties and then wraps it up in a drm framebuffer
+ * object. All metadata is stored in @fb.
+ *
+ * The backing storage of the framebuffer is filled with all zeros, i.e. black
+ * for rgb pixel formats.
+ *
+ * Returns:
+ * The kms id of the created framebuffer.
+ */
+unsigned int igt_create_fb_full(int fd, int width, int height,
+				uint32_t format, uint64_t modifier,
+				enum igt_color_encoding color_encoding,
+				enum igt_color_range color_range,
+				struct igt_fb *fb)
+{
+	return igt_create_fb_with_bo_size(fd, width, height, format, modifier,
+					  color_encoding, color_range,
+					  fb, 0, 0);
+}
+
 /**
  * igt_create_fb:
  * @fd: open i915 drm file descriptor
@@ -1490,11 +1523,59 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
  * Returns:
  * The kms id of the created framebuffer.
  */
-unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
-			   uint64_t modifier, struct igt_fb *fb)
+unsigned int igt_create_fb(int fd, int width, int height,
+			   uint32_t format, uint64_t modifier,
+			   struct igt_fb *fb)
 {
-	return igt_create_fb_with_bo_size(fd, width, height, format, modifier, fb,
-					  0, 0);
+	return igt_create_fb_full(fd, width, height, format, modifier,
+				  IGT_COLOR_YCBCR_BT709,
+				  IGT_COLOR_YCBCR_LIMITED_RANGE, fb);
+}
+
+/**
+ * igt_create_color_fb_full:
+ * @fd: open i915 drm file descriptor
+ * @width: width of the framebuffer in pixel
+ * @height: height of the framebuffer in pixel
+ * @format: drm fourcc pixel format code
+ * @modifier: tiling layout of the framebuffer
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
+ * @r: red value to use as fill color
+ * @g: green value to use as fill color
+ * @b: blue value to use as fill color
+ * @fb: pointer to an #igt_fb structure
+ *
+ * This function allocates a gem buffer object suitable to back a framebuffer
+ * with the requested properties and then wraps it up in a drm framebuffer
+ * object. All metadata is stored in @fb.
+ *
+ * Compared to igt_create_fb() this function also fills the entire framebuffer
+ * with the given color, which is useful for some simple pipe crc based tests.
+ *
+ * Returns:
+ * The kms id of the created framebuffer on success or a negative error code on
+ * failure.
+ */
+unsigned int igt_create_color_fb_full(int fd, int width, int height,
+				      uint32_t format, uint64_t modifier,
+				      enum igt_color_encoding color_encoding,
+				      enum igt_color_range color_range,
+				      double r, double g, double b,
+				      struct igt_fb *fb /* out	 */)
+{
+	unsigned int fb_id;
+	cairo_t *cr;
+
+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
+				   color_encoding, color_range, fb);
+	igt_assert(fb_id);
+
+	cr = igt_get_cairo_ctx(fd, fb);
+	igt_paint_color(cr, 0, 0, width, height, r, g, b);
+	igt_put_cairo_ctx(fd, fb, cr);
+
+	return fb_id;
 }
 
 /**
@@ -1524,15 +1605,51 @@ unsigned int igt_create_color_fb(int fd, int width, int height,
 				 uint32_t format, uint64_t modifier,
 				 double r, double g, double b,
 				 struct igt_fb *fb /* out */)
+{
+	return igt_create_color_fb_full(fd, width, height,
+					format, modifier,
+					IGT_COLOR_YCBCR_BT709,
+					IGT_COLOR_YCBCR_LIMITED_RANGE,
+					r, g, b, fb);
+}
+
+/**
+ * igt_create_pattern_fb_full:
+ * @fd: open i915 drm file descriptor
+ * @width: width of the framebuffer in pixel
+ * @height: height of the framebuffer in pixel
+ * @format: drm fourcc pixel format code
+ * @modifier: tiling layout of the framebuffer
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
+ * @fb: pointer to an #igt_fb structure
+ *
+ * This function allocates a gem buffer object suitable to back a framebuffer
+ * with the requested properties and then wraps it up in a drm framebuffer
+ * object. All metadata is stored in @fb.
+ *
+ * Compared to igt_create_fb() this function also draws the standard test pattern
+ * into the framebuffer.
+ *
+ * Returns:
+ * The kms id of the created framebuffer on success or a negative error code on
+ * failure.
+ */
+unsigned int igt_create_pattern_fb_full(int fd, int width, int height,
+					uint32_t format, uint64_t modifier,
+					enum igt_color_encoding color_encoding,
+					enum igt_color_range color_range,
+					struct igt_fb *fb /* out */)
 {
 	unsigned int fb_id;
 	cairo_t *cr;
 
-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
+				   color_encoding, color_range, fb);
 	igt_assert(fb_id);
 
 	cr = igt_get_cairo_ctx(fd, fb);
-	igt_paint_color(cr, 0, 0, width, height, r, g, b);
+	igt_paint_test_pattern(cr, width, height);
 	igt_put_cairo_ctx(fd, fb, cr);
 
 	return fb_id;
@@ -1561,14 +1678,56 @@ unsigned int igt_create_color_fb(int fd, int width, int height,
 unsigned int igt_create_pattern_fb(int fd, int width, int height,
 				   uint32_t format, uint64_t modifier,
 				   struct igt_fb *fb /* out */)
+{
+	return igt_create_pattern_fb_full(fd, width, height,
+					  format, modifier,
+					  IGT_COLOR_YCBCR_BT709,
+					  IGT_COLOR_YCBCR_LIMITED_RANGE,
+					  fb);
+}
+
+/**
+ * igt_create_color_pattern_fb_full:
+ * @fd: open i915 drm file descriptor
+ * @width: width of the framebuffer in pixel
+ * @height: height of the framebuffer in pixel
+ * @format: drm fourcc pixel format code
+ * @modifier: tiling layout of the framebuffer
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
+ * @r: red value to use as fill color
+ * @g: green value to use as fill color
+ * @b: blue value to use as fill color
+ * @fb: pointer to an #igt_fb structure
+ *
+ * This function allocates a gem buffer object suitable to back a framebuffer
+ * with the requested properties and then wraps it up in a drm framebuffer
+ * object. All metadata is stored in @fb.
+ *
+ * Compared to igt_create_fb() this function also fills the entire framebuffer
+ * with the given color, and then draws the standard test pattern into the
+ * framebuffer.
+ *
+ * Returns:
+ * The kms id of the created framebuffer on success or a negative error code on
+ * failure.
+ */
+unsigned int igt_create_color_pattern_fb_full(int fd, int width, int height,
+					      uint32_t format, uint64_t modifier,
+					      enum igt_color_encoding color_encoding,
+					      enum igt_color_range color_range,
+					      double r, double g, double b,
+					      struct igt_fb *fb /* out	 */)
 {
 	unsigned int fb_id;
 	cairo_t *cr;
 
-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
+				   color_encoding, color_range, fb);
 	igt_assert(fb_id);
 
 	cr = igt_get_cairo_ctx(fd, fb);
+	igt_paint_color(cr, 0, 0, width, height, r, g, b);
 	igt_paint_test_pattern(cr, width, height);
 	igt_put_cairo_ctx(fd, fb, cr);
 
@@ -1582,6 +1741,8 @@ unsigned int igt_create_pattern_fb(int fd, int width, int height,
  * @height: height of the framebuffer in pixel
  * @format: drm fourcc pixel format code
  * @modifier: tiling layout of the framebuffer
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
  * @r: red value to use as fill color
  * @g: green value to use as fill color
  * @b: blue value to use as fill color
@@ -1604,18 +1765,11 @@ unsigned int igt_create_color_pattern_fb(int fd, int width, int height,
 					 double r, double g, double b,
 					 struct igt_fb *fb /* out */)
 {
-	unsigned int fb_id;
-	cairo_t *cr;
-
-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
-	igt_assert(fb_id);
-
-	cr = igt_get_cairo_ctx(fd, fb);
-	igt_paint_color(cr, 0, 0, width, height, r, g, b);
-	igt_paint_test_pattern(cr, width, height);
-	igt_put_cairo_ctx(fd, fb, cr);
-
-	return fb_id;
+	return igt_create_color_pattern_fb_full(fd, width, height,
+						format, modifier,
+						IGT_COLOR_YCBCR_BT709,
+						IGT_COLOR_YCBCR_LIMITED_RANGE,
+						r, g, b, fb);
 }
 
 /**
@@ -1745,8 +1899,8 @@ unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
 	struct igt_fb fb;
 
 	stereo_fb_layout_from_mode(&layout, mode);
-	fb_id = igt_create_fb(drm_fd, layout.fb_width, layout.fb_height, format,
-			      modifier, &fb);
+	fb_id = igt_create_fb(drm_fd, layout.fb_width, layout.fb_height,
+			      format, modifier, &fb);
 	cr = igt_get_cairo_ctx(drm_fd, &fb);
 
 	igt_paint_image(cr, "1080p-left.png",
@@ -3329,7 +3483,10 @@ unsigned int igt_fb_convert_with_stride(struct igt_fb *dst, struct igt_fb *src,
 
 	fb_id = igt_create_fb_with_bo_size(src->fd, src->width,
 					   src->height, dst_fourcc,
-					   dst_modifier, dst, 0,
+					   dst_modifier,
+					   IGT_COLOR_YCBCR_BT709,
+					   IGT_COLOR_YCBCR_LIMITED_RANGE,
+					   dst, 0,
 					   dst_stride);
 	igt_assert(fb_id > 0);
 
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index be786911d577..db936b1608a6 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -120,17 +120,42 @@ void igt_calc_fb_size(int fd, int width, int height, uint32_t format, uint64_t m
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
 			   uint32_t format, uint64_t modifier,
+			   enum igt_color_encoding color_encoding,
+			   enum igt_color_range color_range,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride);
-unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
-			   uint64_t modifier, struct igt_fb *fb);
+unsigned int igt_create_fb_full(int fd, int width, int height,
+				uint32_t format, uint64_t modifier,
+				enum igt_color_encoding color_encoding,
+				enum igt_color_range color_range,
+				struct igt_fb *fb /* out */);
+unsigned int igt_create_fb(int fd, int width, int height,
+			   uint32_t format, uint64_t modifier,
+			   struct igt_fb *fb /* out */);
+unsigned int igt_create_color_fb_full(int fd, int width, int height,
+				      uint32_t format, uint64_t modifier,
+				      enum igt_color_encoding color_encoding,
+				      enum igt_color_range color_range,
+				      double r, double g, double b,
+				      struct igt_fb *fb /* out */);
 unsigned int igt_create_color_fb(int fd, int width, int height,
 				 uint32_t format, uint64_t modifier,
 				 double r, double g, double b,
 				 struct igt_fb *fb /* out */);
+unsigned int igt_create_pattern_fb_full(int fd, int width, int height,
+					uint32_t format, uint64_t modifier,
+					enum igt_color_encoding color_encoding,
+					enum igt_color_range color_range,
+					struct igt_fb *fb /* out */);
 unsigned int igt_create_pattern_fb(int fd, int width, int height,
 				   uint32_t format, uint64_t modifier,
 				   struct igt_fb *fb /* out */);
+unsigned int igt_create_color_pattern_fb_full(int fd, int width, int height,
+					      uint32_t format, uint64_t modifier,
+					      enum igt_color_encoding color_encoding,
+					      enum igt_color_range color_range,
+					      double r, double g, double b,
+					      struct igt_fb *fb /* out */);
 unsigned int igt_create_color_pattern_fb(int fd, int width, int height,
 					 uint32_t format, uint64_t modifier,
 					 double r, double g, double b,
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 0a8d1c55a7aa..ef2521f21a42 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1247,8 +1247,10 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
 					 tiling, &o->fb_info[0]);
 	o->fb_ids[1] = igt_create_fb_with_bo_size(drm_fd, o->fb_width, o->fb_height,
-					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
-					 tiling, &o->fb_info[1], bo_size, 0);
+						  igt_bpp_depth_to_drm_format(o->bpp, o->depth),
+						  tiling, IGT_COLOR_YCBCR_BT709,
+						  IGT_COLOR_YCBCR_LIMITED_RANGE,
+						  &o->fb_info[1], bo_size, 0);
 
 	igt_assert(o->fb_ids[0]);
 	igt_assert(o->fb_ids[1]);
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1037faf8e6f7..c788b59eefba 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -491,8 +491,10 @@ static void create_fb(enum pixel_format pformat, int width, int height,
 	igt_calc_fb_size(drm.fd, width, height, format, tiling_for_size, &size,
 			 &stride);
 
-	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling, fb,
-				   size, stride);
+	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling,
+				   IGT_COLOR_YCBCR_BT709,
+				   IGT_COLOR_YCBCR_LIMITED_RANGE,
+				   fb, size, stride);
 }
 
 static uint32_t pick_color(struct igt_fb *fb, enum color ecolor)
-- 
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] 22+ messages in thread

* [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
@ 2019-06-28 19:44 ` Ville Syrjala
  2019-07-02 15:09   ` Shankar, Uma
  2019-07-02 17:57   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi Ville Syrjala
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 22+ messages in thread
From: Ville Syrjala @ 2019-06-28 19:44 UTC (permalink / raw)
  To: igt-dev

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

Test all support YCbCr encoding/range combinations. So far
we've only been testing one particular combo.

Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_plane.c | 153 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 120 insertions(+), 33 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 59d5f1e80cd2..13d36254dfe3 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -427,15 +427,18 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
 				    igt_plane_t *plane,
 				    uint32_t format, uint64_t modifier,
 				    int width, int height,
+				    enum igt_color_encoding color_encoding,
+				    enum igt_color_range color_range,
 				    int color, igt_crc_t *crc, struct igt_fb *fb)
 {
 	const color_t *c = &colors[color];
 	struct igt_fb old_fb = *fb;
 
 	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
-		igt_create_color_fb(data->drm_fd, width, height,
-				    format, modifier,
-				    c->red, c->green, c->blue, fb);
+		igt_create_color_fb_full(data->drm_fd, width, height,
+					 format, modifier,
+					 color_encoding, color_range,
+					 c->red, c->green, c->blue, fb);
 	} else {
 		/*
 		 * paint border in inverted color, then visible area in middle
@@ -443,11 +446,11 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
 		 */
 		cairo_t *cr;
 
-		igt_create_fb(data->drm_fd,
-			      width + data->crop * 2,
-			      height + data->crop * 2,
-			      format, modifier, fb);
-
+		igt_create_fb_full(data->drm_fd,
+				   width + data->crop * 2,
+				   height + data->crop * 2,
+				   format, modifier,
+				   color_encoding, color_range, fb);
 		cr = igt_get_cairo_ctx(data->drm_fd, fb);
 
 		igt_paint_color(cr, 0, 0,
@@ -500,6 +503,103 @@ static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
 	return num_unique_crc;
 }
 
+static bool test_format_plane_colors(data_t *data, enum pipe pipe,
+				     igt_plane_t *plane,
+				     uint32_t format, uint64_t modifier,
+				     int width, int height,
+				     enum igt_color_encoding encoding,
+				     enum igt_color_range range,
+				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				     struct igt_fb *fb)
+{
+	int crc_mismatch_count = 0;
+	unsigned int crc_mismatch_mask = 0;
+	bool result = true;
+
+	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
+		igt_crc_t crc;
+
+		test_format_plane_color(data, pipe, plane,
+					format, modifier,
+					width, height,
+					encoding, range,
+					i, &crc, fb);
+
+		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
+			crc_mismatch_count++;
+			crc_mismatch_mask |= (1 << i);
+			result = false;
+		}
+	}
+
+	if (crc_mismatch_count)
+		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
+			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
+			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
+
+	return result;
+}
+
+static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
+				  igt_plane_t *plane,
+				  uint32_t format, uint64_t modifier,
+				  int width, int height,
+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				  struct igt_fb *fb)
+{
+	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
+		 IGT_FORMAT_ARGS(format), modifier,
+		 kmstest_pipe_name(pipe), plane->index);
+
+	return test_format_plane_colors(data, pipe, plane,
+					format, modifier,
+					width, height,
+					IGT_COLOR_YCBCR_BT601,
+					IGT_COLOR_YCBCR_LIMITED_RANGE,
+					ref_crc, fb);
+}
+
+static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
+				  igt_plane_t *plane,
+				  uint32_t format, uint64_t modifier,
+				  int width, int height,
+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				  struct igt_fb *fb)
+{
+	bool result = true;
+
+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
+		return true;
+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
+		return true;
+
+	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++) {
+		if (!igt_plane_try_prop_enum(plane,
+					     IGT_PLANE_COLOR_ENCODING,
+					     igt_color_encoding_to_str(e)))
+			continue;
+
+		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++) {
+			if (!igt_plane_try_prop_enum(plane,
+						     IGT_PLANE_COLOR_RANGE,
+						     igt_color_range_to_str(r)))
+				continue;
+
+			igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " (%s, %s) on %s.%u\n",
+				 IGT_FORMAT_ARGS(format), modifier,
+				 igt_color_encoding_to_str(e),
+				 igt_color_range_to_str(r),
+				 kmstest_pipe_name(pipe), plane->index);
+			result &= test_format_plane_colors(data, pipe, plane,
+							   format, modifier,
+							   width, height,
+							   e, r, ref_crc, fb);
+		}
+	}
+
+	return result;
+}
+
 static bool test_format_plane(data_t *data, enum pipe pipe,
 			      igt_output_t *output, igt_plane_t *plane)
 {
@@ -569,6 +669,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 		test_format_plane_color(data, pipe, plane,
 					format, modifier,
 					width, height,
+					IGT_COLOR_YCBCR_BT709,
+					IGT_COLOR_YCBCR_LIMITED_RANGE,
 					i, &ref_crc[i], &fb);
 	}
 
@@ -580,10 +682,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
 
 	for (int i = 0; i < plane->format_mod_count; i++) {
-		int crc_mismatch_count = 0;
-		int crc_mismatch_mask = 0;
-		igt_crc_t crc;
-
 		format = plane->formats[i];
 		modifier = plane->modifiers[i];
 
@@ -599,30 +697,19 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 				continue;
 		}
 
-		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
-			 IGT_FORMAT_ARGS(format), modifier,
-			 kmstest_pipe_name(pipe), plane->index);
-
-		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
-			test_format_plane_color(data, pipe, plane,
-						format, modifier,
-						width, height,
-						j, &crc, &fb);
-
-			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
-				crc_mismatch_count++;
-				crc_mismatch_mask |= (1 << j);
-				result = false;
-			}
-		}
+		if (igt_format_is_yuv(format))
+			result &= test_format_plane_yuv(data, pipe, plane,
+							format, modifier,
+							width, height,
+							ref_crc, &fb);
+		else
+			result &= test_format_plane_rgb(data, pipe, plane,
+							format, modifier,
+							width, height,
+							ref_crc, &fb);
 
 		if (format == DRM_FORMAT_C8)
 			set_legacy_lut(data, pipe, 0xfc00);
-
-		if (crc_mismatch_count)
-			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
-				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
-				 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
 	}
 
 	igt_pipe_crc_stop(data->pipe_crc);
-- 
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] 22+ messages in thread

* [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges Ville Syrjala
@ 2019-06-28 19:44 ` Ville Syrjala
  2019-07-02 13:20   ` Kazlauskas, Nicholas
  2019-06-28 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges Patchwork
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Ville Syrjala @ 2019-06-28 19:44 UTC (permalink / raw)
  To: igt-dev

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

CHV pipe A/C sprites are causing a crc mismatch with BT.601
when we keep the six msbs. If we throw away one more bit we get
matches for BT.601. BT.709 matches even with 6 bits, as do the
pipe B planes with their programmable CSC. Also IVB and KBL
were both happy with 6 bits, so doesn't seem that that these
CHV mismatches are due to bugs in our code, just the hw is
a bit imprecise.

Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_plane.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 13d36254dfe3..e4f3b8d68748 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -30,6 +30,13 @@
 #include <stdio.h>
 #include <string.h>
 
+/*
+ * Throw away enough lsbs in pixel formats tests
+ * to get a match despite some differences between
+ * the software and hardware YCbCr<->RGB conversion
+ * routines.
+ */
+#define LUT_MASK 0xf800
 
 typedef struct {
 	float red;
@@ -690,7 +697,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 			continue;
 
 		if (format == DRM_FORMAT_C8) {
-			if (!set_c8_legacy_lut(data, pipe, 0xfc00))
+			if (!set_c8_legacy_lut(data, pipe, LUT_MASK))
 				continue;
 		} else {
 			if (!igt_fb_supported_format(format))
@@ -709,7 +716,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 							ref_crc, &fb);
 
 		if (format == DRM_FORMAT_C8)
-			set_legacy_lut(data, pipe, 0xfc00);
+			set_legacy_lut(data, pipe, LUT_MASK);
 	}
 
 	igt_pipe_crc_stop(data->pipe_crc);
@@ -744,7 +751,7 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
-	set_legacy_lut(data, pipe, 0xfc00);
+	set_legacy_lut(data, pipe, LUT_MASK);
 
 	test_init(data, pipe);
 
-- 
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] 22+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (2 preceding siblings ...)
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi Ville Syrjala
@ 2019-06-28 22:48 ` Patchwork
  2019-06-29  9:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-06-28 22:48 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges
URL   : https://patchwork.freedesktop.org/series/62963/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6383 -> IGTPW_3211
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/62963/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_3211 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@module-reload:
    - fi-skl-6770hq:      [PASS][1] -> [FAIL][2] ([fdo#108511])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/fi-skl-6770hq/igt@i915_pm_rpm@module-reload.html

  
#### Possible fixes ####

  * {igt@gem_ctx_switch@legacy-render}:
    - fi-cml-u2:          [INCOMPLETE][3] ([fdo#110566]) -> [PASS][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/fi-cml-u2/igt@gem_ctx_switch@legacy-render.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/fi-cml-u2/igt@gem_ctx_switch@legacy-render.html

  * igt@prime_self_import@basic-with_two_bos:
    - fi-icl-dsi:         [INCOMPLETE][5] ([fdo#107713]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/fi-icl-dsi/igt@prime_self_import@basic-with_two_bos.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/fi-icl-dsi/igt@prime_self_import@basic-with_two_bos.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
  [fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566


Participating hosts (52 -> 45)
------------------------------

  Additional (1): fi-skl-iommu 
  Missing    (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * IGT: IGT_5075 -> IGTPW_3211

  CI_DRM_6383: 436587559983b9613fec2ff3ca1ce5d684a0971e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3211: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/
  IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for Test all YCbCr encodings/ranges
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (3 preceding siblings ...)
  2019-06-28 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges Patchwork
@ 2019-06-29  9:45 ` Patchwork
  2019-07-02 17:57 ` [igt-dev] ✗ Fi.CI.BAT: failure for Test all YCbCr encodings/ranges (rev2) Patchwork
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-06-29  9:45 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges
URL   : https://patchwork.freedesktop.org/series/62963/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6383_full -> IGTPW_3211_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/62963/revisions/1/mbox/

Known issues
------------

  Here are the changes found in IGTPW_3211_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_balancer@smoke:
    - shard-iclb:         [PASS][1] -> [SKIP][2] ([fdo#110854])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb2/igt@gem_exec_balancer@smoke.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb7/igt@gem_exec_balancer@smoke.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-glk:          [PASS][3] -> [DMESG-WARN][4] ([fdo#108686] / [fdo#110853])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-glk8/igt@gem_tiled_swapping@non-threaded.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-glk3/igt@gem_tiled_swapping@non-threaded.html
    - shard-hsw:          [PASS][5] -> [DMESG-WARN][6] ([fdo#108686] / [fdo#110853])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-hsw2/igt@gem_tiled_swapping@non-threaded.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-hsw5/igt@gem_tiled_swapping@non-threaded.html

  * igt@gem_tiled_wc:
    - shard-iclb:         [PASS][7] -> [INCOMPLETE][8] ([fdo#107713])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb6/igt@gem_tiled_wc.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb1/igt@gem_tiled_wc.html

  * igt@gem_workarounds@suspend-resume:
    - shard-apl:          [PASS][9] -> [DMESG-WARN][10] ([fdo#108566]) +2 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl6/igt@gem_workarounds@suspend-resume.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl2/igt@gem_workarounds@suspend-resume.html

  * igt@i915_pm_rc6_residency@rc6-accuracy:
    - shard-snb:          [PASS][11] -> [SKIP][12] ([fdo#109271])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-snb4/igt@i915_pm_rc6_residency@rc6-accuracy.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-snb4/igt@i915_pm_rc6_residency@rc6-accuracy.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
    - shard-glk:          [PASS][13] -> [FAIL][14] ([fdo#105363])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-glk6/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-glk6/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-iclb:         [PASS][15] -> [FAIL][16] ([fdo#103167]) +9 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-wc:
    - shard-hsw:          [PASS][17] -> [SKIP][18] ([fdo#109271]) +6 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-hsw4/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-wc.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-hsw1/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-wc.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [PASS][19] -> [FAIL][20] ([fdo#103166])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][21] -> [SKIP][22] ([fdo#109441]) +2 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb6/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_setmode@basic:
    - shard-apl:          [PASS][23] -> [FAIL][24] ([fdo#99912])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl4/igt@kms_setmode@basic.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl2/igt@kms_setmode@basic.html

  * igt@kms_universal_plane@universal-plane-pipe-a-functional:
    - shard-apl:          [PASS][25] -> [FAIL][26] ([fdo#110037])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl3/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl8/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
    - shard-kbl:          [PASS][27] -> [FAIL][28] ([fdo#110037])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-kbl3/igt@kms_universal_plane@universal-plane-pipe-a-functional.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-kbl1/igt@kms_universal_plane@universal-plane-pipe-a-functional.html

  
#### Possible fixes ####

  * igt@gem_eio@in-flight-suspend:
    - shard-kbl:          [DMESG-WARN][29] ([fdo#108566]) -> [PASS][30] +2 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-kbl6/igt@gem_eio@in-flight-suspend.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-kbl2/igt@gem_eio@in-flight-suspend.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-apl:          [DMESG-WARN][31] ([fdo#108686] / [fdo#110853]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl8/igt@gem_tiled_swapping@non-threaded.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl8/igt@gem_tiled_swapping@non-threaded.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [DMESG-WARN][33] ([fdo#108566]) -> [PASS][34] +4 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl3/igt@gem_workarounds@suspend-resume-context.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl7/igt@gem_workarounds@suspend-resume-context.html

  * igt@i915_pm_rpm@i2c:
    - shard-hsw:          [FAIL][35] ([fdo#104097]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-hsw1/igt@i915_pm_rpm@i2c.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-hsw5/igt@i915_pm_rpm@i2c.html

  * igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen:
    - shard-apl:          [FAIL][37] ([fdo#103232]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-apl4/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html
    - shard-kbl:          [FAIL][39] ([fdo#103232]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-256x256-onscreen.html

  * igt@kms_flip@2x-plain-flip-ts-check-interruptible:
    - shard-hsw:          [SKIP][41] ([fdo#109271]) -> [PASS][42] +33 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-hsw1/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-hsw4/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-msflip-blt:
    - shard-iclb:         [FAIL][43] ([fdo#103167]) -> [PASS][44] +3 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-msflip-blt.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-shrfb-msflip-blt.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [SKIP][45] ([fdo#109441]) -> [PASS][46] +2 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb5/igt@kms_psr@psr2_cursor_render.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb2/igt@kms_psr@psr2_cursor_render.html

  * igt@kms_sysfs_edid_timing:
    - shard-iclb:         [FAIL][47] ([fdo#100047]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-iclb2/igt@kms_sysfs_edid_timing.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-iclb1/igt@kms_sysfs_edid_timing.html

  * igt@perf_pmu@rc6:
    - shard-kbl:          [SKIP][49] ([fdo#109271]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6383/shard-kbl1/igt@perf_pmu@rc6.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/shard-kbl7/igt@perf_pmu@rc6.html

  
  [fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110037]: https://bugs.freedesktop.org/show_bug.cgi?id=110037
  [fdo#110853]: https://bugs.freedesktop.org/show_bug.cgi?id=110853
  [fdo#110854]: https://bugs.freedesktop.org/show_bug.cgi?id=110854
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 6)
------------------------------

  Missing    (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005 


Build changes
-------------

  * IGT: IGT_5075 -> IGTPW_3211
  * Piglit: piglit_4509 -> None

  CI_DRM_6383: 436587559983b9613fec2ff3ca1ce5d684a0971e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3211: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/
  IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3211/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi Ville Syrjala
@ 2019-07-02 13:20   ` Kazlauskas, Nicholas
  2019-07-02 13:30     ` Ville Syrjälä
  0 siblings, 1 reply; 22+ messages in thread
From: Kazlauskas, Nicholas @ 2019-07-02 13:20 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev

On 6/28/19 3:44 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> CHV pipe A/C sprites are causing a crc mismatch with BT.601
> when we keep the six msbs. If we throw away one more bit we get
> matches for BT.601. BT.709 matches even with 6 bits, as do the
> pipe B planes with their programmable CSC. Also IVB and KBL
> were both happy with 6 bits, so doesn't seem that that these
> CHV mismatches are due to bugs in our code, just the hw is
> a bit imprecise.
> 
> Cc: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

With the title of this patch corrected ("Throw away yet another bit"), 
this series is:

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

These patches are useful to have.

However, I'm not sure how I feel about the naming on all of these new 
*_full functions or if they're really all needed. I think just having 
one function that explicitly sets all of this is probably enough rather 
than having these 4 new functions.

Nicholas Kazlauskas

> ---
>   tests/kms_plane.c | 13 ++++++++++---
>   1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 13d36254dfe3..e4f3b8d68748 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -30,6 +30,13 @@
>   #include <stdio.h>
>   #include <string.h>
>   
> +/*
> + * Throw away enough lsbs in pixel formats tests
> + * to get a match despite some differences between
> + * the software and hardware YCbCr<->RGB conversion
> + * routines.
> + */
> +#define LUT_MASK 0xf800
>   
>   typedef struct {
>   	float red;
> @@ -690,7 +697,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>   			continue;
>   
>   		if (format == DRM_FORMAT_C8) {
> -			if (!set_c8_legacy_lut(data, pipe, 0xfc00))
> +			if (!set_c8_legacy_lut(data, pipe, LUT_MASK))
>   				continue;
>   		} else {
>   			if (!igt_fb_supported_format(format))
> @@ -709,7 +716,7 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>   							ref_crc, &fb);
>   
>   		if (format == DRM_FORMAT_C8)
> -			set_legacy_lut(data, pipe, 0xfc00);
> +			set_legacy_lut(data, pipe, LUT_MASK);
>   	}
>   
>   	igt_pipe_crc_stop(data->pipe_crc);
> @@ -744,7 +751,7 @@ test_pixel_formats(data_t *data, enum pipe pipe)
>   
>   	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>   
> -	set_legacy_lut(data, pipe, 0xfc00);
> +	set_legacy_lut(data, pipe, LUT_MASK);
>   
>   	test_init(data, pipe);
>   
> 

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

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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-07-02 13:20   ` Kazlauskas, Nicholas
@ 2019-07-02 13:30     ` Ville Syrjälä
  2019-07-02 16:44       ` Shankar, Uma
  0 siblings, 1 reply; 22+ messages in thread
From: Ville Syrjälä @ 2019-07-02 13:30 UTC (permalink / raw)
  To: Kazlauskas, Nicholas; +Cc: igt-dev

On Tue, Jul 02, 2019 at 01:20:47PM +0000, Kazlauskas, Nicholas wrote:
> On 6/28/19 3:44 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > CHV pipe A/C sprites are causing a crc mismatch with BT.601
> > when we keep the six msbs. If we throw away one more bit we get
> > matches for BT.601. BT.709 matches even with 6 bits, as do the
> > pipe B planes with their programmable CSC. Also IVB and KBL
> > were both happy with 6 bits, so doesn't seem that that these
> > CHV mismatches are due to bugs in our code, just the hw is
> > a bit imprecise.
> > 
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> With the title of this patch corrected ("Throw away yet another bit"), 
> this series is:
> 
> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> These patches are useful to have.
> 
> However, I'm not sure how I feel about the naming on all of these new 
> *_full functions or if they're really all needed. I think just having 
> one function that explicitly sets all of this is probably enough rather 
> than having these 4 new functions.

I suppose I could just use igt_create_fb_with_bo_size() and hand
roll the solid fill in the test.

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
@ 2019-07-02 14:47   ` Shankar, Uma
  2019-07-02 17:56   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
  1 sibling, 0 replies; 22+ messages in thread
From: Shankar, Uma @ 2019-07-02 14:47 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev



>-----Original Message-----
>From: Ville Syrjala [mailto:ville.syrjala@linux.intel.com]
>Sent: Saturday, June 29, 2019 1:15 AM
>To: igt-dev@lists.freedesktop.org
>Cc: Shankar, Uma <uma.shankar@intel.com>
>Subject: [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different
>encodings/ranges
>
>From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>Provide alternate versions of the fb creation functions that allow the caller to specify
>the yuv color encoding/range.
>
>Cc: Uma Shankar <uma.shankar@intel.com>
>Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>---
> lib/igt_fb.c                     | 207 +++++++++++++++++++++++++++----
> lib/igt_fb.h                     |  29 ++++-
> tests/kms_flip.c                 |   6 +-
> tests/kms_frontbuffer_tracking.c |   6 +-
> 4 files changed, 217 insertions(+), 31 deletions(-)
>
>diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 415a3d65d24b..86988d6ca805 100644
>--- a/lib/igt_fb.c
>+++ b/lib/igt_fb.c
>@@ -1415,6 +1415,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
>  * @height: height of the framebuffer in pixel
>  * @format: drm fourcc pixel format code
>  * @modifier: tiling layout of the framebuffer (as framebuffer modifier)
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+ otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>  * @fb: pointer to an #igt_fb structure
>  * @bo_size: size of the backing bo (0 for automatic size)
>  * @bo_stride: stride of the backing bo (0 for automatic stride) @@ -1432,12
>+1434,11 @@ void igt_paint_image(cairo_t *cr, const char *filename,  unsigned int
>igt_create_fb_with_bo_size(int fd, int width, int height,
> 			   uint32_t format, uint64_t modifier,
>+			   enum igt_color_encoding color_encoding,
>+			   enum igt_color_range color_range,
> 			   struct igt_fb *fb, uint64_t bo_size,
> 			   unsigned bo_stride)
> {
>-	/* FIXME allow the caller to pass these in */
>-	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
>-	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
> 	uint32_t flags = 0;
>
> 	fb_init(fb, fd, width, height, format, modifier, @@ -1471,6 +1472,38 @@
>igt_create_fb_with_bo_size(int fd, int width, int height,
> 	return fb->fb_id;
> }
>
>+/**
>+ * igt_create_fb_full:
>+ * @fd: open i915 drm file descriptor
>+ * @width: width of the framebuffer in pixel
>+ * @height: height of the framebuffer in pixel
>+ * @format: drm fourcc pixel format code
>+ * @modifier: tiling layout of the framebuffer
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>+ * @fb: pointer to an #igt_fb structure
>+ *
>+ * This function allocates a gem buffer object suitable to back a
>+framebuffer
>+ * with the requested properties and then wraps it up in a drm
>+framebuffer
>+ * object. All metadata is stored in @fb.
>+ *
>+ * The backing storage of the framebuffer is filled with all zeros,
>+i.e. black
>+ * for rgb pixel formats.
>+ *
>+ * Returns:
>+ * The kms id of the created framebuffer.
>+ */
>+unsigned int igt_create_fb_full(int fd, int width, int height,
>+				uint32_t format, uint64_t modifier,
>+				enum igt_color_encoding color_encoding,
>+				enum igt_color_range color_range,
>+				struct igt_fb *fb)
>+{
>+	return igt_create_fb_with_bo_size(fd, width, height, format, modifier,
>+					  color_encoding, color_range,
>+					  fb, 0, 0);
>+}
>+
> /**
>  * igt_create_fb:
>  * @fd: open i915 drm file descriptor
>@@ -1490,11 +1523,59 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
>  * Returns:
>  * The kms id of the created framebuffer.
>  */
>-unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
>-			   uint64_t modifier, struct igt_fb *fb)
>+unsigned int igt_create_fb(int fd, int width, int height,
>+			   uint32_t format, uint64_t modifier,
>+			   struct igt_fb *fb)
> {
>-	return igt_create_fb_with_bo_size(fd, width, height, format, modifier, fb,
>-					  0, 0);
>+	return igt_create_fb_full(fd, width, height, format, modifier,
>+				  IGT_COLOR_YCBCR_BT709,
>+				  IGT_COLOR_YCBCR_LIMITED_RANGE, fb); }
>+
>+/**
>+ * igt_create_color_fb_full:
>+ * @fd: open i915 drm file descriptor
>+ * @width: width of the framebuffer in pixel
>+ * @height: height of the framebuffer in pixel
>+ * @format: drm fourcc pixel format code
>+ * @modifier: tiling layout of the framebuffer
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>+ * @r: red value to use as fill color
>+ * @g: green value to use as fill color
>+ * @b: blue value to use as fill color
>+ * @fb: pointer to an #igt_fb structure
>+ *
>+ * This function allocates a gem buffer object suitable to back a
>+framebuffer
>+ * with the requested properties and then wraps it up in a drm
>+framebuffer
>+ * object. All metadata is stored in @fb.
>+ *
>+ * Compared to igt_create_fb() this function also fills the entire
>+framebuffer
>+ * with the given color, which is useful for some simple pipe crc based tests.
>+ *
>+ * Returns:
>+ * The kms id of the created framebuffer on success or a negative error
>+code on
>+ * failure.
>+ */
>+unsigned int igt_create_color_fb_full(int fd, int width, int height,
>+				      uint32_t format, uint64_t modifier,
>+				      enum igt_color_encoding color_encoding,
>+				      enum igt_color_range color_range,
>+				      double r, double g, double b,
>+				      struct igt_fb *fb /* out	 */)
>+{
>+	unsigned int fb_id;
>+	cairo_t *cr;
>+
>+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
>+				   color_encoding, color_range, fb);
>+	igt_assert(fb_id);
>+
>+	cr = igt_get_cairo_ctx(fd, fb);
>+	igt_paint_color(cr, 0, 0, width, height, r, g, b);
>+	igt_put_cairo_ctx(fd, fb, cr);
>+
>+	return fb_id;
> }
>
> /**
>@@ -1524,15 +1605,51 @@ unsigned int igt_create_color_fb(int fd, int width, int
>height,
> 				 uint32_t format, uint64_t modifier,
> 				 double r, double g, double b,
> 				 struct igt_fb *fb /* out */)
>+{
>+	return igt_create_color_fb_full(fd, width, height,
>+					format, modifier,
>+					IGT_COLOR_YCBCR_BT709,
>+					IGT_COLOR_YCBCR_LIMITED_RANGE,
>+					r, g, b, fb);
>+}
>+
>+/**
>+ * igt_create_pattern_fb_full:
>+ * @fd: open i915 drm file descriptor
>+ * @width: width of the framebuffer in pixel
>+ * @height: height of the framebuffer in pixel
>+ * @format: drm fourcc pixel format code
>+ * @modifier: tiling layout of the framebuffer
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>+ * @fb: pointer to an #igt_fb structure
>+ *
>+ * This function allocates a gem buffer object suitable to back a
>+framebuffer
>+ * with the requested properties and then wraps it up in a drm
>+framebuffer
>+ * object. All metadata is stored in @fb.
>+ *
>+ * Compared to igt_create_fb() this function also draws the standard
>+test pattern
>+ * into the framebuffer.
>+ *
>+ * Returns:
>+ * The kms id of the created framebuffer on success or a negative error
>+code on
>+ * failure.
>+ */
>+unsigned int igt_create_pattern_fb_full(int fd, int width, int height,
>+					uint32_t format, uint64_t modifier,
>+					enum igt_color_encoding color_encoding,
>+					enum igt_color_range color_range,
>+					struct igt_fb *fb /* out */)
> {
> 	unsigned int fb_id;
> 	cairo_t *cr;
>
>-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
>+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
>+				   color_encoding, color_range, fb);
> 	igt_assert(fb_id);
>
> 	cr = igt_get_cairo_ctx(fd, fb);
>-	igt_paint_color(cr, 0, 0, width, height, r, g, b);
>+	igt_paint_test_pattern(cr, width, height);
> 	igt_put_cairo_ctx(fd, fb, cr);
>
> 	return fb_id;
>@@ -1561,14 +1678,56 @@ unsigned int igt_create_color_fb(int fd, int width, int
>height,  unsigned int igt_create_pattern_fb(int fd, int width, int height,
> 				   uint32_t format, uint64_t modifier,
> 				   struct igt_fb *fb /* out */)
>+{
>+	return igt_create_pattern_fb_full(fd, width, height,
>+					  format, modifier,
>+					  IGT_COLOR_YCBCR_BT709,
>+					  IGT_COLOR_YCBCR_LIMITED_RANGE,
>+					  fb);
>+}
>+
>+/**
>+ * igt_create_color_pattern_fb_full:
>+ * @fd: open i915 drm file descriptor
>+ * @width: width of the framebuffer in pixel
>+ * @height: height of the framebuffer in pixel
>+ * @format: drm fourcc pixel format code
>+ * @modifier: tiling layout of the framebuffer
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>+ * @r: red value to use as fill color
>+ * @g: green value to use as fill color
>+ * @b: blue value to use as fill color
>+ * @fb: pointer to an #igt_fb structure
>+ *
>+ * This function allocates a gem buffer object suitable to back a
>+framebuffer
>+ * with the requested properties and then wraps it up in a drm
>+framebuffer
>+ * object. All metadata is stored in @fb.
>+ *
>+ * Compared to igt_create_fb() this function also fills the entire
>+framebuffer
>+ * with the given color, and then draws the standard test pattern into
>+the
>+ * framebuffer.
>+ *
>+ * Returns:
>+ * The kms id of the created framebuffer on success or a negative error
>+code on
>+ * failure.
>+ */
>+unsigned int igt_create_color_pattern_fb_full(int fd, int width, int height,
>+					      uint32_t format, uint64_t modifier,
>+					      enum igt_color_encoding
>color_encoding,
>+					      enum igt_color_range color_range,
>+					      double r, double g, double b,
>+					      struct igt_fb *fb /* out	 */)
> {
> 	unsigned int fb_id;
> 	cairo_t *cr;
>
>-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
>+	fb_id = igt_create_fb_full(fd, width, height, format, modifier,
>+				   color_encoding, color_range, fb);
> 	igt_assert(fb_id);
>
> 	cr = igt_get_cairo_ctx(fd, fb);
>+	igt_paint_color(cr, 0, 0, width, height, r, g, b);
> 	igt_paint_test_pattern(cr, width, height);
> 	igt_put_cairo_ctx(fd, fb, cr);
>
>@@ -1582,6 +1741,8 @@ unsigned int igt_create_pattern_fb(int fd, int width, int
>height,
>  * @height: height of the framebuffer in pixel
>  * @format: drm fourcc pixel format code
>  * @modifier: tiling layout of the framebuffer
>+ * @color_encoding: color encoding for YCbCr formats (ignored
>+ otherwise)
>+ * @color_range: color range for YCbCr formats (ignored otherwise)
>  * @r: red value to use as fill color
>  * @g: green value to use as fill color
>  * @b: blue value to use as fill color
>@@ -1604,18 +1765,11 @@ unsigned int igt_create_color_pattern_fb(int fd, int
>width, int height,
> 					 double r, double g, double b,
> 					 struct igt_fb *fb /* out */)
> {
>-	unsigned int fb_id;
>-	cairo_t *cr;
>-
>-	fb_id = igt_create_fb(fd, width, height, format, modifier, fb);
>-	igt_assert(fb_id);
>-
>-	cr = igt_get_cairo_ctx(fd, fb);
>-	igt_paint_color(cr, 0, 0, width, height, r, g, b);
>-	igt_paint_test_pattern(cr, width, height);
>-	igt_put_cairo_ctx(fd, fb, cr);
>-
>-	return fb_id;
>+	return igt_create_color_pattern_fb_full(fd, width, height,
>+						format, modifier,
>+						IGT_COLOR_YCBCR_BT709,
>+
>	IGT_COLOR_YCBCR_LIMITED_RANGE,
>+						r, g, b, fb);
> }
>
> /**
>@@ -1745,8 +1899,8 @@ unsigned int igt_create_stereo_fb(int drm_fd,
>drmModeModeInfo *mode,
> 	struct igt_fb fb;
>
> 	stereo_fb_layout_from_mode(&layout, mode);
>-	fb_id = igt_create_fb(drm_fd, layout.fb_width, layout.fb_height, format,
>-			      modifier, &fb);
>+	fb_id = igt_create_fb(drm_fd, layout.fb_width, layout.fb_height,
>+			      format, modifier, &fb);
> 	cr = igt_get_cairo_ctx(drm_fd, &fb);
>
> 	igt_paint_image(cr, "1080p-left.png",
>@@ -3329,7 +3483,10 @@ unsigned int igt_fb_convert_with_stride(struct igt_fb
>*dst, struct igt_fb *src,
>
> 	fb_id = igt_create_fb_with_bo_size(src->fd, src->width,
> 					   src->height, dst_fourcc,
>-					   dst_modifier, dst, 0,
>+					   dst_modifier,
>+					   IGT_COLOR_YCBCR_BT709,
>+					   IGT_COLOR_YCBCR_LIMITED_RANGE,
>+					   dst, 0,
> 					   dst_stride);
> 	igt_assert(fb_id > 0);
>
>diff --git a/lib/igt_fb.h b/lib/igt_fb.h index be786911d577..db936b1608a6 100644
>--- a/lib/igt_fb.h
>+++ b/lib/igt_fb.h
>@@ -120,17 +120,42 @@ void igt_calc_fb_size(int fd, int width, int height, uint32_t
>format, uint64_t m  unsigned int  igt_create_fb_with_bo_size(int fd, int width, int
>height,
> 			   uint32_t format, uint64_t modifier,
>+			   enum igt_color_encoding color_encoding,
>+			   enum igt_color_range color_range,
> 			   struct igt_fb *fb, uint64_t bo_size,
> 			   unsigned bo_stride);
>-unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
>-			   uint64_t modifier, struct igt_fb *fb);
>+unsigned int igt_create_fb_full(int fd, int width, int height,
>+				uint32_t format, uint64_t modifier,
>+				enum igt_color_encoding color_encoding,
>+				enum igt_color_range color_range,
>+				struct igt_fb *fb /* out */);
>+unsigned int igt_create_fb(int fd, int width, int height,
>+			   uint32_t format, uint64_t modifier,
>+			   struct igt_fb *fb /* out */);
>+unsigned int igt_create_color_fb_full(int fd, int width, int height,
>+				      uint32_t format, uint64_t modifier,
>+				      enum igt_color_encoding color_encoding,
>+				      enum igt_color_range color_range,
>+				      double r, double g, double b,
>+				      struct igt_fb *fb /* out */);

I feel the usage of some of these new helpers is limited. 
igt_create_color_fb_full is being used at just 2 instances. So I guess we
can either consolidate them or let the caller add those extra steps being done as
part of the helpers.

Will leave it your discretion. Overall the changes looks good.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> unsigned int igt_create_color_fb(int fd, int width, int height,
> 				 uint32_t format, uint64_t modifier,
> 				 double r, double g, double b,
> 				 struct igt_fb *fb /* out */);
>+unsigned int igt_create_pattern_fb_full(int fd, int width, int height,
>+					uint32_t format, uint64_t modifier,
>+					enum igt_color_encoding color_encoding,
>+					enum igt_color_range color_range,
>+					struct igt_fb *fb /* out */);
> unsigned int igt_create_pattern_fb(int fd, int width, int height,
> 				   uint32_t format, uint64_t modifier,
> 				   struct igt_fb *fb /* out */);
>+unsigned int igt_create_color_pattern_fb_full(int fd, int width, int height,
>+					      uint32_t format, uint64_t modifier,
>+					      enum igt_color_encoding
>color_encoding,
>+					      enum igt_color_range color_range,
>+					      double r, double g, double b,
>+					      struct igt_fb *fb /* out */);
> unsigned int igt_create_color_pattern_fb(int fd, int width, int height,
> 					 uint32_t format, uint64_t modifier,
> 					 double r, double g, double b,
>diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 0a8d1c55a7aa..ef2521f21a42
>100755
>--- a/tests/kms_flip.c
>+++ b/tests/kms_flip.c
>@@ -1247,8 +1247,10 @@ static void run_test_on_crtc_set(struct test_output *o,
>int *crtc_idxs,
> 					 igt_bpp_depth_to_drm_format(o->bpp, o-
>>depth),
> 					 tiling, &o->fb_info[0]);
> 	o->fb_ids[1] = igt_create_fb_with_bo_size(drm_fd, o->fb_width, o-
>>fb_height,
>-					 igt_bpp_depth_to_drm_format(o->bpp, o-
>>depth),
>-					 tiling, &o->fb_info[1], bo_size, 0);
>+						  igt_bpp_depth_to_drm_format(o-
>>bpp, o->depth),
>+						  tiling, IGT_COLOR_YCBCR_BT709,
>+
>IGT_COLOR_YCBCR_LIMITED_RANGE,
>+						  &o->fb_info[1], bo_size, 0);
>
> 	igt_assert(o->fb_ids[0]);
> 	igt_assert(o->fb_ids[1]);
>diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
>index 1037faf8e6f7..c788b59eefba 100644
>--- a/tests/kms_frontbuffer_tracking.c
>+++ b/tests/kms_frontbuffer_tracking.c
>@@ -491,8 +491,10 @@ static void create_fb(enum pixel_format pformat, int width,
>int height,
> 	igt_calc_fb_size(drm.fd, width, height, format, tiling_for_size, &size,
> 			 &stride);
>
>-	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling, fb,
>-				   size, stride);
>+	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling,
>+				   IGT_COLOR_YCBCR_BT709,
>+				   IGT_COLOR_YCBCR_LIMITED_RANGE,
>+				   fb, size, stride);
> }
>
> static uint32_t pick_color(struct igt_fb *fb, enum color ecolor)
>--
>2.21.0

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

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

* Re: [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges Ville Syrjala
@ 2019-07-02 15:09   ` Shankar, Uma
  2019-07-02 17:57   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
  1 sibling, 0 replies; 22+ messages in thread
From: Shankar, Uma @ 2019-07-02 15:09 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev



>-----Original Message-----
>From: Ville Syrjala [mailto:ville.syrjala@linux.intel.com]
>Sent: Saturday, June 29, 2019 1:15 AM
>To: igt-dev@lists.freedesktop.org
>Cc: Shankar, Uma <uma.shankar@intel.com>
>Subject: [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
>
>From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>Test all support YCbCr encoding/range combinations. So far we've only been testing
>one particular combo.

Looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Cc: Uma Shankar <uma.shankar@intel.com>
>Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>---
> tests/kms_plane.c | 153 ++++++++++++++++++++++++++++++++++++----------
> 1 file changed, 120 insertions(+), 33 deletions(-)
>
>diff --git a/tests/kms_plane.c b/tests/kms_plane.c index
>59d5f1e80cd2..13d36254dfe3 100644
>--- a/tests/kms_plane.c
>+++ b/tests/kms_plane.c
>@@ -427,15 +427,18 @@ static void test_format_plane_color(data_t *data, enum
>pipe pipe,
> 				    igt_plane_t *plane,
> 				    uint32_t format, uint64_t modifier,
> 				    int width, int height,
>+				    enum igt_color_encoding color_encoding,
>+				    enum igt_color_range color_range,
> 				    int color, igt_crc_t *crc, struct igt_fb *fb)  {
> 	const color_t *c = &colors[color];
> 	struct igt_fb old_fb = *fb;
>
> 	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
>-		igt_create_color_fb(data->drm_fd, width, height,
>-				    format, modifier,
>-				    c->red, c->green, c->blue, fb);
>+		igt_create_color_fb_full(data->drm_fd, width, height,
>+					 format, modifier,
>+					 color_encoding, color_range,
>+					 c->red, c->green, c->blue, fb);
> 	} else {
> 		/*
> 		 * paint border in inverted color, then visible area in middle @@ -
>443,11 +446,11 @@ static void test_format_plane_color(data_t *data, enum pipe
>pipe,
> 		 */
> 		cairo_t *cr;
>
>-		igt_create_fb(data->drm_fd,
>-			      width + data->crop * 2,
>-			      height + data->crop * 2,
>-			      format, modifier, fb);
>-
>+		igt_create_fb_full(data->drm_fd,
>+				   width + data->crop * 2,
>+				   height + data->crop * 2,
>+				   format, modifier,
>+				   color_encoding, color_range, fb);
> 		cr = igt_get_cairo_ctx(data->drm_fd, fb);
>
> 		igt_paint_color(cr, 0, 0,
>@@ -500,6 +503,103 @@ static int num_unique_crcs(const igt_crc_t crc[], int
>num_crc)
> 	return num_unique_crc;
> }
>
>+static bool test_format_plane_colors(data_t *data, enum pipe pipe,
>+				     igt_plane_t *plane,
>+				     uint32_t format, uint64_t modifier,
>+				     int width, int height,
>+				     enum igt_color_encoding encoding,
>+				     enum igt_color_range range,
>+				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>+				     struct igt_fb *fb)
>+{
>+	int crc_mismatch_count = 0;
>+	unsigned int crc_mismatch_mask = 0;
>+	bool result = true;
>+
>+	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
>+		igt_crc_t crc;
>+
>+		test_format_plane_color(data, pipe, plane,
>+					format, modifier,
>+					width, height,
>+					encoding, range,
>+					i, &crc, fb);
>+
>+		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
>+			crc_mismatch_count++;
>+			crc_mismatch_mask |= (1 << i);
>+			result = false;
>+		}
>+	}
>+
>+	if (crc_mismatch_count)
>+		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on
>%s.%u with %d/%d solid colors tested (0x%X)\n",
>+			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
>+			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors),
>+crc_mismatch_mask);
>+
>+	return result;
>+}
>+
>+static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
>+				  igt_plane_t *plane,
>+				  uint32_t format, uint64_t modifier,
>+				  int width, int height,
>+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>+				  struct igt_fb *fb)
>+{
>+	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on
>%s.%u\n",
>+		 IGT_FORMAT_ARGS(format), modifier,
>+		 kmstest_pipe_name(pipe), plane->index);
>+
>+	return test_format_plane_colors(data, pipe, plane,
>+					format, modifier,
>+					width, height,
>+					IGT_COLOR_YCBCR_BT601,
>+					IGT_COLOR_YCBCR_LIMITED_RANGE,
>+					ref_crc, fb);
>+}
>+
>+static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
>+				  igt_plane_t *plane,
>+				  uint32_t format, uint64_t modifier,
>+				  int width, int height,
>+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>+				  struct igt_fb *fb)
>+{
>+	bool result = true;
>+
>+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
>+		return true;
>+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
>+		return true;
>+
>+	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++)
>{
>+		if (!igt_plane_try_prop_enum(plane,
>+					     IGT_PLANE_COLOR_ENCODING,
>+					     igt_color_encoding_to_str(e)))
>+			continue;
>+
>+		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++)
>{
>+			if (!igt_plane_try_prop_enum(plane,
>+						     IGT_PLANE_COLOR_RANGE,
>+						     igt_color_range_to_str(r)))
>+				continue;
>+
>+			igt_info("Testing format " IGT_FORMAT_FMT " / modifier
>0x%" PRIx64 " (%s, %s) on %s.%u\n",
>+				 IGT_FORMAT_ARGS(format), modifier,
>+				 igt_color_encoding_to_str(e),
>+				 igt_color_range_to_str(r),
>+				 kmstest_pipe_name(pipe), plane->index);
>+			result &= test_format_plane_colors(data, pipe, plane,
>+							   format, modifier,
>+							   width, height,
>+							   e, r, ref_crc, fb);
>+		}
>+	}
>+
>+	return result;
>+}
>+
> static bool test_format_plane(data_t *data, enum pipe pipe,
> 			      igt_output_t *output, igt_plane_t *plane)  { @@ -569,6
>+669,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> 		test_format_plane_color(data, pipe, plane,
> 					format, modifier,
> 					width, height,
>+					IGT_COLOR_YCBCR_BT709,
>+					IGT_COLOR_YCBCR_LIMITED_RANGE,
> 					i, &ref_crc[i], &fb);
> 	}
>
>@@ -580,10 +682,6 @@ static bool test_format_plane(data_t *data, enum pipe
>pipe,
> 	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
>
> 	for (int i = 0; i < plane->format_mod_count; i++) {
>-		int crc_mismatch_count = 0;
>-		int crc_mismatch_mask = 0;
>-		igt_crc_t crc;
>-
> 		format = plane->formats[i];
> 		modifier = plane->modifiers[i];
>
>@@ -599,30 +697,19 @@ static bool test_format_plane(data_t *data, enum pipe
>pipe,
> 				continue;
> 		}
>
>-		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%"
>PRIx64 " on %s.%u\n",
>-			 IGT_FORMAT_ARGS(format), modifier,
>-			 kmstest_pipe_name(pipe), plane->index);
>-
>-		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
>-			test_format_plane_color(data, pipe, plane,
>-						format, modifier,
>-						width, height,
>-						j, &crc, &fb);
>-
>-			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
>-				crc_mismatch_count++;
>-				crc_mismatch_mask |= (1 << j);
>-				result = false;
>-			}
>-		}
>+		if (igt_format_is_yuv(format))
>+			result &= test_format_plane_yuv(data, pipe, plane,
>+							format, modifier,
>+							width, height,
>+							ref_crc, &fb);
>+		else
>+			result &= test_format_plane_rgb(data, pipe, plane,
>+							format, modifier,
>+							width, height,
>+							ref_crc, &fb);
>
> 		if (format == DRM_FORMAT_C8)
> 			set_legacy_lut(data, pipe, 0xfc00);
>-
>-		if (crc_mismatch_count)
>-			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT
>" on %s.%u with %d/%d solid colors tested (0x%X)\n",
>-				 IGT_FORMAT_ARGS(format),
>kmstest_pipe_name(pipe),
>-				 plane->index, crc_mismatch_count,
>(int)ARRAY_SIZE(colors), crc_mismatch_mask);
> 	}
>
> 	igt_pipe_crc_stop(data->pipe_crc);
>--
>2.21.0

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

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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-07-02 13:30     ` Ville Syrjälä
@ 2019-07-02 16:44       ` Shankar, Uma
  2019-07-02 17:04         ` Ville Syrjälä
  0 siblings, 1 reply; 22+ messages in thread
From: Shankar, Uma @ 2019-07-02 16:44 UTC (permalink / raw)
  To: Ville Syrjälä, Kazlauskas, Nicholas; +Cc: igt-dev



>-----Original Message-----
>From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
>Sent: Tuesday, July 2, 2019 7:00 PM
>To: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
>Cc: igt-dev@lists.freedesktop.org; Shankar, Uma <uma.shankar@intel.com>
>Subject: Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
>
>On Tue, Jul 02, 2019 at 01:20:47PM +0000, Kazlauskas, Nicholas wrote:
>> On 6/28/19 3:44 PM, Ville Syrjala wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > CHV pipe A/C sprites are causing a crc mismatch with BT.601 when we
>> > keep the six msbs. If we throw away one more bit we get matches for
>> > BT.601. BT.709 matches even with 6 bits, as do the pipe B planes
>> > with their programmable CSC. Also IVB and KBL were both happy with 6
>> > bits, so doesn't seem that that these CHV mismatches are due to bugs
>> > in our code, just the hw is a bit imprecise.
>> >
>> > Cc: Uma Shankar <uma.shankar@intel.com>
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> With the title of this patch corrected ("Throw away yet another bit"),
>> this series is:
>>
>> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>>
>> These patches are useful to have.
>>
>> However, I'm not sure how I feel about the naming on all of these new
>> *_full functions or if they're really all needed. I think just having
>> one function that explicitly sets all of this is probably enough
>> rather than having these 4 new functions.
>
>I suppose I could just use igt_create_fb_with_bo_size() and hand roll the solid fill in
>the test.

Yeah this sounds good. Overall this patch looks ok.
Reviewed-by: Uma Shankar <uma.shanka@intel.com>

I tested this as well on ICL and looks like below test passes without any failure:
Subtest pixel-format-pipe-A-planes: SUCCESS (423.398s)
So, 
Tested-by: Uma Shankar <uma.shankar@intel.com>

>--
>Ville Syrjälä
>Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-07-02 16:44       ` Shankar, Uma
@ 2019-07-02 17:04         ` Ville Syrjälä
  2019-07-03 12:41           ` Shankar, Uma
  0 siblings, 1 reply; 22+ messages in thread
From: Ville Syrjälä @ 2019-07-02 17:04 UTC (permalink / raw)
  To: Shankar, Uma; +Cc: igt-dev

On Tue, Jul 02, 2019 at 04:44:28PM +0000, Shankar, Uma wrote:
> 
> 
> >-----Original Message-----
> >From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> >Sent: Tuesday, July 2, 2019 7:00 PM
> >To: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
> >Cc: igt-dev@lists.freedesktop.org; Shankar, Uma <uma.shankar@intel.com>
> >Subject: Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
> >
> >On Tue, Jul 02, 2019 at 01:20:47PM +0000, Kazlauskas, Nicholas wrote:
> >> On 6/28/19 3:44 PM, Ville Syrjala wrote:
> >> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> >
> >> > CHV pipe A/C sprites are causing a crc mismatch with BT.601 when we
> >> > keep the six msbs. If we throw away one more bit we get matches for
> >> > BT.601. BT.709 matches even with 6 bits, as do the pipe B planes
> >> > with their programmable CSC. Also IVB and KBL were both happy with 6
> >> > bits, so doesn't seem that that these CHV mismatches are due to bugs
> >> > in our code, just the hw is a bit imprecise.
> >> >
> >> > Cc: Uma Shankar <uma.shankar@intel.com>
> >> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> With the title of this patch corrected ("Throw away yet another bit"),
> >> this series is:
> >>
> >> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> >>
> >> These patches are useful to have.
> >>
> >> However, I'm not sure how I feel about the naming on all of these new
> >> *_full functions or if they're really all needed. I think just having
> >> one function that explicitly sets all of this is probably enough
> >> rather than having these 4 new functions.
> >
> >I suppose I could just use igt_create_fb_with_bo_size() and hand roll the solid fill in
> >the test.
> 
> Yeah this sounds good. Overall this patch looks ok.
> Reviewed-by: Uma Shankar <uma.shanka@intel.com>
> 
> I tested this as well on ICL and looks like below test passes without any failure:
> Subtest pixel-format-pipe-A-planes: SUCCESS (423.398s)

Yeah, it already passes with the current upstream code with the wonky
icsc coefficients. Might be nice to test how many correct bits we can
get with the current vs. fixed coefficents.

> So, 
> Tested-by: Uma Shankar <uma.shankar@intel.com>
> 
> >--
> >Ville Syrjälä
> >Intel

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t v2 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
  2019-07-02 14:47   ` Shankar, Uma
@ 2019-07-02 17:56   ` Ville Syrjala
  1 sibling, 0 replies; 22+ messages in thread
From: Ville Syrjala @ 2019-07-02 17:56 UTC (permalink / raw)
  To: igt-dev

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

Pass the color encoding/range to igt_create_fb_with_bo_size()
so that tests are able to generate fbs with various encodings/ranges.

v2: Drop the _full() variants of th fb create funcs (Nicholas)

Cc: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1
Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c                     | 18 ++++++++++++------
 lib/igt_fb.h                     |  2 ++
 tests/kms_flip.c                 |  6 ++++--
 tests/kms_frontbuffer_tracking.c |  6 ++++--
 4 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 415a3d65d24b..5dc74a00089a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1415,6 +1415,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
  * @height: height of the framebuffer in pixel
  * @format: drm fourcc pixel format code
  * @modifier: tiling layout of the framebuffer (as framebuffer modifier)
+ * @color_encoding: color encoding for YCbCr formats (ignored otherwise)
+ * @color_range: color range for YCbCr formats (ignored otherwise)
  * @fb: pointer to an #igt_fb structure
  * @bo_size: size of the backing bo (0 for automatic size)
  * @bo_stride: stride of the backing bo (0 for automatic stride)
@@ -1432,12 +1434,11 @@ void igt_paint_image(cairo_t *cr, const char *filename,
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
 			   uint32_t format, uint64_t modifier,
+			   enum igt_color_encoding color_encoding,
+			   enum igt_color_range color_range,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride)
 {
-	/* FIXME allow the caller to pass these in */
-	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
-	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
 	uint32_t flags = 0;
 
 	fb_init(fb, fd, width, height, format, modifier,
@@ -1493,8 +1494,10 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
 			   uint64_t modifier, struct igt_fb *fb)
 {
-	return igt_create_fb_with_bo_size(fd, width, height, format, modifier, fb,
-					  0, 0);
+	return igt_create_fb_with_bo_size(fd, width, height, format, modifier,
+					  IGT_COLOR_YCBCR_BT709,
+					  IGT_COLOR_YCBCR_LIMITED_RANGE,
+					  fb, 0, 0);
 }
 
 /**
@@ -3329,7 +3332,10 @@ unsigned int igt_fb_convert_with_stride(struct igt_fb *dst, struct igt_fb *src,
 
 	fb_id = igt_create_fb_with_bo_size(src->fd, src->width,
 					   src->height, dst_fourcc,
-					   dst_modifier, dst, 0,
+					   dst_modifier,
+					   IGT_COLOR_YCBCR_BT709,
+					   IGT_COLOR_YCBCR_LIMITED_RANGE,
+					   dst, 0,
 					   dst_stride);
 	igt_assert(fb_id > 0);
 
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index be786911d577..e19cc5d415ef 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -120,6 +120,8 @@ void igt_calc_fb_size(int fd, int width, int height, uint32_t format, uint64_t m
 unsigned int
 igt_create_fb_with_bo_size(int fd, int width, int height,
 			   uint32_t format, uint64_t modifier,
+			   enum igt_color_encoding color_encoding,
+			   enum igt_color_range color_range,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride);
 unsigned int igt_create_fb(int fd, int width, int height, uint32_t format,
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 0a8d1c55a7aa..ef2521f21a42 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1247,8 +1247,10 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
 					 tiling, &o->fb_info[0]);
 	o->fb_ids[1] = igt_create_fb_with_bo_size(drm_fd, o->fb_width, o->fb_height,
-					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
-					 tiling, &o->fb_info[1], bo_size, 0);
+						  igt_bpp_depth_to_drm_format(o->bpp, o->depth),
+						  tiling, IGT_COLOR_YCBCR_BT709,
+						  IGT_COLOR_YCBCR_LIMITED_RANGE,
+						  &o->fb_info[1], bo_size, 0);
 
 	igt_assert(o->fb_ids[0]);
 	igt_assert(o->fb_ids[1]);
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 1037faf8e6f7..c788b59eefba 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -491,8 +491,10 @@ static void create_fb(enum pixel_format pformat, int width, int height,
 	igt_calc_fb_size(drm.fd, width, height, format, tiling_for_size, &size,
 			 &stride);
 
-	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling, fb,
-				   size, stride);
+	igt_create_fb_with_bo_size(drm.fd, width, height, format, tiling,
+				   IGT_COLOR_YCBCR_BT709,
+				   IGT_COLOR_YCBCR_LIMITED_RANGE,
+				   fb, size, stride);
 }
 
 static uint32_t pick_color(struct igt_fb *fb, enum color ecolor)
-- 
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] 22+ messages in thread

* [igt-dev] [PATCH i-g-t v2 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges Ville Syrjala
  2019-07-02 15:09   ` Shankar, Uma
@ 2019-07-02 17:57   ` Ville Syrjala
  2019-07-02 18:07     ` Kazlauskas, Nicholas
  1 sibling, 1 reply; 22+ messages in thread
From: Ville Syrjala @ 2019-07-02 17:57 UTC (permalink / raw)
  To: igt-dev

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

Test all support YCbCr encoding/range combinations. So far
we've only been testing one particular combo.

v2: Use igt_create_fb_with_bo_size() and hand roll the
    solid fills

Cc: Uma Shankar <uma.shankar@intel.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1
Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_plane.c | 164 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 129 insertions(+), 35 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 59d5f1e80cd2..ce4bf9e1c21d 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -427,27 +427,36 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
 				    igt_plane_t *plane,
 				    uint32_t format, uint64_t modifier,
 				    int width, int height,
+				    enum igt_color_encoding color_encoding,
+				    enum igt_color_range color_range,
 				    int color, igt_crc_t *crc, struct igt_fb *fb)
 {
 	const color_t *c = &colors[color];
 	struct igt_fb old_fb = *fb;
+	cairo_t *cr;
 
 	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
-		igt_create_color_fb(data->drm_fd, width, height,
-				    format, modifier,
-				    c->red, c->green, c->blue, fb);
+		igt_create_fb_with_bo_size(data->drm_fd, width, height,
+					   format, modifier, color_encoding,
+					   color_range, fb, 0, 0);
+
+		cr = igt_get_cairo_ctx(data->drm_fd, fb);
+
+		igt_paint_color(cr, 0, 0, width, height,
+				c->red, c->green, c->blue);
+
+		igt_put_cairo_ctx(data->drm_fd, fb, cr);
 	} else {
+		igt_create_fb_with_bo_size(data->drm_fd,
+					   width + data->crop * 2,
+					   height + data->crop * 2,
+					   format, modifier, color_encoding,
+					   color_range, fb, 0, 0);
+
 		/*
 		 * paint border in inverted color, then visible area in middle
 		 * with correct color for clamping test
 		 */
-		cairo_t *cr;
-
-		igt_create_fb(data->drm_fd,
-			      width + data->crop * 2,
-			      height + data->crop * 2,
-			      format, modifier, fb);
-
 		cr = igt_get_cairo_ctx(data->drm_fd, fb);
 
 		igt_paint_color(cr, 0, 0,
@@ -500,6 +509,104 @@ static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
 	return num_unique_crc;
 }
 
+static bool test_format_plane_colors(data_t *data, enum pipe pipe,
+				     igt_plane_t *plane,
+				     uint32_t format, uint64_t modifier,
+				     int width, int height,
+				     enum igt_color_encoding encoding,
+				     enum igt_color_range range,
+				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				     struct igt_fb *fb)
+{
+	int crc_mismatch_count = 0;
+	unsigned int crc_mismatch_mask = 0;
+	bool result = true;
+
+	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
+		igt_crc_t crc;
+
+		test_format_plane_color(data, pipe, plane,
+					format, modifier,
+					width, height,
+					encoding, range,
+					i, &crc, fb);
+
+		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
+			crc_mismatch_count++;
+			crc_mismatch_mask |= (1 << i);
+			result = false;
+		}
+	}
+
+	if (crc_mismatch_count)
+		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
+			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
+			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
+
+	return result;
+}
+
+static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
+				  igt_plane_t *plane,
+				  uint32_t format, uint64_t modifier,
+				  int width, int height,
+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				  struct igt_fb *fb)
+{
+	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
+		 IGT_FORMAT_ARGS(format), modifier,
+		 kmstest_pipe_name(pipe), plane->index);
+
+	return test_format_plane_colors(data, pipe, plane,
+					format, modifier,
+					width, height,
+					IGT_COLOR_YCBCR_BT601,
+					IGT_COLOR_YCBCR_LIMITED_RANGE,
+					ref_crc, fb);
+}
+
+static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
+				  igt_plane_t *plane,
+				  uint32_t format, uint64_t modifier,
+				  int width, int height,
+				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
+				  struct igt_fb *fb)
+{
+	bool result = true;
+
+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
+		return true;
+	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
+		return true;
+
+	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++) {
+		if (!igt_plane_try_prop_enum(plane,
+					     IGT_PLANE_COLOR_ENCODING,
+					     igt_color_encoding_to_str(e)))
+			continue;
+
+		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++) {
+			if (!igt_plane_try_prop_enum(plane,
+						     IGT_PLANE_COLOR_RANGE,
+						     igt_color_range_to_str(r)))
+				continue;
+
+			igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " (%s, %s) on %s.%u\n",
+				 IGT_FORMAT_ARGS(format), modifier,
+				 igt_color_encoding_to_str(e),
+				 igt_color_range_to_str(r),
+				 kmstest_pipe_name(pipe), plane->index);
+
+			result &= test_format_plane_colors(data, pipe, plane,
+							   format, modifier,
+							   width, height,
+							   e, r, ref_crc, fb);
+		}
+	}
+
+	return result;
+}
+
 static bool test_format_plane(data_t *data, enum pipe pipe,
 			      igt_output_t *output, igt_plane_t *plane)
 {
@@ -569,6 +676,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 		test_format_plane_color(data, pipe, plane,
 					format, modifier,
 					width, height,
+					IGT_COLOR_YCBCR_BT709,
+					IGT_COLOR_YCBCR_LIMITED_RANGE,
 					i, &ref_crc[i], &fb);
 	}
 
@@ -580,10 +689,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
 
 	for (int i = 0; i < plane->format_mod_count; i++) {
-		int crc_mismatch_count = 0;
-		int crc_mismatch_mask = 0;
-		igt_crc_t crc;
-
 		format = plane->formats[i];
 		modifier = plane->modifiers[i];
 
@@ -599,30 +704,19 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
 				continue;
 		}
 
-		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
-			 IGT_FORMAT_ARGS(format), modifier,
-			 kmstest_pipe_name(pipe), plane->index);
-
-		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
-			test_format_plane_color(data, pipe, plane,
-						format, modifier,
-						width, height,
-						j, &crc, &fb);
-
-			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
-				crc_mismatch_count++;
-				crc_mismatch_mask |= (1 << j);
-				result = false;
-			}
-		}
+		if (igt_format_is_yuv(format))
+			result &= test_format_plane_yuv(data, pipe, plane,
+							format, modifier,
+							width, height,
+							ref_crc, &fb);
+		else
+			result &= test_format_plane_rgb(data, pipe, plane,
+							format, modifier,
+							width, height,
+							ref_crc, &fb);
 
 		if (format == DRM_FORMAT_C8)
 			set_legacy_lut(data, pipe, 0xfc00);
-
-		if (crc_mismatch_count)
-			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
-				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
-				 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
 	}
 
 	igt_pipe_crc_stop(data->pipe_crc);
-- 
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] 22+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for Test all YCbCr encodings/ranges (rev2)
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (4 preceding siblings ...)
  2019-06-29  9:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-07-02 17:57 ` Patchwork
  2019-07-02 18:08 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-07-02 17:57 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges (rev2)
URL   : https://patchwork.freedesktop.org/series/62963/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
873df2fa9e8f5fd02d4532b30ef2579f4fe4f27f i915: Fix gem_context_has_engine_map() for older kernels

[43/653] Linking target tests/drm_mm.
[44/653] Linking target tests/drm_read.
[45/653] Linking target tests/kms_3d.
[46/653] Linking target tests/gem_exec_fence.
[47/653] Linking target tests/gem_exec_faulting_reloc.
[48/653] Linking target tests/kms_atomic.
[49/653] Linking target tests/kms_atomic_transition.
[50/653] Linking target tests/kms_plane_alpha_blend.
[51/653] Linking target tests/kms_atomic_interruptible.
[52/653] Linking target tests/kms_available_modes_crc.
[53/653] Linking target tests/kms_ccs.
[54/653] Linking target tests/kms_big_fb.
[55/653] Linking target tests/kms_busy.
[56/653] Linking target tests/kms_color.
[57/653] Linking target tests/kms_cursor_legacy.
[58/653] Linking target tests/kms_content_protection.
[59/653] Linking target tests/kms_concurrent.
[60/653] Linking target tests/kms_crtc_background_color.
[61/653] Linking target tests/kms_cursor_crc.
[62/653] Linking target tests/kms_cursor_edge_walk.
[63/653] Linking target tests/kms_fbcon_fbt.
[64/653] Linking target tests/kms_dp_dsc.
[65/653] Linking target tests/kms_draw_crc.
[66/653] Linking target tests/kms_force_connector_basic.
[67/653] Linking target tests/kms_flip.
[68/653] Linking target tests/kms_fence_pin_leak.
[69/653] Linking target tests/kms_flip_event_leak.
[70/653] Linking target tests/kms_frontbuffer_tracking.
[71/653] Linking target tests/kms_flip_tiling.
[72/653] Linking target tests/kms_hdmi_inject.
[73/653] Linking target tests/kms_getfb.
[74/653] Linking target tests/kms_invalid_dotclock.
[75/653] Linking target tests/kms_lease.
[76/653] Linking target tests/kms_panel_fitting.
[77/653] Compiling C object 'tests/tests@@kms_plane@exe/kms_plane.c.o'.
FAILED: tests/tests@@kms_plane@exe/kms_plane.c.o 
ccache cc -Itests/tests@@kms_plane@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/igt/include -I/opt/igt/include/libdrm -I/usr/include/x86_64-linux-gnu -I/usr/include/alsa -I/usr/include -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -pthread  -MD -MQ 'tests/tests@@kms_plane@exe/kms_plane.c.o' -MF 'tests/tests@@kms_plane@exe/kms_plane.c.o.d' -o 'tests/tests@@kms_plane@exe/kms_plane.c.o' -c ../tests/kms_plane.c
../tests/kms_plane.c: In function ‘test_format_plane_color’:
../tests/kms_plane.c:445:3: error: implicit declaration of function ‘igt_create_color_fb_full’; did you mean ‘igt_create_color_fb’? [-Werror=implicit-function-declaration]
   igt_create_color_fb_full(data->drm_fd, width, height,
   ^~~~~~~~~~~~~~~~~~~~~~~~
   igt_create_color_fb
../tests/kms_plane.c:445:3: warning: nested extern declaration of ‘igt_create_color_fb_full’ [-Wnested-externs]
../tests/kms_plane.c:456:3: error: implicit declaration of function ‘igt_create_fb_full’; did you mean ‘igt_create_fb’? [-Werror=implicit-function-declaration]
   igt_create_fb_full(data->drm_fd,
   ^~~~~~~~~~~~~~~~~~
   igt_create_fb
../tests/kms_plane.c:456:3: warning: nested extern declaration of ‘igt_create_fb_full’ [-Wnested-externs]
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.

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

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

* Re: [igt-dev] [PATCH i-g-t v2 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-07-02 17:57   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
@ 2019-07-02 18:07     ` Kazlauskas, Nicholas
  2019-07-03 17:12       ` Ville Syrjälä
  0 siblings, 1 reply; 22+ messages in thread
From: Kazlauskas, Nicholas @ 2019-07-02 18:07 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev

On 7/2/19 1:57 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Test all support YCbCr encoding/range combinations. So far
> we've only been testing one particular combo.
> 
> v2: Use igt_create_fb_with_bo_size() and hand roll the
>      solid fills
> 
> Cc: Uma Shankar <uma.shankar@intel.com>
> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1
> Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   tests/kms_plane.c | 164 ++++++++++++++++++++++++++++++++++++----------
>   1 file changed, 129 insertions(+), 35 deletions(-)
> 
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 59d5f1e80cd2..ce4bf9e1c21d 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -427,27 +427,36 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
>   				    igt_plane_t *plane,
>   				    uint32_t format, uint64_t modifier,
>   				    int width, int height,
> +				    enum igt_color_encoding color_encoding,
> +				    enum igt_color_range color_range,
>   				    int color, igt_crc_t *crc, struct igt_fb *fb)
>   {
>   	const color_t *c = &colors[color];
>   	struct igt_fb old_fb = *fb;
> +	cairo_t *cr;
>   
>   	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
> -		igt_create_color_fb(data->drm_fd, width, height,
> -				    format, modifier,
> -				    c->red, c->green, c->blue, fb);
> +		igt_create_fb_with_bo_size(data->drm_fd, width, height,
> +					   format, modifier, color_encoding,
> +					   color_range, fb, 0, 0);
> +
> +		cr = igt_get_cairo_ctx(data->drm_fd, fb);
> +
> +		igt_paint_color(cr, 0, 0, width, height,
> +				c->red, c->green, c->blue);
> +
> +		igt_put_cairo_ctx(data->drm_fd, fb, cr);
>   	} else {
> +		igt_create_fb_with_bo_size(data->drm_fd,
> +					   width + data->crop * 2,
> +					   height + data->crop * 2,
> +					   format, modifier, color_encoding,
> +					   color_range, fb, 0, 0);
> +
>   		/*
>   		 * paint border in inverted color, then visible area in middle
>   		 * with correct color for clamping test
>   		 */
> -		cairo_t *cr;
> -
> -		igt_create_fb(data->drm_fd,
> -			      width + data->crop * 2,
> -			      height + data->crop * 2,
> -			      format, modifier, fb);
> -
>   		cr = igt_get_cairo_ctx(data->drm_fd, fb);
>   
>   		igt_paint_color(cr, 0, 0,
> @@ -500,6 +509,104 @@ static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
>   	return num_unique_crc;
>   }
>   
> +static bool test_format_plane_colors(data_t *data, enum pipe pipe,
> +				     igt_plane_t *plane,
> +				     uint32_t format, uint64_t modifier,
> +				     int width, int height,
> +				     enum igt_color_encoding encoding,
> +				     enum igt_color_range range,
> +				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> +				     struct igt_fb *fb)
> +{
> +	int crc_mismatch_count = 0;
> +	unsigned int crc_mismatch_mask = 0;
> +	bool result = true;
> +
> +	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
> +		igt_crc_t crc;
> +
> +		test_format_plane_color(data, pipe, plane,
> +					format, modifier,
> +					width, height,
> +					encoding, range,
> +					i, &crc, fb);
> +
> +		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
> +			crc_mismatch_count++;
> +			crc_mismatch_mask |= (1 << i);
> +			result = false;
> +		}
> +	}
> +
> +	if (crc_mismatch_count)
> +		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
> +			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
> +			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
> +
> +	return result;
> +}
> +
> +static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
> +				  igt_plane_t *plane,
> +				  uint32_t format, uint64_t modifier,
> +				  int width, int height,
> +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> +				  struct igt_fb *fb)
> +{
> +	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
> +		 IGT_FORMAT_ARGS(format), modifier,
> +		 kmstest_pipe_name(pipe), plane->index);
> +
> +	return test_format_plane_colors(data, pipe, plane,
> +					format, modifier,
> +					width, height,
> +					IGT_COLOR_YCBCR_BT601,
> +					IGT_COLOR_YCBCR_LIMITED_RANGE,
> +					ref_crc, fb);
> +}
> +
> +static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
> +				  igt_plane_t *plane,
> +				  uint32_t format, uint64_t modifier,
> +				  int width, int height,
> +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> +				  struct igt_fb *fb)
> +{
> +	bool result = true;
> +
> +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
> +		return true;
> +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
> +		return true;

Skimmed over this in my first pass.

Do we really want to be returning true here if the driver doesn't 
support encoding/range? It's probably not a good idea to really expose 
YUV formats with them so it might be best to just assert here instead.

The rest of P1+P2 lgtm. I don't see P3 but that still only needs the 
title fix.

Nicholas Kazlauskas

> +
> +	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++) {
> +		if (!igt_plane_try_prop_enum(plane,
> +					     IGT_PLANE_COLOR_ENCODING,
> +					     igt_color_encoding_to_str(e)))
> +			continue;
> +
> +		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++) {
> +			if (!igt_plane_try_prop_enum(plane,
> +						     IGT_PLANE_COLOR_RANGE,
> +						     igt_color_range_to_str(r)))
> +				continue;
> +
> +			igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " (%s, %s) on %s.%u\n",
> +				 IGT_FORMAT_ARGS(format), modifier,
> +				 igt_color_encoding_to_str(e),
> +				 igt_color_range_to_str(r),
> +				 kmstest_pipe_name(pipe), plane->index);
> +
> +			result &= test_format_plane_colors(data, pipe, plane,
> +							   format, modifier,
> +							   width, height,
> +							   e, r, ref_crc, fb);
> +		}
> +	}
> +
> +	return result;
> +}
> +
>   static bool test_format_plane(data_t *data, enum pipe pipe,
>   			      igt_output_t *output, igt_plane_t *plane)
>   {
> @@ -569,6 +676,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>   		test_format_plane_color(data, pipe, plane,
>   					format, modifier,
>   					width, height,
> +					IGT_COLOR_YCBCR_BT709,
> +					IGT_COLOR_YCBCR_LIMITED_RANGE,
>   					i, &ref_crc[i], &fb);
>   	}
>   
> @@ -580,10 +689,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>   	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
>   
>   	for (int i = 0; i < plane->format_mod_count; i++) {
> -		int crc_mismatch_count = 0;
> -		int crc_mismatch_mask = 0;
> -		igt_crc_t crc;
> -
>   		format = plane->formats[i];
>   		modifier = plane->modifiers[i];
>   
> @@ -599,30 +704,19 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>   				continue;
>   		}
>   
> -		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
> -			 IGT_FORMAT_ARGS(format), modifier,
> -			 kmstest_pipe_name(pipe), plane->index);
> -
> -		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
> -			test_format_plane_color(data, pipe, plane,
> -						format, modifier,
> -						width, height,
> -						j, &crc, &fb);
> -
> -			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
> -				crc_mismatch_count++;
> -				crc_mismatch_mask |= (1 << j);
> -				result = false;
> -			}
> -		}
> +		if (igt_format_is_yuv(format))
> +			result &= test_format_plane_yuv(data, pipe, plane,
> +							format, modifier,
> +							width, height,
> +							ref_crc, &fb);
> +		else
> +			result &= test_format_plane_rgb(data, pipe, plane,
> +							format, modifier,
> +							width, height,
> +							ref_crc, &fb);
>   
>   		if (format == DRM_FORMAT_C8)
>   			set_legacy_lut(data, pipe, 0xfc00);
> -
> -		if (crc_mismatch_count)
> -			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
> -				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
> -				 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
>   	}
>   
>   	igt_pipe_crc_stop(data->pipe_crc);
> 

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

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

* [igt-dev] ✗ GitLab.Pipeline: warning for Test all YCbCr encodings/ranges (rev2)
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (5 preceding siblings ...)
  2019-07-02 17:57 ` [igt-dev] ✗ Fi.CI.BAT: failure for Test all YCbCr encodings/ranges (rev2) Patchwork
@ 2019-07-02 18:08 ` Patchwork
  2019-07-02 18:28 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges (rev3) Patchwork
  2019-07-03 16:53 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-07-02 18:08 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges (rev2)
URL   : https://patchwork.freedesktop.org/series/62963/
State : warning

== Summary ==

Pipeline status: FAILED.

See https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/46178 for more details.

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/46178
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges (rev3)
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (6 preceding siblings ...)
  2019-07-02 18:08 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
@ 2019-07-02 18:28 ` Patchwork
  2019-07-03 16:53 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-07-02 18:28 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges (rev3)
URL   : https://patchwork.freedesktop.org/series/62963/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6396 -> IGTPW_3227
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/62963/revisions/3/mbox/

Known issues
------------

  Here are the changes found in IGTPW_3227 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_cpu_reloc@basic:
    - fi-icl-u3:          [PASS][1] -> [DMESG-WARN][2] ([fdo#107724])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-icl-u3/igt@gem_cpu_reloc@basic.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-icl-u3/igt@gem_cpu_reloc@basic.html

  * igt@i915_module_load@reload:
    - fi-blb-e6850:       [PASS][3] -> [INCOMPLETE][4] ([fdo#107718])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-blb-e6850/igt@i915_module_load@reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-blb-e6850/igt@i915_module_load@reload.html

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-r:           [PASS][5] -> [DMESG-WARN][6] ([fdo#111012])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-kbl-r/igt@i915_pm_rpm@module-reload.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-kbl-r/igt@i915_pm_rpm@module-reload.html

  
#### Possible fixes ####

  * igt@gem_basic@create-close:
    - fi-icl-u3:          [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-icl-u3/igt@gem_basic@create-close.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-icl-u3/igt@gem_basic@create-close.html

  * igt@gem_ctx_create@basic-files:
    - fi-icl-dsi:         [INCOMPLETE][9] ([fdo#107713] / [fdo#109100]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-icl-dsi/igt@gem_ctx_create@basic-files.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-icl-dsi/igt@gem_ctx_create@basic-files.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][11] ([fdo#109485]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
  [fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
  [fdo#111012]: https://bugs.freedesktop.org/show_bug.cgi?id=111012


Participating hosts (56 -> 47)
------------------------------

  Missing    (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-icl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * IGT: IGT_5079 -> IGTPW_3227

  CI_DRM_6396: f6747e7cc19107131922db8fdeabc6c09d812300 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3227: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/
  IGT_5079: 873df2fa9e8f5fd02d4532b30ef2579f4fe4f27f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
  2019-07-02 17:04         ` Ville Syrjälä
@ 2019-07-03 12:41           ` Shankar, Uma
  0 siblings, 0 replies; 22+ messages in thread
From: Shankar, Uma @ 2019-07-03 12:41 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev



>-----Original Message-----
>From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
>Sent: Tuesday, July 2, 2019 10:35 PM
>To: Shankar, Uma <uma.shankar@intel.com>
>Cc: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; igt-
>dev@lists.freedesktop.org
>Subject: Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi
>
>On Tue, Jul 02, 2019 at 04:44:28PM +0000, Shankar, Uma wrote:
>>
>>
>> >-----Original Message-----
>> >From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
>> >Sent: Tuesday, July 2, 2019 7:00 PM
>> >To: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>
>> >Cc: igt-dev@lists.freedesktop.org; Shankar, Uma
>> ><uma.shankar@intel.com>
>> >Subject: Re: [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away
>> >yet another bi
>> >
>> >On Tue, Jul 02, 2019 at 01:20:47PM +0000, Kazlauskas, Nicholas wrote:
>> >> On 6/28/19 3:44 PM, Ville Syrjala wrote:
>> >> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >> >
>> >> > CHV pipe A/C sprites are causing a crc mismatch with BT.601 when
>> >> > we keep the six msbs. If we throw away one more bit we get
>> >> > matches for BT.601. BT.709 matches even with 6 bits, as do the
>> >> > pipe B planes with their programmable CSC. Also IVB and KBL were
>> >> > both happy with 6 bits, so doesn't seem that that these CHV
>> >> > mismatches are due to bugs in our code, just the hw is a bit imprecise.
>> >> >
>> >> > Cc: Uma Shankar <uma.shankar@intel.com>
>> >> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >>
>> >> With the title of this patch corrected ("Throw away yet another
>> >> bit"), this series is:
>> >>
>> >> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
>> >>
>> >> These patches are useful to have.
>> >>
>> >> However, I'm not sure how I feel about the naming on all of these
>> >> new *_full functions or if they're really all needed. I think just
>> >> having one function that explicitly sets all of this is probably
>> >> enough rather than having these 4 new functions.
>> >
>> >I suppose I could just use igt_create_fb_with_bo_size() and hand roll
>> >the solid fill in the test.
>>
>> Yeah this sounds good. Overall this patch looks ok.
>> Reviewed-by: Uma Shankar <uma.shanka@intel.com>
>>
>> I tested this as well on ICL and looks like below test passes without any failure:
>> Subtest pixel-format-pipe-A-planes: SUCCESS (423.398s)
>
>Yeah, it already passes with the current upstream code with the wonky icsc
>coefficients. Might be nice to test how many correct bits we can get with the current
>vs. fixed coefficents.

Tried with below series:
https://patchwork.freedesktop.org/series/60480/

which has fixes for the coefficients.  I can see the tests passing still with the current IGT changes
introduced in this series.

There are some known limitations if we go for testing with 4K where I see some flips getting rejected
due to hardware limitations. For testing limited it to 1024x768 (1920x1080 as well should be fine I guess).

>> So,
>> Tested-by: Uma Shankar <uma.shankar@intel.com>
>>
>> >--
>> >Ville Syrjälä
>> >Intel
>
>--
>Ville Syrjälä
>Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for Test all YCbCr encodings/ranges (rev3)
  2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
                   ` (7 preceding siblings ...)
  2019-07-02 18:28 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges (rev3) Patchwork
@ 2019-07-03 16:53 ` Patchwork
  8 siblings, 0 replies; 22+ messages in thread
From: Patchwork @ 2019-07-03 16:53 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

== Series Details ==

Series: Test all YCbCr encodings/ranges (rev3)
URL   : https://patchwork.freedesktop.org/series/62963/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6396_full -> IGTPW_3227_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_3227_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_3227_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/62963/revisions/3/mbox/

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_3227_full:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_eio@reset-stress:
    - shard-apl:          [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-apl5/igt@gem_eio@reset-stress.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-apl4/igt@gem_eio@reset-stress.html

  
Known issues
------------

  Here are the changes found in IGTPW_3227_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@kms_cursor_legacy@cursor-vs-flip-toggle:
    - shard-hsw:          [PASS][3] -> [FAIL][4] ([fdo#103355])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-hsw4/igt@kms_cursor_legacy@cursor-vs-flip-toggle.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-hsw8/igt@kms_cursor_legacy@cursor-vs-flip-toggle.html

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          [PASS][5] -> [FAIL][6] ([fdo#105363])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-glk1/igt@kms_flip@flip-vs-expired-vblank.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-glk6/igt@kms_flip@flip-vs-expired-vblank.html

  * igt@kms_flip@flip-vs-suspend:
    - shard-kbl:          [PASS][7] -> [INCOMPLETE][8] ([fdo#103665])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-kbl1/igt@kms_flip@flip-vs-suspend.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-kbl2/igt@kms_flip@flip-vs-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-pwrite:
    - shard-iclb:         [PASS][9] -> [FAIL][10] ([fdo#103167]) +3 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-pwrite.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-pwrite.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-apl:          [PASS][11] -> [DMESG-WARN][12] ([fdo#108566]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-apl8/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-apl3/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [PASS][13] -> [FAIL][14] ([fdo#103166])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb7/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [PASS][15] -> [SKIP][16] ([fdo#109642])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb2/igt@kms_psr2_su@frontbuffer.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb1/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@no_drrs:
    - shard-iclb:         [PASS][17] -> [FAIL][18] ([fdo#108341])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb8/igt@kms_psr@no_drrs.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb1/igt@kms_psr@no_drrs.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [PASS][19] -> [SKIP][20] ([fdo#109441]) +3 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb6/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [PASS][21] -> [FAIL][22] ([fdo#99912])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-kbl3/igt@kms_setmode@basic.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-kbl6/igt@kms_setmode@basic.html

  * igt@perf@blocking:
    - shard-iclb:         [PASS][23] -> [FAIL][24] ([fdo#110728])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb2/igt@perf@blocking.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb8/igt@perf@blocking.html

  
#### Possible fixes ####

  * igt@gem_eio@in-flight-suspend:
    - shard-apl:          [DMESG-WARN][25] ([fdo#108566]) -> [PASS][26] +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-apl4/igt@gem_eio@in-flight-suspend.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-apl5/igt@gem_eio@in-flight-suspend.html

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          [FAIL][27] ([fdo#109661]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-snb1/igt@gem_eio@unwedge-stress.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-snb6/igt@gem_eio@unwedge-stress.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-apl:          [DMESG-WARN][29] ([fdo#108686]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-apl2/igt@gem_tiled_swapping@non-threaded.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-apl8/igt@gem_tiled_swapping@non-threaded.html

  * igt@i915_pm_rpm@i2c:
    - shard-hsw:          [FAIL][31] ([fdo#104097]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-hsw4/igt@i915_pm_rpm@i2c.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-hsw7/igt@i915_pm_rpm@i2c.html

  * igt@kms_color@pipe-b-degamma:
    - shard-kbl:          [FAIL][33] ([fdo#104782]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-kbl1/igt@kms_color@pipe-b-degamma.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-kbl2/igt@kms_color@pipe-b-degamma.html
    - shard-apl:          [FAIL][35] ([fdo#104782]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-apl7/igt@kms_color@pipe-b-degamma.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-apl8/igt@kms_color@pipe-b-degamma.html
    - shard-glk:          [FAIL][37] ([fdo#104782]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-glk9/igt@kms_color@pipe-b-degamma.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-glk7/igt@kms_color@pipe-b-degamma.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-random:
    - shard-hsw:          [INCOMPLETE][39] ([fdo#103540]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-hsw7/igt@kms_cursor_crc@pipe-a-cursor-64x64-random.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-hsw5/igt@kms_cursor_crc@pipe-a-cursor-64x64-random.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-mmap-wc:
    - shard-iclb:         [INCOMPLETE][41] ([fdo#106978] / [fdo#107713]) -> [PASS][42]
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-mmap-wc.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
    - shard-iclb:         [FAIL][43] ([fdo#103167]) -> [PASS][44] +1 similar issue
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [SKIP][45] ([fdo#109642]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb6/igt@kms_psr2_su@page_flip.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb2/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_no_drrs:
    - shard-iclb:         [SKIP][47] ([fdo#109441]) -> [PASS][48] +3 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb5/igt@kms_psr@psr2_no_drrs.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb2/igt@kms_psr@psr2_no_drrs.html

  
#### Warnings ####

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [DMESG-WARN][49] ([fdo#107724]) -> [SKIP][50] ([fdo#109349])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6396/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/shard-iclb3/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
  [fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
  [fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (10 -> 6)
------------------------------

  Missing    (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005 


Build changes
-------------

  * IGT: IGT_5079 -> IGTPW_3227
  * Piglit: piglit_4509 -> None

  CI_DRM_6396: f6747e7cc19107131922db8fdeabc6c09d812300 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_3227: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/
  IGT_5079: 873df2fa9e8f5fd02d4532b30ef2579f4fe4f27f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3227/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-07-02 18:07     ` Kazlauskas, Nicholas
@ 2019-07-03 17:12       ` Ville Syrjälä
  2019-07-03 18:01         ` Kazlauskas, Nicholas
  0 siblings, 1 reply; 22+ messages in thread
From: Ville Syrjälä @ 2019-07-03 17:12 UTC (permalink / raw)
  To: Kazlauskas, Nicholas; +Cc: igt-dev

On Tue, Jul 02, 2019 at 06:07:24PM +0000, Kazlauskas, Nicholas wrote:
> On 7/2/19 1:57 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Test all support YCbCr encoding/range combinations. So far
> > we've only been testing one particular combo.
> > 
> > v2: Use igt_create_fb_with_bo_size() and hand roll the
> >      solid fills
> > 
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1
> > Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   tests/kms_plane.c | 164 ++++++++++++++++++++++++++++++++++++----------
> >   1 file changed, 129 insertions(+), 35 deletions(-)
> > 
> > diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> > index 59d5f1e80cd2..ce4bf9e1c21d 100644
> > --- a/tests/kms_plane.c
> > +++ b/tests/kms_plane.c
> > @@ -427,27 +427,36 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
> >   				    igt_plane_t *plane,
> >   				    uint32_t format, uint64_t modifier,
> >   				    int width, int height,
> > +				    enum igt_color_encoding color_encoding,
> > +				    enum igt_color_range color_range,
> >   				    int color, igt_crc_t *crc, struct igt_fb *fb)
> >   {
> >   	const color_t *c = &colors[color];
> >   	struct igt_fb old_fb = *fb;
> > +	cairo_t *cr;
> >   
> >   	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
> > -		igt_create_color_fb(data->drm_fd, width, height,
> > -				    format, modifier,
> > -				    c->red, c->green, c->blue, fb);
> > +		igt_create_fb_with_bo_size(data->drm_fd, width, height,
> > +					   format, modifier, color_encoding,
> > +					   color_range, fb, 0, 0);
> > +
> > +		cr = igt_get_cairo_ctx(data->drm_fd, fb);
> > +
> > +		igt_paint_color(cr, 0, 0, width, height,
> > +				c->red, c->green, c->blue);
> > +
> > +		igt_put_cairo_ctx(data->drm_fd, fb, cr);
> >   	} else {
> > +		igt_create_fb_with_bo_size(data->drm_fd,
> > +					   width + data->crop * 2,
> > +					   height + data->crop * 2,
> > +					   format, modifier, color_encoding,
> > +					   color_range, fb, 0, 0);
> > +
> >   		/*
> >   		 * paint border in inverted color, then visible area in middle
> >   		 * with correct color for clamping test
> >   		 */
> > -		cairo_t *cr;
> > -
> > -		igt_create_fb(data->drm_fd,
> > -			      width + data->crop * 2,
> > -			      height + data->crop * 2,
> > -			      format, modifier, fb);
> > -
> >   		cr = igt_get_cairo_ctx(data->drm_fd, fb);
> >   
> >   		igt_paint_color(cr, 0, 0,
> > @@ -500,6 +509,104 @@ static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
> >   	return num_unique_crc;
> >   }
> >   
> > +static bool test_format_plane_colors(data_t *data, enum pipe pipe,
> > +				     igt_plane_t *plane,
> > +				     uint32_t format, uint64_t modifier,
> > +				     int width, int height,
> > +				     enum igt_color_encoding encoding,
> > +				     enum igt_color_range range,
> > +				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> > +				     struct igt_fb *fb)
> > +{
> > +	int crc_mismatch_count = 0;
> > +	unsigned int crc_mismatch_mask = 0;
> > +	bool result = true;
> > +
> > +	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
> > +		igt_crc_t crc;
> > +
> > +		test_format_plane_color(data, pipe, plane,
> > +					format, modifier,
> > +					width, height,
> > +					encoding, range,
> > +					i, &crc, fb);
> > +
> > +		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
> > +			crc_mismatch_count++;
> > +			crc_mismatch_mask |= (1 << i);
> > +			result = false;
> > +		}
> > +	}
> > +
> > +	if (crc_mismatch_count)
> > +		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
> > +			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
> > +			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
> > +
> > +	return result;
> > +}
> > +
> > +static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
> > +				  igt_plane_t *plane,
> > +				  uint32_t format, uint64_t modifier,
> > +				  int width, int height,
> > +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> > +				  struct igt_fb *fb)
> > +{
> > +	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
> > +		 IGT_FORMAT_ARGS(format), modifier,
> > +		 kmstest_pipe_name(pipe), plane->index);
> > +
> > +	return test_format_plane_colors(data, pipe, plane,
> > +					format, modifier,
> > +					width, height,
> > +					IGT_COLOR_YCBCR_BT601,
> > +					IGT_COLOR_YCBCR_LIMITED_RANGE,
> > +					ref_crc, fb);
> > +}
> > +
> > +static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
> > +				  igt_plane_t *plane,
> > +				  uint32_t format, uint64_t modifier,
> > +				  int width, int height,
> > +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
> > +				  struct igt_fb *fb)
> > +{
> > +	bool result = true;
> > +
> > +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
> > +		return true;
> > +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
> > +		return true;
> 
> Skimmed over this in my first pass.
> 
> Do we really want to be returning true here if the driver doesn't 
> support encoding/range? It's probably not a good idea to really expose 
> YUV formats with them so it might be best to just assert here instead.

I suspect there are still quite a few drivers that don't expose
these props. Asserting/skipping here would mean skipping the entire
subtest which is not so great. So IMO better to just skip the YUV
formats.

> 
> The rest of P1+P2 lgtm. I don't see P3 but that still only needs the 
> title fix.
> 
> Nicholas Kazlauskas
> 
> > +
> > +	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++) {
> > +		if (!igt_plane_try_prop_enum(plane,
> > +					     IGT_PLANE_COLOR_ENCODING,
> > +					     igt_color_encoding_to_str(e)))
> > +			continue;
> > +
> > +		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++) {
> > +			if (!igt_plane_try_prop_enum(plane,
> > +						     IGT_PLANE_COLOR_RANGE,
> > +						     igt_color_range_to_str(r)))
> > +				continue;
> > +
> > +			igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " (%s, %s) on %s.%u\n",
> > +				 IGT_FORMAT_ARGS(format), modifier,
> > +				 igt_color_encoding_to_str(e),
> > +				 igt_color_range_to_str(r),
> > +				 kmstest_pipe_name(pipe), plane->index);
> > +
> > +			result &= test_format_plane_colors(data, pipe, plane,
> > +							   format, modifier,
> > +							   width, height,
> > +							   e, r, ref_crc, fb);
> > +		}
> > +	}
> > +
> > +	return result;
> > +}
> > +
> >   static bool test_format_plane(data_t *data, enum pipe pipe,
> >   			      igt_output_t *output, igt_plane_t *plane)
> >   {
> > @@ -569,6 +676,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> >   		test_format_plane_color(data, pipe, plane,
> >   					format, modifier,
> >   					width, height,
> > +					IGT_COLOR_YCBCR_BT709,
> > +					IGT_COLOR_YCBCR_LIMITED_RANGE,
> >   					i, &ref_crc[i], &fb);
> >   	}
> >   
> > @@ -580,10 +689,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> >   	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
> >   
> >   	for (int i = 0; i < plane->format_mod_count; i++) {
> > -		int crc_mismatch_count = 0;
> > -		int crc_mismatch_mask = 0;
> > -		igt_crc_t crc;
> > -
> >   		format = plane->formats[i];
> >   		modifier = plane->modifiers[i];
> >   
> > @@ -599,30 +704,19 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> >   				continue;
> >   		}
> >   
> > -		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
> > -			 IGT_FORMAT_ARGS(format), modifier,
> > -			 kmstest_pipe_name(pipe), plane->index);
> > -
> > -		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
> > -			test_format_plane_color(data, pipe, plane,
> > -						format, modifier,
> > -						width, height,
> > -						j, &crc, &fb);
> > -
> > -			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
> > -				crc_mismatch_count++;
> > -				crc_mismatch_mask |= (1 << j);
> > -				result = false;
> > -			}
> > -		}
> > +		if (igt_format_is_yuv(format))
> > +			result &= test_format_plane_yuv(data, pipe, plane,
> > +							format, modifier,
> > +							width, height,
> > +							ref_crc, &fb);
> > +		else
> > +			result &= test_format_plane_rgb(data, pipe, plane,
> > +							format, modifier,
> > +							width, height,
> > +							ref_crc, &fb);
> >   
> >   		if (format == DRM_FORMAT_C8)
> >   			set_legacy_lut(data, pipe, 0xfc00);
> > -
> > -		if (crc_mismatch_count)
> > -			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
> > -				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
> > -				 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
> >   	}
> >   
> >   	igt_pipe_crc_stop(data->pipe_crc);
> > 
> 

-- 
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t v2 2/3] tests/kms_plane: Test all YCbCr encodings/ranges
  2019-07-03 17:12       ` Ville Syrjälä
@ 2019-07-03 18:01         ` Kazlauskas, Nicholas
  0 siblings, 0 replies; 22+ messages in thread
From: Kazlauskas, Nicholas @ 2019-07-03 18:01 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

On 7/3/19 1:12 PM, Ville Syrjälä wrote:
> On Tue, Jul 02, 2019 at 06:07:24PM +0000, Kazlauskas, Nicholas wrote:
>> On 7/2/19 1:57 PM, Ville Syrjala wrote:
>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> Test all support YCbCr encoding/range combinations. So far
>>> we've only been testing one particular combo.
>>>
>>> v2: Use igt_create_fb_with_bo_size() and hand roll the
>>>       solid fills
>>>
>>> Cc: Uma Shankar <uma.shankar@intel.com>
>>> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1
>>> Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> ---
>>>    tests/kms_plane.c | 164 ++++++++++++++++++++++++++++++++++++----------
>>>    1 file changed, 129 insertions(+), 35 deletions(-)
>>>
>>> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
>>> index 59d5f1e80cd2..ce4bf9e1c21d 100644
>>> --- a/tests/kms_plane.c
>>> +++ b/tests/kms_plane.c
>>> @@ -427,27 +427,36 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
>>>    				    igt_plane_t *plane,
>>>    				    uint32_t format, uint64_t modifier,
>>>    				    int width, int height,
>>> +				    enum igt_color_encoding color_encoding,
>>> +				    enum igt_color_range color_range,
>>>    				    int color, igt_crc_t *crc, struct igt_fb *fb)
>>>    {
>>>    	const color_t *c = &colors[color];
>>>    	struct igt_fb old_fb = *fb;
>>> +	cairo_t *cr;
>>>    
>>>    	if (data->crop == 0 || format == DRM_FORMAT_XRGB8888) {
>>> -		igt_create_color_fb(data->drm_fd, width, height,
>>> -				    format, modifier,
>>> -				    c->red, c->green, c->blue, fb);
>>> +		igt_create_fb_with_bo_size(data->drm_fd, width, height,
>>> +					   format, modifier, color_encoding,
>>> +					   color_range, fb, 0, 0);
>>> +
>>> +		cr = igt_get_cairo_ctx(data->drm_fd, fb);
>>> +
>>> +		igt_paint_color(cr, 0, 0, width, height,
>>> +				c->red, c->green, c->blue);
>>> +
>>> +		igt_put_cairo_ctx(data->drm_fd, fb, cr);
>>>    	} else {
>>> +		igt_create_fb_with_bo_size(data->drm_fd,
>>> +					   width + data->crop * 2,
>>> +					   height + data->crop * 2,
>>> +					   format, modifier, color_encoding,
>>> +					   color_range, fb, 0, 0);
>>> +
>>>    		/*
>>>    		 * paint border in inverted color, then visible area in middle
>>>    		 * with correct color for clamping test
>>>    		 */
>>> -		cairo_t *cr;
>>> -
>>> -		igt_create_fb(data->drm_fd,
>>> -			      width + data->crop * 2,
>>> -			      height + data->crop * 2,
>>> -			      format, modifier, fb);
>>> -
>>>    		cr = igt_get_cairo_ctx(data->drm_fd, fb);
>>>    
>>>    		igt_paint_color(cr, 0, 0,
>>> @@ -500,6 +509,104 @@ static int num_unique_crcs(const igt_crc_t crc[], int num_crc)
>>>    	return num_unique_crc;
>>>    }
>>>    
>>> +static bool test_format_plane_colors(data_t *data, enum pipe pipe,
>>> +				     igt_plane_t *plane,
>>> +				     uint32_t format, uint64_t modifier,
>>> +				     int width, int height,
>>> +				     enum igt_color_encoding encoding,
>>> +				     enum igt_color_range range,
>>> +				     igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>>> +				     struct igt_fb *fb)
>>> +{
>>> +	int crc_mismatch_count = 0;
>>> +	unsigned int crc_mismatch_mask = 0;
>>> +	bool result = true;
>>> +
>>> +	for (int i = 0; i < ARRAY_SIZE(colors); i++) {
>>> +		igt_crc_t crc;
>>> +
>>> +		test_format_plane_color(data, pipe, plane,
>>> +					format, modifier,
>>> +					width, height,
>>> +					encoding, range,
>>> +					i, &crc, fb);
>>> +
>>> +		if (!igt_check_crc_equal(&crc, &ref_crc[i])) {
>>> +			crc_mismatch_count++;
>>> +			crc_mismatch_mask |= (1 << i);
>>> +			result = false;
>>> +		}
>>> +	}
>>> +
>>> +	if (crc_mismatch_count)
>>> +		igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
>>> +			 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
>>> +			 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
>>> +
>>> +	return result;
>>> +}
>>> +
>>> +static bool test_format_plane_rgb(data_t *data, enum pipe pipe,
>>> +				  igt_plane_t *plane,
>>> +				  uint32_t format, uint64_t modifier,
>>> +				  int width, int height,
>>> +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>>> +				  struct igt_fb *fb)
>>> +{
>>> +	igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
>>> +		 IGT_FORMAT_ARGS(format), modifier,
>>> +		 kmstest_pipe_name(pipe), plane->index);
>>> +
>>> +	return test_format_plane_colors(data, pipe, plane,
>>> +					format, modifier,
>>> +					width, height,
>>> +					IGT_COLOR_YCBCR_BT601,
>>> +					IGT_COLOR_YCBCR_LIMITED_RANGE,
>>> +					ref_crc, fb);
>>> +}
>>> +
>>> +static bool test_format_plane_yuv(data_t *data, enum pipe pipe,
>>> +				  igt_plane_t *plane,
>>> +				  uint32_t format, uint64_t modifier,
>>> +				  int width, int height,
>>> +				  igt_crc_t ref_crc[ARRAY_SIZE(colors)],
>>> +				  struct igt_fb *fb)
>>> +{
>>> +	bool result = true;
>>> +
>>> +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_ENCODING))
>>> +		return true;
>>> +	if (!igt_plane_has_prop(plane, IGT_PLANE_COLOR_RANGE))
>>> +		return true;
>>
>> Skimmed over this in my first pass.
>>
>> Do we really want to be returning true here if the driver doesn't
>> support encoding/range? It's probably not a good idea to really expose
>> YUV formats with them so it might be best to just assert here instead.
> 
> I suspect there are still quite a few drivers that don't expose
> these props. Asserting/skipping here would mean skipping the entire
> subtest which is not so great. So IMO better to just skip the YUV
> formats.

That's a fair point. It's still a silent skip but it's probably not a 
big deal. This series looks fine to me:

Reviewed-by: Nicholas Kazlauskas <nicholas.kazluaskas@amd.com>

> 
>>
>> The rest of P1+P2 lgtm. I don't see P3 but that still only needs the
>> title fix.
>>
>> Nicholas Kazlauskas
>>
>>> +
>>> +	for (enum igt_color_encoding e = 0; e < IGT_NUM_COLOR_ENCODINGS; e++) {
>>> +		if (!igt_plane_try_prop_enum(plane,
>>> +					     IGT_PLANE_COLOR_ENCODING,
>>> +					     igt_color_encoding_to_str(e)))
>>> +			continue;
>>> +
>>> +		for (enum igt_color_range r = 0; r < IGT_NUM_COLOR_RANGES; r++) {
>>> +			if (!igt_plane_try_prop_enum(plane,
>>> +						     IGT_PLANE_COLOR_RANGE,
>>> +						     igt_color_range_to_str(r)))
>>> +				continue;
>>> +
>>> +			igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " (%s, %s) on %s.%u\n",
>>> +				 IGT_FORMAT_ARGS(format), modifier,
>>> +				 igt_color_encoding_to_str(e),
>>> +				 igt_color_range_to_str(r),
>>> +				 kmstest_pipe_name(pipe), plane->index);
>>> +
>>> +			result &= test_format_plane_colors(data, pipe, plane,
>>> +							   format, modifier,
>>> +							   width, height,
>>> +							   e, r, ref_crc, fb);
>>> +		}
>>> +	}
>>> +
>>> +	return result;
>>> +}
>>> +
>>>    static bool test_format_plane(data_t *data, enum pipe pipe,
>>>    			      igt_output_t *output, igt_plane_t *plane)
>>>    {
>>> @@ -569,6 +676,8 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>>>    		test_format_plane_color(data, pipe, plane,
>>>    					format, modifier,
>>>    					width, height,
>>> +					IGT_COLOR_YCBCR_BT709,
>>> +					IGT_COLOR_YCBCR_LIMITED_RANGE,
>>>    					i, &ref_crc[i], &fb);
>>>    	}
>>>    
>>> @@ -580,10 +689,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>>>    	igt_require(num_unique_crcs(ref_crc, ARRAY_SIZE(colors)) > 1);
>>>    
>>>    	for (int i = 0; i < plane->format_mod_count; i++) {
>>> -		int crc_mismatch_count = 0;
>>> -		int crc_mismatch_mask = 0;
>>> -		igt_crc_t crc;
>>> -
>>>    		format = plane->formats[i];
>>>    		modifier = plane->modifiers[i];
>>>    
>>> @@ -599,30 +704,19 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
>>>    				continue;
>>>    		}
>>>    
>>> -		igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
>>> -			 IGT_FORMAT_ARGS(format), modifier,
>>> -			 kmstest_pipe_name(pipe), plane->index);
>>> -
>>> -		for (int j = 0; j < ARRAY_SIZE(colors); j++) {
>>> -			test_format_plane_color(data, pipe, plane,
>>> -						format, modifier,
>>> -						width, height,
>>> -						j, &crc, &fb);
>>> -
>>> -			if (!igt_check_crc_equal(&crc, &ref_crc[j])) {
>>> -				crc_mismatch_count++;
>>> -				crc_mismatch_mask |= (1 << j);
>>> -				result = false;
>>> -			}
>>> -		}
>>> +		if (igt_format_is_yuv(format))
>>> +			result &= test_format_plane_yuv(data, pipe, plane,
>>> +							format, modifier,
>>> +							width, height,
>>> +							ref_crc, &fb);
>>> +		else
>>> +			result &= test_format_plane_rgb(data, pipe, plane,
>>> +							format, modifier,
>>> +							width, height,
>>> +							ref_crc, &fb);
>>>    
>>>    		if (format == DRM_FORMAT_C8)
>>>    			set_legacy_lut(data, pipe, 0xfc00);
>>> -
>>> -		if (crc_mismatch_count)
>>> -			igt_warn("CRC mismatches with format " IGT_FORMAT_FMT " on %s.%u with %d/%d solid colors tested (0x%X)\n",
>>> -				 IGT_FORMAT_ARGS(format), kmstest_pipe_name(pipe),
>>> -				 plane->index, crc_mismatch_count, (int)ARRAY_SIZE(colors), crc_mismatch_mask);
>>>    	}
>>>    
>>>    	igt_pipe_crc_stop(data->pipe_crc);
>>>
>>
> 

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

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

end of thread, other threads:[~2019-07-03 18:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 19:44 [igt-dev] [PATCH i-g-t 0/3] Test all YCbCr encodings/ranges Ville Syrjala
2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: Allow creating yuv fbs with different encodings/ranges Ville Syrjala
2019-07-02 14:47   ` Shankar, Uma
2019-07-02 17:56   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_plane: Test all YCbCr encodings/ranges Ville Syrjala
2019-07-02 15:09   ` Shankar, Uma
2019-07-02 17:57   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-07-02 18:07     ` Kazlauskas, Nicholas
2019-07-03 17:12       ` Ville Syrjälä
2019-07-03 18:01         ` Kazlauskas, Nicholas
2019-06-28 19:44 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_plane: Throw away yet another bi Ville Syrjala
2019-07-02 13:20   ` Kazlauskas, Nicholas
2019-07-02 13:30     ` Ville Syrjälä
2019-07-02 16:44       ` Shankar, Uma
2019-07-02 17:04         ` Ville Syrjälä
2019-07-03 12:41           ` Shankar, Uma
2019-06-28 22:48 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges Patchwork
2019-06-29  9:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-07-02 17:57 ` [igt-dev] ✗ Fi.CI.BAT: failure for Test all YCbCr encodings/ranges (rev2) Patchwork
2019-07-02 18:08 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2019-07-02 18:28 ` [igt-dev] ✓ Fi.CI.BAT: success for Test all YCbCr encodings/ranges (rev3) Patchwork
2019-07-03 16:53 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.