All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions
@ 2018-10-08 14:04 Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 02/16] fb: Only set the GEM domain on intel platforms Arkadiusz Hiler
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 cba67f41..f1332169 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));
@@ -1837,6 +1846,36 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 				    blit, destroy_cairo_surface__convert);
 }
 
+/**
+ * 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
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 35bf307a..758d4d0d 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,
-- 
2.17.1

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

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

* [igt-dev] [CI 02/16] fb: Only set the GEM domain on intel platforms
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 03/16] fb: Add RGB888 format Arkadiusz Hiler
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
---
 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 f1332169..aaa90bf7 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,
-- 
2.17.1

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

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

* [igt-dev] [CI 03/16] fb: Add RGB888 format
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 02/16] fb: Only set the GEM domain on intel platforms Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 04/16] fb: Use an igt_fb for the cairo shadow buffer Arkadiusz Hiler
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_fb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index aaa90bf7..130cf05c 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", .depth = -1, .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, },
-- 
2.17.1

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

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

* [igt-dev] [CI 04/16] fb: Use an igt_fb for the cairo shadow buffer
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 02/16] fb: Only set the GEM domain on intel platforms Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 03/16] fb: Add RGB888 format Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 05/16] fb: convert: Remove swizzle from the arguments Arkadiusz Hiler
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
---
 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 130cf05c..804fef6a 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,
-- 
2.17.1

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

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

* [igt-dev] [CI 05/16] fb: convert: Remove swizzle from the arguments
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (2 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 04/16] fb: Use an igt_fb for the cairo shadow buffer Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 06/16] fb: Create common function to convert frame formats Arkadiusz Hiler
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 804fef6a..cc1089aa 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",
-- 
2.17.1

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

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

* [igt-dev] [CI 06/16] fb: Create common function to convert frame formats
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (3 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 05/16] fb: convert: Remove swizzle from the arguments Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 07/16] fb: Add format conversion routine Arkadiusz Hiler
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 | 206 +++++++++++++++++++++++++++++----------------------
 1 file changed, 118 insertions(+), 88 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index cc1089aa..dc227493 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);
+	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(fb->drm_format == DRM_FORMAT_NV12,
+	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);
+	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(fb->drm_format == DRM_FORMAT_YUYV ||
-		     fb->drm_format == DRM_FORMAT_YVYU ||
-		     fb->drm_format == DRM_FORMAT_UYVY ||
-		     fb->drm_format == DRM_FORMAT_VYUY,
+	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;
+	struct fb_convert cvt = {
+		.dst	= {
+			.ptr	= blit->base.linear.map,
+			.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);
-	}
+		.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,
-- 
2.17.1

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

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

* [igt-dev] [CI 07/16] fb: Add format conversion routine
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (4 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 06/16] fb: Create common function to convert frame formats Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 08/16] igt: Make pixman mandatory Arkadiusz Hiler
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 dc227493..bd9ebf50 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2036,6 +2036,51 @@ void igt_remove_fb(int fd, struct igt_fb *fb)
 	fb->fb_id = 0;
 }
 
+/**
+ * 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
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 758d4d0d..9f027deb 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);
-- 
2.17.1

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

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

* [igt-dev] [CI 08/16] igt: Make pixman mandatory
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (5 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 07/16] fb: Add format conversion routine Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 09/16] tests: kms_plane: Disable XBGR8888 Arkadiusz Hiler
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 README          | 2 +-
 configure.ac    | 3 +--
 lib/meson.build | 5 +++--
 meson.build     | 9 +++------
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/README b/README
index f8ba5c71..78d14060 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/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
 
diff --git a/meson.build b/meson.build
index faf1b764..eff35585 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'
-- 
2.17.1

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

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

* [igt-dev] [CI 09/16] tests: kms_plane: Disable XBGR8888
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (6 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 08/16] igt: Make pixman mandatory Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 10/16] fb: Add support for conversions through pixman Arkadiusz Hiler
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Acked-by: Martin Peres <martin.peres@linux.intel.com>
---
 tests/kms_plane.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 5a0bc05b..45e0a304 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);
-- 
2.17.1

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

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

* [igt-dev] [CI 10/16] fb: Add support for conversions through pixman
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (7 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 09/16] tests: kms_plane: Disable XBGR8888 Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 11/16] fb: Add more formats Arkadiusz Hiler
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 bd9ebf50..7e5a6b45 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", .depth = -1, .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;
 }
-- 
2.17.1

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

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

* [igt-dev] [CI 11/16] fb: Add more formats
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (8 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 10/16] fb: Add support for conversions through pixman Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 12/16] chamelium: Split CRC test function in two Arkadiusz Hiler
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_fb.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 7e5a6b45..35be2e88 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", .depth = -1, .drm_id = DRM_FORMAT_ARGB1555,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_a1r5g5b5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "XRGB1555", .depth = -1, .drm_id = DRM_FORMAT_XRGB1555,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_x1r5g5b5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
 	{ .name = "RGB565", .depth = 16, .drm_id = DRM_FORMAT_RGB565,
 	  .cairo_id = CAIRO_FORMAT_RGB16_565,
 	  .pixman_id = PIXMAN_r5g6b5,
 	  .num_planes = 1, .plane_bpp = { 16, },
 	},
+	{ .name = "BGR565", .depth = -1, .drm_id = DRM_FORMAT_BGR565,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b5g6r5,
+	  .num_planes = 1, .plane_bpp = { 16, },
+	},
+	{ .name = "BGR888", .depth = -1, .drm_id = DRM_FORMAT_BGR888,
+	  .cairo_id = CAIRO_FORMAT_INVALID,
+	  .pixman_id = PIXMAN_b8g8r8,
+	  .num_planes = 1, .plane_bpp = { 24, },
+	},
 	{ .name = "RGB888", .depth = -1, .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", .depth = -1, .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", .depth = -1, .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, },
-- 
2.17.1

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

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

* [igt-dev] [CI 12/16] chamelium: Split CRC test function in two
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (9 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 11/16] fb: Add more formats Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 13/16] chamelium: Change our pattern for a custom one if needed Arkadiusz Hiler
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 5ebac8dc..14b84d46 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);
+	drmModeFreeConnector(connector);
+}
 
-		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);
+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);
-- 
2.17.1

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

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

* [igt-dev] [CI 13/16] chamelium: Change our pattern for a custom one if needed
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (10 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 12/16] chamelium: Split CRC test function in two Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 14/16] chamelium: Add format support Arkadiusz Hiler
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
---
 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 14b84d46..d6d0f315 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,
-- 
2.17.1

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

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

* [igt-dev] [CI 14/16] chamelium: Add format support
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (11 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 13/16] chamelium: Change our pattern for a custom one if needed Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 15/16] chamelium: Add format subtests Arkadiusz Hiler
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 d6d0f315..0c082f9c 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);
-- 
2.17.1

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

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

* [igt-dev] [CI 15/16] chamelium: Add format subtests
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (12 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 14/16] chamelium: Add format support Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:04 ` [igt-dev] [CI 16/16] tests: Add chamelium formats subtests to vc4 test lists Arkadiusz Hiler
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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 0c082f9c..e0e3e3f1 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);
 	}
-- 
2.17.1

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

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

* [igt-dev] [CI 16/16] tests: Add chamelium formats subtests to vc4 test lists
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (13 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 15/16] chamelium: Add format subtests Arkadiusz Hiler
@ 2018-10-08 14:04 ` Arkadiusz Hiler
  2018-10-08 14:56 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,01/16] fb: Add buffer map/unmap functions Patchwork
  2018-10-08 16:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  16 siblings, 0 replies; 18+ messages in thread
From: Arkadiusz Hiler @ 2018-10-08 14:04 UTC (permalink / raw)
  To: igt-dev

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

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>
---
 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 964167b8..dd45d12a 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 b00f54cd..d3d4104a 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
-- 
2.17.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,01/16] fb: Add buffer map/unmap functions
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (14 preceding siblings ...)
  2018-10-08 14:04 ` [igt-dev] [CI 16/16] tests: Add chamelium formats subtests to vc4 test lists Arkadiusz Hiler
@ 2018-10-08 14:56 ` Patchwork
  2018-10-08 16:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  16 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-10-08 14:56 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [CI,01/16] fb: Add buffer map/unmap functions
URL   : https://patchwork.freedesktop.org/series/50693/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4944 -> IGTPW_1926 =

== Summary - WARNING ==

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

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

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rpm@module-reload:
      fi-hsw-4770r:       PASS -> SKIP

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#107425, fdo#107924)

    igt@kms_flip@basic-flip-vs-dpms:
      fi-skl-6700hq:      PASS -> DMESG-WARN (fdo#105998)

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-bwr-2160:        NOTRUN -> FAIL (fdo#100368)

    igt@pm_rpm@module-reload:
      fi-hsw-peppy:       NOTRUN -> DMESG-WARN (fdo#107603, fdo#106386)

    
    ==== Possible fixes ====

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       DMESG-WARN (fdo#107726) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
  fdo#106386 https://bugs.freedesktop.org/show_bug.cgi?id=106386
  fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
  fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726
  fdo#107924 https://bugs.freedesktop.org/show_bug.cgi?id=107924


== Participating hosts (45 -> 43) ==

  Additional (5): fi-hsw-peppy fi-kbl-7560u fi-byt-clapper fi-bwr-2160 fi-kbl-r 
  Missing    (7): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-icl-u2 fi-ctg-p8600 fi-pnv-d510 fi-bdw-samus 


== Build changes ==

    * IGT: IGT_4670 -> IGTPW_1926

  CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1926: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1926/
  IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ 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_1926/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [CI,01/16] fb: Add buffer map/unmap functions
  2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
                   ` (15 preceding siblings ...)
  2018-10-08 14:56 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,01/16] fb: Add buffer map/unmap functions Patchwork
@ 2018-10-08 16:26 ` Patchwork
  16 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-10-08 16:26 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: igt-dev

== Series Details ==

Series: series starting with [CI,01/16] fb: Add buffer map/unmap functions
URL   : https://patchwork.freedesktop.org/series/50693/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4670_full -> IGTPW_1926_full =

== Summary - WARNING ==

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

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

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

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

    igt@gem_render_linear_blits@basic:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665) +1

    igt@gem_tiled_blits@interruptible:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_atomic_transition@plane-all-modeset-transition-fencing:
      shard-glk:          PASS -> INCOMPLETE (fdo#103359, k.org#198133)

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

    igt@kms_color@pipe-a-degamma:
      shard-apl:          PASS -> FAIL (fdo#104782, fdo#108145)

    igt@kms_cursor_crc@cursor-256x256-random:
      shard-glk:          PASS -> FAIL (fdo#103232) +8

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-apl:          PASS -> FAIL (fdo#103232) +3

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
      shard-kbl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-glk:          PASS -> FAIL (fdo#103167, fdo#105682)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-move:
      shard-glk:          PASS -> FAIL (fdo#103167) +6

    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) +1

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

    
    ==== Possible fixes ====

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

    igt@kms_cursor_crc@cursor-256x85-sliding:
      shard-glk:          FAIL (fdo#103232) -> PASS

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

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

    igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
      shard-glk:          DMESG-WARN (fdo#105763, fdo#106538) -> PASS +2

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

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

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

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-blt:
      shard-glk:          FAIL (fdo#103167) -> PASS +3

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

    {igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max}:
      shard-glk:          FAIL (fdo#108145) -> PASS +1

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

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-kbl:          FAIL (fdo#103166) -> PASS +1

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

    igt@kms_universal_plane@universal-plane-pipe-c-functional:
      shard-glk:          FAIL (fdo#103166) -> PASS +1

    
  {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#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#107749 https://bugs.freedesktop.org/show_bug.cgi?id=107749
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  Missing    (1): shard-skl 


== Build changes ==

    * IGT: IGT_4670 -> IGTPW_1926
    * Linux: CI_DRM_4933 -> CI_DRM_4944

  CI_DRM_4933: 6b7a44d1597791524f46d7ea17620db54dffdc8c @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4944: 66bd263b99fd264b57432c232756baf95b0a6255 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1926: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1926/
  IGT_4670: 7e066794d2ea860f4199fd67549080de17b6b852 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

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

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