All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats
@ 2018-10-04 12:38 Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 01/16] fb: Add buffer map/unmap functions Maxime Ripard
                   ` (17 more replies)
  0 siblings, 18 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: 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 v7:
  * Rebased on top of current master
  * Fixed a breakage on intel platforms
  * Move back to a hand crafted shadow buffer using mmap, but initialise a
    matching igt_fb to represent it using fb_init.
  * Made pixman mandatory
  * Remove YUYV pixman support, since it's causing a segfault
  * Removed width and height parameters from struct fb_convert
  * Dropped the depth from the formats

Changes from v6:
  * Convert the igt_fb cairo shadow buffer to a igt_fb of its own
  * Fix a regression in the igt_fb common code that will prevent it from
    running on anything else than i915

Changes from v5:
  * Fixed a typo

Changes from v4:
  * Added Eric's Reviewed-by
  * Dropped the preferred mode patch
  * Use the igt_fb pattern if we can
  * Rebased on top of master

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 (16):
  fb: Add buffer map/unmap functions
  fb: Only set the GEM domain on intel platforms
  fb: Add RGB888 format
  fb: Use an igt_fb for the cairo shadow buffer
  fb: convert: Remove swizzle from the arguments
  fb: Create common function to convert frame formats
  fb: Add format conversion routine
  igt: Make pixman mandatory
  tests: kms_plane: Disable XBGR8888
  fb: Add support for conversions through pixman
  fb: Add more formats
  chamelium: Split CRC test function in two
  chamelium: Change our pattern for a custom one if needed
  chamelium: Add format support
  chamelium: Add format subtests
  tests: Add chamelium formats subtests to vc4 test lists

 README                                   |   2 +-
 lib/igt_fb.c                             | 467 ++++++++++++++++++------
 lib/igt_fb.h                             |   4 +-
 meson.build                              |   9 +-
 tests/kms_chamelium.c                    | 205 ++++++++---
 tests/kms_plane.c                        |  10 +-
 tests/vc4_ci/vc4-chamelium-fast.testlist |  10 +-
 tests/vc4_ci/vc4-chamelium.testlist      |  10 +-
 8 files changed, 547 insertions(+), 170 deletions(-)

base-commit: d36388a9f2dfc76ac3ccc963242de1f44f9cacd4
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 01/16] fb: Add buffer map/unmap functions
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms Maxime Ripard
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 59 ++++++++++++++++++++++++++++++++++++++++++++---------
 lib/igt_fb.h |  2 ++-
 2 files changed, 51 insertions(+), 10 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index cba67f41bcc1..f1332169915f 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1336,18 +1336,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;
 
@@ -1361,6 +1366,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),
@@ -1776,7 +1788,7 @@ static void destroy_cairo_surface__convert(void *arg)
 	if (blit->base.linear.fb.gem_handle)
 		free_linear_mapping(&blit->base);
 	else
-		gem_munmap(blit->base.linear.map, fb->size);
+		unmap_bo(fb, blit->base.linear.map);
 
 	free(blit);
 
@@ -1800,10 +1812,7 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 		setup_linear_mapping(fd, fb, &blit->base.linear);
 	} else {
 		blit->base.linear.fb.gem_handle = 0;
-		gem_set_domain(fd, fb->gem_handle,
-			       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
-		blit->base.linear.map = gem_mmap__gtt(fd, fb->gem_handle, fb->size,
-						      PROT_READ | PROT_WRITE);
+		blit->base.linear.map = map_bo(fd, fb);
 		igt_assert(blit->base.linear.map);
 		blit->base.linear.fb.size = fb->size;
 		memcpy(blit->base.linear.fb.strides, fb->strides, sizeof(fb->strides));
@@ -1838,6 +1847,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 35bf307a930b..758d4d0dd2eb 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] 28+ messages in thread

* [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 01/16] fb: Add buffer map/unmap functions Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-05  8:11   ` Arkadiusz Hiler
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format Maxime Ripard
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: eben, Paul Kocialkowski, Thomas Petazzoni

The gem_set_domain call uses an i915 specific ioctl that will fail on
anything else. Let's move that call under a check for whether or not we're
running on an intel platform.

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

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f1332169915f..aaa90bf74a9a 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1356,8 +1356,9 @@ static void *map_bo(int fd, struct igt_fb *fb)
 {
 	void *ptr;
 
-	gem_set_domain(fd, fb->gem_handle,
-		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+	if (is_i915_device(fd))
+		gem_set_domain(fd, fb->gem_handle,
+			       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
 	if (fb->is_dumb)
 		ptr = kmstest_dumb_map_buffer(fd, fb->gem_handle, fb->size,
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 01/16] fb: Add buffer map/unmap functions Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-05 15:57   ` Arkadiusz Hiler
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer Maxime Ripard
                   ` (14 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: eben, Paul Kocialkowski, Thomas Petazzoni

The RGB888 format is the one used as the shadow buffer used when a cairo
surface is requested for a format that Cairo cannot handle.

Since we're going to move that buffer representation to a struct igt_fb,
let's add the RGB888 format to the list of formats that igt_fb knows about.

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

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index aaa90bf74a9a..805a7b737981 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -72,6 +72,10 @@ static const struct format_desc_struct {
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "RGB888", .drm_id = DRM_FORMAT_RGB888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .num_planes = 1, .plane_bpp = { 24, },
+	},
 	{ .name = "XRGB8888", .depth = 24, .drm_id = DRM_FORMAT_XRGB8888,
 	  .cairo_id = CAIRO_FORMAT_RGB24,
 	  .num_planes = 1, .plane_bpp = { 32, },
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (2 preceding siblings ...)
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-08 13:41   ` Arkadiusz Hiler
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 05/16] fb: convert: Remove swizzle from the arguments Maxime Ripard
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: eben, Paul Kocialkowski, Thomas Petazzoni

In the case where an igt_fb user wants to get a cairo surface out of that
framebuffer, if the format of that framebuffer cannot be imported as-is in
Cairo, the current code will do an anonymous mapping to create a shadow
buffer where an RGB24 copy of that buffer will be created.

However, making that shadow buffer into an igt_fb itself will help us do
further improvements on the conversion code.

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

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 805a7b737981..a9d91e47ecae 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1392,13 +1392,39 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
 struct fb_convert_blit_upload {
 	struct fb_blit_upload base;
 
-	struct {
-		uint64_t size;
-		uint8_t *map;
-		unsigned stride;
-	} rgb24;
+	struct igt_fb shadow_fb;
+	uint8_t *shadow_ptr;
 };
 
+static void *igt_fb_create_cairo_shadow_buffer(int fd,
+					       unsigned int width,
+					       unsigned int height,
+					       struct igt_fb *shadow)
+{
+	void *ptr;
+
+	igt_assert(shadow);
+
+	fb_init(shadow, fd, width, height,
+		DRM_FORMAT_RGB888, LOCAL_DRM_FORMAT_MOD_NONE,
+		IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_LIMITED_RANGE);
+
+	shadow->strides[0] = ALIGN(width * 4, 16);
+	shadow->size = ALIGN(shadow->strides[0] * height,
+			     sysconf(_SC_PAGESIZE));
+	ptr = mmap(NULL, shadow->size, PROT_READ | PROT_WRITE,
+		   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+	igt_assert(ptr != MAP_FAILED);
+
+	return ptr;
+}
+
+static void igt_fb_destroy_cairo_shadow_buffer(struct igt_fb *shadow,
+					       void *ptr)
+{
+	munmap(ptr, shadow->size);
+}
+
 static uint8_t clamprgb(float val)
 {
 	return clamp((int)(val + 0.5f), 0, 255);
@@ -1423,8 +1449,9 @@ static void convert_nv12_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 {
 	int i, j;
 	const uint8_t *y, *uv;
-	uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride, planar_stride = blit->base.linear.fb.strides[0];
+	uint8_t *rgb24 = blit->shadow_ptr;
+	unsigned rgb24_stride = blit->shadow_fb.strides[0];
+	unsigned planar_stride = blit->base.linear.fb.strides[0];
 	uint8_t *buf = malloc(blit->base.linear.fb.size);
 	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
 						    fb->color_range);
@@ -1532,8 +1559,8 @@ static void convert_rgb24_to_nv12(struct igt_fb *fb, struct fb_convert_blit_uplo
 	int i, j;
 	uint8_t *y = &blit->base.linear.map[blit->base.linear.fb.offsets[0]];
 	uint8_t *uv = &blit->base.linear.map[blit->base.linear.fb.offsets[1]];
-	const uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride;
+	const uint8_t *rgb24 = blit->shadow_ptr;
+	unsigned rgb24_stride = blit->shadow_fb.strides[0];
 	unsigned planar_stride = blit->base.linear.fb.strides[0];
 	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
 						    fb->color_range);
@@ -1660,8 +1687,9 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 {
 	int i, j;
 	const uint8_t *yuyv;
-	uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride, yuyv_stride = blit->base.linear.fb.strides[0];
+	uint8_t *rgb24 = blit->shadow_ptr;
+	unsigned rgb24_stride = blit->shadow_fb.strides[0];
+	unsigned yuyv_stride = blit->base.linear.fb.strides[0];
 	uint8_t *buf = malloc(blit->base.linear.fb.size);
 	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
 						    fb->color_range);
@@ -1719,8 +1747,8 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
 {
 	int i, j;
 	uint8_t *yuyv = blit->base.linear.map;
-	const uint8_t *rgb24 = blit->rgb24.map;
-	unsigned rgb24_stride = blit->rgb24.stride;
+	const uint8_t *rgb24 = blit->shadow_ptr;
+	unsigned rgb24_stride = blit->shadow_fb.strides[0];
 	unsigned yuyv_stride = blit->base.linear.fb.strides[0];
 	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
 						    fb->color_range);
@@ -1788,7 +1816,7 @@ static void destroy_cairo_surface__convert(void *arg)
 			     fb->drm_format);
 	}
 
-	munmap(blit->rgb24.map, blit->rgb24.size);
+	igt_fb_destroy_cairo_shadow_buffer(&blit->shadow_fb, blit->shadow_ptr);
 
 	if (blit->base.linear.fb.gem_handle)
 		free_linear_mapping(&blit->base);
@@ -1803,14 +1831,16 @@ 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));
+
 	igt_assert(blit);
 
 	blit->base.fd = fd;
 	blit->base.fb = fb;
-	blit->rgb24.stride = ALIGN(fb->width * 4, 16);
-	blit->rgb24.size = ALIGN((uint64_t) blit->rgb24.stride * fb->height, sysconf(_SC_PAGESIZE));
-	blit->rgb24.map = mmap(NULL, blit->rgb24.size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-	igt_assert(blit->rgb24.map != MAP_FAILED);
+	blit->shadow_ptr = igt_fb_create_cairo_shadow_buffer(fd,
+							     fb->width,
+							     fb->height,
+							     &blit->shadow_fb);
+	igt_assert(blit->shadow_ptr);
 
 	if (fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
 	    fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED) {
@@ -1841,10 +1871,10 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 	}
 
 	fb->cairo_surface =
-		cairo_image_surface_create_for_data(blit->rgb24.map,
+		cairo_image_surface_create_for_data(blit->shadow_ptr,
 						    CAIRO_FORMAT_RGB24,
 						    fb->width, fb->height,
-						    blit->rgb24.stride);
+						    blit->shadow_fb.strides[0]);
 
 	cairo_surface_set_user_data(fb->cairo_surface,
 				    (cairo_user_data_key_t *)create_cairo_surface__convert,
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 05/16] fb: convert: Remove swizzle from the arguments
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (3 preceding siblings ...)
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 06/16] fb: Create common function to convert frame formats Maxime Ripard
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
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 a9d91e47ecae..41b5ed06e2c5 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1682,8 +1682,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;
@@ -1693,6 +1692,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
 	uint8_t *buf = malloc(blit->base.linear.fb.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,
@@ -1742,8 +1742,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->base.linear.map;
@@ -1752,6 +1751,7 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
 	unsigned yuyv_stride = blit->base.linear.fb.strides[0];
 	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 ||
@@ -1809,7 +1809,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",
@@ -1863,7 +1863,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] 28+ messages in thread

* [igt-dev] [PATCH v8 06/16] fb: Create common function to convert frame formats
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (4 preceding siblings ...)
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 05/16] fb: convert: Remove swizzle from the arguments Maxime Ripard
@ 2018-10-04 12:38 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 07/16] fb: Add format conversion routine Maxime Ripard
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:38 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 214 +++++++++++++++++++++++++++++-----------------------
 1 file changed, 122 insertions(+), 92 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 41b5ed06e2c5..b8b8d066cdd6 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1445,28 +1445,38 @@ 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)
+struct fb_convert_buf {
+	void			*ptr;
+	struct igt_fb		*fb;
+};
+
+struct fb_convert {
+	struct fb_convert_buf	dst;
+	struct fb_convert_buf	src;
+};
+
+static void convert_nv12_to_rgb24(struct fb_convert *cvt)
 {
 	int i, j;
 	const uint8_t *y, *uv;
-	uint8_t *rgb24 = blit->shadow_ptr;
-	unsigned rgb24_stride = blit->shadow_fb.strides[0];
-	unsigned planar_stride = blit->base.linear.fb.strides[0];
-	uint8_t *buf = malloc(blit->base.linear.fb.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.fb->strides[0];
+	unsigned int planar_stride = cvt->src.fb->strides[0];
+	uint8_t *buf = malloc(cvt->src.fb->size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(cvt->src.fb->color_encoding,
+						    cvt->src.fb->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->base.linear.map, blit->base.linear.fb.size);
-	y = &buf[blit->base.linear.fb.offsets[0]];
-	uv = &buf[blit->base.linear.fb.offsets[1]];
+	igt_memcpy_from_wc(buf, cvt->src.ptr, cvt->src.fb->size);
+	y = cvt->src.ptr + cvt->src.fb->offsets[0];
+	uv = cvt->src.ptr + cvt->src.fb->offsets[1];
 
-	for (i = 0; i < fb->height / 2; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->dst.fb->height / 2; i++) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x2 pixel blocks */
 			struct igt_vec4 yuv[4];
 			struct igt_vec4 rgb[4];
@@ -1491,7 +1501,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->dst.fb->width & 1) {
 			/* Convert 1x2 pixel block */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1515,9 +1525,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->dst.fb->height & 1) {
 		/* Convert last row */
-		for (j = 0; j < fb->width / 2; j++) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1535,7 +1545,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->dst.fb->width & 1) {
 			/* Convert single pixel */
 			struct igt_vec4 yuv;
 			struct igt_vec4 rgb;
@@ -1554,22 +1564,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->base.linear.map[blit->base.linear.fb.offsets[0]];
-	uint8_t *uv = &blit->base.linear.map[blit->base.linear.fb.offsets[1]];
-	const uint8_t *rgb24 = blit->shadow_ptr;
-	unsigned rgb24_stride = blit->shadow_fb.strides[0];
-	unsigned planar_stride = blit->base.linear.fb.strides[0];
-	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.fb->offsets[0];
+	uint8_t *uv = cvt->dst.ptr + cvt->dst.fb->offsets[1];
+	const uint8_t *rgb24 = cvt->src.ptr;
+	unsigned rgb24_stride = cvt->src.fb->strides[0];
+	unsigned planar_stride = cvt->dst.fb->strides[0];
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(cvt->dst.fb->color_encoding,
+						    cvt->dst.fb->color_range);
+
+	igt_assert_f(cvt->dst.fb->drm_format == 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->dst.fb->height / 2; i++) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x2 pixel blocks */
 			struct igt_vec4 rgb[4];
 			struct igt_vec4 yuv[4];
@@ -1598,7 +1608,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->dst.fb->width & 1) {
 			/* Convert 1x2 pixel block */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1627,8 +1637,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->dst.fb->height & 1) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1645,7 +1655,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->dst.fb->width & 1) {
 			/* Convert single pixel */
 			struct igt_vec4 rgb;
 			struct igt_vec4 yuv;
@@ -1682,28 +1692,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->shadow_ptr;
-	unsigned rgb24_stride = blit->shadow_fb.strides[0];
-	unsigned yuyv_stride = blit->base.linear.fb.strides[0];
-	uint8_t *buf = malloc(blit->base.linear.fb.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.fb->strides[0];
+	unsigned int yuyv_stride = cvt->src.fb->strides[0];
+	uint8_t *buf = malloc(cvt->src.fb->size);
+	struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(cvt->src.fb->color_encoding,
+						    cvt->src.fb->color_range);
+	const unsigned char *swz = yuyv_swizzle(cvt->src.fb->drm_format);
 
 	/*
 	 * 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->base.linear.map, blit->base.linear.fb.size);
+	igt_memcpy_from_wc(buf, cvt->src.ptr, cvt->src.fb->size);
 	yuyv = buf;
 
-	for (i = 0; i < fb->height; i++) {
-		for (j = 0; j < fb->width / 2; j++) {
+	for (i = 0; i < cvt->dst.fb->height; i++) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 yuv[2];
 			struct igt_vec4 rgb[2];
@@ -1721,7 +1731,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->dst.fb->width & 1) {
 			struct igt_vec4 yuv;
 			struct igt_vec4 rgb;
 
@@ -1742,25 +1752,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->base.linear.map;
-	const uint8_t *rgb24 = blit->shadow_ptr;
-	unsigned rgb24_stride = blit->shadow_fb.strides[0];
-	unsigned yuyv_stride = blit->base.linear.fb.strides[0];
-	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.fb->strides[0];
+	unsigned yuyv_stride = cvt->dst.fb->strides[0];
+	struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(cvt->dst.fb->color_encoding,
+						    cvt->dst.fb->color_range);
+	const unsigned char *swz = yuyv_swizzle(cvt->dst.fb->drm_format);
+
+	igt_assert_f(cvt->dst.fb->drm_format == DRM_FORMAT_YUYV ||
+		     cvt->dst.fb->drm_format == DRM_FORMAT_YVYU ||
+		     cvt->dst.fb->drm_format == DRM_FORMAT_UYVY ||
+		     cvt->dst.fb->drm_format == 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->dst.fb->height; i++) {
+		for (j = 0; j < cvt->dst.fb->width / 2; j++) {
 			/* Convert 2x1 pixel blocks */
 			struct igt_vec4 rgb[2];
 			struct igt_vec4 yuv[2];
@@ -1777,7 +1787,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->dst.fb->width & 1) {
 			struct igt_vec4 rgb;
 			struct igt_vec4 yuv;
 
@@ -1795,27 +1805,56 @@ 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.fb->drm_format == DRM_FORMAT_RGB888) {
+		switch (cvt->src.fb->drm_format) {
+		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.fb->drm_format == DRM_FORMAT_RGB888) {
+		switch (cvt->dst.fb->drm_format) {
+		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.fb->drm_format, cvt->dst.fb->drm_format);
+}
+
 static void destroy_cairo_surface__convert(void *arg)
 {
 	struct fb_convert_blit_upload *blit = arg;
 	struct igt_fb *fb = blit->base.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 = {
+		.dst	= {
+			.ptr	= blit->base.linear.map,
+			.fb	= blit->base.fb,
+		},
+
+		.src	= {
+			.ptr	= blit->shadow_ptr,
+			.fb	= &blit->shadow_fb,
+		},
+	};
+
+	fb_convert(&cvt);
 	igt_fb_destroy_cairo_shadow_buffer(&blit->shadow_fb, blit->shadow_ptr);
 
 	if (blit->base.linear.fb.gem_handle)
@@ -1831,6 +1870,7 @@ 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);
 
@@ -1854,21 +1894,11 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 		memcpy(blit->base.linear.fb.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.dst.ptr = blit->shadow_ptr;
+	cvt.dst.fb = &blit->shadow_fb;
+	cvt.src.ptr = blit->base.linear.map;
+	cvt.src.fb = blit->base.fb;
+	fb_convert(&cvt);
 
 	fb->cairo_surface =
 		cairo_image_surface_create_for_data(blit->shadow_ptr,
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 07/16] fb: Add format conversion routine
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (5 preceding siblings ...)
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 06/16] fb: Create common function to convert frame formats Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory Maxime Ripard
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_fb.h |  2 ++
 2 files changed, 47 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index b8b8d066cdd6..2054fae1f229 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2037,6 +2037,51 @@ 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.dst.ptr = dst_ptr;
+	cvt.dst.fb = dst;
+	cvt.src.ptr = src_ptr;
+	cvt.src.fb = src;
+	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 758d4d0dd2eb..9f027deba842 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] 28+ messages in thread

* [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (6 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 07/16] fb: Add format conversion routine Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-05 11:42   ` Arkadiusz Hiler
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888 Maxime Ripard
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: eben, Paul Kocialkowski, Thomas Petazzoni

So far, pixman was used exclusively when the Chamelium support was enabled.

However, since we're going to use it as one of the backend to do the
igt_fb conversions between formats, we'll need it all the time. Make
that explicit.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 README      |  2 +-
 meson.build |  9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/README b/README
index f8ba5c710e81..78d14060dccd 100644
--- a/README
+++ b/README
@@ -145,6 +145,7 @@ the default configuration (package names may vary):
 	libcairo2-dev
 	libdrm-dev
 	libkmod-dev
+	libpixman-1-dev
 	libpciaccess-dev
 	libprocps-dev
 	libunwind-dev
@@ -157,7 +158,6 @@ The following dependencies are required for building chamelium support
 (package names may vary):
 
 	libxmlrpc-core-c3-dev
-	libpixman-1-dev
 	libudev-dev
 	libglib2.0-dev
 	libgsl-dev
diff --git a/meson.build b/meson.build
index faf1b764d69d..eff35585f619 100644
--- a/meson.build
+++ b/meson.build
@@ -105,6 +105,7 @@ libprocps = dependency('libprocps', required : true)
 libunwind = dependency('libunwind', required : true)
 libdw = dependency('libdw', required : true)
 ssl = dependency('openssl', required : true)
+pixman = dependency('pixman-1', required : true)
 
 valgrind = null_dep
 valgrindinfo = 'No'
@@ -123,16 +124,12 @@ glib = dependency('glib-2.0', required : true)
 
 gsl = null_dep
 alsa = null_dep
-pixman = null_dep
 if _build_audio or _build_chamelium
 	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
 endif
 if _build_audio
 	alsa = dependency('alsa', required : _audio_required)
 endif
-if _build_chamelium
-	pixman = dependency('pixman-1', required : _chamelium_required)
-endif
 
 audioinfo = 'No'
 if _build_audio and alsa.found() and gsl.found()
@@ -164,8 +161,8 @@ endif
 
 chamelium = null_dep
 chameliuminfo = 'No'
-if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
-	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
+if _build_chamelium and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
+	chamelium = declare_dependency(dependencies : [ xmlrpc,
 							xmlrpc_util, xmlrpc_client])
 	config.set('HAVE_CHAMELIUM', 1)
 	chameliuminfo = 'Yes'
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (7 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-08 13:06   ` Arkadiusz Hiler
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 10/16] fb: Add support for conversions through pixman Maxime Ripard
                   ` (8 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: eben, Paul Kocialkowski, Thomas Petazzoni

For some reason, the XBGR8888 CRC check will fail in the kms_plane tests.
Since that format will be enabled and checked by that test in the next
commit, make sure we don't introduce a regression for no particular reason.

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

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 5a0bc05b0f34..45e0a304e8ce 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -489,6 +489,16 @@ static void test_format_plane(data_t *data, enum pipe pipe,
 		if (!igt_fb_supported_format(format))
 			continue;
 
+		/*
+		 * There seems to be some issue there with the CRC not
+		 * matching. Both CRCs are stable, but don't match,
+		 * which seems to indicate some issue with the CRC
+		 * computation logic, but I haven't been able to find
+		 * what.
+		 */
+		if (format == DRM_FORMAT_XBGR8888)
+			continue;
+
 		igt_info("Testing format " IGT_FORMAT_FMT " on %s.%u\n",
 			 IGT_FORMAT_ARGS(format),
 			 kmstest_pipe_name(pipe), plane->index);
-- 
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] 28+ messages in thread

* [igt-dev] [PATCH v8 10/16] fb: Add support for conversions through pixman
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (8 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888 Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 11/16] fb: Add more formats Maxime Ripard
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 63 insertions(+), 3 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 2054fae1f229..cd3fe90c73e3 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,33 +60,41 @@
  * functions to work with these pixel format codes.
  */
 
+#define PIXMAN_invalid	0
+
 /* drm fourcc/cairo format maps */
 static const 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 = "RGB888", .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 = "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,
@@ -1192,6 +1201,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)
+{
+	const 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)
 {
 	const struct format_desc_struct *f;
@@ -1805,9 +1826,43 @@ 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.fb->drm_format);
+	pixman_format_code_t dst_pixman = drm_format_to_pixman(cvt->dst.fb->drm_format);
+	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->src.fb->width,
+					     cvt->src.fb->height,
+					     cvt->src.ptr,
+					     cvt->src.fb->strides[0]);
+	igt_assert(src_image);
+
+	dst_image = pixman_image_create_bits(dst_pixman,
+					     cvt->dst.fb->width,
+					     cvt->dst.fb->height,
+					     cvt->dst.ptr,
+					     cvt->dst.fb->strides[0]);
+	igt_assert(dst_image);
+
+	pixman_image_composite(PIXMAN_OP_SRC, src_image, NULL, dst_image,
+			       0, 0, 0, 0, 0, 0,
+			       cvt->dst.fb->width, cvt->dst.fb->height);
+	pixman_image_unref(dst_image);
+	pixman_image_unref(src_image);
+}
+
 static void fb_convert(struct fb_convert *cvt)
 {
-	if (cvt->dst.fb->drm_format == DRM_FORMAT_RGB888) {
+	if ((drm_format_to_pixman(cvt->src.fb->drm_format) != PIXMAN_invalid) &&
+	    (drm_format_to_pixman(cvt->dst.fb->drm_format) != PIXMAN_invalid)) {
+		convert_pixman(cvt);
+		return;
+	} else if (cvt->dst.fb->drm_format == DRM_FORMAT_RGB888) {
 		switch (cvt->src.fb->drm_format) {
 		case DRM_FORMAT_NV12:
 			convert_nv12_to_rgb24(cvt);
@@ -1954,8 +2009,12 @@ void igt_fb_unmap_buffer(struct igt_fb *fb, void *buffer)
  */
 cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
 {
+	const struct format_desc_struct *f = lookup_drm_format(fb->drm_format);
+
 	if (fb->cairo_surface == NULL) {
-		if (igt_format_is_yuv(fb->drm_format))
+		if (igt_format_is_yuv(fb->drm_format) ||
+		    ((f->cairo_id == CAIRO_FORMAT_INVALID) &&
+		     (f->pixman_id != PIXMAN_invalid)))
 			create_cairo_surface__convert(fd, fb);
 		else if (fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
 		    fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED)
@@ -2149,7 +2208,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] 28+ messages in thread

* [igt-dev] [PATCH v8 11/16] fb: Add more formats
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (9 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 10/16] fb: Add support for conversions through pixman Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 12/16] chamelium: Split CRC test function in two Maxime Ripard
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index cd3fe90c73e3..9f16984fd522 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -72,11 +72,31 @@ static const struct format_desc_struct {
 	int num_planes;
 	int plane_bpp[4];
 } format_desc[] = {
+	{ .name = "ARGB1555", .drm_id = DRM_FORMAT_ARGB1555,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a1r5g5b5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "XRGB1555", .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", .drm_id = DRM_FORMAT_BGR565,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b5g6r5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "BGR888", .drm_id = DRM_FORMAT_BGR888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b8g8r8,
+	  .num_planes = 1, .plane_bpp = { 24, },
+	},
 	{ .name = "RGB888", .drm_id = DRM_FORMAT_RGB888,
 	  .cairo_id = CAIRO_FORMAT_INVALID,
 	  .pixman_id = PIXMAN_r8g8b8,
@@ -87,6 +107,11 @@ static const struct format_desc_struct {
 	  .pixman_id = PIXMAN_x8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
+	{ .name = "XBGR8888", .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,
@@ -97,6 +122,11 @@ static const struct format_desc_struct {
 	  .pixman_id = PIXMAN_a8r8g8b8,
 	  .num_planes = 1, .plane_bpp = { 32, },
 	},
+	{ .name = "ABGR8888", .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] 28+ messages in thread

* [igt-dev] [PATCH v8 12/16] chamelium: Split CRC test function in two
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (10 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 11/16] fb: Add more formats Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed Maxime Ripard
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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 | 120 +++++++++++++++++++++++++------------------
 1 file changed, 72 insertions(+), 48 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index cf7e3c9aacac..49f6854ac611 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,20 +486,60 @@ 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;
 
 	reset_state(data, port);
 
@@ -508,46 +548,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;
+	do_test_display_crc(data, port, output, &connector->modes[0], count);
 
-	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);
-
-		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 +832,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 +896,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] 28+ messages in thread

* [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (11 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 12/16] chamelium: Split CRC test function in two Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-08 13:17   ` Arkadiusz Hiler
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 14/16] chamelium: Add format support Maxime Ripard
                   ` (4 subsequent siblings)
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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 that pattern in the chamelium
code if we need to convert the framebuffer to a smaller depth, and use the
current pattern otherwise.

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 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 (this has been
tested on a Raspberry Pi's VC4) 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 | 44 ++++++++++++++++++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 6 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 49f6854ac611..6aea4678feb5 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,6 +486,42 @@ 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);
+
+	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,
 				igt_output_t *output, drmModeModeInfo *mode,
 				int count)
@@ -496,12 +532,8 @@ 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] 28+ messages in thread

* [igt-dev] [PATCH v8 14/16] chamelium: Add format support
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (12 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 15/16] chamelium: Add format subtests Maxime Ripard
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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 6aea4678feb5..dbdbf62fd052 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -524,22 +524,26 @@ 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
@@ -563,11 +567,12 @@ 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);
 }
 
 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;
@@ -580,13 +585,13 @@ 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);
+	do_test_display_crc(data, port, output, &connector->modes[0], 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;
@@ -603,7 +608,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);
@@ -864,13 +869,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);
@@ -928,13 +936,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] 28+ messages in thread

* [igt-dev] [PATCH v8 15/16] chamelium: Add format subtests
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (13 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 14/16] chamelium: Add format support Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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 dbdbf62fd052..cce4401978ef 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -947,6 +947,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] 28+ messages in thread

* [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (14 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 15/16] chamelium: Add format subtests Maxime Ripard
@ 2018-10-04 12:39 ` Maxime Ripard
  2018-10-08 13:18   ` Arkadiusz Hiler
  2018-10-05  9:46 ` [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev7) Patchwork
  2018-10-05 13:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  17 siblings, 1 reply; 28+ messages in thread
From: Maxime Ripard @ 2018-10-04 12:39 UTC (permalink / raw)
  To: igt-dev; +Cc: 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] 28+ messages in thread

* Re: [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms Maxime Ripard
@ 2018-10-05  8:11   ` Arkadiusz Hiler
  0 siblings, 0 replies; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-05  8:11 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Paul Kocialkowski, Petri Latvala, eben, igt-dev, Thomas Petazzoni

On Thu, Oct 04, 2018 at 02:38:55PM +0200, Maxime Ripard wrote:
> The gem_set_domain call uses an i915 specific ioctl that will fail on
> anything else. Let's move that call under a check for whether or not we're
> running on an intel platform.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev7)
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (15 preceding siblings ...)
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
@ 2018-10-05  9:46 ` Patchwork
  2018-10-05 13:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  17 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2018-10-05  9:46 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

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

== Summary ==

= CI Bug Log - changes from CI_DRM_4933 -> IGTPW_1915 =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-bdw-samus:       NOTRUN -> INCOMPLETE (fdo#107773)

    
  fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773


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

  Additional (3): fi-glk-j4005 fi-bdw-samus fi-snb-2520m 
  Missing    (7): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-ctg-p8600 fi-byt-clapper fi-kbl-r 


== Build changes ==

    * IGT: IGT_4669 -> IGTPW_1915

  CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1915: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1915/
  IGT_4669: 5f40e617cd9c1e089f4a2d79c53a417d891e3e3c @ 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_1915/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory Maxime Ripard
@ 2018-10-05 11:42   ` Arkadiusz Hiler
  2018-10-05 15:23     ` Maxime Ripard
  0 siblings, 1 reply; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-05 11:42 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

On Thu, Oct 04, 2018 at 02:39:01PM +0200, Maxime Ripard wrote:
> So far, pixman was used exclusively when the Chamelium support was enabled.
> 
> However, since we're going to use it as one of the backend to do the
> igt_fb conversions between formats, we'll need it all the time. Make
> that explicit.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  README      |  2 +-
>  meson.build |  9 +++------
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/README b/README
> index f8ba5c710e81..78d14060dccd 100644
> --- a/README
> +++ b/README
> @@ -145,6 +145,7 @@ the default configuration (package names may vary):
>  	libcairo2-dev
>  	libdrm-dev
>  	libkmod-dev
> +	libpixman-1-dev
>  	libpciaccess-dev
>  	libprocps-dev
>  	libunwind-dev
> @@ -157,7 +158,6 @@ The following dependencies are required for building chamelium support
>  (package names may vary):
>  
>  	libxmlrpc-core-c3-dev
> -	libpixman-1-dev
>  	libudev-dev
>  	libglib2.0-dev
>  	libgsl-dev
> diff --git a/meson.build b/meson.build
> index faf1b764d69d..eff35585f619 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -105,6 +105,7 @@ libprocps = dependency('libprocps', required : true)
>  libunwind = dependency('libunwind', required : true)
>  libdw = dependency('libdw', required : true)
>  ssl = dependency('openssl', required : true)
> +pixman = dependency('pixman-1', required : true)
>  
>  valgrind = null_dep
>  valgrindinfo = 'No'
> @@ -123,16 +124,12 @@ glib = dependency('glib-2.0', required : true)
>  
>  gsl = null_dep
>  alsa = null_dep
> -pixman = null_dep
>  if _build_audio or _build_chamelium
>  	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
>  endif
>  if _build_audio
>  	alsa = dependency('alsa', required : _audio_required)
>  endif
> -if _build_chamelium
> -	pixman = dependency('pixman-1', required : _chamelium_required)
> -endif
>  
>  audioinfo = 'No'
>  if _build_audio and alsa.found() and gsl.found()
> @@ -164,8 +161,8 @@ endif
>  
>  chamelium = null_dep
>  chameliuminfo = 'No'
> -if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> -	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> +if _build_chamelium and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> +	chamelium = declare_dependency(dependencies : [ xmlrpc,
>  							xmlrpc_util, xmlrpc_client])
>  	config.set('HAVE_CHAMELIUM', 1)
>  	chameliuminfo = 'Yes'
> -- 
> git-series 0.9.1


Squash this in:

diff --git a/configure.ac b/configure.ac
index c75ef284..b80e905e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,6 +183,7 @@ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXran
 PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
 PKG_CHECK_MODULES(LIBUDEV, [libudev])
 PKG_CHECK_MODULES(GLIB, [glib-2.0])
+PKG_CHECK_MODULES(PIXMAN, [pixman-1])
 PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
 AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
@@ -206,8 +207,6 @@ if test "x$enable_chamelium" = xyes; then
 			AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium.])
 		fi
 	fi
-	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
-			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
 	if test x"$gsl" != xyes; then
 		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
 	fi
diff --git a/lib/meson.build b/lib/meson.build
index e60e5e02..7e2c9b7a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -66,6 +66,7 @@ lib_deps = [
 	math,
 	realtime,
 	ssl,
+	pixman,
 ]
 
 if libdrm_intel.found()
@@ -79,8 +80,8 @@ if valgrind.found()
 	lib_deps += valgrind
 endif
 
-if gsl.found() and pixman.found()
-	lib_deps += [ gsl, pixman ]
+if gsl.found()
+	lib_deps += [ gsl ]
 	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
 endif
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for chamelium: Test the plane formats (rev7)
  2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
                   ` (16 preceding siblings ...)
  2018-10-05  9:46 ` [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev7) Patchwork
@ 2018-10-05 13:21 ` Patchwork
  17 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2018-10-05 13:21 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

== Series Details ==

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

== Summary ==

= CI Bug Log - changes from IGT_4669_full -> IGTPW_1915_full =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_await@wide-contexts:
      shard-kbl:          PASS -> FAIL (fdo#106680)

    igt@gem_exec_big:
      shard-hsw:          PASS -> TIMEOUT (fdo#107937)

    igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
      shard-kbl:          PASS -> FAIL (fdo#108145)

    igt@kms_cursor_crc@cursor-128x42-random:
      shard-glk:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-apl:          PASS -> FAIL (fdo#103191, fdo#103232)

    igt@kms_cursor_legacy@cursora-vs-flipa-toggle:
      shard-glk:          PASS -> DMESG-WARN (fdo#106538, fdo#105763)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-wc:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-pwrite:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu:
      shard-glk:          PASS -> FAIL (fdo#103167) +2

    igt@kms_plane@pixel-format-pipe-b-planes:
      shard-kbl:          PASS -> FAIL (fdo#103166) +3

    igt@kms_plane@pixel-format-pipe-c-planes:
      shard-apl:          PASS -> FAIL (fdo#103166) +4

    {igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb}:
      shard-apl:          PASS -> FAIL (fdo#108145)
      shard-glk:          PASS -> FAIL (fdo#108145) +1

    igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
      shard-glk:          PASS -> FAIL (fdo#103166) +4

    igt@kms_vblank@pipe-a-query-forked:
      shard-apl:          PASS -> DMESG-FAIL (fdo#103558, fdo#105602)

    
    ==== Possible fixes ====

    igt@gem_eio@in-flight-internal-10ms:
      shard-glk:          FAIL (fdo#105957) -> PASS

    igt@gem_eio@reset-stress:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_available_modes_crc@available_mode_test_crc:
      shard-apl:          FAIL (fdo#106641) -> PASS

    igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
      shard-kbl:          DMESG-WARN (fdo#107956) -> PASS

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-glk:          FAIL (fdo#108145) -> PASS

    igt@kms_color@pipe-a-ctm-max:
      shard-apl:          FAIL (fdo#108147) -> PASS

    igt@kms_cursor_crc@cursor-64x21-random:
      shard-apl:          FAIL (fdo#103232) -> PASS +6
      shard-kbl:          FAIL (fdo#103232) -> PASS +1

    igt@kms_cursor_crc@cursor-64x64-onscreen:
      shard-glk:          FAIL (fdo#103232) -> PASS +2

    igt@kms_cursor_legacy@cursora-vs-flipa-atomic:
      shard-glk:          DMESG-WARN (fdo#106538, fdo#105763) -> PASS +3

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      shard-apl:          FAIL (fdo#103167) -> PASS +3

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-glk:          FAIL (fdo#103167) -> PASS +10

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-snb:          FAIL (fdo#103166, fdo#107749) -> PASS

    igt@kms_plane@plane-position-covered-pipe-c-planes:
      shard-glk:          FAIL (fdo#103166) -> PASS

    igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925) -> PASS

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

  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#105957 https://bugs.freedesktop.org/show_bug.cgi?id=105957
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#106680 https://bugs.freedesktop.org/show_bug.cgi?id=106680
  fdo#107749 https://bugs.freedesktop.org/show_bug.cgi?id=107749
  fdo#107937 https://bugs.freedesktop.org/show_bug.cgi?id=107937
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147


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

  Missing    (1): shard-skl 


== Build changes ==

    * IGT: IGT_4669 -> IGTPW_1915
    * Linux: CI_DRM_4931 -> CI_DRM_4933

  CI_DRM_4931: 826702bf60ae2b37841c051ed769b44af194fbb1 @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1915: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1915/
  IGT_4669: 5f40e617cd9c1e089f4a2d79c53a417d891e3e3c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory
  2018-10-05 11:42   ` Arkadiusz Hiler
@ 2018-10-05 15:23     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2018-10-05 15:23 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev


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

On Fri, Oct 05, 2018 at 02:42:03PM +0300, Arkadiusz Hiler wrote:
> On Thu, Oct 04, 2018 at 02:39:01PM +0200, Maxime Ripard wrote:
> > So far, pixman was used exclusively when the Chamelium support was enabled.
> > 
> > However, since we're going to use it as one of the backend to do the
> > igt_fb conversions between formats, we'll need it all the time. Make
> > that explicit.
> > 
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > ---
> >  README      |  2 +-
> >  meson.build |  9 +++------
> >  2 files changed, 4 insertions(+), 7 deletions(-)
> > 
> > diff --git a/README b/README
> > index f8ba5c710e81..78d14060dccd 100644
> > --- a/README
> > +++ b/README
> > @@ -145,6 +145,7 @@ the default configuration (package names may vary):
> >  	libcairo2-dev
> >  	libdrm-dev
> >  	libkmod-dev
> > +	libpixman-1-dev
> >  	libpciaccess-dev
> >  	libprocps-dev
> >  	libunwind-dev
> > @@ -157,7 +158,6 @@ The following dependencies are required for building chamelium support
> >  (package names may vary):
> >  
> >  	libxmlrpc-core-c3-dev
> > -	libpixman-1-dev
> >  	libudev-dev
> >  	libglib2.0-dev
> >  	libgsl-dev
> > diff --git a/meson.build b/meson.build
> > index faf1b764d69d..eff35585f619 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -105,6 +105,7 @@ libprocps = dependency('libprocps', required : true)
> >  libunwind = dependency('libunwind', required : true)
> >  libdw = dependency('libdw', required : true)
> >  ssl = dependency('openssl', required : true)
> > +pixman = dependency('pixman-1', required : true)
> >  
> >  valgrind = null_dep
> >  valgrindinfo = 'No'
> > @@ -123,16 +124,12 @@ glib = dependency('glib-2.0', required : true)
> >  
> >  gsl = null_dep
> >  alsa = null_dep
> > -pixman = null_dep
> >  if _build_audio or _build_chamelium
> >  	gsl = dependency('gsl', required : _audio_required or _chamelium_required)
> >  endif
> >  if _build_audio
> >  	alsa = dependency('alsa', required : _audio_required)
> >  endif
> > -if _build_chamelium
> > -	pixman = dependency('pixman-1', required : _chamelium_required)
> > -endif
> >  
> >  audioinfo = 'No'
> >  if _build_audio and alsa.found() and gsl.found()
> > @@ -164,8 +161,8 @@ endif
> >  
> >  chamelium = null_dep
> >  chameliuminfo = 'No'
> > -if _build_chamelium and pixman.found() and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > -	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> > +if _build_chamelium and gsl.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > +	chamelium = declare_dependency(dependencies : [ xmlrpc,
> >  							xmlrpc_util, xmlrpc_client])
> >  	config.set('HAVE_CHAMELIUM', 1)
> >  	chameliuminfo = 'Yes'
> > -- 
> > git-series 0.9.1
> 
> 
> Squash this in:
> 
> diff --git a/configure.ac b/configure.ac
> index c75ef284..b80e905e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -183,6 +183,7 @@ PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXran
>  PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
>  PKG_CHECK_MODULES(LIBUDEV, [libudev])
>  PKG_CHECK_MODULES(GLIB, [glib-2.0])
> +PKG_CHECK_MODULES(PIXMAN, [pixman-1])
>  PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
>  AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
>  
> @@ -206,8 +207,6 @@ if test "x$enable_chamelium" = xyes; then
>  			AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium.])
>  		fi
>  	fi
> -	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
> -			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
>  	if test x"$gsl" != xyes; then
>  		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
>  	fi
> diff --git a/lib/meson.build b/lib/meson.build
> index e60e5e02..7e2c9b7a 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -66,6 +66,7 @@ lib_deps = [
>  	math,
>  	realtime,
>  	ssl,
> +	pixman,
>  ]
>  
>  if libdrm_intel.found()
> @@ -79,8 +80,8 @@ if valgrind.found()
>  	lib_deps += valgrind
>  endif
>  
> -if gsl.found() and pixman.found()
> -	lib_deps += [ gsl, pixman ]
> +if gsl.found()
> +	lib_deps += [ gsl ]
>  	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
>  endif

I will, 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] 28+ messages in thread

* Re: [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format Maxime Ripard
@ 2018-10-05 15:57   ` Arkadiusz Hiler
  0 siblings, 0 replies; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-05 15:57 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

On Thu, Oct 04, 2018 at 02:38:56PM +0200, Maxime Ripard wrote:
> The RGB888 format is the one used as the shadow buffer used when a cairo
> surface is requested for a format that Cairo cannot handle.
> 
> Since we're going to move that buffer representation to a struct igt_fb,
> let's add the RGB888 format to the list of formats that igt_fb knows about.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  lib/igt_fb.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index aaa90bf74a9a..805a7b737981 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -72,6 +72,10 @@ static const struct format_desc_struct {
>  	  .cairo_id = CAIRO_FORMAT_RGB16_565,
>  	  .num_planes = 1, .plane_bpp = { 16, },
>  	},
> +	{ .name = "RGB888", .drm_id = DRM_FORMAT_RGB888,
> +	  .cairo_id = CAIRO_FORMAT_INVALID,
> +	  .num_planes = 1, .plane_bpp = { 24, },
> +	},

We use here the .depth = -1 as a convention.

This should be reworked in tests anyway, so don't bother too much.
I can add it here while applying the series.

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888 Maxime Ripard
@ 2018-10-08 13:06   ` Arkadiusz Hiler
  2018-10-08 13:15     ` Martin Peres
  0 siblings, 1 reply; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 13:06 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev, Martin Peres

On Thu, Oct 04, 2018 at 02:39:02PM +0200, Maxime Ripard wrote:
> For some reason, the XBGR8888 CRC check will fail in the kms_plane tests.
> Since that format will be enabled and checked by that test in the next
> commit, make sure we don't introduce a regression for no particular reason.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

I'll have to create a bug for that on the fdo bugzilla, and make sure
that it gets investigated.

Unless Martin thinks that we should just let it fail and have this
covered with cibuglog instead:

Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888
  2018-10-08 13:06   ` Arkadiusz Hiler
@ 2018-10-08 13:15     ` Martin Peres
  0 siblings, 0 replies; 28+ messages in thread
From: Martin Peres @ 2018-10-08 13:15 UTC (permalink / raw)
  To: Arkadiusz Hiler, Maxime Ripard; +Cc: igt-dev

On 08/10/2018 16:06, Arkadiusz Hiler wrote:
> On Thu, Oct 04, 2018 at 02:39:02PM +0200, Maxime Ripard wrote:
>> For some reason, the XBGR8888 CRC check will fail in the kms_plane tests.
>> Since that format will be enabled and checked by that test in the next
>> commit, make sure we don't introduce a regression for no particular reason.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> 
> I'll have to create a bug for that on the fdo bugzilla, and make sure
> that it gets investigated.
> 
> Unless Martin thinks that we should just let it fail and have this
> covered with cibuglog instead:
> 
> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> 

If the commits land at the same time, I will not see the error, so from
a CI PoV, it is:

Acked-by: Martin Peres <martin.peres@linux.intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed Maxime Ripard
@ 2018-10-08 13:17   ` Arkadiusz Hiler
  0 siblings, 0 replies; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 13:17 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

On Thu, Oct 04, 2018 at 02:39:06PM +0200, Maxime Ripard wrote:
> 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 that pattern in the chamelium
> code if we need to convert the framebuffer to a smaller depth, and use the
> current pattern otherwise.
> 
> 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 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 (this has been
> tested on a Raspberry Pi's VC4) 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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists
  2018-10-04 12:39 ` [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
@ 2018-10-08 13:18   ` Arkadiusz Hiler
  0 siblings, 0 replies; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 13:18 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

On Thu, Oct 04, 2018 at 02:39:09PM +0200, Maxime Ripard wrote:
> 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>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer
  2018-10-04 12:38 ` [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer Maxime Ripard
@ 2018-10-08 13:41   ` Arkadiusz Hiler
  0 siblings, 0 replies; 28+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 13:41 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: igt-dev

On Thu, Oct 04, 2018 at 02:38:57PM +0200, Maxime Ripard wrote:
> In the case where an igt_fb user wants to get a cairo surface out of that
> framebuffer, if the format of that framebuffer cannot be imported as-is in
> Cairo, the current code will do an anonymous mapping to create a shadow
> buffer where an RGB24 copy of that buffer will be created.
> 
> However, making that shadow buffer into an igt_fb itself will help us do
> further improvements on the conversion code.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-10-08 13:41 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 12:38 [igt-dev] [PATCH v8 00/16] chamelium: Test the plane formats Maxime Ripard
2018-10-04 12:38 ` [igt-dev] [PATCH v8 01/16] fb: Add buffer map/unmap functions Maxime Ripard
2018-10-04 12:38 ` [igt-dev] [PATCH v8 02/16] fb: Only set the GEM domain on intel platforms Maxime Ripard
2018-10-05  8:11   ` Arkadiusz Hiler
2018-10-04 12:38 ` [igt-dev] [PATCH v8 03/16] fb: Add RGB888 format Maxime Ripard
2018-10-05 15:57   ` Arkadiusz Hiler
2018-10-04 12:38 ` [igt-dev] [PATCH v8 04/16] fb: Use an igt_fb for the cairo shadow buffer Maxime Ripard
2018-10-08 13:41   ` Arkadiusz Hiler
2018-10-04 12:38 ` [igt-dev] [PATCH v8 05/16] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-10-04 12:38 ` [igt-dev] [PATCH v8 06/16] fb: Create common function to convert frame formats Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 07/16] fb: Add format conversion routine Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 08/16] igt: Make pixman mandatory Maxime Ripard
2018-10-05 11:42   ` Arkadiusz Hiler
2018-10-05 15:23     ` Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 09/16] tests: kms_plane: Disable XBGR8888 Maxime Ripard
2018-10-08 13:06   ` Arkadiusz Hiler
2018-10-08 13:15     ` Martin Peres
2018-10-04 12:39 ` [igt-dev] [PATCH v8 10/16] fb: Add support for conversions through pixman Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 11/16] fb: Add more formats Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 12/16] chamelium: Split CRC test function in two Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 13/16] chamelium: Change our pattern for a custom one if needed Maxime Ripard
2018-10-08 13:17   ` Arkadiusz Hiler
2018-10-04 12:39 ` [igt-dev] [PATCH v8 14/16] chamelium: Add format support Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 15/16] chamelium: Add format subtests Maxime Ripard
2018-10-04 12:39 ` [igt-dev] [PATCH v8 16/16] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-10-08 13:18   ` Arkadiusz Hiler
2018-10-05  9:46 ` [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev7) Patchwork
2018-10-05 13:21 ` [igt-dev] ✓ Fi.CI.IGT: " 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.