All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] kms_ccs testcase improvements
@ 2017-08-31  5:58 Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Hey,

Here is a v2 including other testcases for kms_ccs as well as random
fixes to that test and one to igt_kms.

I have two other testcases that I wanted to share together with this set
for kms_ccs, but they will come later.

Please notice that the testcase for the overlapping buffers will hit a
failure because linux fails to detect the overlapping buffers in
add_fb2.  I'll submit on another thread with a patch to linux fixing the
ioctl, which will make this test suceed. 

Please, let me know your feedback,

Gabriel Krisman Bertazi (7):
  tests/kms_ccs: Test pipes other than pipe A
  lib/igt_kms: Fix off-by-one bug on skip of missing pipe
  tests/kms_ccs: Prevent segfault if pipe is not supported
  tests/kms_ccs: Test case where the CCS buffer was not provided
  tests/kms_ccs: Test case where CCS and main buffer overlaps
  tests/kms_ccs: Test case where CCS is on a different BO
  tests/kms_ccs: Test case for wrong aux buffer stripe size

 lib/igt_kms.c   |  2 +-
 tests/kms_ccs.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 74 insertions(+), 10 deletions(-)

-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 1/7] tests/kms_ccs: Test pipes other than pipe A
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Commit d41c4ccbd2f9 ("tests/kms_ccs: Fix subtest enumeration")
accidently removed the update of data.pipe, causing kms_ccs to silently
only test PIPE_A.

This fixes the behavior reported by Daniel Vetter where tests would
succeed even on nonexistent pipes.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index ab9325d14991..775c6999699f 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -483,6 +483,8 @@ igt_main
 		const char *pipe_name = kmstest_pipe_name(pipe);
 		int sprite_idx = 0;
 
+		data.pipe = pipe;
+
 		data.flags = TEST_BAD_PIXEL_FORMAT;
 		igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name)
 			test_output(&data);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

display->n_pipes is zero-indexed, so N returned in
igt_display_get_n_pipes is already not a valid pipe.  This patch
prevents kms_ccs from going nuts when testing the first unxesting pipe.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 14e2701c3afd..ce07fcc1fc73 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1864,7 +1864,7 @@ void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe)
 {
 	igt_output_t *output;
 
-	igt_skip_on_f(igt_display_get_n_pipes(display) < pipe,
+	igt_skip_on_f(igt_display_get_n_pipes(display) <= pipe,
 		      "Pipe %s does not exist.\n", kmstest_pipe_name(pipe));
 
 	for_each_valid_output_on_pipe(display, pipe, output)
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

for_each_plane_on_pipe() indexes bad memory when iterating over an invalid
pipe.  Make sure the pipe exists before trying to use it.  This prevents
the crash below:

root@ideacentre:~# igt-gpu-tools/tests/kms_ccs --r pipe-D-crc-sprite-planes-basic
IGT-Version: 1.19-g59f0e3d182a8 (x86_64) (Linux: 4.13.0-rc6.intel-boxes+x86_64)
Received signal SIGSEGV.
Stack trace:
 #0 [fatal_sig_handler+0x185]
 #1 [killpg+0x40]
 #2 [__real_main485+0x2de]
 #3 [main+0x3f]
 #4 [__libc_start_main+0xf1]
 #5 [_start+0x2a]
 #6 [<unknown>+0x2a]
Subtest pipe-D-crc-sprite-planes-basic: CRASH (0.004s)

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 775c6999699f..73025a1e019f 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -503,6 +503,9 @@ igt_main
 
 		data.flags = TEST_CRC;
 		igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) {
+
+			igt_display_require_output_on_pipe(&data.display, data.pipe);
+
 			for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
 				if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
 					continue;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
                   ` (2 preceding siblings ...)
  2017-08-31  5:58 ` [PATCH v2 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-09-05  8:09   ` Daniel Stone
  2017-08-31  5:58 ` [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 73025a1e019f..cc41c85c4964 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -33,8 +33,12 @@ enum test_flags {
 	TEST_ROTATE_180			= 1 << 2,
 	TEST_BAD_PIXEL_FORMAT		= 1 << 3,
 	TEST_BAD_ROTATION_90		= 1 << 4,
+	TEST_NO_AUX_BUFFER		= 1 << 5,
 };
 
+#define TEST_FAIL_ON_ADDFB2 \
+	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER)
+
 enum test_fb_flags {
 	FB_COMPRESSED			= 1 << 0,
 	FB_HAS_PLANE			= 1 << 1,
@@ -321,16 +325,19 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 		size[1] = f.pitches[1] * ALIGN(ccs_height, 32);
 
 		f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
-		f.handles[1] = f.handles[0];
-		render_ccs(data, f.handles[1], f.offsets[1], size[1],
-			   height, f.pitches[1]);
+
+		if (!(data->flags & TEST_NO_AUX_BUFFER)) {
+			f.handles[1] = f.handles[0];
+			render_ccs(data, f.handles[1], f.offsets[1], size[1],
+				   height, f.pitches[1]);
+		}
 	} else
 		f.handles[0] = gem_create(data->drm_fd, size[0]);
 
 	render_fb(data, f.handles[0], size[0], fb_flags, height, f.pitches[0]);
 
 	ret = drmIoctl(data->drm_fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f);
-	if (data->flags & TEST_BAD_PIXEL_FORMAT) {
+	if (data->flags & TEST_FAIL_ON_ADDFB2) {
 		igt_assert_eq(ret, -1);
 		igt_assert_eq(errno, EINVAL);
 		return;
@@ -379,7 +386,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags)
 			    drm_mode->vdisplay, fb_flags);
 	}
 
-	if (data->flags & TEST_BAD_PIXEL_FORMAT)
+	if (data->flags & TEST_FAIL_ON_ADDFB2)
 		return;
 
 	igt_plane_set_position(primary, 0, 0);
@@ -446,7 +453,8 @@ static void test_output(data_t *data)
 	}
 
 	if (data->flags & TEST_BAD_PIXEL_FORMAT ||
-	    data->flags & TEST_BAD_ROTATION_90) {
+	    data->flags & TEST_BAD_ROTATION_90 ||
+	    data->flags & TEST_NO_AUX_BUFFER) {
 		try_config(data, fb_flags | FB_COMPRESSED);
 	}
 
@@ -515,6 +523,11 @@ igt_main
 		}
 
 		data.plane = NULL;
+
+		data.flags = TEST_NO_AUX_BUFFER;
+		igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
+			test_output(&data);
+
 	}
 
 	igt_fixture
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
                   ` (3 preceding siblings ...)
  2017-08-31  5:58 ` [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-09-05  8:06   ` Daniel Stone
  2017-08-31  5:58 ` [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
  2017-08-31  5:58 ` [PATCH v2 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size Gabriel Krisman Bertazi
  6 siblings, 1 reply; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index cc41c85c4964..06d34a80b108 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -34,10 +34,11 @@ enum test_flags {
 	TEST_BAD_PIXEL_FORMAT		= 1 << 3,
 	TEST_BAD_ROTATION_90		= 1 << 4,
 	TEST_NO_AUX_BUFFER		= 1 << 5,
+	TEST_BAD_CCS_OFFSET		= 1 << 6,
 };
 
 #define TEST_FAIL_ON_ADDFB2 \
-	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER)
+	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER | TEST_BAD_CCS_OFFSET)
 
 enum test_fb_flags {
 	FB_COMPRESSED			= 1 << 0,
@@ -321,7 +322,13 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 		int ccs_height = ALIGN(height, 16) / 16;
 		f.pitches[1] = ALIGN(ccs_width * 1, 128);
 		f.modifier[1] = modifier;
-		f.offsets[1] = size[0];
+
+		if (data->flags & TEST_BAD_CCS_OFFSET) {
+			/* Overlap CCS buffer with the color buffer. */
+			f.offsets[1] = 0;
+		} else
+			f.offsets[1] = size[0];
+
 		size[1] = f.pitches[1] * ALIGN(ccs_height, 32);
 
 		f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
@@ -454,7 +461,8 @@ static void test_output(data_t *data)
 
 	if (data->flags & TEST_BAD_PIXEL_FORMAT ||
 	    data->flags & TEST_BAD_ROTATION_90 ||
-	    data->flags & TEST_NO_AUX_BUFFER) {
+	    data->flags & TEST_NO_AUX_BUFFER ||
+	    data->flags & TEST_BAD_CCS_OFFSET) {
 		try_config(data, fb_flags | FB_COMPRESSED);
 	}
 
@@ -528,6 +536,10 @@ igt_main
 		igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
 			test_output(&data);
 
+		data.flags = TEST_BAD_CCS_OFFSET;
+		igt_subtest_f("pipe-%s-invalid-ccs-offset", pipe_name)
+			test_output(&data);
+
 	}
 
 	igt_fixture
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
                   ` (4 preceding siblings ...)
  2017-08-31  5:58 ` [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  2017-09-05  8:05   ` Daniel Stone
  2017-08-31  5:58 ` [PATCH v2 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size Gabriel Krisman Bertazi
  6 siblings, 1 reply; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 06d34a80b108..95de6963226d 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -35,10 +35,12 @@ enum test_flags {
 	TEST_BAD_ROTATION_90		= 1 << 4,
 	TEST_NO_AUX_BUFFER		= 1 << 5,
 	TEST_BAD_CCS_OFFSET		= 1 << 6,
+	TEST_BAD_CCS_HANDLE		= 1 << 7,
 };
 
 #define TEST_FAIL_ON_ADDFB2 \
-	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER | TEST_BAD_CCS_OFFSET)
+	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER | TEST_BAD_CCS_OFFSET | \
+	 TEST_BAD_CCS_HANDLE)
 
 enum test_fb_flags {
 	FB_COMPRESSED			= 1 << 0,
@@ -276,6 +278,7 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 	unsigned int size[2];
 	uint64_t modifier;
 	int ret;
+	uint32_t ccs_handle;
 
 	/* Use either compressed or Y-tiled to test. However, given the lack of
 	 * available bandwidth, we use linear for the primary plane when
@@ -331,10 +334,18 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 
 		size[1] = f.pitches[1] * ALIGN(ccs_height, 32);
 
-		f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
+		if (data->flags & TEST_BAD_CCS_HANDLE) {
+			/* Put the CCS buffer on a different BO. */
+			f.handles[0] = gem_create(data->drm_fd, size[0]);
+			ccs_handle = gem_create(data->drm_fd, size[1]);
+			f.offsets[1] = 0;
+		} else {
+			f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
+			ccs_handle = f.handles[0];
+		}
 
 		if (!(data->flags & TEST_NO_AUX_BUFFER)) {
-			f.handles[1] = f.handles[0];
+			f.handles[1] = ccs_handle;
 			render_ccs(data, f.handles[1], f.offsets[1], size[1],
 				   height, f.pitches[1]);
 		}
@@ -462,7 +473,8 @@ static void test_output(data_t *data)
 	if (data->flags & TEST_BAD_PIXEL_FORMAT ||
 	    data->flags & TEST_BAD_ROTATION_90 ||
 	    data->flags & TEST_NO_AUX_BUFFER ||
-	    data->flags & TEST_BAD_CCS_OFFSET) {
+	    data->flags & TEST_BAD_CCS_OFFSET ||
+	    data->flags & TEST_BAD_CCS_HANDLE) {
 		try_config(data, fb_flags | FB_COMPRESSED);
 	}
 
@@ -540,6 +552,10 @@ igt_main
 		igt_subtest_f("pipe-%s-invalid-ccs-offset", pipe_name)
 			test_output(&data);
 
+		data.flags = TEST_BAD_CCS_HANDLE;
+		igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name)
+			test_output(&data);
+
 	}
 
 	igt_fixture
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size
  2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
                   ` (5 preceding siblings ...)
  2017-08-31  5:58 ` [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
@ 2017-08-31  5:58 ` Gabriel Krisman Bertazi
  6 siblings, 0 replies; 11+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-08-31  5:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter, daniels, tomeu.vizoso

Two scenarios tested:
  - unaligned stripe
  - Stripe too small

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 95de6963226d..2e6efe95ffca 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -36,15 +36,18 @@ enum test_flags {
 	TEST_NO_AUX_BUFFER		= 1 << 5,
 	TEST_BAD_CCS_OFFSET		= 1 << 6,
 	TEST_BAD_CCS_HANDLE		= 1 << 7,
+	TEST_BAD_AUX_STRIDE		= 1 << 8,
 };
 
 #define TEST_FAIL_ON_ADDFB2 \
 	(TEST_BAD_PIXEL_FORMAT | TEST_NO_AUX_BUFFER | TEST_BAD_CCS_OFFSET | \
-	 TEST_BAD_CCS_HANDLE)
+	 TEST_BAD_CCS_HANDLE | TEST_BAD_AUX_STRIDE)
 
 enum test_fb_flags {
 	FB_COMPRESSED			= 1 << 0,
 	FB_HAS_PLANE			= 1 << 1,
+	FB_MISALIGN_AUX_STRIDE		= 1 << 2,
+	FB_SMALL_AUX_STRIDE		= 1 << 3,
 };
 
 typedef struct {
@@ -323,7 +326,14 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 		 */
 		int ccs_width = ALIGN(width * 4, 32) / 32;
 		int ccs_height = ALIGN(height, 16) / 16;
-		f.pitches[1] = ALIGN(ccs_width * 1, 128);
+		int aux_stride = ALIGN(ccs_width * 1, 128);
+
+		if (fb_flags & FB_MISALIGN_AUX_STRIDE)
+			aux_stride = ccs_width;
+		else if (fb_flags & FB_SMALL_AUX_STRIDE)
+			aux_stride = ALIGN(ccs_width/2, 128);
+
+		f.pitches[1] = aux_stride;
 		f.modifier[1] = modifier;
 
 		if (data->flags & TEST_BAD_CCS_OFFSET) {
@@ -478,6 +488,11 @@ static void test_output(data_t *data)
 		try_config(data, fb_flags | FB_COMPRESSED);
 	}
 
+	if (data->flags & TEST_BAD_AUX_STRIDE) {
+		try_config(data, fb_flags | FB_COMPRESSED | FB_MISALIGN_AUX_STRIDE);
+		try_config(data, fb_flags | FB_COMPRESSED | FB_SMALL_AUX_STRIDE);
+	}
+
 	primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
 	igt_plane_set_fb(primary, NULL);
 	igt_plane_set_rotation(primary, IGT_ROTATION_0);
@@ -556,6 +571,9 @@ igt_main
 		igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name)
 			test_output(&data);
 
+		data.flags = TEST_BAD_AUX_STRIDE;
+		igt_subtest_f("pipe-%s-bad-aux-stride", pipe_name)
+			test_output(&data);
 	}
 
 	igt_fixture
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO
  2017-08-31  5:58 ` [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
@ 2017-09-05  8:05   ` Daniel Stone
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Stone @ 2017-09-05  8:05 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi
  Cc: Vetter, Daniel, intel-gfx, Daniel Stone, Tomeu Vizoso

Hi Gabriel,

On 31 August 2017 at 06:58, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> +               if (data->flags & TEST_BAD_CCS_HANDLE) {
> +                       /* Put the CCS buffer on a different BO. */
> +                       f.handles[0] = gem_create(data->drm_fd, size[0]);
> +                       ccs_handle = gem_create(data->drm_fd, size[1]);
> +                       f.offsets[1] = 0;

This could be caught by offsets[1] < size[0] checking. Could you
please create both BOs with (size[0] + size[1]), and set (offset[1] ==
size[0])? In other words, the only thing differing at all is the BO.

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps
  2017-08-31  5:58 ` [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
@ 2017-09-05  8:06   ` Daniel Stone
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Stone @ 2017-09-05  8:06 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi
  Cc: Vetter, Daniel, intel-gfx, Daniel Stone, Tomeu Vizoso

On 31 August 2017 at 06:58, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> @@ -321,7 +322,13 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
>                 int ccs_height = ALIGN(height, 16) / 16;
>                 f.pitches[1] = ALIGN(ccs_width * 1, 128);
>                 f.modifier[1] = modifier;
> -               f.offsets[1] = size[0];
> +
> +               if (data->flags & TEST_BAD_CCS_OFFSET) {
> +                       /* Overlap CCS buffer with the color buffer. */
> +                       f.offsets[1] = 0;

How about size[0] - 1024? That will give us an aligned-to-128 value
which looks plausible, and should overlap actual colour data.

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided
  2017-08-31  5:58 ` [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
@ 2017-09-05  8:09   ` Daniel Stone
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Stone @ 2017-09-05  8:09 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: Vetter, Daniel, intel-gfx, Tomeu Vizoso

Hi Gabriel,

On 31 August 2017 at 06:58, Gabriel Krisman Bertazi
<krisman@collabora.co.uk> wrote:
> @@ -321,16 +325,19 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
>                 size[1] = f.pitches[1] * ALIGN(ccs_height, 32);
>
>                 f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]);
> -               f.handles[1] = f.handles[0];
> -               render_ccs(data, f.handles[1], f.offsets[1], size[1],
> -                          height, f.pitches[1]);
> +
> +               if (!(data->flags & TEST_NO_AUX_BUFFER)) {
> +                       f.handles[1] = f.handles[0];
> +                       render_ccs(data, f.handles[1], f.offsets[1], size[1],
> +                                  height, f.pitches[1]);
> +               }

Doesn't this leave modifier[1] still set? If so, that'll get rejected
by core code already for a mismatch.

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-09-05  8:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31  5:58 [PATCH v2 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
2017-08-31  5:58 ` [PATCH v2 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
2017-08-31  5:58 ` [PATCH v2 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
2017-08-31  5:58 ` [PATCH v2 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
2017-08-31  5:58 ` [PATCH v2 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
2017-09-05  8:09   ` Daniel Stone
2017-08-31  5:58 ` [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
2017-09-05  8:06   ` Daniel Stone
2017-08-31  5:58 ` [PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
2017-09-05  8:05   ` Daniel Stone
2017-08-31  5:58 ` [PATCH v2 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size Gabriel Krisman Bertazi

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.