@@ -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
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(-)