All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats
@ 2018-07-26 10:41 Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
                   ` (16 more replies)
  0 siblings, 17 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:41 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

Hi,

Here is another attempt at a serie that aims at starting to test the plane
formats using the Chamelium over the HDMI. This was tested using the vc4
DRM driver found on the RaspberryPi.

There's been a number of changes from the RFC thanks to the feedback from
Eric Anholt, Paul Kocialkowski and Ville Syrjälä.

The series now relies mostly on igt_fb, with some decoupling from cairo and
a bunch of new helpers to aim at being able to convert igt_fb to arbitrary
DRM formats. The list of formats have been extended a bit, but is quite
small at this point. We also rely solely on either pixman or the existing
format conversions functions at them moment, and we allow cairo surfaces to
be created for framebuffers in a format not supported by cairo, through an
intermediate conversion to RGB24.

However, since it's now abstracted away from the igt_fb users, we can
easily add some routines to convert to additional formats if needed. And
since the code was so close now, it's been integrated into kms_chamelium.

Let me know what you think,
Maxime

Changes from v3:
  * Plug into the cairo surface conversion code, and share the code between
    the explicit conversion and the implicit one done when asking for a
    cairo surface for a framebuffer in a format not supported by Cairo.
  * Rebased on top of master

Changes from v2:
  * Reworded a commit log
  * Dropped commit making chamelium_calculate_fb_crc static
  * Added a few more missing formats
  * Changed PIXMAN_invalid to 0 to make sure it never conflicts with a
    pixman format

Changes from v1:
  * Add a README for the test lists
  * Add igt_fb buffer mapping / unmapping functions
  * Add igt_fb buffer format conversion function
  * Add pixman formats to the format descriptors
  * Made some refactoring to kms_chamelium to support format tests
  * Created sub-tests for the formats

Maxime Ripard (13):
  fb: Add buffer map/unmap functions
  fb: convert: Remove swizzle from the arguments
  fb: Create common function to convert frame formats
  fb: Add format conversion routine
  fb: Add support for conversions through pixman
  fb: Add more formats
  chamelium: Split CRC test function in two
  chamelium: Use preferred mode when testing a single mode
  chamelium: Add function to generate our test pattern
  chamelium: Change our pattern for a custom one
  chamelium: Add format support
  chamelium: Add format subtests
  tests: Add chamelium formats subtests to vc4 test lists

 lib/igt_fb.c                             | 447 ++++++++++++++++++------
 lib/igt_fb.h                             |   4 +-
 tests/kms_chamelium.c                    | 220 +++++++++---
 tests/vc4_ci/vc4-chamelium-fast.testlist |  10 +-
 tests/vc4_ci/vc4-chamelium.testlist      |  10 +-
 5 files changed, 544 insertions(+), 147 deletions(-)

base-commit: 2884f91dd6d7682ea738ef6f0943cc591643dda2
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The current code to manipulate the buffer has the assumption that we can
create an underlying cairo instance.

However, when it comes to supporting various formats, cairo is very limited
so we would need to decouple the buffer access from cairo surfaces.

Let's create a function that allows to map the underlying GEM buffer from
an igt_fb structure, which will then allow use to manipulate as we wish.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 57 +++++++++++++++++++++++++++++++++++++++++++++--------
 lib/igt_fb.h |  2 ++-
 2 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ae71d9673228..a4e38b7a8963 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1327,18 +1327,23 @@ int igt_dirty_fb(int fd, struct igt_fb *fb)
 	return drmModeDirtyFB(fb->fd, fb->fb_id, NULL, 0);
 }
 
+static void unmap_bo(struct igt_fb *fb, void *ptr)
+{
+	gem_munmap(ptr, fb->size);
+
+	if (fb->is_dumb)
+		igt_dirty_fb(fb->fd, fb);
+}
+
 static void destroy_cairo_surface__gtt(void *arg)
 {
 	struct igt_fb *fb = arg;
 
-	gem_munmap(cairo_image_surface_get_data(fb->cairo_surface), fb->size);
+	unmap_bo(fb, cairo_image_surface_get_data(fb->cairo_surface));
 	fb->cairo_surface = NULL;
-
-	if (fb->is_dumb)
-		igt_dirty_fb(fb->fd, fb);
 }
 
-static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
+static void *map_bo(int fd, struct igt_fb *fb)
 {
 	void *ptr;
 
@@ -1349,6 +1354,13 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
 		ptr = gem_mmap__gtt(fd, fb->gem_handle, fb->size,
 				    PROT_READ | PROT_WRITE);
 
+	return ptr;
+}
+
+static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
+{
+	void *ptr = map_bo(fd, fb);
+
 	fb->cairo_surface =
 		cairo_image_surface_create_for_data(ptr,
 						    drm_format_to_cairo(fb->drm_format),
@@ -1766,7 +1778,7 @@ static void destroy_cairo_surface__convert(void *arg)
 	if (blit->linear.handle)
 		free_linear_mapping(blit->fd, blit->fb, &blit->linear);
 	else
-		gem_munmap(blit->linear.map, fb->size);
+		unmap_bo(fb, blit->linear.map);
 
 	free(blit);
 
@@ -1790,8 +1802,7 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 		setup_linear_mapping(fd, fb, &blit->linear);
 	} else {
 		blit->linear.handle = 0;
-		blit->linear.map = gem_mmap__gtt(fd, fb->gem_handle, fb->size,
-					      PROT_READ | PROT_WRITE);
+		blit->linear.map = map_bo(fd, fb);
 		igt_assert(blit->linear.map);
 		blit->linear.stride = fb->stride;
 		blit->linear.size = fb->size;
@@ -1826,6 +1837,36 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 }
 
 /**
+ * igt_fb_map_buffer:
+ * @fd: open drm file descriptor
+ * @fb: pointer to an #igt_fb structure
+ *
+ * This function will creating a new mapping of the buffer and return a pointer
+ * to the content of the supplied framebuffer's plane. This mapping needs to be
+ * deleted using igt_fb_unmap_buffer().
+ *
+ * Returns:
+ * A pointer to a buffer with the contents of the framebuffer
+ */
+void *igt_fb_map_buffer(int fd, struct igt_fb *fb)
+{
+	return map_bo(fd, fb);
+}
+
+/**
+ * igt_fb_unmap_buffer:
+ * @fb: pointer to the backing igt_fb structure
+ * @buffer: pointer to the buffer previously mappped
+ *
+ * This function will unmap a buffer mapped previously with
+ * igt_fb_map_buffer().
+ */
+void igt_fb_unmap_buffer(struct igt_fb *fb, void *buffer)
+{
+	return unmap_bo(fb, buffer);
+}
+
+/**
  * igt_get_cairo_surface:
  * @fd: open drm file descriptor
  * @fb: pointer to an #igt_fb structure
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index d28bc0c4110a..ca028f550ab8 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -132,6 +132,8 @@ unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
 				  uint32_t format, uint64_t tiling);
 void igt_remove_fb(int fd, struct igt_fb *fb);
 int igt_dirty_fb(int fd, struct igt_fb *fb);
+void *igt_fb_map_buffer(int fd, struct igt_fb *fb);
+void igt_fb_unmap_buffer(struct igt_fb *fb, void *buffer);
 
 int igt_create_bo_with_dimensions(int fd, int width, int height, uint32_t format,
 				  uint64_t modifier, unsigned stride,
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats Maxime Ripard
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

Since it can be inferred from the framebuffer that is already given as an
argument, it is redundant and can be removed.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index a4e38b7a8963..4061fedec0c1 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1640,8 +1640,7 @@ static const unsigned char *yuyv_swizzle(uint32_t format)
 	}
 }
 
-static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit,
-				  const unsigned char swz[4])
+static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
 {
 	int i, j;
 	const uint8_t *yuyv;
@@ -1650,6 +1649,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	uint8_t *buf = malloc(blit->linear.size);
 	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
 						    fb->color_range);
+	const unsigned char *swz = yuyv_swizzle(fb->drm_format);
 
 	/*
 	 * Reading from the BO is awfully slow because of lack of read caching,
@@ -1699,8 +1699,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	free(buf);
 }
 
-static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_upload *blit,
-				  const unsigned char swz[4])
+static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
 {
 	int i, j;
 	uint8_t *yuyv = blit->linear.map;
@@ -1709,6 +1708,7 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
 	unsigned yuyv_stride = blit->linear.stride;
 	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
 						    fb->color_range);
+	const unsigned char *swz = yuyv_swizzle(fb->drm_format);
 
 	igt_assert_f(fb->drm_format == DRM_FORMAT_YUYV ||
 		     fb->drm_format == DRM_FORMAT_YVYU ||
@@ -1766,7 +1766,7 @@ static void destroy_cairo_surface__convert(void *arg)
 	case DRM_FORMAT_YVYU:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
-		convert_rgb24_to_yuyv(fb, blit, yuyv_swizzle(fb->drm_format));
+		convert_rgb24_to_yuyv(fb, blit);
 		break;
 	default:
 		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
@@ -1818,7 +1818,7 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 	case DRM_FORMAT_YVYU:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
-		convert_yuyv_to_rgb24(fb, blit, yuyv_swizzle(fb->drm_format));
+		convert_yuyv_to_rgb24(fb, blit);
 		break;
 	default:
 		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine Maxime Ripard
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The current code to convert between two buffer formats is quite tied to the
cairo surface infrastructure. Since we'll want to reuse it, make that
function more generic by introducing a common structure that passes all the
arguments and a common function that will call the right functions we
needed.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 243 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 153 insertions(+), 90 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 4061fedec0c1..1914233786a5 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1384,6 +1384,24 @@ struct fb_convert_blit_upload {
 	struct fb_blit_linear linear;
 };
 
+struct fb_convert_buf {
+	void			*ptr;
+	unsigned int		stride;
+	unsigned int		size;
+	uint32_t		fmt;
+	enum igt_color_encoding	color_encoding;
+	enum igt_color_range	color_range;
+	uint32_t		offsets[4];
+};
+
+struct fb_convert {
+	unsigned int		width;
+	unsigned int		height;
+
+	struct fb_convert_buf	dst;
+	struct fb_convert_buf	src;
+};
+
 static uint8_t clamprgb(float val)
 {
 	return clamp((int)(val + 0.5f), 0, 255);
@@ -1404,27 +1422,28 @@ static void write_rgb(uint8_t *rgb24, const struct igt_vec4 *rgb)
 	rgb24[0] = clamprgb(rgb->d[2]);
 }
 
-static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+static void convert_nv12_to_rgb24(struct fb_convert *cvt)
 {
 	int i, j;
 	const uint8_t *y, *uv;
-	uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride, planar_stride = blit->linear.stride;
-	uint8_t *buf = malloc(blit->linear.size);
-	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
-						    fb->color_range);
+	uint8_t *rgb24 = cvt->dst.ptr;
+	unsigned int rgb24_stride = cvt->dst.stride;
+	unsigned int planar_stride = cvt->src.stride;
+	uint8_t *buf = malloc(cvt->src.size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(cvt->src.color_encoding,
+						    cvt->src.color_range);
 
 	/*
 	 * Reading from the BO is awfully slow because of lack of read caching,
 	 * it's faster to copy the whole BO to a temporary buffer and convert
 	 * from there.
 	 */
-	igt_memcpy_from_wc(buf, blit->linear.map, blit->linear.size);
-	y = &buf[blit->linear.offsets[0]];
-	uv = &buf[blit->linear.offsets[1]];
+	igt_memcpy_from_wc(buf, cvt->src.ptr, cvt->src.size);
+	y = cvt->src.ptr + cvt->src.offsets[0];
+	uv = cvt->src.ptr + cvt->src.offsets[1];
 
-	for (i = 0; i < fb->height / 2; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->height / 2; i++) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x2 pixel blocks */
 			struct igt_vec4 yuv[4];
 			struct igt_vec4 rgb[4];
@@ -1449,7 +1468,7 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 			write_rgb(&rgb24[j * 8 + 4 + rgb24_stride], &rgb[3]);
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			/* Convert 1x2 pixel block */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1473,9 +1492,9 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 		uv += planar_stride;
 	}
 
-	if (fb->height & 1) {
+	if (cvt->height & 1) {
 		/* Convert last row */
-		for (j = 0; j < fb->width / 2; j++) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1493,7 +1512,7 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 			write_rgb(&rgb24[j * 8 + 4], &rgb[0]);
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			/* Convert single pixel */
 			struct igt_vec4 yuv;
 			struct igt_vec4 rgb;
@@ -1512,22 +1531,22 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	free(buf);
 }
 
-static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+static void convert_rgb24_to_nv12(struct fb_convert *cvt)
 {
 	int i, j;
-	uint8_t *y = &blit->linear.map[blit->linear.offsets[0]];
-	uint8_t *uv = &blit->linear.map[blit->linear.offsets[1]];
-	const uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride;
-	unsigned planar_stride = blit->linear.stride;
-	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
-						    fb->color_range);
-
-	igt_assert_f(fb->drm_format == DRM_FORMAT_NV12,
+	uint8_t *y = cvt->dst.ptr + cvt->dst.offsets[0];
+	uint8_t *uv = cvt->dst.ptr + cvt->dst.offsets[1];
+	const uint8_t *rgb24 = cvt->src.ptr;
+	unsigned rgb24_stride = cvt->src.stride;
+	unsigned planar_stride = cvt->dst.stride;
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(cvt->dst.color_encoding,
+						    cvt->dst.color_range);
+
+	igt_assert_f(cvt->dst.fmt == DRM_FORMAT_NV12,
 		     "Conversion not implemented for !NV12 planar formats\n");
 
-	for (i = 0; i < fb->height / 2; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->height / 2; i++) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x2 pixel blocks */
 			struct igt_vec4 rgb[4];
 			struct igt_vec4 yuv[4];
@@ -1556,7 +1575,7 @@ static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_uplo
 			uv[j * 2 + 1] = (yuv[0].d[2] + yuv[2].d[2]) / 2.0f;
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			/* Convert 1x2 pixel block */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1585,8 +1604,8 @@ static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_uplo
 	}
 
 	/* Last row cannot be interpolated between 2 pixels, take the single value */
-	if (fb->height & 1) {
-		for (j = 0; j < fb->width / 2; j++) {
+	if (cvt->height & 1) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1603,7 +1622,7 @@ static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_uplo
 			uv[j * 2 + 1] = yuv[0].d[2];
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			/* Convert single pixel */
 			struct igt_vec4 rgb;
 			struct igt_vec4 yuv;
@@ -1640,27 +1659,28 @@ static const unsigned char *yuyv_swizzle(uint32_t format)
 	}
 }
 
-static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+static void convert_yuyv_to_rgb24(struct fb_convert *cvt)
 {
 	int i, j;
 	const uint8_t *yuyv;
-	uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride, yuyv_stride = blit->linear.stride;
-	uint8_t *buf = malloc(blit->linear.size);
-	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
-						    fb->color_range);
-	const unsigned char *swz = yuyv_swizzle(fb->drm_format);
+	uint8_t *rgb24 = cvt->dst.ptr;
+	unsigned int rgb24_stride = cvt->dst.stride;
+	unsigned int yuyv_stride = cvt->src.stride;
+	uint8_t *buf = malloc(cvt->src.size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(cvt->src.color_encoding,
+						    cvt->src.color_range);
+	const unsigned char *swz = yuyv_swizzle(cvt->src.fmt);
 
 	/*
 	 * Reading from the BO is awfully slow because of lack of read caching,
 	 * it's faster to copy the whole BO to a temporary buffer and convert
 	 * from there.
 	 */
-	igt_memcpy_from_wc(buf, blit->linear.map, blit->linear.size);
+	igt_memcpy_from_wc(buf, cvt->src.ptr, cvt->src.size);
 	yuyv = buf;
 
-	for (i = 0; i < fb->height; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->height; i++) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1678,7 +1698,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 			write_rgb(&rgb24[j * 8 + 4], &rgb[1]);
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			struct igt_vec4 yuv;
 			struct igt_vec4 rgb;
 
@@ -1699,25 +1719,25 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	free(buf);
 }
 
-static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
+static void convert_rgb24_to_yuyv(struct fb_convert *cvt)
 {
 	int i, j;
-	uint8_t *yuyv = blit->linear.map;
-	const uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride;
-	unsigned yuyv_stride = blit->linear.stride;
-	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
-						    fb->color_range);
-	const unsigned char *swz = yuyv_swizzle(fb->drm_format);
-
-	igt_assert_f(fb->drm_format == DRM_FORMAT_YUYV ||
-		     fb->drm_format == DRM_FORMAT_YVYU ||
-		     fb->drm_format == DRM_FORMAT_UYVY ||
-		     fb->drm_format == DRM_FORMAT_VYUY,
+	uint8_t *yuyv = cvt->dst.ptr;
+	const uint8_t *rgb24 = cvt->src.ptr;
+	unsigned rgb24_stride = cvt->src.stride;
+	unsigned yuyv_stride = cvt->dst.stride;
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(cvt->dst.color_encoding,
+						    cvt->dst.color_range);
+	const unsigned char *swz = yuyv_swizzle(cvt->dst.fmt);
+
+	igt_assert_f(cvt->dst.fmt == DRM_FORMAT_YUYV ||
+		     cvt->dst.fmt == DRM_FORMAT_YVYU ||
+		     cvt->dst.fmt == DRM_FORMAT_UYVY ||
+		     cvt->dst.fmt == DRM_FORMAT_VYUY,
 		     "Conversion not implemented for !YUYV planar formats\n");
 
-	for (i = 0; i < fb->height; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->height; i++) {
+		for (j = 0; j < cvt->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1734,7 +1754,7 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
 			yuyv[j * 4 + swz[3]] = (yuv[0].d[2] + yuv[1].d[2]) / 2.0f;
 		}
 
-		if (fb->width & 1) {
+		if (cvt->width & 1) {
 			struct igt_vec4 rgb;
 			struct igt_vec4 yuv;
 
@@ -1752,27 +1772,65 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
 	}
 }
 
+static void fb_convert(struct fb_convert *cvt)
+{
+	if (cvt->dst.fmt == DRM_FORMAT_RGB888) {
+		switch (cvt->src.fmt) {
+		case DRM_FORMAT_NV12:
+			convert_nv12_to_rgb24(cvt);
+			return;
+		case DRM_FORMAT_YUYV:
+		case DRM_FORMAT_YVYU:
+		case DRM_FORMAT_UYVY:
+		case DRM_FORMAT_VYUY:
+			convert_yuyv_to_rgb24(cvt);
+			return;
+		}
+	} else if (cvt->src.fmt == DRM_FORMAT_RGB888) {
+		switch (cvt->dst.fmt) {
+		case DRM_FORMAT_NV12:
+			convert_rgb24_to_nv12(cvt);
+			return;
+		case DRM_FORMAT_YUYV:
+		case DRM_FORMAT_YVYU:
+		case DRM_FORMAT_UYVY:
+		case DRM_FORMAT_VYUY:
+			convert_rgb24_to_yuyv(cvt);
+			return;
+		}
+	}
+
+	igt_assert_f(false,
+		     "Conversion not implemented (from format 0x%x to 0x%x)\n",
+		     cvt->src.fmt, cvt->dst.fmt);
+}
+
 static void destroy_cairo_surface__convert(void *arg)
 {
 	struct fb_convert_blit_upload *blit = arg;
 	struct igt_fb *fb = blit->fb;
-
-	/* Convert linear rgb back! */
-	switch(fb->drm_format) {
-	case DRM_FORMAT_NV12:
-		convert_rgb24_to_nv12(fb, blit);
-		break;
-	case DRM_FORMAT_YUYV:
-	case DRM_FORMAT_YVYU:
-	case DRM_FORMAT_UYVY:
-	case DRM_FORMAT_VYUY:
-		convert_rgb24_to_yuyv(fb, blit);
-		break;
-	default:
-		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
-			     fb->drm_format);
-	}
-
+	struct fb_convert cvt = {
+		.width	= fb->width,
+		.height	= fb->height,
+
+		.dst	= {
+			.ptr		= blit->linear.map,
+			.fmt		= fb->drm_format,
+			.stride		= blit->linear.stride,
+			.size		= blit->linear.size,
+			.color_encoding	= fb->color_encoding,
+			.color_range	= fb->color_range,
+		},
+
+		.src	= {
+			.ptr		= blit->rgb24.map,
+			.fmt		= DRM_FORMAT_RGB888,
+			.stride		= blit->rgb24.stride,
+			.size		= blit->rgb24.size,
+		},
+	};
+
+	fb_convert(&cvt);
 	munmap(blit->rgb24.map, blit->rgb24.size);
 
 	if (blit->linear.handle)
@@ -1788,6 +1846,8 @@ static void destroy_cairo_surface__convert(void *arg)
 static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 {
 	struct fb_convert_blit_upload *blit = malloc(sizeof(*blit));
+	struct fb_convert cvt = { 0 };
+
 	igt_assert(blit);
 
 	blit->fd = fd;
@@ -1809,21 +1869,24 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 		memcpy(blit->linear.offsets, fb->offsets, sizeof(fb->offsets));
 	}
 
-	/* Convert to linear rgb! */
-	switch(fb->drm_format) {
-	case DRM_FORMAT_NV12:
-		convert_nv12_to_rgb24(fb, blit);
-		break;
-	case DRM_FORMAT_YUYV:
-	case DRM_FORMAT_YVYU:
-	case DRM_FORMAT_UYVY:
-	case DRM_FORMAT_VYUY:
-		convert_yuyv_to_rgb24(fb, blit);
-		break;
-	default:
-		igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
-			     fb->drm_format);
-	}
+	cvt.width = fb->width;
+	cvt.height = fb->height;
+
+	cvt.dst.ptr = blit->rgb24.map;
+	cvt.dst.fmt = DRM_FORMAT_RGB888;
+	cvt.dst.stride = blit->rgb24.stride;
+	cvt.dst.size = blit->rgb24.size;
+
+	cvt.src.ptr = blit->linear.map;
+	cvt.src.fmt = fb->drm_format;
+	cvt.src.stride	= blit->linear.stride;
+	cvt.src.size = blit->linear.size;
+	cvt.src.color_encoding = fb->color_encoding;
+	cvt.src.color_range = fb->color_range;
+	memcpy(cvt.dst.offsets, blit->linear.offsets,
+	       sizeof(blit->linear.offsets));
+
+	fb_convert(&cvt);
 
 	fb->cairo_surface =
 		cairo_image_surface_create_for_data(blit->rgb24.map,
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (2 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman Maxime Ripard
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The chamelium format subtests will need to convert the reference pattern to
the format to be tested on the DRM device.

However, Cairo is very limited when it comes to format, and while pixman
has much more support for formats, it's still falling short compared to
what DRM exposes, especially on the YUV side. Plus, since we want to run
CRC checks on the frame, we can't afford having conversions back and forth
between RGB24, as the current API is doing.

In order to abstract this away, let's create a function that will convert a
igt_fb structure to another DRM format and return the converted igt_fb.

For now, we will use only cairo to do the conversion, but we will use other
libraries or roll our own routines to convert to more exotic formats and
abstract it away from the users.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 lib/igt_fb.h |  2 ++-
 2 files changed, 61 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 1914233786a5..9aee02c35c16 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2029,6 +2029,65 @@ void igt_remove_fb(int fd, struct igt_fb *fb)
 }
 
 /**
+ * igt_fb_convert:
+ * @dst: pointer to the #igt_fb structure that will store the conversion result
+ * @src: pointer to the #igt_fb structure that stores the frame we convert
+ * @dst_fourcc: DRM format specifier to convert to
+ *
+ * This will convert a given @src content to the @dst_fourcc format,
+ * storing the result in the @dst fb, allocating the @dst fb
+ * underlying buffer.
+ *
+ * Once done with @dst, the caller will have to call igt_remove_fb()
+ * on it to free the associated resources.
+ *
+ * Returns:
+ * The kms id of the created framebuffer.
+ */
+unsigned int igt_fb_convert(struct igt_fb *dst, struct igt_fb *src,
+			    uint32_t dst_fourcc)
+{
+	struct fb_convert cvt = { 0 };
+	void *dst_ptr, *src_ptr;
+	int fb_id;
+
+	fb_id = igt_create_fb(src->fd, src->width, src->height,
+			      dst_fourcc, LOCAL_DRM_FORMAT_MOD_NONE, dst);
+	igt_assert(fb_id > 0);
+
+	src_ptr = igt_fb_map_buffer(src->fd, src);
+	igt_assert(src_ptr);
+
+	dst_ptr = igt_fb_map_buffer(dst->fd, dst);
+	igt_assert(dst_ptr);
+
+	cvt.width = src->width;
+	cvt.height = src->height;
+
+	cvt.dst.ptr = dst_ptr;
+	cvt.dst.fmt = dst_fourcc;
+	cvt.dst.stride = dst->stride;
+	cvt.dst.size = dst->size;
+	cvt.dst.color_encoding = dst->color_encoding;
+	cvt.dst.color_range = dst->color_range;
+	memcpy(&cvt.dst.offsets, dst->offsets, sizeof(dst->offsets));
+
+	cvt.src.ptr = src_ptr;
+	cvt.src.fmt = src->drm_format;
+	cvt.src.stride = src->stride;
+	cvt.src.size = src->size;
+	cvt.src.color_encoding = src->color_encoding;
+	cvt.src.color_range = src->color_range;
+	memcpy(&cvt.src.offsets, src->offsets, sizeof(src->offsets));
+	fb_convert(&cvt);
+
+	igt_fb_unmap_buffer(dst, dst_ptr);
+	igt_fb_unmap_buffer(src, src_ptr);
+
+	return fb_id;
+}
+
+/**
  * igt_bpp_depth_to_drm_format:
  * @bpp: desired bits per pixel
  * @depth: desired depth
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index ca028f550ab8..eb68b236530e 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -130,6 +130,8 @@ unsigned int igt_create_image_fb(int drm_fd,  int width, int height,
 				 struct igt_fb *fb /* out */);
 unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
 				  uint32_t format, uint64_t tiling);
+unsigned int igt_fb_convert(struct igt_fb *dst, struct igt_fb *src,
+			    uint32_t dst_fourcc);
 void igt_remove_fb(int fd, struct igt_fb *fb);
 int igt_dirty_fb(int fd, struct igt_fb *fb);
 void *igt_fb_map_buffer(int fd, struct igt_fb *fb);
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (3 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

Pixman allows for much more conversions than cairo, and we don't want to
open code conversions routine for the common formats.

Let's plug pixman in our conversion function so that we can benefit from it
when possible.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 53 insertions(+), 2 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 9aee02c35c16..9defbd8b044c 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -29,6 +29,7 @@
 #include <math.h>
 #include <wchar.h>
 #include <inttypes.h>
+#include <pixman.h>
 
 #include "drmtest.h"
 #include "igt_aux.h"
@@ -59,29 +60,36 @@
  * functions to work with these pixel format codes.
  */
 
+#define PIXMAN_invalid	0
+
 /* drm fourcc/cairo format maps */
 static struct format_desc_struct {
 	const char *name;
 	uint32_t drm_id;
 	cairo_format_t cairo_id;
+	pixman_format_code_t pixman_id;
 	int depth;
 	int num_planes;
 	int plane_bpp[4];
 } format_desc[] = {
 	{ .name = "RGB565", .depth = 16, .drm_id = DRM_FORMAT_RGB565,
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
+	  .pixman_id = PIXMAN_r5g6b5,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
 	{ .name = "XRGB8888", .depth = 24, .drm_id = DRM_FORMAT_XRGB8888,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
+	  .pixman_id = PIXMAN_x8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
 	{ .name = "XRGB2101010", .depth = 30, .drm_id = DRM_FORMAT_XRGB2101010,
 	  .cairo_id = CAIRO_FORMAT_RGB30,
+	  .pixman_id = PIXMAN_x2r10g10b10,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
 	{ .name = "ARGB8888", .depth = 32, .drm_id = DRM_FORMAT_ARGB8888,
 	  .cairo_id = CAIRO_FORMAT_ARGB32,
+	  .pixman_id = PIXMAN_a8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
 	{ .name = "NV12", .depth = -1, .drm_id = DRM_FORMAT_NV12,
@@ -90,6 +98,7 @@ static struct format_desc_struct {
 	},
 	{ .name = "YUYV", .depth = -1, .drm_id = DRM_FORMAT_YUYV,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
+	  .pixman_id = PIXMAN_yuy2,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
 	{ .name = "YVYU", .depth = -1, .drm_id = DRM_FORMAT_YVYU,
@@ -1175,6 +1184,18 @@ unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
 	return fb_id;
 }
 
+static pixman_format_code_t drm_format_to_pixman(uint32_t drm_format)
+{
+	struct format_desc_struct *f;
+
+	for_each_format(f)
+		if (f->drm_id == drm_format)
+			return f->pixman_id;
+
+	igt_assert_f(0, "can't find a pixman format for %08x (%s)\n",
+		     drm_format, igt_format_str(drm_format));
+}
+
 static cairo_format_t drm_format_to_cairo(uint32_t drm_format)
 {
 	struct format_desc_struct *f;
@@ -1772,9 +1793,38 @@ static void convert_rgb24_to_yuyv(struct fb_convert *cvt)
 	}
 }
 
+static void convert_pixman(struct fb_convert *cvt)
+{
+	pixman_format_code_t src_pixman = drm_format_to_pixman(cvt->src.fmt);
+	pixman_format_code_t dst_pixman = drm_format_to_pixman(cvt->dst.fmt);
+	pixman_image_t *dst_image, *src_image;
+
+	igt_assert((src_pixman != PIXMAN_invalid) &&
+		   (dst_pixman != PIXMAN_invalid));
+
+	src_image = pixman_image_create_bits(src_pixman,
+					     cvt->width, cvt->height,
+					     cvt->src.ptr, cvt->src.stride);
+	igt_assert(src_image);
+
+	dst_image = pixman_image_create_bits(dst_pixman,
+					     cvt->width, cvt->height,
+					     cvt->dst.ptr, cvt->dst.stride);
+	igt_assert(dst_image);
+
+	pixman_image_composite(PIXMAN_OP_SRC, src_image, NULL, dst_image,
+			       0, 0, 0, 0, 0, 0, cvt->width, cvt->height);
+	pixman_image_unref(dst_image);
+	pixman_image_unref(src_image);
+}
+
 static void fb_convert(struct fb_convert *cvt)
 {
-	if (cvt->dst.fmt == DRM_FORMAT_RGB888) {
+	if ((drm_format_to_pixman(cvt->src.fmt) != PIXMAN_invalid) &&
+	    (drm_format_to_pixman(cvt->dst.fmt) != PIXMAN_invalid)) {
+		convert_pixman(cvt);
+		return;
+	} else if (cvt->dst.fmt == DRM_FORMAT_RGB888) {
 		switch (cvt->src.fmt) {
 		case DRM_FORMAT_NV12:
 			convert_nv12_to_rgb24(cvt);
@@ -2155,7 +2205,8 @@ bool igt_fb_supported_format(uint32_t drm_format)
 
 	for_each_format(f)
 		if (f->drm_id == drm_format)
-			return f->cairo_id != CAIRO_FORMAT_INVALID;
+			return (f->cairo_id != CAIRO_FORMAT_INVALID) ||
+				(f->pixman_id != PIXMAN_invalid);
 
 	return false;
 }
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 06/13] fb: Add more formats
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (4 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-08-09 21:25   ` Eric Anholt
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two Maxime Ripard
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

We're going to need some DRM formats, and we're going to need the igt_fb
code to handle them. Since it relies on the format_desc structure to map
the DRM fourcc to the pixman and cairo formats, we need to add these new
formats to that structure.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 9defbd8b044c..17deeada5beb 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -72,16 +72,46 @@ static struct format_desc_struct {
 	int num_planes;
 	int plane_bpp[4];
 } format_desc[] = {
+	{ .name = "ARGB1555", .depth = 15, .drm_id = DRM_FORMAT_ARGB1555,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a1r5g5b5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "XRGB1555", .depth = 15, .drm_id = DRM_FORMAT_XRGB1555,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_x1r5g5b5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
 	{ .name = "RGB565", .depth = 16, .drm_id = DRM_FORMAT_RGB565,
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .pixman_id = PIXMAN_r5g6b5,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "BGR565", .depth = 16, .drm_id = DRM_FORMAT_BGR565,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b5g6r5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "BGR888", .depth = 24, .drm_id = DRM_FORMAT_BGR888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b8g8r8,
+	  .num_planes = 1, .plane_bpp = { 24, },
+	},
+	{ .name = "RGB888", .depth = 24, .drm_id = DRM_FORMAT_RGB888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_r8g8b8,
+	  .num_planes = 1, .plane_bpp = { 24, },
+	},
 	{ .name = "XRGB8888", .depth = 24, .drm_id = DRM_FORMAT_XRGB8888,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
 	  .pixman_id = PIXMAN_x8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
+	{ .name = "XBGR8888", .depth = 24, .drm_id = DRM_FORMAT_XBGR8888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_x8b8g8r8,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	},
 	{ .name = "XRGB2101010", .depth = 30, .drm_id = DRM_FORMAT_XRGB2101010,
 	  .cairo_id = CAIRO_FORMAT_RGB30,
 	  .pixman_id = PIXMAN_x2r10g10b10,
@@ -92,6 +122,11 @@ static struct format_desc_struct {
 	  .pixman_id = PIXMAN_a8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
+	{ .name = "ABGR8888", .depth = 32, .drm_id = DRM_FORMAT_ABGR8888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a8b8g8r8,
+	  .num_planes = 1, .plane_bpp = { 32, },
+	},
 	{ .name = "NV12", .depth = -1, .drm_id = DRM_FORMAT_NV12,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
 	  .num_planes = 2, .plane_bpp = { 8, 16, },
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (5 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

We have two use cases in our current sub-test suites: the tests that test
all the modes exposed by the driver, and the ones just picking up one.

Instead of having to deal with this two cases in the same function as it is
currently done, move the part that test a single mode into a separate
function, and just call it for every mode that we want to test if needs be.

This will result in a simpler function that will be easier to extend to
support formats.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 121 +++++++++++++++++++++++++------------------
 1 file changed, 73 insertions(+), 48 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 2bc34d07788d..490bacc6f5fe 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,20 +486,61 @@ enable_output(data_t *data,
 	drmModeFreeConnector(connector);
 }
 
-static void
-test_display_crc(data_t *data, struct chamelium_port *port, int count,
-		 bool fast)
+static void do_test_display_crc(data_t *data, struct chamelium_port *port,
+				igt_output_t *output, drmModeModeInfo *mode,
+				int count)
 {
-	igt_output_t *output;
-	igt_plane_t *primary;
 	igt_crc_t *crc;
 	igt_crc_t *expected_crc;
 	struct chamelium_fb_crc_async_data *fb_crc;
 	struct igt_fb fb;
-	drmModeModeInfo *mode;
+	int i, fb_id, captured_frame_count;
+
+	fb_id = igt_create_color_pattern_fb(data->drm_fd,
+					    mode->hdisplay,
+					    mode->vdisplay,
+					    DRM_FORMAT_XRGB8888,
+					    LOCAL_DRM_FORMAT_MOD_NONE,
+					    0, 0, 0, &fb);
+	igt_assert(fb_id > 0);
+
+	fb_crc = chamelium_calculate_fb_crc_async_start(data->drm_fd,
+							&fb);
+
+	enable_output(data, port, output, mode, &fb);
+
+	/* We want to keep the display running for a little bit, since
+	 * there's always the potential the driver isn't able to keep
+	 * the display running properly for very long
+	 */
+	chamelium_capture(data->chamelium, port, 0, 0, 0, 0, count);
+	crc = chamelium_read_captured_crcs(data->chamelium,
+					   &captured_frame_count);
+
+	igt_assert(captured_frame_count == count);
+
+	igt_debug("Captured %d frames\n", captured_frame_count);
+
+	expected_crc = chamelium_calculate_fb_crc_async_finish(fb_crc);
+
+	for (i = 0; i < captured_frame_count; i++)
+		chamelium_assert_crc_eq_or_dump(data->chamelium,
+						expected_crc, &crc[i],
+						&fb, i);
+
+	free(expected_crc);
+	free(crc);
+
+	igt_remove_fb(data->drm_fd, &fb);
+}
+
+static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
+				      int count)
+{
+	igt_output_t *output;
 	drmModeConnector *connector;
-	int fb_id, i, j, captured_frame_count;
-	int count_modes;
+	igt_plane_t *primary;
+	drmModeModeInfo *mode;
 
 	reset_state(data, port);
 
@@ -508,46 +549,30 @@ test_display_crc(data_t *data, struct chamelium_port *port, int count,
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_assert(primary);
 
-	count_modes = fast ? 1 : connector->count_modes;
-
-	for (i = 0; i < count_modes; i++) {
-		mode = &connector->modes[i];
-		fb_id = igt_create_color_pattern_fb(data->drm_fd,
-						    mode->hdisplay,
-						    mode->vdisplay,
-						    DRM_FORMAT_XRGB8888,
-						    LOCAL_DRM_FORMAT_MOD_NONE,
-						    0, 0, 0, &fb);
-		igt_assert(fb_id > 0);
-
-		fb_crc = chamelium_calculate_fb_crc_async_start(data->drm_fd,
-								&fb);
+	do_test_display_crc(data, port, output, &connector->modes[0], count);
 
-		enable_output(data, port, output, mode, &fb);
-
-		/* We want to keep the display running for a little bit, since
-		 * there's always the potential the driver isn't able to keep
-		 * the display running properly for very long
-		 */
-		chamelium_capture(data->chamelium, port, 0, 0, 0, 0, count);
-		crc = chamelium_read_captured_crcs(data->chamelium,
-						   &captured_frame_count);
-
-		igt_assert(captured_frame_count == count);
+	drmModeFreeConnector(connector);
+}
 
-		igt_debug("Captured %d frames\n", captured_frame_count);
+static void test_display_crc_all_modes(data_t *data, struct chamelium_port *port,
+					int count)
+{
+	igt_output_t *output;
+	igt_plane_t *primary;
+	drmModeConnector *connector;
+	int i;
 
-		expected_crc = chamelium_calculate_fb_crc_async_finish(fb_crc);
+	reset_state(data, port);
 
-		for (j = 0; j < captured_frame_count; j++)
-			chamelium_assert_crc_eq_or_dump(data->chamelium,
-							expected_crc, &crc[j],
-							&fb, j);
+	output = prepare_output(data, port);
+	connector = chamelium_port_get_connector(data->chamelium, port, false);
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	igt_assert(primary);
 
-		free(expected_crc);
-		free(crc);
+	for (i = 0; i < connector->count_modes; i++) {
+		drmModeModeInfo *mode = &connector->modes[i];
 
-		igt_remove_fb(data->drm_fd, &fb);
+		do_test_display_crc(data, port, output, mode, count);
 	}
 
 	drmModeFreeConnector(connector);
@@ -808,13 +833,13 @@ igt_main
 							edid_id, alt_edid_id);
 
 		connector_subtest("dp-crc-single", DisplayPort)
-			test_display_crc(&data, port, 1, false);
+			test_display_crc_all_modes(&data, port, 1);
 
 		connector_subtest("dp-crc-fast", DisplayPort)
-			test_display_crc(&data, port, 1, true);
+			test_display_crc_one_mode(&data, port, 1);
 
 		connector_subtest("dp-crc-multiple", DisplayPort)
-			test_display_crc(&data, port, 3, false);
+			test_display_crc_all_modes(&data, port, 3);
 
 		connector_subtest("dp-frame-dump", DisplayPort)
 			test_display_frame_dump(&data, port);
@@ -872,13 +897,13 @@ igt_main
 							edid_id, alt_edid_id);
 
 		connector_subtest("hdmi-crc-single", HDMIA)
-			test_display_crc(&data, port, 1, false);
+			test_display_crc_all_modes(&data, port, 1);
 
 		connector_subtest("hdmi-crc-fast", HDMIA)
-			test_display_crc(&data, port, 1, true);
+			test_display_crc_one_mode(&data, port, 1);
 
 		connector_subtest("hdmi-crc-multiple", HDMIA)
-			test_display_crc(&data, port, 3, false);
+			test_display_crc_all_modes(&data, port, 3);
 
 		connector_subtest("hdmi-frame-dump", HDMIA)
 			test_display_frame_dump(&data, port);
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (6 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-08-09 21:28   ` Eric Anholt
  2018-08-23 15:17   ` Ville Syrjälä
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern Maxime Ripard
                   ` (8 subsequent siblings)
  16 siblings, 2 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The current code is testing the first mode in the connector list when it's
testing a single mode. While this is arbitrarily chosen, it makes more
sense to use the preferred mode reported by the display.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 490bacc6f5fe..5d7fb83fb74f 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -534,6 +534,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 	igt_remove_fb(data->drm_fd, &fb);
 }
 
+static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
+{
+	int i;
+
+	for (i = 0; i < connector->count_modes; i++) {
+		drmModeModeInfo *mode = &connector->modes[i];
+
+		if (mode->type & DRM_MODE_TYPE_PREFERRED)
+			return mode;
+	}
+
+	return NULL;
+}
+
 static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
 				      int count)
 {
@@ -549,7 +563,10 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_assert(primary);
 
-	do_test_display_crc(data, port, output, &connector->modes[0], count);
+	mode = find_preferred_mode(connector);
+	igt_assert(mode);
+
+	do_test_display_crc(data, port, output, mode, count);
 
 	drmModeFreeConnector(connector);
 }
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (7 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Maxime Ripard
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The current pattern being used is the one generated through the
igt_create_color_pattern_fb.

However, in order to deal with multiple formats and the upsampling /
downsampling issues that might arise from converting back and forth between
formats, we will need to have a pattern with quite precise color values,
and without any shades or gradient of colors.

Let's create a function that will generate our pattern in the chamelium
code, keeping the current pattern for now. We will extend it in a later
patch.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 5d7fb83fb74f..f14e3ebb4b87 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,6 +486,17 @@ enable_output(data_t *data,
 	drmModeFreeConnector(connector);
 }
 
+static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode,
+				    uint32_t fourcc, struct igt_fb *fb)
+{
+	igt_assert(fourcc == DRM_FORMAT_XRGB8888);
+
+	return igt_create_color_pattern_fb(data->drm_fd, mode->hdisplay,
+					   mode->vdisplay, fourcc,
+					   LOCAL_DRM_FORMAT_MOD_NONE,
+					   0, 0, 0, fb);
+}
+
 static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 				igt_output_t *output, drmModeModeInfo *mode,
 				int count)
@@ -496,12 +507,7 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 	struct igt_fb fb;
 	int i, fb_id, captured_frame_count;
 
-	fb_id = igt_create_color_pattern_fb(data->drm_fd,
-					    mode->hdisplay,
-					    mode->vdisplay,
-					    DRM_FORMAT_XRGB8888,
-					    LOCAL_DRM_FORMAT_MOD_NONE,
-					    0, 0, 0, &fb);
+	fb_id = chamelium_get_pattern_fb(data, mode, DRM_FORMAT_XRGB8888, &fb);
 	igt_assert(fb_id > 0);
 
 	fb_crc = chamelium_calculate_fb_crc_async_start(data->drm_fd,
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (8 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-08-09 21:31   ` Eric Anholt
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 11/13] chamelium: Add format support Maxime Ripard
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

The current pattern being used is the one generated through the
igt_create_color_pattern_fb.

However, in order to deal with multiple formats and the upsampling /
downsampling issues that might arise from converting back and forth between
formats, we will need to have a pattern with quite precise color values,
and without any shades or gradient of colors.

The easiest way to do that will be to only use values that would have the
same part on the common most significant bits (5, to deal with the most
formats) and have the same bit repeated on the least significant bits that
are going to be dropped and / or padded when converting between formats.

Pixman will fill the lowest bits with 1, and our hardware is able to
support that, so the easiest is to just use all 1's for our components in
order to still be able to compute the CRCs.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index f14e3ebb4b87..4f4984b51b41 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,15 +486,40 @@ enable_output(data_t *data,
 	drmModeFreeConnector(connector);
 }
 
+static void chamelium_paint_xr24_pattern(uint32_t *data,
+					 size_t width, size_t height)
+{
+	uint32_t colors[] = { 0xff000000,
+			      0xffff0000,
+			      0xff00ff00,
+			      0xff0000ff,
+			      0xffffffff };
+	unsigned i, j;
+
+	for (i = 0; i < height; i++)
+		for (j = 0; j < width; j++)
+			*(data + i * width + j) = colors[((j / 64) + (i / 64)) % 5];
+}
+
 static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode,
 				    uint32_t fourcc, struct igt_fb *fb)
 {
+	int fb_id;
+	void *ptr;
+
 	igt_assert(fourcc == DRM_FORMAT_XRGB8888);
 
-	return igt_create_color_pattern_fb(data->drm_fd, mode->hdisplay,
-					   mode->vdisplay, fourcc,
-					   LOCAL_DRM_FORMAT_MOD_NONE,
-					   0, 0, 0, fb);
+	fb_id = igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+			      fourcc, LOCAL_DRM_FORMAT_MOD_NONE, fb);
+	igt_assert(fb_id > 0);
+
+	ptr = igt_fb_map_buffer(fb->fd, fb);
+	igt_assert(ptr);
+
+	chamelium_paint_xr24_pattern(ptr, mode->vdisplay, mode->hdisplay);
+	igt_fb_unmap_buffer(fb, ptr);
+
+	return fb_id;
 }
 
 static void do_test_display_crc(data_t *data, struct chamelium_port *port,
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 11/13] chamelium: Add format support
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (9 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests Maxime Ripard
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

In order to introduce CRC subtests for DRM formats, we need to take an
intermediate step.

The current code will generate a pattern in XR24, and will try to compare
the CRC returned by the Chamelium for each frames.

This CRC is computed on an XR24 format as well, so it works. However, as
soon as we will start implementing other formats, if we just change the
format of the pattern, the raw content of the buffer, and therefore the
CRC's won't match anymore.

In order to address that, we will need an intermediate step, and we will
now still create the XR24 pattern, and compute its CRC, then convert it to
the format we want to test, and finally retrieve the CRC from the Chamelium
to compare it with the one from the XR24 pattern.

The current code is converted to the new prototype that will take the
fourcc of the format to test, even though we're still using XR24 everywhere
for now.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 4f4984b51b41..aa0aa4fd89ef 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -524,21 +524,25 @@ static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode,
 
 static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 				igt_output_t *output, drmModeModeInfo *mode,
-				int count)
+				uint32_t fourcc, int count)
 {
 	igt_crc_t *crc;
 	igt_crc_t *expected_crc;
 	struct chamelium_fb_crc_async_data *fb_crc;
-	struct igt_fb fb;
+	struct igt_fb frame_fb, fb;
 	int i, fb_id, captured_frame_count;
+	int frame_id;
 
 	fb_id = chamelium_get_pattern_fb(data, mode, DRM_FORMAT_XRGB8888, &fb);
 	igt_assert(fb_id > 0);
 
+	frame_id = igt_fb_convert(&frame_fb, &fb, fourcc);
+	igt_assert(frame_id > 0);
+
 	fb_crc = chamelium_calculate_fb_crc_async_start(data->drm_fd,
 							&fb);
 
-	enable_output(data, port, output, mode, &fb);
+	enable_output(data, port, output, mode, &frame_fb);
 
 	/* We want to keep the display running for a little bit, since
 	 * there's always the potential the driver isn't able to keep
@@ -562,6 +566,7 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
 	free(expected_crc);
 	free(crc);
 
+	igt_remove_fb(data->drm_fd, &frame_fb);
 	igt_remove_fb(data->drm_fd, &fb);
 }
 
@@ -580,7 +585,7 @@ static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
 }
 
 static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
-				      int count)
+				      uint32_t fourcc, int count)
 {
 	igt_output_t *output;
 	drmModeConnector *connector;
@@ -597,13 +602,13 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
 	mode = find_preferred_mode(connector);
 	igt_assert(mode);
 
-	do_test_display_crc(data, port, output, mode, count);
+	do_test_display_crc(data, port, output, mode, fourcc, count);
 
 	drmModeFreeConnector(connector);
 }
 
 static void test_display_crc_all_modes(data_t *data, struct chamelium_port *port,
-					int count)
+				       uint32_t fourcc, int count)
 {
 	igt_output_t *output;
 	igt_plane_t *primary;
@@ -620,7 +625,7 @@ static void test_display_crc_all_modes(data_t *data, struct chamelium_port *port
 	for (i = 0; i < connector->count_modes; i++) {
 		drmModeModeInfo *mode = &connector->modes[i];
 
-		do_test_display_crc(data, port, output, mode, count);
+		do_test_display_crc(data, port, output, mode, fourcc, count);
 	}
 
 	drmModeFreeConnector(connector);
@@ -881,13 +886,16 @@ igt_main
 							edid_id, alt_edid_id);
 
 		connector_subtest("dp-crc-single", DisplayPort)
-			test_display_crc_all_modes(&data, port, 1);
+			test_display_crc_all_modes(&data, port,
+						   DRM_FORMAT_XRGB8888, 1);
 
 		connector_subtest("dp-crc-fast", DisplayPort)
-			test_display_crc_one_mode(&data, port, 1);
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_XRGB8888, 1);
 
 		connector_subtest("dp-crc-multiple", DisplayPort)
-			test_display_crc_all_modes(&data, port, 3);
+			test_display_crc_all_modes(&data, port,
+						   DRM_FORMAT_XRGB8888, 3);
 
 		connector_subtest("dp-frame-dump", DisplayPort)
 			test_display_frame_dump(&data, port);
@@ -945,13 +953,16 @@ igt_main
 							edid_id, alt_edid_id);
 
 		connector_subtest("hdmi-crc-single", HDMIA)
-			test_display_crc_all_modes(&data, port, 1);
+			test_display_crc_all_modes(&data, port,
+						   DRM_FORMAT_XRGB8888, 1);
 
 		connector_subtest("hdmi-crc-fast", HDMIA)
-			test_display_crc_one_mode(&data, port, 1);
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_XRGB8888, 1);
 
 		connector_subtest("hdmi-crc-multiple", HDMIA)
-			test_display_crc_all_modes(&data, port, 3);
+			test_display_crc_all_modes(&data, port,
+						   DRM_FORMAT_XRGB8888, 3);
 
 		connector_subtest("hdmi-frame-dump", HDMIA)
 			test_display_frame_dump(&data, port);
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (10 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 11/13] chamelium: Add format support Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

Now that we have everything in place, we can add the support for the
subtests testing the output of planes setup with formats other than XR24.
Since YUV will be a bit trickier to handle, start with various common RGB
formats.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index aa0aa4fd89ef..e77b930a8298 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -964,6 +964,46 @@ igt_main
 			test_display_crc_all_modes(&data, port,
 						   DRM_FORMAT_XRGB8888, 3);
 
+		connector_subtest("hdmi-crc-argb8888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_ARGB8888, 1);
+
+		connector_subtest("hdmi-crc-abgr8888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_ABGR8888, 1);
+
+		connector_subtest("hdmi-crc-xrgb8888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_XRGB8888, 1);
+
+		connector_subtest("hdmi-crc-xbgr8888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_XBGR8888, 1);
+
+		connector_subtest("hdmi-crc-rgb888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_RGB888, 1);
+
+		connector_subtest("hdmi-crc-bgr888", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_BGR888, 1);
+
+		connector_subtest("hdmi-crc-rgb565", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_RGB565, 1);
+
+		connector_subtest("hdmi-crc-bgr565", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_BGR565, 1);
+
+		connector_subtest("hdmi-crc-argb1555", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_ARGB1555, 1);
+
+		connector_subtest("hdmi-crc-xrgb1555", HDMIA)
+			test_display_crc_one_mode(&data, port,
+						  DRM_FORMAT_XRGB1555, 1);
+
 		connector_subtest("hdmi-frame-dump", HDMIA)
 			test_display_frame_dump(&data, port);
 	}
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (11 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests Maxime Ripard
@ 2018-07-26 10:42 ` Maxime Ripard
  2018-07-27  8:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3) Patchwork
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-07-26 10:42 UTC (permalink / raw)
  To: igt-dev; +Cc: Maxime Ripard, eben, Paul Kocialkowski, Thomas Petazzoni

Now that we have support for the format sub-tests, enable them in the vc4
chamelium test lists.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/vc4_ci/vc4-chamelium-fast.testlist | 10 ++++++++++
 tests/vc4_ci/vc4-chamelium.testlist      | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/tests/vc4_ci/vc4-chamelium-fast.testlist b/tests/vc4_ci/vc4-chamelium-fast.testlist
index 964167b82d00..dd45d12ab487 100644
--- a/tests/vc4_ci/vc4-chamelium-fast.testlist
+++ b/tests/vc4_ci/vc4-chamelium-fast.testlist
@@ -1,4 +1,14 @@
+igt@kms_chamelium@hdmi-crc-abgr8888
+igt@kms_chamelium@hdmi-crc-argb1555
+igt@kms_chamelium@hdmi-crc-argb8888
+igt@kms_chamelium@hdmi-crc-bgr565
+igt@kms_chamelium@hdmi-crc-bgr888
 igt@kms_chamelium@hdmi-crc-fast
+igt@kms_chamelium@hdmi-crc-rgb565
+igt@kms_chamelium@hdmi-crc-rgb888
+igt@kms_chamelium@hdmi-crc-xbgr8888
+igt@kms_chamelium@hdmi-crc-xrgb1555
+igt@kms_chamelium@hdmi-crc-xrgb8888
 igt@kms_chamelium@hdmi-edid-read
 igt@kms_chamelium@hdmi-hpd
 igt@kms_chamelium@hdmi-hpd-fast
diff --git a/tests/vc4_ci/vc4-chamelium.testlist b/tests/vc4_ci/vc4-chamelium.testlist
index b00f54cd9c46..d3d4104acf48 100644
--- a/tests/vc4_ci/vc4-chamelium.testlist
+++ b/tests/vc4_ci/vc4-chamelium.testlist
@@ -1,6 +1,16 @@
+igt@kms_chamelium@hdmi-crc-abgr8888
+igt@kms_chamelium@hdmi-crc-argb1555
+igt@kms_chamelium@hdmi-crc-argb8888
+igt@kms_chamelium@hdmi-crc-bgr565
+igt@kms_chamelium@hdmi-crc-bgr888
 igt@kms_chamelium@hdmi-crc-fast
 igt@kms_chamelium@hdmi-crc-multiple
+igt@kms_chamelium@hdmi-crc-rgb565
+igt@kms_chamelium@hdmi-crc-rgb888
 igt@kms_chamelium@hdmi-crc-single
+igt@kms_chamelium@hdmi-crc-xbgr8888
+igt@kms_chamelium@hdmi-crc-xrgb1555
+igt@kms_chamelium@hdmi-crc-xrgb8888
 igt@kms_chamelium@hdmi-edid-read
 igt@kms_chamelium@hdmi-frame-dump
 igt@kms_chamelium@hdmi-hpd
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3)
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (12 preceding siblings ...)
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
@ 2018-07-27  8:49 ` Patchwork
  2018-07-27 11:32 ` Patchwork
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2018-07-27  8:49 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

Series: chamelium: Test the plane formats (rev3)
URL   : https://patchwork.freedesktop.org/series/42165/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4547 -> IGTPW_1655 =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1655 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1655, 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/42165/revisions/3/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@debugfs_test@read_all_entries:
      {fi-icl-u}:         NOTRUN -> DMESG-WARN

    igt@drv_module_reload@basic-reload-inject:
      fi-pnv-d510:        NOTRUN -> INCOMPLETE

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-no-display:
      fi-cnl-psr:         NOTRUN -> DMESG-WARN (fdo#105395) +2

    igt@gem_exec_suspend@basic-s3:
      {fi-skl-caroline}:  NOTRUN -> INCOMPLETE (fdo#104108)

    igt@gem_workarounds@basic-read:
      {fi-icl-u}:         NOTRUN -> FAIL (fdo#107338)

    igt@kms_chamelium@hdmi-hpd-fast:
      fi-kbl-7500u:       SKIP -> FAIL (fdo#103841, fdo#102672)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-skl-guc:         PASS -> FAIL (fdo#103191)
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      {fi-icl-u}:         NOTRUN -> DMESG-WARN (fdo#107382) +4
      fi-skl-6700k2:      PASS -> FAIL (fdo#103191)

    {igt@kms_psr@cursor_plane_move}:
      fi-cnl-psr:         NOTRUN -> DMESG-FAIL (fdo#107372)

    {igt@kms_psr@primary_mmap_gtt}:
      fi-cnl-psr:         NOTRUN -> DMESG-WARN (fdo#107372) +1

    {igt@kms_psr@primary_page_flip}:
      {fi-icl-u}:         NOTRUN -> FAIL (fdo#107383) +3

    igt@prime_vgem@basic-fence-flip:
      fi-blb-e6850:       PASS -> FAIL (fdo#103182)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#106725, fdo#106248) -> PASS

    igt@gem_exec_create@basic:
      fi-glk-j4005:       DMESG-WARN (fdo#106745) -> PASS

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       FAIL (fdo#100368) -> PASS

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

  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
  fdo#103182 https://bugs.freedesktop.org/show_bug.cgi?id=103182
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
  fdo#105395 https://bugs.freedesktop.org/show_bug.cgi?id=105395
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
  fdo#106745 https://bugs.freedesktop.org/show_bug.cgi?id=106745
  fdo#107338 https://bugs.freedesktop.org/show_bug.cgi?id=107338
  fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
  fdo#107382 https://bugs.freedesktop.org/show_bug.cgi?id=107382
  fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383


== Participating hosts (48 -> 47) ==

  Additional (5): fi-byt-j1900 fi-skl-caroline fi-icl-u fi-cnl-psr fi-pnv-d510 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper 


== Build changes ==

    * IGT: IGT_4575 -> IGTPW_1655

  CI_DRM_4547: 0a7ab192a697e951b2404f3c1ce42c5fa74f9ed1 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1655: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1655/
  IGT_4575: fe908a01012c9daafafb3410b9407725ca9d4f21 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_chamelium@hdmi-crc-abgr8888
+igt@kms_chamelium@hdmi-crc-argb1555
+igt@kms_chamelium@hdmi-crc-argb8888
+igt@kms_chamelium@hdmi-crc-bgr565
+igt@kms_chamelium@hdmi-crc-bgr888
+igt@kms_chamelium@hdmi-crc-rgb565
+igt@kms_chamelium@hdmi-crc-rgb888
+igt@kms_chamelium@hdmi-crc-xbgr8888
+igt@kms_chamelium@hdmi-crc-xrgb1555
+igt@kms_chamelium@hdmi-crc-xrgb8888

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3)
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (13 preceding siblings ...)
  2018-07-27  8:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3) Patchwork
@ 2018-07-27 11:32 ` Patchwork
  2018-07-28 12:42 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
  2018-07-28 16:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  16 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2018-07-27 11:32 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

Series: chamelium: Test the plane formats (rev3)
URL   : https://patchwork.freedesktop.org/series/42165/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4547 -> IGTPW_1659 =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1659 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1659, 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/42165/revisions/3/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@drv_module_reload@basic-reload-inject:
      fi-pnv-d510:        NOTRUN -> INCOMPLETE

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      {fi-icl-u}:         NOTRUN -> DMESG-WARN (fdo#107396)

    igt@drv_module_reload@basic-no-display:
      fi-cnl-psr:         NOTRUN -> DMESG-WARN (fdo#105395) +2

    igt@gem_exec_suspend@basic-s3:
      {fi-skl-caroline}:  NOTRUN -> INCOMPLETE (fdo#104108)

    igt@gem_workarounds@basic-read:
      {fi-icl-u}:         NOTRUN -> FAIL (fdo#107338)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-FAIL (fdo#102614, fdo#106103)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      {fi-icl-u}:         NOTRUN -> DMESG-WARN (fdo#107382) +4

    {igt@kms_psr@cursor_plane_move}:
      fi-cnl-psr:         NOTRUN -> DMESG-FAIL (fdo#107372) +1

    {igt@kms_psr@primary_mmap_gtt}:
      fi-cnl-psr:         NOTRUN -> DMESG-WARN (fdo#107372)

    {igt@kms_psr@primary_page_flip}:
      {fi-icl-u}:         NOTRUN -> FAIL (fdo#107383) +3

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#106248, fdo#106725) -> PASS

    igt@gem_exec_create@basic:
      fi-glk-j4005:       DMESG-WARN (fdo#106745) -> PASS

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       FAIL (fdo#100368) -> PASS

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

  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
  fdo#105395 https://bugs.freedesktop.org/show_bug.cgi?id=105395
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
  fdo#106745 https://bugs.freedesktop.org/show_bug.cgi?id=106745
  fdo#107338 https://bugs.freedesktop.org/show_bug.cgi?id=107338
  fdo#107372 https://bugs.freedesktop.org/show_bug.cgi?id=107372
  fdo#107382 https://bugs.freedesktop.org/show_bug.cgi?id=107382
  fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
  fdo#107396 https://bugs.freedesktop.org/show_bug.cgi?id=107396


== Participating hosts (48 -> 47) ==

  Additional (5): fi-byt-j1900 fi-skl-caroline fi-icl-u fi-cnl-psr fi-pnv-d510 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper 


== Build changes ==

    * IGT: IGT_4575 -> IGTPW_1659

  CI_DRM_4547: 0a7ab192a697e951b2404f3c1ce42c5fa74f9ed1 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1659: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1659/
  IGT_4575: fe908a01012c9daafafb3410b9407725ca9d4f21 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_chamelium@hdmi-crc-abgr8888
+igt@kms_chamelium@hdmi-crc-argb1555
+igt@kms_chamelium@hdmi-crc-argb8888
+igt@kms_chamelium@hdmi-crc-bgr565
+igt@kms_chamelium@hdmi-crc-bgr888
+igt@kms_chamelium@hdmi-crc-rgb565
+igt@kms_chamelium@hdmi-crc-rgb888
+igt@kms_chamelium@hdmi-crc-xbgr8888
+igt@kms_chamelium@hdmi-crc-xrgb1555
+igt@kms_chamelium@hdmi-crc-xrgb8888

== Logs ==

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev3)
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (14 preceding siblings ...)
  2018-07-27 11:32 ` Patchwork
@ 2018-07-28 12:42 ` Patchwork
  2018-07-28 16:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  16 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2018-07-28 12:42 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

Series: chamelium: Test the plane formats (rev3)
URL   : https://patchwork.freedesktop.org/series/42165/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4562 -> IGTPW_1669 =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_chamelium@dp-hpd-fast:
      fi-skl-6700k2:      SKIP -> FAIL (fdo#103841) +4

    igt@kms_chamelium@hdmi-crc-fast:
      fi-skl-6700k2:      PASS -> FAIL (fdo#103841) +3

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-ivb-3520m:       FAIL (fdo#103375) -> PASS +2
      {fi-bdw-samus}:     DMESG-WARN -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      {fi-cfl-8109u}:     DMESG-WARN (fdo#107345) -> PASS +1

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      {fi-cfl-8109u}:     INCOMPLETE (fdo#106070) -> PASS

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

  fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#106070 https://bugs.freedesktop.org/show_bug.cgi?id=106070
  fdo#107345 https://bugs.freedesktop.org/show_bug.cgi?id=107345


== Participating hosts (53 -> 44) ==

  Missing    (9): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-8809g fi-icl-u fi-byt-clapper 


== Build changes ==

    * IGT: IGT_4579 -> IGTPW_1669

  CI_DRM_4562: 99bbd80f75cdcf28699ffd3c93a714ca4a89b962 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1669: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1669/
  IGT_4579: a21999477545c2aed1e6a80dc93f87368614c7e5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_chamelium@hdmi-crc-abgr8888
+igt@kms_chamelium@hdmi-crc-argb1555
+igt@kms_chamelium@hdmi-crc-argb8888
+igt@kms_chamelium@hdmi-crc-bgr565
+igt@kms_chamelium@hdmi-crc-bgr888
+igt@kms_chamelium@hdmi-crc-rgb565
+igt@kms_chamelium@hdmi-crc-rgb888
+igt@kms_chamelium@hdmi-crc-xbgr8888
+igt@kms_chamelium@hdmi-crc-xrgb1555
+igt@kms_chamelium@hdmi-crc-xrgb8888

== Logs ==

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for chamelium: Test the plane formats (rev3)
  2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
                   ` (15 preceding siblings ...)
  2018-07-28 12:42 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
@ 2018-07-28 16:33 ` Patchwork
  16 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2018-07-28 16:33 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

Series: chamelium: Test the plane formats (rev3)
URL   : https://patchwork.freedesktop.org/series/42165/
State : failure

== Summary ==

= CI Bug Log - changes from IGT_4579_full -> IGTPW_1669_full =

== Summary - FAILURE ==

  Serious unknown changes coming with IGTPW_1669_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1669_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/42165/revisions/3/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_atomic@plane_overlay_legacy:
      shard-hsw:          PASS -> FAIL +3
      shard-snb:          PASS -> FAIL +2

    igt@kms_plane@pixel-format-pipe-b-planes:
      shard-kbl:          PASS -> FAIL +10

    igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
      shard-glk:          PASS -> FAIL +7

    igt@kms_plane_scaling@pipe-b-scaler-with-rotation:
      shard-glk:          NOTRUN -> FAIL

    igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
      shard-apl:          PASS -> FAIL +10

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-glk:          PASS -> FAIL (fdo#106886)

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#106023)

    igt@kms_cursor_crc@cursor-64x64-dpms:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          PASS -> FAIL (fdo#106509, fdo#105454)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      shard-kbl:          PASS -> FAIL (fdo#103375) +2

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
      shard-kbl:          PASS -> FAIL (fdo#106539)

    igt@pm_rpm@modeset-lpsp:
      shard-kbl:          SKIP -> FAIL (fdo#106539)

    igt@prime_vgem@sync-blt:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@testdisplay:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359, fdo#107093)

    
    ==== Possible fixes ====

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-glk:          FAIL (fdo#105363) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-gtt:
      shard-snb:          DMESG-WARN -> PASS

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-wc:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

    igt@perf@blocking:
      shard-hsw:          FAIL (fdo#102252) -> PASS

    igt@pm_rpm@gem-execbuf:
      shard-glk:          FAIL (fdo#106539) -> PASS +4
      shard-apl:          FAIL (fdo#106539) -> PASS
      shard-kbl:          FAIL (fdo#106539) -> PASS
      shard-hsw:          FAIL (fdo#106539) -> PASS

    igt@pm_rpm@modeset-lpsp:
      shard-glk:          FAIL (fdo#106539) -> SKIP +1

    
  fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
  fdo#106539 https://bugs.freedesktop.org/show_bug.cgi?id=106539
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#107093 https://bugs.freedesktop.org/show_bug.cgi?id=107093
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4579 -> IGTPW_1669
    * Linux: CI_DRM_4560 -> CI_DRM_4562

  CI_DRM_4560: b73c0ddef408783e556741ac9d3679b7d153e3e1 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4562: 99bbd80f75cdcf28699ffd3c93a714ca4a89b962 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1669: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1669/
  IGT_4579: a21999477545c2aed1e6a80dc93f87368614c7e5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH v4 06/13] fb: Add more formats
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
@ 2018-08-09 21:25   ` Eric Anholt
  0 siblings, 0 replies; 25+ messages in thread
From: Eric Anholt @ 2018-08-09 21:25 UTC (permalink / raw)
  To: Maxime Ripard, igt-dev
  Cc: eben, Maxime Ripard, Paul Kocialkowski, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 874 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> We're going to need some DRM formats, and we're going to need the igt_fb
> code to handle them. Since it relies on the format_desc structure to map
> the DRM fourcc to the pixman and cairo formats, we need to add these new
> formats to that structure.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  lib/igt_fb.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 9defbd8b044c..17deeada5beb 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -72,16 +72,46 @@ static struct format_desc_struct {
>  	int num_planes;
>  	int plane_bpp[4];
>  } format_desc[] = {
> +	{ .name = "ARGB1555", .depth = 15, .drm_id = DRM_FORMAT_ARGB1555,

.depth=16 here?

Other than that, 1-6 are:

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
@ 2018-08-09 21:28   ` Eric Anholt
  2018-08-23 11:46     ` Maxime Ripard
  2018-08-23 15:17   ` Ville Syrjälä
  1 sibling, 1 reply; 25+ messages in thread
From: Eric Anholt @ 2018-08-09 21:28 UTC (permalink / raw)
  To: Maxime Ripard, igt-dev
  Cc: eben, Maxime Ripard, Paul Kocialkowski, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 1740 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> The current code is testing the first mode in the connector list when it's
> testing a single mode. While this is arbitrarily chosen, it makes more
> sense to use the preferred mode reported by the display.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  tests/kms_chamelium.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index 490bacc6f5fe..5d7fb83fb74f 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -534,6 +534,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
>  	igt_remove_fb(data->drm_fd, &fb);
>  }
>  
> +static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
> +{
> +	int i;
> +
> +	for (i = 0; i < connector->count_modes; i++) {
> +		drmModeModeInfo *mode = &connector->modes[i];
> +
> +		if (mode->type & DRM_MODE_TYPE_PREFERRED)
> +			return mode;
> +	}
> +
> +	return NULL;
> +}
> +
>  static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  				      int count)
>  {
> @@ -549,7 +563,10 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>  	igt_assert(primary);
>  
> -	do_test_display_crc(data, port, output, &connector->modes[0], count);
> +	mode = find_preferred_mode(connector);
> +	igt_assert(mode);
> +
> +	do_test_display_crc(data, port, output, mode, count);

Instead of asserting, should we pick the first if there was no
preferred?  I don't really know, so I'd ack the patch either way.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Maxime Ripard
@ 2018-08-09 21:31   ` Eric Anholt
  2018-08-24  7:59     ` Maxime Ripard
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Anholt @ 2018-08-09 21:31 UTC (permalink / raw)
  To: Maxime Ripard, igt-dev
  Cc: eben, Maxime Ripard, Paul Kocialkowski, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 1011 bytes --]

Maxime Ripard <maxime.ripard@bootlin.com> writes:

> The current pattern being used is the one generated through the
> igt_create_color_pattern_fb.
>
> However, in order to deal with multiple formats and the upsampling /
> downsampling issues that might arise from converting back and forth between
> formats, we will need to have a pattern with quite precise color values,
> and without any shades or gradient of colors.

64x64 blocks of color seem pretty limited, and might miss tiling issues
for people -- would the previous pattern be worth using for 1:1,
possibly non-format-converted cases?

> The easiest way to do that will be to only use values that would have the
> same part on the common most significant bits (5, to deal with the most
> formats) and have the same bit repeated on the least significant bits that
> are going to be dropped and / or padded when converting between formats.
>
> Pixman will fill the lowest bits with 1, and our hardware is able to

Let's specify which hardware here :)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
  2018-08-09 21:28   ` Eric Anholt
@ 2018-08-23 11:46     ` Maxime Ripard
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-08-23 11:46 UTC (permalink / raw)
  To: Eric Anholt; +Cc: Paul Kocialkowski, eben, igt-dev, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 2099 bytes --]

Hi Eric,

On Thu, Aug 09, 2018 at 02:28:12PM -0700, Eric Anholt wrote:
> Maxime Ripard <maxime.ripard@bootlin.com> writes:
> 
> > The current code is testing the first mode in the connector list when it's
> > testing a single mode. While this is arbitrarily chosen, it makes more
> > sense to use the preferred mode reported by the display.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > ---
> >  tests/kms_chamelium.c | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> > index 490bacc6f5fe..5d7fb83fb74f 100644
> > --- a/tests/kms_chamelium.c
> > +++ b/tests/kms_chamelium.c
> > @@ -534,6 +534,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
> >  	igt_remove_fb(data->drm_fd, &fb);
> >  }
> >  
> > +static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
> > +{
> > +	int i;
> > +
> > +	for (i = 0; i < connector->count_modes; i++) {
> > +		drmModeModeInfo *mode = &connector->modes[i];
> > +
> > +		if (mode->type & DRM_MODE_TYPE_PREFERRED)
> > +			return mode;
> > +	}
> > +
> > +	return NULL;
> > +}
> > +
> >  static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
> >  				      int count)
> >  {
> > @@ -549,7 +563,10 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
> >  	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> >  	igt_assert(primary);
> >  
> > -	do_test_display_crc(data, port, output, &connector->modes[0], count);
> > +	mode = find_preferred_mode(connector);
> > +	igt_assert(mode);
> > +
> > +	do_test_display_crc(data, port, output, mode, count);
> 
> Instead of asserting, should we pick the first if there was no
> preferred?  I don't really know, so I'd ack the patch either way.

I've changed the return NULL above to return &connector->modes[0]
instead.

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
  2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
  2018-08-09 21:28   ` Eric Anholt
@ 2018-08-23 15:17   ` Ville Syrjälä
  2018-08-24  7:49     ` Maxime Ripard
  1 sibling, 1 reply; 25+ messages in thread
From: Ville Syrjälä @ 2018-08-23 15:17 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: Paul Kocialkowski, eben, igt-dev, Thomas Petazzoni

On Thu, Jul 26, 2018 at 12:42:07PM +0200, Maxime Ripard wrote:
> The current code is testing the first mode in the connector list when it's
> testing a single mode. While this is arbitrarily chosen, it makes more
> sense to use the preferred mode reported by the display.

The kernel sorts modes such that preferred modes appear before
non-preferred modes.

> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  tests/kms_chamelium.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index 490bacc6f5fe..5d7fb83fb74f 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -534,6 +534,20 @@ static void do_test_display_crc(data_t *data, struct chamelium_port *port,
>  	igt_remove_fb(data->drm_fd, &fb);
>  }
>  
> +static drmModeModeInfo *find_preferred_mode(drmModeConnector *connector)
> +{
> +	int i;
> +
> +	for (i = 0; i < connector->count_modes; i++) {
> +		drmModeModeInfo *mode = &connector->modes[i];
> +
> +		if (mode->type & DRM_MODE_TYPE_PREFERRED)
> +			return mode;
> +	}
> +
> +	return NULL;
> +}
> +
>  static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  				      int count)
>  {
> @@ -549,7 +563,10 @@ static void test_display_crc_one_mode(data_t *data, struct chamelium_port *port,
>  	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>  	igt_assert(primary);
>  
> -	do_test_display_crc(data, port, output, &connector->modes[0], count);
> +	mode = find_preferred_mode(connector);
> +	igt_assert(mode);
> +
> +	do_test_display_crc(data, port, output, mode, count);
>  
>  	drmModeFreeConnector(connector);
>  }
> -- 
> git-series 0.9.1

-- 
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] 25+ messages in thread

* Re: [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode
  2018-08-23 15:17   ` Ville Syrjälä
@ 2018-08-24  7:49     ` Maxime Ripard
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-08-24  7:49 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Paul Kocialkowski, eben, igt-dev, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 620 bytes --]

Hi Ville,

On Thu, Aug 23, 2018 at 06:17:48PM +0300, Ville Syrjälä wrote:
> On Thu, Jul 26, 2018 at 12:42:07PM +0200, Maxime Ripard wrote:
> > The current code is testing the first mode in the connector list when it's
> > testing a single mode. While this is arbitrarily chosen, it makes more
> > sense to use the preferred mode reported by the display.
> 
> The kernel sorts modes such that preferred modes appear before
> non-preferred modes.

Ah, that's good to know. I've dropped that patch then, thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one
  2018-08-09 21:31   ` Eric Anholt
@ 2018-08-24  7:59     ` Maxime Ripard
  0 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2018-08-24  7:59 UTC (permalink / raw)
  To: Eric Anholt; +Cc: Paul Kocialkowski, eben, igt-dev, Thomas Petazzoni


[-- Attachment #1.1: Type: text/plain, Size: 1399 bytes --]

Hi Eric,

On Thu, Aug 09, 2018 at 02:31:50PM -0700, Eric Anholt wrote:
> Maxime Ripard <maxime.ripard@bootlin.com> writes:
> 
> > The current pattern being used is the one generated through the
> > igt_create_color_pattern_fb.
> >
> > However, in order to deal with multiple formats and the upsampling /
> > downsampling issues that might arise from converting back and forth between
> > formats, we will need to have a pattern with quite precise color values,
> > and without any shades or gradient of colors.
> 
> 64x64 blocks of color seem pretty limited, and might miss tiling issues
> for people -- would the previous pattern be worth using for 1:1,
> possibly non-format-converted cases?

I've changed it to use the previous pattern if we have the same depth
(and therefore won't have any up/down sampling issues).

> > The easiest way to do that will be to only use values that would have the
> > same part on the common most significant bits (5, to deal with the most
> > formats) and have the same bit repeated on the least significant bits that
> > are going to be dropped and / or padded when converting between formats.
> >
> > Pixman will fill the lowest bits with 1, and our hardware is able to
> 
> Let's specify which hardware here :)

ACK :)

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

end of thread, other threads:[~2018-08-24  8:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
2018-08-09 21:25   ` Eric Anholt
2018-07-26 10:42 ` [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
2018-08-09 21:28   ` Eric Anholt
2018-08-23 11:46     ` Maxime Ripard
2018-08-23 15:17   ` Ville Syrjälä
2018-08-24  7:49     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Maxime Ripard
2018-08-09 21:31   ` Eric Anholt
2018-08-24  7:59     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 11/13] chamelium: Add format support Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-07-27  8:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3) Patchwork
2018-07-27 11:32 ` Patchwork
2018-07-28 12:42 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2018-07-28 16:33 ` [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.