[PATCH v2 6/7] tests/kms_ccs: Test case where CCS is on a different BO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux