diff mbox

[v2,4/7] tests/kms_ccs: Test case where the CCS buffer was not provided

Message ID 20170831055818.11796-5-krisman@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

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

Comments

Daniel Stone Sept. 5, 2017, 8:09 a.m. UTC | #1
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
diff mbox

Patch

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