[Intel-gfx] [PATCH v2 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps
Gabriel Krisman Bertazi
krisman at collabora.co.uk
Thu Aug 31 05:58:16 UTC 2017
Signed-off-by: Gabriel Krisman Bertazi <krisman at 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
More information about the Intel-gfx
mailing list