All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
@ 2020-02-07 19:15 Imre Deak
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
                   ` (10 more replies)
  0 siblings, 11 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev; +Cc: Vanshidhar Konda

From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>

Simplify the number of places from which gem_get_tiling method is called
and call it only if the device has support in hardware for tiling.

v2:
- Use gem_available_fences() to check for HW detiling.

Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 lib/igt_draw.c                   | 56 +++++++++++++++++---------------
 lib/igt_draw.h                   |  5 +--
 tests/kms_frontbuffer_tracking.c |  8 +++--
 3 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 6950bc49..d227a53a 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -333,20 +333,19 @@ static void draw_rect_ptr_tiled(void *ptr, uint32_t stride, uint32_t tiling,
 }
 
 static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
-			       uint32_t color)
+			       uint32_t tiling, uint32_t swizzle, uint32_t color)
 {
 	uint32_t *ptr;
-	uint32_t tiling, swizzle;
 
 	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_CPU,
 		       I915_GEM_DOMAIN_CPU);
-	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
 
 	/* We didn't implement suport for the older tiling methods yet. */
 	if (tiling != I915_TILING_NONE)
 		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
 
-	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size), 0);
+	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size),
+			    PROT_READ | PROT_WRITE);
 
 	switch (tiling) {
 	case I915_TILING_NONE:
@@ -384,14 +383,12 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
 }
 
 static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
-			      uint32_t color)
+			      uint32_t tiling, uint32_t swizzle, uint32_t color)
 {
 	uint32_t *ptr;
-	uint32_t tiling, swizzle;
 
 	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
 		       I915_GEM_DOMAIN_GTT);
-	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
 
 	/* We didn't implement suport for the older tiling methods yet. */
 	if (tiling != I915_TILING_NONE)
@@ -495,12 +492,9 @@ static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
 }
 
 static void draw_rect_pwrite(int fd, struct buf_data *buf,
-			     struct rect *rect, uint32_t color)
+			     struct rect *rect, uint32_t tiling,
+			     uint32_t swizzle, uint32_t color)
 {
-	uint32_t tiling, swizzle;
-
-	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
-
 	switch (tiling) {
 	case I915_TILING_NONE:
 		draw_rect_pwrite_untiled(fd, buf, rect, color);
@@ -517,6 +511,7 @@ static void draw_rect_pwrite(int fd, struct buf_data *buf,
 
 static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 			  struct buf_data *buf, struct rect *rect,
+			  uint32_t tiling, uint32_t swizzle,
 			  uint32_t color)
 {
 	drm_intel_bo *dst;
@@ -524,11 +519,8 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 	int blt_cmd_len, blt_cmd_tiling, blt_cmd_depth;
 	uint32_t devid = intel_get_drm_devid(fd);
 	int gen = intel_gen(devid);
-	uint32_t tiling, swizzle;
 	int pitch;
 
-	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
-
 	dst = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", buf->handle);
 	igt_assert(dst);
 
@@ -574,6 +566,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 
 static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 			     struct buf_data *buf, struct rect *rect,
+			     uint32_t tiling, uint32_t swizzle,
 			     uint32_t color)
 {
 	drm_intel_bo *src, *dst;
@@ -581,21 +574,18 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 	igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid);
 	struct igt_buf src_buf = {}, dst_buf = {};
 	struct intel_batchbuffer *batch;
-	uint32_t tiling, swizzle;
 	struct buf_data tmp;
 	int pixel_size = buf->bpp / 8;
 
 	igt_skip_on(!rendercopy);
 
-	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
-
 	/* We create a temporary buffer and copy from it using rendercopy. */
 	tmp.size = rect->w * rect->h * pixel_size;
 	tmp.handle = gem_create(fd, tmp.size);
 	tmp.stride = rect->w * pixel_size;
 	tmp.bpp = buf->bpp;
 	draw_rect_mmap_cpu(fd, &tmp, &(struct rect){0, 0, rect->w, rect->h},
-			   color);
+			   I915_TILING_NONE, I915_BIT_6_SWIZZLE_NONE, color);
 
 	src = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", tmp.handle);
 	igt_assert(src);
@@ -647,9 +637,12 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
  */
 void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
 		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
-		   enum igt_draw_method method, int rect_x, int rect_y,
-		   int rect_w, int rect_h, uint32_t color, int bpp)
+		   uint32_t tiling, enum igt_draw_method method,
+		   int rect_x, int rect_y, int rect_w, int rect_h,
+		   uint32_t color, int bpp)
 {
+	uint32_t buf_tiling, swizzle;
+
 	struct cmd_data cmd_data = {
 		.bufmgr = bufmgr,
 		.context = context,
@@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
 		.h = rect_h,
 	};
 
+	swizzle = I915_BIT_6_SWIZZLE_NONE;
+	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
+		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
+		igt_assert(tiling == buf_tiling);
+	}
+
 	switch (method) {
 	case IGT_DRAW_MMAP_CPU:
-		draw_rect_mmap_cpu(fd, &buf, &rect, color);
+		draw_rect_mmap_cpu(fd, &buf, &rect, tiling, swizzle, color);
 		break;
 	case IGT_DRAW_MMAP_GTT:
 		draw_rect_mmap_gtt(fd, &buf, &rect, color);
 		break;
 	case IGT_DRAW_MMAP_WC:
-		draw_rect_mmap_wc(fd, &buf, &rect, color);
+		draw_rect_mmap_wc(fd, &buf, &rect, tiling, swizzle, color);
 		break;
 	case IGT_DRAW_PWRITE:
-		draw_rect_pwrite(fd, &buf, &rect, color);
+		draw_rect_pwrite(fd, &buf, &rect, tiling, swizzle, color);
 		break;
 	case IGT_DRAW_BLT:
-		draw_rect_blt(fd, &cmd_data, &buf, &rect, color);
+		draw_rect_blt(fd, &cmd_data, &buf, &rect, tiling, swizzle,
+			      color);
 		break;
 	case IGT_DRAW_RENDER:
-		draw_rect_render(fd, &cmd_data, &buf, &rect, color);
+		draw_rect_render(fd, &cmd_data, &buf, &rect, tiling, swizzle,
+				 color);
 		break;
 	default:
 		igt_assert(false);
@@ -715,7 +716,8 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
 		      int rect_w, int rect_h, uint32_t color)
 {
 	igt_draw_rect(fd, bufmgr, context, fb->gem_handle, fb->size, fb->strides[0],
-		      method, rect_x, rect_y, rect_w, rect_h, color,
+		      igt_fb_mod_to_tiling(fb->modifier), method,
+		      rect_x, rect_y, rect_w, rect_h, color,
 		      igt_drm_format_to_bpp(fb->drm_format));
 }
 
diff --git a/lib/igt_draw.h b/lib/igt_draw.h
index b030131e..ec146754 100644
--- a/lib/igt_draw.h
+++ b/lib/igt_draw.h
@@ -52,8 +52,9 @@ const char *igt_draw_get_method_name(enum igt_draw_method method);
 
 void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
 		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
-		   enum igt_draw_method method, int rect_x, int rect_y,
-		   int rect_w, int rect_h, uint32_t color, int bpp);
+		   uint32_t tiling, enum igt_draw_method method,
+		   int rect_x, int rect_y, int rect_w, int rect_h,
+		   uint32_t color, int bpp);
 
 void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
 		      drm_intel_context *context, struct igt_fb *fb,
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 2c765c34..9c2c3a5d 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -291,6 +291,7 @@ struct {
 	int height;
 	uint32_t color;
 	int bpp;
+	uint32_t tiling;
 } busy_thread = {
 	.stop = true,
 };
@@ -1126,9 +1127,9 @@ static void *busy_thread_func(void *data)
 	while (!busy_thread.stop)
 		igt_draw_rect(drm.fd, drm.bufmgr, NULL, busy_thread.handle,
 			      busy_thread.size, busy_thread.stride,
-			      IGT_DRAW_BLT, 0, 0, busy_thread.width,
-			      busy_thread.height, busy_thread.color,
-			      busy_thread.bpp);
+			      busy_thread.tiling, IGT_DRAW_BLT, 0, 0,
+			      busy_thread.width, busy_thread.height,
+			      busy_thread.color, busy_thread.bpp);
 
 	pthread_exit(0);
 }
@@ -1146,6 +1147,7 @@ static void start_busy_thread(struct igt_fb *fb)
 	busy_thread.height = fb->height;
 	busy_thread.color = pick_color(fb, COLOR_PRIM_BG);
 	busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format);
+	busy_thread.tiling = igt_fb_mod_to_tiling(fb->modifier);
 
 	rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL);
 	igt_assert_eq(rc, 0);
-- 
2.23.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 i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-08 22:36   ` Dixit, Ashutosh
  2020-02-10 22:32   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer Imre Deak
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev; +Cc: Vanshidhar Konda

From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>

Skip the method that is setting tiling with invalid strides if the
hardware does not support HW for tiling/de-tiling.

v2:
- Use gem_available_fences() to check for HW detiling.

Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_frontbuffer_tracking.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 9c2c3a5d..724f5d16 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -2833,7 +2833,8 @@ static void badstride_subtest(const struct test_mode *t)
 	struct modeset_params *params = pick_params(t);
 	int rc;
 
-	try_invalid_strides();
+	if (gem_available_fences(drm.fd))
+		try_invalid_strides();
 
 	prepare_subtest(t, NULL);
 
-- 
2.23.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 i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 22:47   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture Imre Deak
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev; +Cc: Vanshidhar Konda

From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>

The GEM object used for the framebuffer does not need tiling to be set
on it as the entire framebuffer is being filled with the same value -
tiling will not impact the end value of the buffer.

Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_available_modes_crc.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 12761343..ed43d1fb 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -211,17 +211,11 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 	data->buf = (unsigned char *)calloc(data->size*2, 1);
 
 	data->gem_handle = gem_create(data->gfx_fd, gemsize);
-	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
-			       igt_fb_mod_to_tiling(tiling),
-			       data->fb.strides[0]);
-
 	data->fb.gem_handle = data->gem_handle;
 	data->fb.width = w;
 	data->fb.height = h;
 	fill_in_fb(data, output, plane, format);
 
-	igt_assert_eq(ret, 0);
-
 	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
 			  format, tiling, data->fb.strides, data->fb.offsets,
 			  num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
-- 
2.23.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 i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 22:51   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs " Imre Deak
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev

Subtests drawing through a GTT mapping are not relevant on platforms w/o
a GTT aperture, so skip them.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_draw_crc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index ea14db9a..6de9feae 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -178,6 +178,8 @@ static void draw_method_subtest(enum igt_draw_method method,
 	igt_crc_t crc;
 
 	igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
+	igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm_fd));
 
 	igt_require(format_is_supported(formats[format_index], tiling));
 
-- 
2.23.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 i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs on platforms w/o aperture
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (2 preceding siblings ...)
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 22:58   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests " Imre Deak
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev

Generate reference CRCs by drawing through a CPU mapping, which is also
available on platforms w/o a GTT aperture.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_draw_crc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index 6de9feae..f9d4b178 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -187,7 +187,7 @@ static void draw_method_subtest(enum igt_draw_method method,
 	 * comparison. Cache the value so we don't recompute it for every single
 	 * subtest. */
 	if (!base_crcs[format_index].set) {
-		get_method_crc(IGT_DRAW_MMAP_GTT, formats[format_index],
+		get_method_crc(IGT_DRAW_MMAP_CPU, formats[format_index],
 			       LOCAL_DRM_FORMAT_MOD_NONE,
 			       &base_crcs[format_index].crc);
 		base_crcs[format_index].set = true;
@@ -225,7 +225,7 @@ static void fill_fb_subtest(void)
 	igt_create_fb(drm_fd, ms.mode->hdisplay, ms.mode->vdisplay,
 		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
 
-	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_GTT,
+	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_CPU,
 			 0, 0, fb.width, fb.height, 0xFF);
 
 	rc = drmModeSetCrtc(drm_fd, ms.crtc_id, fb.fb_id, 0, 0,
-- 
2.23.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 i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests on platforms w/o aperture
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (3 preceding siblings ...)
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs " Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 23:19   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() " Imre Deak
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev

Subtests that draw through a GTT mapping are not relevent on a platform w/o
GTT aperture, so skip them.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_frontbuffer_tracking.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 724f5d16..310c8b7b 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1934,6 +1934,9 @@ static void draw_subtest(const struct test_mode *t)
 	struct modeset_params *params = pick_params(t);
 	struct fb_region *target;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	switch (t->screen) {
 	case SCREEN_PRIM:
 		if (t->method != IGT_DRAW_MMAP_GTT && t->plane == PLANE_PRI)
@@ -2032,6 +2035,11 @@ static void multidraw_subtest(const struct test_mode *t)
 			igt_debug("Methods %s and %s\n",
 				  igt_draw_get_method_name(m1),
 				  igt_draw_get_method_name(m2));
+
+			igt_skip_on((m1 == IGT_DRAW_MMAP_GTT ||
+				     m2 == IGT_DRAW_MMAP_GTT) &&
+				    !gem_has_mappable_ggtt(drm.fd));
+
 			for (r = 0; r < pattern->n_rects; r++) {
 				used_method = (r % 2 == 0) ? m1 : m2;
 
@@ -2140,6 +2148,9 @@ static void badformat_subtest(const struct test_mode *t)
  */
 static void format_draw_subtest(const struct test_mode *t)
 {
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	if (format_is_valid(t->feature, t->format))
 		draw_subtest(t);
 	else
@@ -2276,6 +2287,9 @@ static void flip_subtest(const struct test_mode *t)
 	struct draw_pattern_info *pattern = &pattern1;
 	enum color bg_color;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	switch (t->screen) {
 	case SCREEN_PRIM:
 		assertions |= ASSERT_LAST_ACTION_CHANGED;
@@ -2335,6 +2349,9 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern1;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	prepare_subtest(t, pattern);
 
 	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
@@ -2383,6 +2400,9 @@ static void move_subtest(const struct test_mode *t)
 	struct fb_region *reg = pick_target(t, params);
 	bool repeat = false;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	prepare_subtest(t, pattern);
 
 	/* Just paint the right color since we start at 0x0. */
@@ -2434,6 +2454,9 @@ static void onoff_subtest(const struct test_mode *t)
 	struct modeset_params *params = pick_params(t);
 	struct draw_pattern_info *pattern = &pattern3;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	prepare_subtest(t, pattern);
 
 	/* Just paint the right color since we start at 0x0. */
@@ -2493,6 +2516,9 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
 	struct modeset_params *params = pick_params(t);
 	int assertions;
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	prepare_subtest(t, pattern);
 
 	rect = pattern->get_rect(&params->primary, 0);
@@ -2744,6 +2770,9 @@ static void farfromfence_subtest(const struct test_mode *t)
 	int max_height, assertions = 0;
 	int gen = intel_gen(intel_get_drm_devid(drm.fd));
 
+	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
+		    !gem_has_mappable_ggtt(drm.fd));
+
 	switch (gen) {
 	case 2:
 		max_height = 2048;
@@ -3025,6 +3054,9 @@ static void basic_subtest(const struct test_mode *t)
 	fb1 = params->primary.fb;
 
 	for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) {
+		igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
+			    !gem_has_mappable_ggtt(drm.fd));
+
 		if (r == pattern->n_rects) {
 			params->primary.fb = (params->primary.fb == fb1) ? &fb2 : fb1;
 
-- 
2.23.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 i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() on platforms w/o aperture
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (4 preceding siblings ...)
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests " Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 23:22   ` Matt Roper
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared Imre Deak
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev

Draw through a CPU mapping on platforms w/o a GTT aperture.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 lib/igt_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index d227a53a..c720a4c2 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -731,6 +731,6 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
  */
 void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint32_t color)
 {
-	igt_draw_rect_fb(fd, NULL, NULL, fb, IGT_DRAW_MMAP_GTT,
+	igt_draw_rect_fb(fd, NULL, NULL, fb, IGT_DRAW_MMAP_CPU,
 			 0, 0, fb->width, fb->height, color);
 }
-- 
2.23.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 i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (5 preceding siblings ...)
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() " Imre Deak
@ 2020-02-07 19:15 ` Imre Deak
  2020-02-10 23:34   ` Matt Roper
  2020-02-07 19:51 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls Patchwork
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-07 19:15 UTC (permalink / raw)
  To: igt-dev

For tiled FBs that are mapped in an other way than a GTT map we need to
clear all tile-rows. Clearing only the first stride*height bytes may
leave tiles at the end of the FB uncleared.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 lib/igt_fb.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index af3291a2..a4db0749 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -841,10 +841,20 @@ static void memset64(uint64_t *s, uint64_t c, size_t n)
 static void clear_yuv_buffer(struct igt_fb *fb)
 {
 	bool full_range = fb->color_range == IGT_COLOR_YCBCR_FULL_RANGE;
+	size_t plane_size[2];
 	void *ptr;
 
 	igt_assert(igt_format_is_yuv(fb->drm_format));
 
+	for (int i = 0; i < min(ARRAY_SIZE(plane_size), fb->num_planes); i++) {
+		unsigned int tile_width, tile_height;
+
+		igt_get_fb_tile_size(fb->fd, fb->modifier, fb->plane_bpp[i],
+				     &tile_width, &tile_height);
+		plane_size[i] = fb->strides[i] *
+			ALIGN(fb->plane_height[i], tile_height);
+	}
+
 	/* Ensure the framebuffer is preallocated */
 	ptr = igt_fb_map_buffer(fb->fd, fb);
 	igt_assert(*(uint32_t *)ptr == 0);
@@ -853,48 +863,48 @@ static void clear_yuv_buffer(struct igt_fb *fb)
 	case DRM_FORMAT_NV12:
 		memset(ptr + fb->offsets[0],
 		       full_range ? 0x00 : 0x10,
-		       fb->strides[0] * fb->plane_height[0]);
+		       plane_size[0]);
 		memset(ptr + fb->offsets[1],
 		       0x80,
-		       fb->strides[1] * fb->plane_height[1]);
+		       plane_size[1]);
 		break;
 	case DRM_FORMAT_XYUV8888:
 		wmemset(ptr + fb->offsets[0], full_range ? 0x00008080 : 0x00108080,
-			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		break;
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_YVYU:
 		wmemset(ptr + fb->offsets[0],
 			full_range ? 0x80008000 : 0x80108010,
-			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		break;
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 		wmemset(ptr + fb->offsets[0],
 			full_range ? 0x00800080 : 0x10801080,
-			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		break;
 	case DRM_FORMAT_P010:
 	case DRM_FORMAT_P012:
 	case DRM_FORMAT_P016:
 		wmemset(ptr, full_range ? 0 : 0x10001000,
-			fb->offsets[1] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		wmemset(ptr + fb->offsets[1], 0x80008000,
-			fb->strides[1] * fb->plane_height[1] / sizeof(wchar_t));
+			plane_size[1] / sizeof(wchar_t));
 		break;
 	case DRM_FORMAT_Y210:
 	case DRM_FORMAT_Y212:
 	case DRM_FORMAT_Y216:
 		wmemset(ptr + fb->offsets[0],
 			full_range ? 0x80000000 : 0x80001000,
-			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		break;
 
 	case DRM_FORMAT_XVYU2101010:
 	case DRM_FORMAT_Y410:
 		wmemset(ptr + fb->offsets[0],
 			full_range ? 0x20000200 : 0x20010200,
-		fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
+			plane_size[0] / sizeof(wchar_t));
 		break;
 
 	case DRM_FORMAT_XVYU12_16161616:
@@ -903,7 +913,7 @@ static void clear_yuv_buffer(struct igt_fb *fb)
 	case DRM_FORMAT_Y416:
 		memset64(ptr + fb->offsets[0],
 			 full_range ? 0x800000008000ULL : 0x800010008000ULL,
-			 fb->strides[0] * fb->plane_height[0] / sizeof(uint64_t));
+			 plane_size[0] / sizeof(uint64_t));
 		break;
 	}
 
-- 
2.23.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] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (6 preceding siblings ...)
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared Imre Deak
@ 2020-02-07 19:51 ` Patchwork
  2020-02-08 22:36 ` [igt-dev] [PATCH i-g-t 1/8] " Dixit, Ashutosh
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2020-02-07 19:51 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls
URL   : https://patchwork.freedesktop.org/series/73172/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7887 -> IGTPW_4114
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_blt:
    - fi-bsw-nick:        [PASS][1] -> [INCOMPLETE][2] ([i915#392])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-bsw-nick/igt@i915_selftest@live_blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-bsw-nick/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-cfl-guc:         [PASS][3] -> [INCOMPLETE][4] ([fdo#106070] / [i915#424])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-cfl-guc/igt@i915_selftest@live_gem_contexts.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-skl-6770hq:      [PASS][5] -> [SKIP][6] ([fdo#109271])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-c:
    - fi-skl-6770hq:      [PASS][7] -> [DMESG-WARN][8] ([i915#106] / [i915#188])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-c.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-skl-6770hq/igt@kms_pipe_crc_basic@read-crc-pipe-c.html

  
#### Possible fixes ####

  * igt@i915_selftest@live_blt:
    - fi-ivb-3770:        [DMESG-FAIL][9] ([i915#725]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-ivb-3770/igt@i915_selftest@live_blt.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-ivb-3770/igt@i915_selftest@live_blt.html

  * igt@i915_selftest@live_execlists:
    - fi-icl-y:           [DMESG-FAIL][11] ([fdo#108569]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-icl-y/igt@i915_selftest@live_execlists.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-icl-y/igt@i915_selftest@live_execlists.html

  * igt@i915_selftest@live_gem_contexts:
    - fi-cfl-8700k:       [DMESG-FAIL][13] ([i915#623]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-cfl-8700k/igt@i915_selftest@live_gem_contexts.html
    - fi-byt-n2820:       [DMESG-FAIL][15] ([i915#1052]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html

  * igt@i915_selftest@live_gtt:
    - fi-icl-guc:         [TIMEOUT][17] ([fdo#112271]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-icl-guc/igt@i915_selftest@live_gtt.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-icl-guc/igt@i915_selftest@live_gtt.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][19] ([fdo#111096] / [i915#323]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Warnings ####

  * igt@i915_module_load@reload:
    - fi-icl-u2:          [DMESG-WARN][21] ([i915#289]) -> [DMESG-WARN][22] ([i915#109] / [i915#289])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-icl-u2/igt@i915_module_load@reload.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-icl-u2/igt@i915_module_load@reload.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-skl-6770hq:      [INCOMPLETE][23] ([i915#69]) -> [SKIP][24] ([fdo#109271])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/fi-skl-6770hq/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/fi-skl-6770hq/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  
  [fdo#106070]: https://bugs.freedesktop.org/show_bug.cgi?id=106070
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
  [i915#1052]: https://gitlab.freedesktop.org/drm/intel/issues/1052
  [i915#106]: https://gitlab.freedesktop.org/drm/intel/issues/106
  [i915#109]: https://gitlab.freedesktop.org/drm/intel/issues/109
  [i915#188]: https://gitlab.freedesktop.org/drm/intel/issues/188
  [i915#289]: https://gitlab.freedesktop.org/drm/intel/issues/289
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#392]: https://gitlab.freedesktop.org/drm/intel/issues/392
  [i915#424]: https://gitlab.freedesktop.org/drm/intel/issues/424
  [i915#623]: https://gitlab.freedesktop.org/drm/intel/issues/623
  [i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725


Participating hosts (48 -> 46)
------------------------------

  Additional (5): fi-bdw-5557u fi-gdg-551 fi-skl-lmem fi-blb-e6850 fi-skl-6600u 
  Missing    (7): fi-hsw-4200u fi-bsw-n3050 fi-bsw-cyan fi-ctg-p8600 fi-kbl-7560u fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5425 -> IGTPW_4114

  CI-20190529: 20190529
  CI_DRM_7887: b147ed9753265260d6380604de01c3d646a323cd @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4114: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.html
  IGT_5425: ad4542ef1adbaa1227bc9ba9e24bb0e0f6dd408d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (7 preceding siblings ...)
  2020-02-07 19:51 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls Patchwork
@ 2020-02-08 22:36 ` Dixit, Ashutosh
  2020-02-10 11:37   ` Imre Deak
  2020-02-10 22:13 ` Matt Roper
  2020-02-11  9:30 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/8] " Patchwork
  10 siblings, 1 reply; 28+ messages in thread
From: Dixit, Ashutosh @ 2020-02-08 22:36 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev, Vanshidhar Konda

On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote:
>  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
>		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> -		   enum igt_draw_method method, int rect_x, int rect_y,
> -		   int rect_w, int rect_h, uint32_t color, int bpp)
> +		   uint32_t tiling, enum igt_draw_method method,
> +		   int rect_x, int rect_y, int rect_w, int rect_h,
> +		   uint32_t color, int bpp)
>  {
> +	uint32_t buf_tiling, swizzle;
> +
>	struct cmd_data cmd_data = {
>		.bufmgr = bufmgr,
>		.context = context,
> @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
>		.h = rect_h,
>	};
>
> +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> +		igt_assert(tiling == buf_tiling);
> +	}

Probably a nit, but looks a little strange to call gem_get_tiling() to get
the swizzle and then doing an assert. Instead, since igt_draw_rect() has
only two callers how about moving the gem_get_tiling() call into the
callers and passing both tiling and swizzle into igt_draw_rect()?

> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 2c765c34..9c2c3a5d 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -291,6 +291,7 @@ struct {
>	int height;
>	uint32_t color;
>	int bpp;
> +	uint32_t tiling;

Should not need this if we follow the suggestion above.
_______________________________________________
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 i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
@ 2020-02-08 22:36   ` Dixit, Ashutosh
  2020-02-10 22:32   ` Matt Roper
  1 sibling, 0 replies; 28+ messages in thread
From: Dixit, Ashutosh @ 2020-02-08 22:36 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev, Vanshidhar Konda

On Fri, 07 Feb 2020 11:15:18 -0800, Imre Deak wrote:
>
> From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
>
> Skip the method that is setting tiling with invalid strides if the
> hardware does not support HW for tiling/de-tiling.
>
> v2:
> - Use gem_available_fences() to check for HW detiling.

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

>
> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  tests/kms_frontbuffer_tracking.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 9c2c3a5d..724f5d16 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -2833,7 +2833,8 @@ static void badstride_subtest(const struct test_mode *t)
>	struct modeset_params *params = pick_params(t);
>	int rc;
>
> -	try_invalid_strides();
> +	if (gem_available_fences(drm.fd))
> +		try_invalid_strides();
>
>	prepare_subtest(t, NULL);
>
> --
> 2.23.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-08 22:36 ` [igt-dev] [PATCH i-g-t 1/8] " Dixit, Ashutosh
@ 2020-02-10 11:37   ` Imre Deak
  2020-02-11 19:10     ` Dixit, Ashutosh
  0 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-10 11:37 UTC (permalink / raw)
  To: Dixit, Ashutosh; +Cc: igt-dev, Vanshidhar Konda

On Sat, Feb 08, 2020 at 02:36:38PM -0800, Dixit, Ashutosh wrote:
> On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote:
> >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> >		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > -		   int rect_w, int rect_h, uint32_t color, int bpp)
> > +		   uint32_t tiling, enum igt_draw_method method,
> > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > +		   uint32_t color, int bpp)
> >  {
> > +	uint32_t buf_tiling, swizzle;
> > +
> >	struct cmd_data cmd_data = {
> >		.bufmgr = bufmgr,
> >		.context = context,
> > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> >		.h = rect_h,
> >	};
> >
> > +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> > +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> > +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> > +		igt_assert(tiling == buf_tiling);
> > +	}
> 
> Probably a nit, but looks a little strange to call gem_get_tiling() to get
> the swizzle and then doing an assert.

gem_get_tiling() is the way to get the swizzling for a buffer. The
assert only makes sure that the caller's and kernel's idea of the tiling
matches. While the callers will pick the tiling (when creating the
buffer), the swizzling is fixed based on this tiling and platform.

> Instead, since igt_draw_rect() has only two callers how about moving
> the gem_get_tiling() call into the callers and passing both tiling and
> swizzle into igt_draw_rect()?

Why?

> 
> > diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> > index 2c765c34..9c2c3a5d 100644
> > --- a/tests/kms_frontbuffer_tracking.c
> > +++ b/tests/kms_frontbuffer_tracking.c
> > @@ -291,6 +291,7 @@ struct {
> >	int height;
> >	uint32_t color;
> >	int bpp;
> > +	uint32_t tiling;
> 
> Should not need this if we follow the suggestion above.

This contains the tiling of the buffer as now we won't have a way to
retrieve the same from the kernel.

--Imre
_______________________________________________
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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (8 preceding siblings ...)
  2020-02-08 22:36 ` [igt-dev] [PATCH i-g-t 1/8] " Dixit, Ashutosh
@ 2020-02-10 22:13 ` Matt Roper
  2020-02-11  0:37   ` Imre Deak
  2020-02-11  9:30 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/8] " Patchwork
  10 siblings, 1 reply; 28+ messages in thread
From: Matt Roper @ 2020-02-10 22:13 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev, Vanshidhar Konda

On Fri, Feb 07, 2020 at 09:15:17PM +0200, Imre Deak wrote:
> From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> 
> Simplify the number of places from which gem_get_tiling method is called
> and call it only if the device has support in hardware for tiling.
> 
> v2:
> - Use gem_available_fences() to check for HW detiling.
> 
> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  lib/igt_draw.c                   | 56 +++++++++++++++++---------------
>  lib/igt_draw.h                   |  5 +--
>  tests/kms_frontbuffer_tracking.c |  8 +++--
>  3 files changed, 37 insertions(+), 32 deletions(-)
> 
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index 6950bc49..d227a53a 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -333,20 +333,19 @@ static void draw_rect_ptr_tiled(void *ptr, uint32_t stride, uint32_t tiling,
>  }
>  
>  static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
> -			       uint32_t color)
> +			       uint32_t tiling, uint32_t swizzle, uint32_t color)
>  {
>  	uint32_t *ptr;
> -	uint32_t tiling, swizzle;
>  
>  	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_CPU,
>  		       I915_GEM_DOMAIN_CPU);
> -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
>  
>  	/* We didn't implement suport for the older tiling methods yet. */
>  	if (tiling != I915_TILING_NONE)
>  		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
>  
> -	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size), 0);
> +	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size),
> +			    PROT_READ | PROT_WRITE);

This change doesn't seem to be related to the main purpose of this
patch?

>  
>  	switch (tiling) {
>  	case I915_TILING_NONE:
> @@ -384,14 +383,12 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
>  }
>  
>  static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
> -			      uint32_t color)
> +			      uint32_t tiling, uint32_t swizzle, uint32_t color)
>  {
>  	uint32_t *ptr;
> -	uint32_t tiling, swizzle;
>  
>  	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
>  		       I915_GEM_DOMAIN_GTT);
> -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
>  
>  	/* We didn't implement suport for the older tiling methods yet. */
>  	if (tiling != I915_TILING_NONE)
> @@ -495,12 +492,9 @@ static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
>  }
>  
>  static void draw_rect_pwrite(int fd, struct buf_data *buf,
> -			     struct rect *rect, uint32_t color)
> +			     struct rect *rect, uint32_t tiling,
> +			     uint32_t swizzle, uint32_t color)
>  {
> -	uint32_t tiling, swizzle;
> -
> -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> -
>  	switch (tiling) {
>  	case I915_TILING_NONE:
>  		draw_rect_pwrite_untiled(fd, buf, rect, color);
> @@ -517,6 +511,7 @@ static void draw_rect_pwrite(int fd, struct buf_data *buf,
>  
>  static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
>  			  struct buf_data *buf, struct rect *rect,
> +			  uint32_t tiling, uint32_t swizzle,
>  			  uint32_t color)
>  {
>  	drm_intel_bo *dst;
> @@ -524,11 +519,8 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
>  	int blt_cmd_len, blt_cmd_tiling, blt_cmd_depth;
>  	uint32_t devid = intel_get_drm_devid(fd);
>  	int gen = intel_gen(devid);
> -	uint32_t tiling, swizzle;
>  	int pitch;
>  
> -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> -
>  	dst = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", buf->handle);
>  	igt_assert(dst);
>  
> @@ -574,6 +566,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
>  
>  static void draw_rect_render(int fd, struct cmd_data *cmd_data,
>  			     struct buf_data *buf, struct rect *rect,
> +			     uint32_t tiling, uint32_t swizzle,
>  			     uint32_t color)
>  {
>  	drm_intel_bo *src, *dst;
> @@ -581,21 +574,18 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
>  	igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid);
>  	struct igt_buf src_buf = {}, dst_buf = {};
>  	struct intel_batchbuffer *batch;
> -	uint32_t tiling, swizzle;
>  	struct buf_data tmp;
>  	int pixel_size = buf->bpp / 8;
>  
>  	igt_skip_on(!rendercopy);
>  
> -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> -
>  	/* We create a temporary buffer and copy from it using rendercopy. */
>  	tmp.size = rect->w * rect->h * pixel_size;
>  	tmp.handle = gem_create(fd, tmp.size);
>  	tmp.stride = rect->w * pixel_size;
>  	tmp.bpp = buf->bpp;
>  	draw_rect_mmap_cpu(fd, &tmp, &(struct rect){0, 0, rect->w, rect->h},
> -			   color);
> +			   I915_TILING_NONE, I915_BIT_6_SWIZZLE_NONE, color);
>  
>  	src = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", tmp.handle);
>  	igt_assert(src);
> @@ -647,9 +637,12 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
>   */
>  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
>  		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> -		   enum igt_draw_method method, int rect_x, int rect_y,
> -		   int rect_w, int rect_h, uint32_t color, int bpp)
> +		   uint32_t tiling, enum igt_draw_method method,

The new tiling parameter should probably be captured in the kerneldoc
right above this function.

> +		   int rect_x, int rect_y, int rect_w, int rect_h,
> +		   uint32_t color, int bpp)
>  {
> +	uint32_t buf_tiling, swizzle;
> +
>  	struct cmd_data cmd_data = {
>  		.bufmgr = bufmgr,
>  		.context = context,
> @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
>  		.h = rect_h,
>  	};
>  
> +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> +		igt_assert(tiling == buf_tiling);
> +	}
> +
>  	switch (method) {
>  	case IGT_DRAW_MMAP_CPU:
> -		draw_rect_mmap_cpu(fd, &buf, &rect, color);
> +		draw_rect_mmap_cpu(fd, &buf, &rect, tiling, swizzle, color);
>  		break;
>  	case IGT_DRAW_MMAP_GTT:
>  		draw_rect_mmap_gtt(fd, &buf, &rect, color);
>  		break;
>  	case IGT_DRAW_MMAP_WC:
> -		draw_rect_mmap_wc(fd, &buf, &rect, color);
> +		draw_rect_mmap_wc(fd, &buf, &rect, tiling, swizzle, color);
>  		break;
>  	case IGT_DRAW_PWRITE:
> -		draw_rect_pwrite(fd, &buf, &rect, color);
> +		draw_rect_pwrite(fd, &buf, &rect, tiling, swizzle, color);
>  		break;
>  	case IGT_DRAW_BLT:
> -		draw_rect_blt(fd, &cmd_data, &buf, &rect, color);
> +		draw_rect_blt(fd, &cmd_data, &buf, &rect, tiling, swizzle,
> +			      color);
>  		break;
>  	case IGT_DRAW_RENDER:
> -		draw_rect_render(fd, &cmd_data, &buf, &rect, color);
> +		draw_rect_render(fd, &cmd_data, &buf, &rect, tiling, swizzle,
> +				 color);
>  		break;

Blt and render draws don't use the swizzle parameter.  If the goal is to
keep a consistent parameter list for all these functions, we should
probably add tiling & swizzle to the gtt map function, even though they
won't be used; otherwise we can drop the swizzle parameter from these
two.


Matt

>  	default:
>  		igt_assert(false);
> @@ -715,7 +716,8 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
>  		      int rect_w, int rect_h, uint32_t color)
>  {
>  	igt_draw_rect(fd, bufmgr, context, fb->gem_handle, fb->size, fb->strides[0],
> -		      method, rect_x, rect_y, rect_w, rect_h, color,
> +		      igt_fb_mod_to_tiling(fb->modifier), method,
> +		      rect_x, rect_y, rect_w, rect_h, color,
>  		      igt_drm_format_to_bpp(fb->drm_format));
>  }
>  
> diff --git a/lib/igt_draw.h b/lib/igt_draw.h
> index b030131e..ec146754 100644
> --- a/lib/igt_draw.h
> +++ b/lib/igt_draw.h
> @@ -52,8 +52,9 @@ const char *igt_draw_get_method_name(enum igt_draw_method method);
>  
>  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
>  		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> -		   enum igt_draw_method method, int rect_x, int rect_y,
> -		   int rect_w, int rect_h, uint32_t color, int bpp);
> +		   uint32_t tiling, enum igt_draw_method method,
> +		   int rect_x, int rect_y, int rect_w, int rect_h,
> +		   uint32_t color, int bpp);
>  
>  void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
>  		      drm_intel_context *context, struct igt_fb *fb,
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 2c765c34..9c2c3a5d 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -291,6 +291,7 @@ struct {
>  	int height;
>  	uint32_t color;
>  	int bpp;
> +	uint32_t tiling;
>  } busy_thread = {
>  	.stop = true,
>  };
> @@ -1126,9 +1127,9 @@ static void *busy_thread_func(void *data)
>  	while (!busy_thread.stop)
>  		igt_draw_rect(drm.fd, drm.bufmgr, NULL, busy_thread.handle,
>  			      busy_thread.size, busy_thread.stride,
> -			      IGT_DRAW_BLT, 0, 0, busy_thread.width,
> -			      busy_thread.height, busy_thread.color,
> -			      busy_thread.bpp);
> +			      busy_thread.tiling, IGT_DRAW_BLT, 0, 0,
> +			      busy_thread.width, busy_thread.height,
> +			      busy_thread.color, busy_thread.bpp);
>  
>  	pthread_exit(0);
>  }
> @@ -1146,6 +1147,7 @@ static void start_busy_thread(struct igt_fb *fb)
>  	busy_thread.height = fb->height;
>  	busy_thread.color = pick_color(fb, COLOR_PRIM_BG);
>  	busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format);
> +	busy_thread.tiling = igt_fb_mod_to_tiling(fb->modifier);
>  
>  	rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL);
>  	igt_assert_eq(rc, 0);
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
  2020-02-08 22:36   ` Dixit, Ashutosh
@ 2020-02-10 22:32   ` Matt Roper
  1 sibling, 0 replies; 28+ messages in thread
From: Matt Roper @ 2020-02-10 22:32 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev, Vanshidhar Konda

On Fri, Feb 07, 2020 at 09:15:18PM +0200, Imre Deak wrote:
> From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> 
> Skip the method that is setting tiling with invalid strides if the
> hardware does not support HW for tiling/de-tiling.
> 
> v2:
> - Use gem_available_fences() to check for HW detiling.
> 
> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  tests/kms_frontbuffer_tracking.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 9c2c3a5d..724f5d16 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -2833,7 +2833,8 @@ static void badstride_subtest(const struct test_mode *t)
>  	struct modeset_params *params = pick_params(t);
>  	int rc;
>  
> -	try_invalid_strides();
> +	if (gem_available_fences(drm.fd))
> +		try_invalid_strides();
>  
>  	prepare_subtest(t, NULL);
>  
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer Imre Deak
@ 2020-02-10 22:47   ` Matt Roper
  0 siblings, 0 replies; 28+ messages in thread
From: Matt Roper @ 2020-02-10 22:47 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev, Vanshidhar Konda

On Fri, Feb 07, 2020 at 09:15:19PM +0200, Imre Deak wrote:
> From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> 
> The GEM object used for the framebuffer does not need tiling to be set
> on it as the entire framebuffer is being filled with the same value -
> tiling will not impact the end value of the buffer.
> 
> Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  tests/kms_available_modes_crc.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
> index 12761343..ed43d1fb 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
> @@ -211,17 +211,11 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
>  	data->buf = (unsigned char *)calloc(data->size*2, 1);
>  
>  	data->gem_handle = gem_create(data->gfx_fd, gemsize);
> -	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
> -			       igt_fb_mod_to_tiling(tiling),
> -			       data->fb.strides[0]);
> -
>  	data->fb.gem_handle = data->gem_handle;
>  	data->fb.width = w;
>  	data->fb.height = h;
>  	fill_in_fb(data, output, plane, format);
>  
> -	igt_assert_eq(ret, 0);
> -
>  	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
>  			  format, tiling, data->fb.strides, data->fb.offsets,
>  			  num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture Imre Deak
@ 2020-02-10 22:51   ` Matt Roper
  0 siblings, 0 replies; 28+ messages in thread
From: Matt Roper @ 2020-02-10 22:51 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

On Fri, Feb 07, 2020 at 09:15:20PM +0200, Imre Deak wrote:
> Subtests drawing through a GTT mapping are not relevant on platforms w/o
> a GTT aperture, so skip them.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> ---
>  tests/kms_draw_crc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
> index ea14db9a..6de9feae 100644
> --- a/tests/kms_draw_crc.c
> +++ b/tests/kms_draw_crc.c
> @@ -178,6 +178,8 @@ static void draw_method_subtest(enum igt_draw_method method,
>  	igt_crc_t crc;
>  
>  	igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
> +	igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm_fd));
>  
>  	igt_require(format_is_supported(formats[format_index], tiling));
>  
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs on platforms w/o aperture
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs " Imre Deak
@ 2020-02-10 22:58   ` Matt Roper
  2020-02-11  0:38     ` Imre Deak
  0 siblings, 1 reply; 28+ messages in thread
From: Matt Roper @ 2020-02-10 22:58 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

On Fri, Feb 07, 2020 at 09:15:21PM +0200, Imre Deak wrote:
> Generate reference CRCs by drawing through a CPU mapping, which is also
> available on platforms w/o a GTT aperture.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  tests/kms_draw_crc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
> index 6de9feae..f9d4b178 100644
> --- a/tests/kms_draw_crc.c
> +++ b/tests/kms_draw_crc.c
> @@ -187,7 +187,7 @@ static void draw_method_subtest(enum igt_draw_method method,
>  	 * comparison. Cache the value so we don't recompute it for every single
>  	 * subtest. */

It doesn't show in the context here, but the comment line just above
this says "Use IGT_DRAW_MMAP_GTT" --- that should be updated to match
the code change below.


Matt

>  	if (!base_crcs[format_index].set) {
> -		get_method_crc(IGT_DRAW_MMAP_GTT, formats[format_index],
> +		get_method_crc(IGT_DRAW_MMAP_CPU, formats[format_index],
>  			       LOCAL_DRM_FORMAT_MOD_NONE,
>  			       &base_crcs[format_index].crc);
>  		base_crcs[format_index].set = true;
> @@ -225,7 +225,7 @@ static void fill_fb_subtest(void)
>  	igt_create_fb(drm_fd, ms.mode->hdisplay, ms.mode->vdisplay,
>  		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
>  
> -	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_GTT,
> +	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_CPU,
>  			 0, 0, fb.width, fb.height, 0xFF);
>  
>  	rc = drmModeSetCrtc(drm_fd, ms.crtc_id, fb.fb_id, 0, 0,
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests on platforms w/o aperture
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests " Imre Deak
@ 2020-02-10 23:19   ` Matt Roper
  2020-02-11  1:18     ` Imre Deak
  0 siblings, 1 reply; 28+ messages in thread
From: Matt Roper @ 2020-02-10 23:19 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

On Fri, Feb 07, 2020 at 09:15:22PM +0200, Imre Deak wrote:
> Subtests that draw through a GTT mapping are not relevent on a platform w/o
> GTT aperture, so skip them.

Could this check be pushed down into check_test_requirements()?


Matt

> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  tests/kms_frontbuffer_tracking.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> index 724f5d16..310c8b7b 100644
> --- a/tests/kms_frontbuffer_tracking.c
> +++ b/tests/kms_frontbuffer_tracking.c
> @@ -1934,6 +1934,9 @@ static void draw_subtest(const struct test_mode *t)
>  	struct modeset_params *params = pick_params(t);
>  	struct fb_region *target;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	switch (t->screen) {
>  	case SCREEN_PRIM:
>  		if (t->method != IGT_DRAW_MMAP_GTT && t->plane == PLANE_PRI)
> @@ -2032,6 +2035,11 @@ static void multidraw_subtest(const struct test_mode *t)
>  			igt_debug("Methods %s and %s\n",
>  				  igt_draw_get_method_name(m1),
>  				  igt_draw_get_method_name(m2));
> +
> +			igt_skip_on((m1 == IGT_DRAW_MMAP_GTT ||
> +				     m2 == IGT_DRAW_MMAP_GTT) &&
> +				    !gem_has_mappable_ggtt(drm.fd));
> +
>  			for (r = 0; r < pattern->n_rects; r++) {
>  				used_method = (r % 2 == 0) ? m1 : m2;
>  
> @@ -2140,6 +2148,9 @@ static void badformat_subtest(const struct test_mode *t)
>   */
>  static void format_draw_subtest(const struct test_mode *t)
>  {
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	if (format_is_valid(t->feature, t->format))
>  		draw_subtest(t);
>  	else
> @@ -2276,6 +2287,9 @@ static void flip_subtest(const struct test_mode *t)
>  	struct draw_pattern_info *pattern = &pattern1;
>  	enum color bg_color;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	switch (t->screen) {
>  	case SCREEN_PRIM:
>  		assertions |= ASSERT_LAST_ACTION_CHANGED;
> @@ -2335,6 +2349,9 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
>  	struct modeset_params *params = pick_params(t);
>  	struct draw_pattern_info *pattern = &pattern1;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	prepare_subtest(t, pattern);
>  
>  	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
> @@ -2383,6 +2400,9 @@ static void move_subtest(const struct test_mode *t)
>  	struct fb_region *reg = pick_target(t, params);
>  	bool repeat = false;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	prepare_subtest(t, pattern);
>  
>  	/* Just paint the right color since we start at 0x0. */
> @@ -2434,6 +2454,9 @@ static void onoff_subtest(const struct test_mode *t)
>  	struct modeset_params *params = pick_params(t);
>  	struct draw_pattern_info *pattern = &pattern3;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	prepare_subtest(t, pattern);
>  
>  	/* Just paint the right color since we start at 0x0. */
> @@ -2493,6 +2516,9 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
>  	struct modeset_params *params = pick_params(t);
>  	int assertions;
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	prepare_subtest(t, pattern);
>  
>  	rect = pattern->get_rect(&params->primary, 0);
> @@ -2744,6 +2770,9 @@ static void farfromfence_subtest(const struct test_mode *t)
>  	int max_height, assertions = 0;
>  	int gen = intel_gen(intel_get_drm_devid(drm.fd));
>  
> +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> +		    !gem_has_mappable_ggtt(drm.fd));
> +
>  	switch (gen) {
>  	case 2:
>  		max_height = 2048;
> @@ -3025,6 +3054,9 @@ static void basic_subtest(const struct test_mode *t)
>  	fb1 = params->primary.fb;
>  
>  	for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) {
> +		igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
> +			    !gem_has_mappable_ggtt(drm.fd));
> +
>  		if (r == pattern->n_rects) {
>  			params->primary.fb = (params->primary.fb == fb1) ? &fb2 : fb1;
>  
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() on platforms w/o aperture
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() " Imre Deak
@ 2020-02-10 23:22   ` Matt Roper
  0 siblings, 0 replies; 28+ messages in thread
From: Matt Roper @ 2020-02-10 23:22 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

On Fri, Feb 07, 2020 at 09:15:23PM +0200, Imre Deak wrote:
> Draw through a CPU mapping on platforms w/o a GTT aperture.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>

> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  lib/igt_draw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index d227a53a..c720a4c2 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -731,6 +731,6 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
>   */
>  void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint32_t color)
>  {
> -	igt_draw_rect_fb(fd, NULL, NULL, fb, IGT_DRAW_MMAP_GTT,
> +	igt_draw_rect_fb(fd, NULL, NULL, fb, IGT_DRAW_MMAP_CPU,
>  			 0, 0, fb->width, fb->height, color);
>  }
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared
  2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared Imre Deak
@ 2020-02-10 23:34   ` Matt Roper
  2020-02-11  1:26     ` Imre Deak
  0 siblings, 1 reply; 28+ messages in thread
From: Matt Roper @ 2020-02-10 23:34 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

On Fri, Feb 07, 2020 at 09:15:24PM +0200, Imre Deak wrote:
> For tiled FBs that are mapped in an other way than a GTT map we need to
> clear all tile-rows. Clearing only the first stride*height bytes may
> leave tiles at the end of the FB uncleared.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  lib/igt_fb.c | 30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index af3291a2..a4db0749 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -841,10 +841,20 @@ static void memset64(uint64_t *s, uint64_t c, size_t n)
>  static void clear_yuv_buffer(struct igt_fb *fb)
>  {
>  	bool full_range = fb->color_range == IGT_COLOR_YCBCR_FULL_RANGE;
> +	size_t plane_size[2];
>  	void *ptr;
>  
>  	igt_assert(igt_format_is_yuv(fb->drm_format));
>  
> +	for (int i = 0; i < min(ARRAY_SIZE(plane_size), fb->num_planes); i++) {

This will still calculate a plane_size[1] for packed YUV + CCS I think,
but I guess that doesn't hurt anything since it just never gets used
below.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>


Matt

> +		unsigned int tile_width, tile_height;
> +
> +		igt_get_fb_tile_size(fb->fd, fb->modifier, fb->plane_bpp[i],
> +				     &tile_width, &tile_height);
> +		plane_size[i] = fb->strides[i] *
> +			ALIGN(fb->plane_height[i], tile_height);
> +	}
> +
>  	/* Ensure the framebuffer is preallocated */
>  	ptr = igt_fb_map_buffer(fb->fd, fb);
>  	igt_assert(*(uint32_t *)ptr == 0);
> @@ -853,48 +863,48 @@ static void clear_yuv_buffer(struct igt_fb *fb)
>  	case DRM_FORMAT_NV12:
>  		memset(ptr + fb->offsets[0],
>  		       full_range ? 0x00 : 0x10,
> -		       fb->strides[0] * fb->plane_height[0]);
> +		       plane_size[0]);
>  		memset(ptr + fb->offsets[1],
>  		       0x80,
> -		       fb->strides[1] * fb->plane_height[1]);
> +		       plane_size[1]);
>  		break;
>  	case DRM_FORMAT_XYUV8888:
>  		wmemset(ptr + fb->offsets[0], full_range ? 0x00008080 : 0x00108080,
> -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		break;
>  	case DRM_FORMAT_YUYV:
>  	case DRM_FORMAT_YVYU:
>  		wmemset(ptr + fb->offsets[0],
>  			full_range ? 0x80008000 : 0x80108010,
> -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		break;
>  	case DRM_FORMAT_UYVY:
>  	case DRM_FORMAT_VYUY:
>  		wmemset(ptr + fb->offsets[0],
>  			full_range ? 0x00800080 : 0x10801080,
> -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		break;
>  	case DRM_FORMAT_P010:
>  	case DRM_FORMAT_P012:
>  	case DRM_FORMAT_P016:
>  		wmemset(ptr, full_range ? 0 : 0x10001000,
> -			fb->offsets[1] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		wmemset(ptr + fb->offsets[1], 0x80008000,
> -			fb->strides[1] * fb->plane_height[1] / sizeof(wchar_t));
> +			plane_size[1] / sizeof(wchar_t));
>  		break;
>  	case DRM_FORMAT_Y210:
>  	case DRM_FORMAT_Y212:
>  	case DRM_FORMAT_Y216:
>  		wmemset(ptr + fb->offsets[0],
>  			full_range ? 0x80000000 : 0x80001000,
> -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		break;
>  
>  	case DRM_FORMAT_XVYU2101010:
>  	case DRM_FORMAT_Y410:
>  		wmemset(ptr + fb->offsets[0],
>  			full_range ? 0x20000200 : 0x20010200,
> -		fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> +			plane_size[0] / sizeof(wchar_t));
>  		break;
>  
>  	case DRM_FORMAT_XVYU12_16161616:
> @@ -903,7 +913,7 @@ static void clear_yuv_buffer(struct igt_fb *fb)
>  	case DRM_FORMAT_Y416:
>  		memset64(ptr + fb->offsets[0],
>  			 full_range ? 0x800000008000ULL : 0x800010008000ULL,
> -			 fb->strides[0] * fb->plane_height[0] / sizeof(uint64_t));
> +			 plane_size[0] / sizeof(uint64_t));
>  		break;
>  	}
>  
> -- 
> 2.23.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-10 22:13 ` Matt Roper
@ 2020-02-11  0:37   ` Imre Deak
  0 siblings, 0 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-11  0:37 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev, Vanshidhar Konda

On Mon, Feb 10, 2020 at 02:13:31PM -0800, Matt Roper wrote:
> On Fri, Feb 07, 2020 at 09:15:17PM +0200, Imre Deak wrote:
> > From: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> > 
> > Simplify the number of places from which gem_get_tiling method is called
> > and call it only if the device has support in hardware for tiling.
> > 
> > v2:
> > - Use gem_available_fences() to check for HW detiling.
> > 
> > Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda@intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  lib/igt_draw.c                   | 56 +++++++++++++++++---------------
> >  lib/igt_draw.h                   |  5 +--
> >  tests/kms_frontbuffer_tracking.c |  8 +++--
> >  3 files changed, 37 insertions(+), 32 deletions(-)
> > 
> > diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> > index 6950bc49..d227a53a 100644
> > --- a/lib/igt_draw.c
> > +++ b/lib/igt_draw.c
> > @@ -333,20 +333,19 @@ static void draw_rect_ptr_tiled(void *ptr, uint32_t stride, uint32_t tiling,
> >  }
> >  
> >  static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
> > -			       uint32_t color)
> > +			       uint32_t tiling, uint32_t swizzle, uint32_t color)
> >  {
> >  	uint32_t *ptr;
> > -	uint32_t tiling, swizzle;
> >  
> >  	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_CPU,
> >  		       I915_GEM_DOMAIN_CPU);
> > -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> >  
> >  	/* We didn't implement suport for the older tiling methods yet. */
> >  	if (tiling != I915_TILING_NONE)
> >  		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);
> >  
> > -	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size), 0);
> > +	ptr = gem_mmap__cpu(fd, buf->handle, 0, PAGE_ALIGN(buf->size),
> > +			    PROT_READ | PROT_WRITE);
> 
> This change doesn't seem to be related to the main purpose of this
> patch?

It's a consequence of starting to use __gem_mmap_offset() on DG1 after
this patch, which uses the prot argument, unlike __gem_mmap() used so
far. This should've been part of the commit log.

> 
> >  
> >  	switch (tiling) {
> >  	case I915_TILING_NONE:
> > @@ -384,14 +383,12 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
> >  }
> >  
> >  static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
> > -			      uint32_t color)
> > +			      uint32_t tiling, uint32_t swizzle, uint32_t color)
> >  {
> >  	uint32_t *ptr;
> > -	uint32_t tiling, swizzle;
> >  
> >  	gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT,
> >  		       I915_GEM_DOMAIN_GTT);
> > -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> >  
> >  	/* We didn't implement suport for the older tiling methods yet. */
> >  	if (tiling != I915_TILING_NONE)
> > @@ -495,12 +492,9 @@ static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
> >  }
> >  
> >  static void draw_rect_pwrite(int fd, struct buf_data *buf,
> > -			     struct rect *rect, uint32_t color)
> > +			     struct rect *rect, uint32_t tiling,
> > +			     uint32_t swizzle, uint32_t color)
> >  {
> > -	uint32_t tiling, swizzle;
> > -
> > -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> > -
> >  	switch (tiling) {
> >  	case I915_TILING_NONE:
> >  		draw_rect_pwrite_untiled(fd, buf, rect, color);
> > @@ -517,6 +511,7 @@ static void draw_rect_pwrite(int fd, struct buf_data *buf,
> >  
> >  static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
> >  			  struct buf_data *buf, struct rect *rect,
> > +			  uint32_t tiling, uint32_t swizzle,
> >  			  uint32_t color)
> >  {
> >  	drm_intel_bo *dst;
> > @@ -524,11 +519,8 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
> >  	int blt_cmd_len, blt_cmd_tiling, blt_cmd_depth;
> >  	uint32_t devid = intel_get_drm_devid(fd);
> >  	int gen = intel_gen(devid);
> > -	uint32_t tiling, swizzle;
> >  	int pitch;
> >  
> > -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> > -
> >  	dst = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", buf->handle);
> >  	igt_assert(dst);
> >  
> > @@ -574,6 +566,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
> >  
> >  static void draw_rect_render(int fd, struct cmd_data *cmd_data,
> >  			     struct buf_data *buf, struct rect *rect,
> > +			     uint32_t tiling, uint32_t swizzle,
> >  			     uint32_t color)
> >  {
> >  	drm_intel_bo *src, *dst;
> > @@ -581,21 +574,18 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
> >  	igt_render_copyfunc_t rendercopy = igt_get_render_copyfunc(devid);
> >  	struct igt_buf src_buf = {}, dst_buf = {};
> >  	struct intel_batchbuffer *batch;
> > -	uint32_t tiling, swizzle;
> >  	struct buf_data tmp;
> >  	int pixel_size = buf->bpp / 8;
> >  
> >  	igt_skip_on(!rendercopy);
> >  
> > -	igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle));
> > -
> >  	/* We create a temporary buffer and copy from it using rendercopy. */
> >  	tmp.size = rect->w * rect->h * pixel_size;
> >  	tmp.handle = gem_create(fd, tmp.size);
> >  	tmp.stride = rect->w * pixel_size;
> >  	tmp.bpp = buf->bpp;
> >  	draw_rect_mmap_cpu(fd, &tmp, &(struct rect){0, 0, rect->w, rect->h},
> > -			   color);
> > +			   I915_TILING_NONE, I915_BIT_6_SWIZZLE_NONE, color);
> >  
> >  	src = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", tmp.handle);
> >  	igt_assert(src);
> > @@ -647,9 +637,12 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
> >   */
> >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> >  		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > -		   int rect_w, int rect_h, uint32_t color, int bpp)
> > +		   uint32_t tiling, enum igt_draw_method method,
> 
> The new tiling parameter should probably be captured in the kerneldoc
> right above this function.

Yes, that was missed.

> 
> > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > +		   uint32_t color, int bpp)
> >  {
> > +	uint32_t buf_tiling, swizzle;
> > +
> >  	struct cmd_data cmd_data = {
> >  		.bufmgr = bufmgr,
> >  		.context = context,
> > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> >  		.h = rect_h,
> >  	};
> >  
> > +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> > +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> > +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> > +		igt_assert(tiling == buf_tiling);
> > +	}
> > +
> >  	switch (method) {
> >  	case IGT_DRAW_MMAP_CPU:
> > -		draw_rect_mmap_cpu(fd, &buf, &rect, color);
> > +		draw_rect_mmap_cpu(fd, &buf, &rect, tiling, swizzle, color);
> >  		break;
> >  	case IGT_DRAW_MMAP_GTT:
> >  		draw_rect_mmap_gtt(fd, &buf, &rect, color);
> >  		break;
> >  	case IGT_DRAW_MMAP_WC:
> > -		draw_rect_mmap_wc(fd, &buf, &rect, color);
> > +		draw_rect_mmap_wc(fd, &buf, &rect, tiling, swizzle, color);
> >  		break;
> >  	case IGT_DRAW_PWRITE:
> > -		draw_rect_pwrite(fd, &buf, &rect, color);
> > +		draw_rect_pwrite(fd, &buf, &rect, tiling, swizzle, color);
> >  		break;
> >  	case IGT_DRAW_BLT:
> > -		draw_rect_blt(fd, &cmd_data, &buf, &rect, color);
> > +		draw_rect_blt(fd, &cmd_data, &buf, &rect, tiling, swizzle,
> > +			      color);
> >  		break;
> >  	case IGT_DRAW_RENDER:
> > -		draw_rect_render(fd, &cmd_data, &buf, &rect, color);
> > +		draw_rect_render(fd, &cmd_data, &buf, &rect, tiling, swizzle,
> > +				 color);
> >  		break;
> 
> Blt and render draws don't use the swizzle parameter.  If the goal is to
> keep a consistent parameter list for all these functions, we should
> probably add tiling & swizzle to the gtt map function, even though they
> won't be used; otherwise we can drop the swizzle parameter from these
> two.

Ok, will remove swizzle from the blt/render funcs.

> 
> 
> Matt
> 
> >  	default:
> >  		igt_assert(false);
> > @@ -715,7 +716,8 @@ void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
> >  		      int rect_w, int rect_h, uint32_t color)
> >  {
> >  	igt_draw_rect(fd, bufmgr, context, fb->gem_handle, fb->size, fb->strides[0],
> > -		      method, rect_x, rect_y, rect_w, rect_h, color,
> > +		      igt_fb_mod_to_tiling(fb->modifier), method,
> > +		      rect_x, rect_y, rect_w, rect_h, color,
> >  		      igt_drm_format_to_bpp(fb->drm_format));
> >  }
> >  
> > diff --git a/lib/igt_draw.h b/lib/igt_draw.h
> > index b030131e..ec146754 100644
> > --- a/lib/igt_draw.h
> > +++ b/lib/igt_draw.h
> > @@ -52,8 +52,9 @@ const char *igt_draw_get_method_name(enum igt_draw_method method);
> >  
> >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> >  		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > -		   int rect_w, int rect_h, uint32_t color, int bpp);
> > +		   uint32_t tiling, enum igt_draw_method method,
> > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > +		   uint32_t color, int bpp);
> >  
> >  void igt_draw_rect_fb(int fd, drm_intel_bufmgr *bufmgr,
> >  		      drm_intel_context *context, struct igt_fb *fb,
> > diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> > index 2c765c34..9c2c3a5d 100644
> > --- a/tests/kms_frontbuffer_tracking.c
> > +++ b/tests/kms_frontbuffer_tracking.c
> > @@ -291,6 +291,7 @@ struct {
> >  	int height;
> >  	uint32_t color;
> >  	int bpp;
> > +	uint32_t tiling;
> >  } busy_thread = {
> >  	.stop = true,
> >  };
> > @@ -1126,9 +1127,9 @@ static void *busy_thread_func(void *data)
> >  	while (!busy_thread.stop)
> >  		igt_draw_rect(drm.fd, drm.bufmgr, NULL, busy_thread.handle,
> >  			      busy_thread.size, busy_thread.stride,
> > -			      IGT_DRAW_BLT, 0, 0, busy_thread.width,
> > -			      busy_thread.height, busy_thread.color,
> > -			      busy_thread.bpp);
> > +			      busy_thread.tiling, IGT_DRAW_BLT, 0, 0,
> > +			      busy_thread.width, busy_thread.height,
> > +			      busy_thread.color, busy_thread.bpp);
> >  
> >  	pthread_exit(0);
> >  }
> > @@ -1146,6 +1147,7 @@ static void start_busy_thread(struct igt_fb *fb)
> >  	busy_thread.height = fb->height;
> >  	busy_thread.color = pick_color(fb, COLOR_PRIM_BG);
> >  	busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format);
> > +	busy_thread.tiling = igt_fb_mod_to_tiling(fb->modifier);
> >  
> >  	rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL);
> >  	igt_assert_eq(rc, 0);
> > -- 
> > 2.23.1
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795
_______________________________________________
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 i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs on platforms w/o aperture
  2020-02-10 22:58   ` Matt Roper
@ 2020-02-11  0:38     ` Imre Deak
  0 siblings, 0 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-11  0:38 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

On Mon, Feb 10, 2020 at 02:58:03PM -0800, Matt Roper wrote:
> On Fri, Feb 07, 2020 at 09:15:21PM +0200, Imre Deak wrote:
> > Generate reference CRCs by drawing through a CPU mapping, which is also
> > available on platforms w/o a GTT aperture.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  tests/kms_draw_crc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
> > index 6de9feae..f9d4b178 100644
> > --- a/tests/kms_draw_crc.c
> > +++ b/tests/kms_draw_crc.c
> > @@ -187,7 +187,7 @@ static void draw_method_subtest(enum igt_draw_method method,
> >  	 * comparison. Cache the value so we don't recompute it for every single
> >  	 * subtest. */
> 
> It doesn't show in the context here, but the comment line just above
> this says "Use IGT_DRAW_MMAP_GTT" --- that should be updated to match
> the code change below.

Ok.

> 
> 
> Matt
> 
> >  	if (!base_crcs[format_index].set) {
> > -		get_method_crc(IGT_DRAW_MMAP_GTT, formats[format_index],
> > +		get_method_crc(IGT_DRAW_MMAP_CPU, formats[format_index],
> >  			       LOCAL_DRM_FORMAT_MOD_NONE,
> >  			       &base_crcs[format_index].crc);
> >  		base_crcs[format_index].set = true;
> > @@ -225,7 +225,7 @@ static void fill_fb_subtest(void)
> >  	igt_create_fb(drm_fd, ms.mode->hdisplay, ms.mode->vdisplay,
> >  		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
> >  
> > -	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_GTT,
> > +	igt_draw_rect_fb(drm_fd, bufmgr, NULL, &fb, IGT_DRAW_MMAP_CPU,
> >  			 0, 0, fb.width, fb.height, 0xFF);
> >  
> >  	rc = drmModeSetCrtc(drm_fd, ms.crtc_id, fb.fb_id, 0, 0,
> > -- 
> > 2.23.1
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795
_______________________________________________
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 i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests on platforms w/o aperture
  2020-02-10 23:19   ` Matt Roper
@ 2020-02-11  1:18     ` Imre Deak
  0 siblings, 0 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-11  1:18 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

On Mon, Feb 10, 2020 at 03:19:48PM -0800, Matt Roper wrote:
> On Fri, Feb 07, 2020 at 09:15:22PM +0200, Imre Deak wrote:
> > Subtests that draw through a GTT mapping are not relevent on a platform w/o
> > GTT aperture, so skip them.
> 
> Could this check be pushed down into check_test_requirements()?

The requirement wouldn't be correct for all subtests and for some others
we need to check something else than t->method.

> Matt
> 
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  tests/kms_frontbuffer_tracking.c | 32 ++++++++++++++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> > index 724f5d16..310c8b7b 100644
> > --- a/tests/kms_frontbuffer_tracking.c
> > +++ b/tests/kms_frontbuffer_tracking.c
> > @@ -1934,6 +1934,9 @@ static void draw_subtest(const struct test_mode *t)
> >  	struct modeset_params *params = pick_params(t);
> >  	struct fb_region *target;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	switch (t->screen) {
> >  	case SCREEN_PRIM:
> >  		if (t->method != IGT_DRAW_MMAP_GTT && t->plane == PLANE_PRI)
> > @@ -2032,6 +2035,11 @@ static void multidraw_subtest(const struct test_mode *t)
> >  			igt_debug("Methods %s and %s\n",
> >  				  igt_draw_get_method_name(m1),
> >  				  igt_draw_get_method_name(m2));
> > +
> > +			igt_skip_on((m1 == IGT_DRAW_MMAP_GTT ||
> > +				     m2 == IGT_DRAW_MMAP_GTT) &&
> > +				    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  			for (r = 0; r < pattern->n_rects; r++) {
> >  				used_method = (r % 2 == 0) ? m1 : m2;
> >  
> > @@ -2140,6 +2148,9 @@ static void badformat_subtest(const struct test_mode *t)
> >   */
> >  static void format_draw_subtest(const struct test_mode *t)
> >  {
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	if (format_is_valid(t->feature, t->format))
> >  		draw_subtest(t);
> >  	else
> > @@ -2276,6 +2287,9 @@ static void flip_subtest(const struct test_mode *t)
> >  	struct draw_pattern_info *pattern = &pattern1;
> >  	enum color bg_color;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	switch (t->screen) {
> >  	case SCREEN_PRIM:
> >  		assertions |= ASSERT_LAST_ACTION_CHANGED;
> > @@ -2335,6 +2349,9 @@ static void fliptrack_subtest(const struct test_mode *t, enum flip_type type)
> >  	struct modeset_params *params = pick_params(t);
> >  	struct draw_pattern_info *pattern = &pattern1;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	prepare_subtest(t, pattern);
> >  
> >  	create_fb(t->format, params->primary.fb->width, params->primary.fb->height,
> > @@ -2383,6 +2400,9 @@ static void move_subtest(const struct test_mode *t)
> >  	struct fb_region *reg = pick_target(t, params);
> >  	bool repeat = false;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	prepare_subtest(t, pattern);
> >  
> >  	/* Just paint the right color since we start at 0x0. */
> > @@ -2434,6 +2454,9 @@ static void onoff_subtest(const struct test_mode *t)
> >  	struct modeset_params *params = pick_params(t);
> >  	struct draw_pattern_info *pattern = &pattern3;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	prepare_subtest(t, pattern);
> >  
> >  	/* Just paint the right color since we start at 0x0. */
> > @@ -2493,6 +2516,9 @@ static void fullscreen_plane_subtest(const struct test_mode *t)
> >  	struct modeset_params *params = pick_params(t);
> >  	int assertions;
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	prepare_subtest(t, pattern);
> >  
> >  	rect = pattern->get_rect(&params->primary, 0);
> > @@ -2744,6 +2770,9 @@ static void farfromfence_subtest(const struct test_mode *t)
> >  	int max_height, assertions = 0;
> >  	int gen = intel_gen(intel_get_drm_devid(drm.fd));
> >  
> > +	igt_skip_on(t->method == IGT_DRAW_MMAP_GTT &&
> > +		    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  	switch (gen) {
> >  	case 2:
> >  		max_height = 2048;
> > @@ -3025,6 +3054,9 @@ static void basic_subtest(const struct test_mode *t)
> >  	fb1 = params->primary.fb;
> >  
> >  	for (r = 0, method = 0; method < IGT_DRAW_METHOD_COUNT; method++, r++) {
> > +		igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
> > +			    !gem_has_mappable_ggtt(drm.fd));
> > +
> >  		if (r == pattern->n_rects) {
> >  			params->primary.fb = (params->primary.fb == fb1) ? &fb2 : fb1;
> >  
> > -- 
> > 2.23.1
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795
_______________________________________________
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 i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared
  2020-02-10 23:34   ` Matt Roper
@ 2020-02-11  1:26     ` Imre Deak
  0 siblings, 0 replies; 28+ messages in thread
From: Imre Deak @ 2020-02-11  1:26 UTC (permalink / raw)
  To: Matt Roper; +Cc: igt-dev

On Mon, Feb 10, 2020 at 03:34:46PM -0800, Matt Roper wrote:
> On Fri, Feb 07, 2020 at 09:15:24PM +0200, Imre Deak wrote:
> > For tiled FBs that are mapped in an other way than a GTT map we need to
> > clear all tile-rows. Clearing only the first stride*height bytes may
> > leave tiles at the end of the FB uncleared.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >  lib/igt_fb.c | 30 ++++++++++++++++++++----------
> >  1 file changed, 20 insertions(+), 10 deletions(-)
> > 
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index af3291a2..a4db0749 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -841,10 +841,20 @@ static void memset64(uint64_t *s, uint64_t c, size_t n)
> >  static void clear_yuv_buffer(struct igt_fb *fb)
> >  {
> >  	bool full_range = fb->color_range == IGT_COLOR_YCBCR_FULL_RANGE;
> > +	size_t plane_size[2];
> >  	void *ptr;
> >  
> >  	igt_assert(igt_format_is_yuv(fb->drm_format));
> >  
> > +	for (int i = 0; i < min(ARRAY_SIZE(plane_size), fb->num_planes); i++) {
> 
> This will still calculate a plane_size[1] for packed YUV + CCS I think,
> but I guess that doesn't hurt anything since it just never gets used
> below.

Yes, thanks for spotting that. This should be:
	i < lookup_drm_format(fb->drm_format)->num_planes

> Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
> 
> 
> Matt
> 
> > +		unsigned int tile_width, tile_height;
> > +
> > +		igt_get_fb_tile_size(fb->fd, fb->modifier, fb->plane_bpp[i],
> > +				     &tile_width, &tile_height);
> > +		plane_size[i] = fb->strides[i] *
> > +			ALIGN(fb->plane_height[i], tile_height);
> > +	}
> > +
> >  	/* Ensure the framebuffer is preallocated */
> >  	ptr = igt_fb_map_buffer(fb->fd, fb);
> >  	igt_assert(*(uint32_t *)ptr == 0);
> > @@ -853,48 +863,48 @@ static void clear_yuv_buffer(struct igt_fb *fb)
> >  	case DRM_FORMAT_NV12:
> >  		memset(ptr + fb->offsets[0],
> >  		       full_range ? 0x00 : 0x10,
> > -		       fb->strides[0] * fb->plane_height[0]);
> > +		       plane_size[0]);
> >  		memset(ptr + fb->offsets[1],
> >  		       0x80,
> > -		       fb->strides[1] * fb->plane_height[1]);
> > +		       plane_size[1]);
> >  		break;
> >  	case DRM_FORMAT_XYUV8888:
> >  		wmemset(ptr + fb->offsets[0], full_range ? 0x00008080 : 0x00108080,
> > -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		break;
> >  	case DRM_FORMAT_YUYV:
> >  	case DRM_FORMAT_YVYU:
> >  		wmemset(ptr + fb->offsets[0],
> >  			full_range ? 0x80008000 : 0x80108010,
> > -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		break;
> >  	case DRM_FORMAT_UYVY:
> >  	case DRM_FORMAT_VYUY:
> >  		wmemset(ptr + fb->offsets[0],
> >  			full_range ? 0x00800080 : 0x10801080,
> > -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		break;
> >  	case DRM_FORMAT_P010:
> >  	case DRM_FORMAT_P012:
> >  	case DRM_FORMAT_P016:
> >  		wmemset(ptr, full_range ? 0 : 0x10001000,
> > -			fb->offsets[1] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		wmemset(ptr + fb->offsets[1], 0x80008000,
> > -			fb->strides[1] * fb->plane_height[1] / sizeof(wchar_t));
> > +			plane_size[1] / sizeof(wchar_t));
> >  		break;
> >  	case DRM_FORMAT_Y210:
> >  	case DRM_FORMAT_Y212:
> >  	case DRM_FORMAT_Y216:
> >  		wmemset(ptr + fb->offsets[0],
> >  			full_range ? 0x80000000 : 0x80001000,
> > -			fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		break;
> >  
> >  	case DRM_FORMAT_XVYU2101010:
> >  	case DRM_FORMAT_Y410:
> >  		wmemset(ptr + fb->offsets[0],
> >  			full_range ? 0x20000200 : 0x20010200,
> > -		fb->strides[0] * fb->plane_height[0] / sizeof(wchar_t));
> > +			plane_size[0] / sizeof(wchar_t));
> >  		break;
> >  
> >  	case DRM_FORMAT_XVYU12_16161616:
> > @@ -903,7 +913,7 @@ static void clear_yuv_buffer(struct igt_fb *fb)
> >  	case DRM_FORMAT_Y416:
> >  		memset64(ptr + fb->offsets[0],
> >  			 full_range ? 0x800000008000ULL : 0x800010008000ULL,
> > -			 fb->strides[0] * fb->plane_height[0] / sizeof(uint64_t));
> > +			 plane_size[0] / sizeof(uint64_t));
> >  		break;
> >  	}
> >  
> > -- 
> > 2.23.1
> > 
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795
_______________________________________________
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.IGT: failure for series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
                   ` (9 preceding siblings ...)
  2020-02-10 22:13 ` Matt Roper
@ 2020-02-11  9:30 ` Patchwork
  10 siblings, 0 replies; 28+ messages in thread
From: Patchwork @ 2020-02-11  9:30 UTC (permalink / raw)
  To: Imre Deak; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls
URL   : https://patchwork.freedesktop.org/series/73172/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7887_full -> IGTPW_4114_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4114_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4114_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@runner@aborted:
    - shard-hsw:          NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw5/igt@runner@aborted.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_schedule@out-order-bsd2:
    - shard-iclb:         [PASS][2] -> [SKIP][3] ([fdo#109276]) +8 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb1/igt@gem_exec_schedule@out-order-bsd2.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb6/igt@gem_exec_schedule@out-order-bsd2.html

  * igt@gem_exec_schedule@pi-common-bsd:
    - shard-iclb:         [PASS][4] -> [SKIP][5] ([i915#677]) +1 similar issue
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb3/igt@gem_exec_schedule@pi-common-bsd.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb4/igt@gem_exec_schedule@pi-common-bsd.html

  * igt@gem_exec_schedule@reorder-wide-bsd:
    - shard-iclb:         [PASS][6] -> [SKIP][7] ([fdo#112146]) +6 similar issues
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb3/igt@gem_exec_schedule@reorder-wide-bsd.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb2/igt@gem_exec_schedule@reorder-wide-bsd.html

  * igt@gem_partial_pwrite_pread@reads-uncached:
    - shard-hsw:          [PASS][8] -> [FAIL][9] ([i915#694])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw2/igt@gem_partial_pwrite_pread@reads-uncached.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw1/igt@gem_partial_pwrite_pread@reads-uncached.html

  * igt@gem_ppgtt@blt-vs-render-ctx0:
    - shard-hsw:          [PASS][10] -> [INCOMPLETE][11] ([i915#61])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw8/igt@gem_ppgtt@blt-vs-render-ctx0.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw5/igt@gem_ppgtt@blt-vs-render-ctx0.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [PASS][12] -> [FAIL][13] ([i915#454])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb5/igt@i915_pm_dc@dc6-dpms.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_selftest@live_gtt:
    - shard-apl:          [PASS][14] -> [TIMEOUT][15] ([fdo#112271])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-apl8/igt@i915_selftest@live_gtt.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-apl4/igt@i915_selftest@live_gtt.html

  * igt@kms_cursor_crc@pipe-b-cursor-256x256-onscreen:
    - shard-apl:          [PASS][16] -> [FAIL][17] ([i915#54])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-apl2/igt@kms_cursor_crc@pipe-b-cursor-256x256-onscreen.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-apl2/igt@kms_cursor_crc@pipe-b-cursor-256x256-onscreen.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-apl:          [PASS][18] -> [DMESG-WARN][19] ([i915#180])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-apl2/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-apl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_flip@plain-flip-ts-check-interruptible:
    - shard-glk:          [PASS][20] -> [FAIL][21] ([i915#34])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-glk1/igt@kms_flip@plain-flip-ts-check-interruptible.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-glk1/igt@kms_flip@plain-flip-ts-check-interruptible.html

  * igt@kms_frontbuffer_tracking@psr-suspend:
    - shard-iclb:         [PASS][22] -> [INCOMPLETE][23] ([i915#123])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@kms_frontbuffer_tracking@psr-suspend.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb8/igt@kms_frontbuffer_tracking@psr-suspend.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [PASS][24] -> [SKIP][25] ([fdo#109441]) +2 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb8/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_setmode@basic:
    - shard-glk:          [PASS][26] -> [FAIL][27] ([i915#31])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-glk2/igt@kms_setmode@basic.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-glk7/igt@kms_setmode@basic.html

  * igt@perf_pmu@init-busy-vcs1:
    - shard-iclb:         [PASS][28] -> [SKIP][29] ([fdo#112080]) +9 similar issues
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@perf_pmu@init-busy-vcs1.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb5/igt@perf_pmu@init-busy-vcs1.html

  * igt@prime_mmap_coherency@ioctl-errors:
    - shard-hsw:          [PASS][30] -> [FAIL][31] ([i915#831])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw2/igt@prime_mmap_coherency@ioctl-errors.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw8/igt@prime_mmap_coherency@ioctl-errors.html

  
#### Possible fixes ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [SKIP][32] ([fdo#112080]) -> [PASS][33] +8 similar issues
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb6/igt@gem_busy@busy-vcs1.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb1/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_isolation@rcs0-s3:
    - shard-apl:          [DMESG-WARN][34] ([i915#180]) -> [PASS][35] +1 similar issue
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-apl6/igt@gem_ctx_isolation@rcs0-s3.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-apl8/igt@gem_ctx_isolation@rcs0-s3.html

  * igt@gem_exec_balancer@hang:
    - shard-iclb:         [TIMEOUT][36] ([fdo#112271]) -> [PASS][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb4/igt@gem_exec_balancer@hang.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb2/igt@gem_exec_balancer@hang.html

  * igt@gem_exec_schedule@deep-bsd:
    - shard-iclb:         [SKIP][38] ([fdo#112146]) -> [PASS][39] +3 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@gem_exec_schedule@deep-bsd.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb7/igt@gem_exec_schedule@deep-bsd.html

  * igt@gem_exec_schedule@preempt-queue-bsd1:
    - shard-iclb:         [SKIP][40] ([fdo#109276]) -> [PASS][41] +13 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb6/igt@gem_exec_schedule@preempt-queue-bsd1.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb2/igt@gem_exec_schedule@preempt-queue-bsd1.html

  * igt@gem_partial_pwrite_pread@reads:
    - shard-hsw:          [FAIL][42] ([i915#694]) -> [PASS][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw2/igt@gem_partial_pwrite_pread@reads.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw8/igt@gem_partial_pwrite_pread@reads.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-snb:          [DMESG-WARN][44] ([fdo#111870] / [i915#478]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-snb5/igt@gem_userptr_blits@sync-unmap.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-snb6/igt@gem_userptr_blits@sync-unmap.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][46] ([i915#454]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@i915_pm_dc@dc6-psr.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb7/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rps@waitboost:
    - shard-iclb:         [FAIL][48] ([i915#413]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb7/igt@i915_pm_rps@waitboost.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb3/igt@i915_pm_rps@waitboost.html

  * igt@i915_selftest@live_blt:
    - shard-hsw:          [DMESG-FAIL][50] ([i915#553] / [i915#725]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw8/igt@i915_selftest@live_blt.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw2/igt@i915_selftest@live_blt.html

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-xtiled:
    - shard-snb:          [DMESG-WARN][52] ([i915#478]) -> [PASS][53]
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-snb5/igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-xtiled.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-snb2/igt@kms_draw_crc@draw-method-xrgb8888-mmap-gtt-xtiled.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-glk:          [FAIL][54] ([i915#899]) -> [PASS][55]
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-glk4/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-glk7/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [SKIP][56] ([fdo#109642] / [fdo#111068]) -> [PASS][57] +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb5/igt@kms_psr2_su@frontbuffer.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb2/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][58] ([fdo#109441]) -> [PASS][59] +1 similar issue
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
    - shard-iclb:         [INCOMPLETE][60] ([i915#140]) -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb7/igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb8/igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [SKIP][62] ([fdo#112080]) -> [FAIL][63] ([IGT#28])
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb7/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb1/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_tiled_blits@interruptible:
    - shard-hsw:          [FAIL][64] ([i915#818]) -> [FAIL][65] ([i915#694])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-hsw5/igt@gem_tiled_blits@interruptible.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-hsw1/igt@gem_tiled_blits@interruptible.html

  * igt@i915_pm_rpm@legacy-planes:
    - shard-snb:          [INCOMPLETE][66] ([i915#82]) -> [SKIP][67] ([fdo#109271])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-snb4/igt@i915_pm_rpm@legacy-planes.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-snb4/igt@i915_pm_rpm@legacy-planes.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [DMESG-WARN][68] ([fdo#107724]) -> [SKIP][69] ([fdo#109349])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb8/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@runner@aborted:
    - shard-iclb:         [FAIL][70] ([fdo#111093]) -> [FAIL][71] ([fdo#111093] / [i915#209])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7887/shard-iclb7/igt@runner@aborted.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/shard-iclb8/igt@runner@aborted.html

  
  [IGT#28]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/28
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111093]: https://bugs.freedesktop.org/show_bug.cgi?id=111093
  [fdo#111870]: https://bugs.freedesktop.org/show_bug.cgi?id=111870
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [fdo#112271]: https://bugs.freedesktop.org/show_bug.cgi?id=112271
  [i915#123]: https://gitlab.freedesktop.org/drm/intel/issues/123
  [i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#209]: https://gitlab.freedesktop.org/drm/intel/issues/209
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#478]: https://gitlab.freedesktop.org/drm/intel/issues/478
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
  [i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
  [i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
  [i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#831]: https://gitlab.freedesktop.org/drm/intel/issues/831
  [i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5425 -> IGTPW_4114
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_7887: b147ed9753265260d6380604de01c3d646a323cd @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4114: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.html
  IGT_5425: ad4542ef1adbaa1227bc9ba9e24bb0e0f6dd408d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4114/index.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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-10 11:37   ` Imre Deak
@ 2020-02-11 19:10     ` Dixit, Ashutosh
  2020-02-11 19:18       ` Imre Deak
  0 siblings, 1 reply; 28+ messages in thread
From: Dixit, Ashutosh @ 2020-02-11 19:10 UTC (permalink / raw)
  To: imre.deak; +Cc: igt-dev, Vanshidhar Konda

On Mon, 10 Feb 2020 03:37:54 -0800, Imre Deak wrote:
>
> On Sat, Feb 08, 2020 at 02:36:38PM -0800, Dixit, Ashutosh wrote:
> > On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote:
> > >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > >		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > > -		   int rect_w, int rect_h, uint32_t color, int bpp)
> > > +		   uint32_t tiling, enum igt_draw_method method,
> > > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > > +		   uint32_t color, int bpp)
> > >  {
> > > +	uint32_t buf_tiling, swizzle;
> > > +
> > >	struct cmd_data cmd_data = {
> > >		.bufmgr = bufmgr,
> > >		.context = context,
> > > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > >		.h = rect_h,
> > >	};
> > >
> > > +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> > > +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> > > +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> > > +		igt_assert(tiling == buf_tiling);
> > > +	}
> >
> > Probably a nit, but looks a little strange to call gem_get_tiling() to get
> > the swizzle and then doing an assert.
>
> gem_get_tiling() is the way to get the swizzling for a buffer. The
> assert only makes sure that the caller's and kernel's idea of the tiling
> matches. While the callers will pick the tiling (when creating the
> buffer), the swizzling is fixed based on this tiling and platform.

Let me ask a different way, do we even need the new tiling argument to
igt_draw_rect()? Can't we just do:

        if (gem_available_fences(fd))
                gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);

Basically if we have the handle we should just be able to query the tiling.

> > Instead, since igt_draw_rect() has only two callers how about moving
> > the gem_get_tiling() call into the callers and passing both tiling and
> > swizzle into igt_draw_rect()?
>
> Why?
>
> >
> > > diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> > > index 2c765c34..9c2c3a5d 100644
> > > --- a/tests/kms_frontbuffer_tracking.c
> > > +++ b/tests/kms_frontbuffer_tracking.c
> > > @@ -291,6 +291,7 @@ struct {
> > >	int height;
> > >	uint32_t color;
> > >	int bpp;
> > > +	uint32_t tiling;
> >
> > Should not need this if we follow the suggestion above.
>
> This contains the tiling of the buffer as now we won't have a way to
> retrieve the same from the kernel.

Again, won't need these other changes if the tiling arg to igt_draw_rect()
can be eliminated.
_______________________________________________
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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-11 19:10     ` Dixit, Ashutosh
@ 2020-02-11 19:18       ` Imre Deak
  2020-02-12  4:17         ` Dixit, Ashutosh
  0 siblings, 1 reply; 28+ messages in thread
From: Imre Deak @ 2020-02-11 19:18 UTC (permalink / raw)
  To: Dixit, Ashutosh; +Cc: igt-dev, Vanshidhar Konda

On Tue, Feb 11, 2020 at 11:10:13AM -0800, Dixit, Ashutosh wrote:
> On Mon, 10 Feb 2020 03:37:54 -0800, Imre Deak wrote:
> >
> > On Sat, Feb 08, 2020 at 02:36:38PM -0800, Dixit, Ashutosh wrote:
> > > On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote:
> > > >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > > >		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > > > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > > > -		   int rect_w, int rect_h, uint32_t color, int bpp)
> > > > +		   uint32_t tiling, enum igt_draw_method method,
> > > > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > > > +		   uint32_t color, int bpp)
> > > >  {
> > > > +	uint32_t buf_tiling, swizzle;
> > > > +
> > > >	struct cmd_data cmd_data = {
> > > >		.bufmgr = bufmgr,
> > > >		.context = context,
> > > > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > > >		.h = rect_h,
> > > >	};
> > > >
> > > > +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> > > > +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> > > > +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> > > > +		igt_assert(tiling == buf_tiling);
> > > > +	}
> > >
> > > Probably a nit, but looks a little strange to call gem_get_tiling() to get
> > > the swizzle and then doing an assert.
> >
> > gem_get_tiling() is the way to get the swizzling for a buffer. The
> > assert only makes sure that the caller's and kernel's idea of the tiling
> > matches. While the callers will pick the tiling (when creating the
> > buffer), the swizzling is fixed based on this tiling and platform.
> 
> Let me ask a different way, do we even need the new tiling argument to
> igt_draw_rect()? Can't we just do:
> 
>         if (gem_available_fences(fd))
>                 gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> 
> Basically if we have the handle we should just be able to query the tiling.

We do need to handle different tilings even if
!gem_available_fences(fd), so we need the tiling param. Note that HW
detiling support via GGTT != tiling support by display,gt engines.

> 
> > > Instead, since igt_draw_rect() has only two callers how about moving
> > > the gem_get_tiling() call into the callers and passing both tiling and
> > > swizzle into igt_draw_rect()?
> >
> > Why?
> >
> > >
> > > > diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
> > > > index 2c765c34..9c2c3a5d 100644
> > > > --- a/tests/kms_frontbuffer_tracking.c
> > > > +++ b/tests/kms_frontbuffer_tracking.c
> > > > @@ -291,6 +291,7 @@ struct {
> > > >	int height;
> > > >	uint32_t color;
> > > >	int bpp;
> > > > +	uint32_t tiling;
> > >
> > > Should not need this if we follow the suggestion above.
> >
> > This contains the tiling of the buffer as now we won't have a way to
> > retrieve the same from the kernel.
> 
> Again, won't need these other changes if the tiling arg to igt_draw_rect()
> can be eliminated.
_______________________________________________
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 i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls
  2020-02-11 19:18       ` Imre Deak
@ 2020-02-12  4:17         ` Dixit, Ashutosh
  0 siblings, 0 replies; 28+ messages in thread
From: Dixit, Ashutosh @ 2020-02-12  4:17 UTC (permalink / raw)
  To: imre.deak; +Cc: igt-dev

On Tue, 11 Feb 2020 11:18:45 -0800, Imre Deak wrote:
> On Tue, Feb 11, 2020 at 11:10:13AM -0800, Dixit, Ashutosh wrote:
> > On Mon, 10 Feb 2020 03:37:54 -0800, Imre Deak wrote:
> > >
> > > On Sat, Feb 08, 2020 at 02:36:38PM -0800, Dixit, Ashutosh wrote:
> > > > On Fri, 07 Feb 2020 11:15:17 -0800, Imre Deak wrote:
> > > > >  void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > > > >		   uint32_t buf_handle, uint32_t buf_size, uint32_t buf_stride,
> > > > > -		   enum igt_draw_method method, int rect_x, int rect_y,
> > > > > -		   int rect_w, int rect_h, uint32_t color, int bpp)
> > > > > +		   uint32_t tiling, enum igt_draw_method method,
> > > > > +		   int rect_x, int rect_y, int rect_w, int rect_h,
> > > > > +		   uint32_t color, int bpp)
> > > > >  {
> > > > > +	uint32_t buf_tiling, swizzle;
> > > > > +
> > > > >	struct cmd_data cmd_data = {
> > > > >		.bufmgr = bufmgr,
> > > > >		.context = context,
> > > > > @@ -667,24 +660,32 @@ void igt_draw_rect(int fd, drm_intel_bufmgr *bufmgr, drm_intel_context *context,
> > > > >		.h = rect_h,
> > > > >	};
> > > > >
> > > > > +	swizzle = I915_BIT_6_SWIZZLE_NONE;
> > > > > +	if (tiling != I915_TILING_NONE && gem_available_fences(fd)) {
> > > > > +		gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> > > > > +		igt_assert(tiling == buf_tiling);
> > > > > +	}
> > > >
> > > > Probably a nit, but looks a little strange to call gem_get_tiling() to get
> > > > the swizzle and then doing an assert.
> > >
> > > gem_get_tiling() is the way to get the swizzling for a buffer. The
> > > assert only makes sure that the caller's and kernel's idea of the tiling
> > > matches. While the callers will pick the tiling (when creating the
> > > buffer), the swizzling is fixed based on this tiling and platform.
> >
> > Let me ask a different way, do we even need the new tiling argument to
> > igt_draw_rect()? Can't we just do:
> >
> >         if (gem_available_fences(fd))
> >                 gem_get_tiling(fd, buf_handle, &buf_tiling, &swizzle);
> >
> > Basically if we have the handle we should just be able to query the tiling.
>
> We do need to handle different tilings even if
> !gem_available_fences(fd), so we need the tiling param. Note that HW
> detiling support via GGTT != tiling support by display,gt engines.

OK:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@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:[~2020-02-12  4:29 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 19:15 [igt-dev] [PATCH i-g-t 1/8] lib/igt_draw: Refactor get_tiling calls Imre Deak
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 2/8] tests/kms_frontbuffer_tracking: Skip set tiling calls if not supported Imre Deak
2020-02-08 22:36   ` Dixit, Ashutosh
2020-02-10 22:32   ` Matt Roper
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 3/8] tests/kms_available_modes_crc: Don't set tiling for framebuffer Imre Deak
2020-02-10 22:47   ` Matt Roper
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 4/8] tests/kms_draw_crc: Skip GTT subtests on platforms w/o aperture Imre Deak
2020-02-10 22:51   ` Matt Roper
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 5/8] tests/kms_draw_crc: Fix generating reference CRCs " Imre Deak
2020-02-10 22:58   ` Matt Roper
2020-02-11  0:38     ` Imre Deak
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 6/8] tests/kms_frontbuffer_tracking: Skip GTT subtests " Imre Deak
2020-02-10 23:19   ` Matt Roper
2020-02-11  1:18     ` Imre Deak
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 7/8] lib/igt_draw: Fix igt_draw_fill_fb() " Imre Deak
2020-02-10 23:22   ` Matt Roper
2020-02-07 19:15 ` [igt-dev] [PATCH i-g-t 8/8] lib/igt_fb: Make sure tiled YUV framebuffers are fully cleared Imre Deak
2020-02-10 23:34   ` Matt Roper
2020-02-11  1:26     ` Imre Deak
2020-02-07 19:51 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib/igt_draw: Refactor get_tiling calls Patchwork
2020-02-08 22:36 ` [igt-dev] [PATCH i-g-t 1/8] " Dixit, Ashutosh
2020-02-10 11:37   ` Imre Deak
2020-02-11 19:10     ` Dixit, Ashutosh
2020-02-11 19:18       ` Imre Deak
2020-02-12  4:17         ` Dixit, Ashutosh
2020-02-10 22:13 ` Matt Roper
2020-02-11  0:37   ` Imre Deak
2020-02-11  9:30 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/8] " 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.