[igt-dev] [PATCH i-g-t v4 3/3] tests/kms_ccs: Add GEN12 CCS render compression format modifiers
Mika Kahola
mika.kahola at intel.com
Fri Nov 8 11:41:58 UTC 2019
Add GEN12 CCS format modifiers for render compression. Render
compression is not supported for 90/270 rotation.
v2: Added new subtests for each format modifier.
v3: Add IGT description for each subtest (GitLab)
v4: Fix errorneous subtest execution and listing
Bspec: 49252
Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
tests/kms_ccs.c | 107 ++++++++++++++++++++++++++++--------------------
1 file changed, 63 insertions(+), 44 deletions(-)
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 1ce66cde..c5a37df8 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -70,10 +70,14 @@ static const struct {
{0.0, 1.0, 0.0}
};
-static const uint64_t ccs_modifiers[] = {
- LOCAL_I915_FORMAT_MOD_Y_TILED_CCS,
- LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS,
-};
+static const struct {
+ uint64_t modifier;
+ char name[8];
+} ccs_modifiers[3] = {
+ {LOCAL_I915_FORMAT_MOD_Y_TILED_CCS, "Y"},
+ {LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS, "Yf"},
+ {LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, "Y-rc"},
+ };
/*
* Limit maximum used sprite plane width so this test will not mistakenly
@@ -300,17 +304,14 @@ static int test_ccs(data_t *data)
static int __test_output(data_t *data)
{
igt_display_t *display = &data->display;
- int i, valid_tests = 0;
+ int valid_tests = 0;
data->output = igt_get_single_output_for_pipe(display, data->pipe);
igt_require(data->output);
igt_output_set_pipe(data->output, data->pipe);
- for (i = 0; i < ARRAY_SIZE(ccs_modifiers); i++) {
- data->ccs_modifier = ccs_modifiers[i];
- valid_tests += test_ccs(data);
- }
+ valid_tests += test_ccs(data);
igt_output_set_pipe(data->output, PIPE_NONE);
igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
@@ -328,12 +329,14 @@ static data_t data;
igt_main
{
+ int i, gen;
enum pipe pipe;
igt_fixture {
data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
- igt_require(intel_gen(intel_get_drm_devid(data.drm_fd)) >= 9);
+ gen = intel_gen(intel_get_drm_devid(data.drm_fd));
+ igt_require(gen >= 9);
kmstest_set_vt_graphics_mode();
igt_require_pipe_crc(data.drm_fd);
@@ -345,51 +348,67 @@ igt_main
data.pipe = pipe;
- data.flags = TEST_BAD_PIXEL_FORMAT;
- igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name)
- test_output(&data);
+ for (i = 0; i < ARRAY_SIZE(ccs_modifiers); i++) {
+ if (!igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888,
+ ccs_modifiers[i].modifier))
+ continue;
- data.flags = TEST_BAD_ROTATION_90;
- igt_subtest_f("pipe-%s-bad-rotation-90", pipe_name)
- test_output(&data);
+ data.ccs_modifier = ccs_modifiers[i].modifier;
- data.flags = TEST_CRC;
- igt_subtest_f("pipe-%s-crc-primary-basic", pipe_name)
- test_output(&data);
+ data.flags = TEST_BAD_PIXEL_FORMAT;
+ igt_describe("Test bad pixel format with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-bad-pixel-format", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
- data.flags = TEST_CRC | TEST_ROTATE_180;
- igt_subtest_f("pipe-%s-crc-primary-rotation-180", pipe_name)
- test_output(&data);
+ data.flags = TEST_BAD_ROTATION_90;
+ igt_describe("Test 90 degree rotation with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-bad-rotation-90", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
- data.flags = TEST_CRC;
- igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) {
- int valid_tests = 0;
+ data.flags = TEST_CRC;
+ igt_describe("Test primary plane CRC compatibility with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-crc-primary-basic", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
- igt_display_require_output_on_pipe(&data.display, data.pipe);
+ data.flags = TEST_CRC | TEST_ROTATE_180;
+ igt_describe("Test 180 degree rotation with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-crc-primary-rotation-180", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
- for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
- if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
- continue;
- valid_tests += __test_output(&data);
- }
+ data.flags = TEST_CRC;
+ igt_describe("Test sprite plane CRC compatibility with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-crc-sprite-planes-basic", pipe_name, ccs_modifiers[i].name) {
+ int valid_tests = 0;
- igt_require_f(valid_tests > 0,
- "CCS not supported, skipping\n");
- }
+ 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;
+ valid_tests += __test_output(&data);
+ }
- data.plane = NULL;
+ igt_require_f(valid_tests > 0,
+ "CCS not supported, skipping\n");
+ }
- data.flags = TEST_NO_AUX_BUFFER;
- igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
- test_output(&data);
+ data.plane = NULL;
- data.flags = TEST_BAD_CCS_HANDLE;
- igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name)
- test_output(&data);
+ data.flags = TEST_NO_AUX_BUFFER;
+ igt_describe("Test missing CCS buffer with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-missing-ccs-buffer", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
- data.flags = TEST_BAD_AUX_STRIDE;
- igt_subtest_f("pipe-%s-bad-aux-stride", pipe_name)
- test_output(&data);
+ data.flags = TEST_BAD_CCS_HANDLE;
+ igt_describe("Test CCS with different BO with given modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-ccs-on-another-bo", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
+
+ data.flags = TEST_BAD_AUX_STRIDE;
+ igt_describe("Test with bad AUX stride with given CCS modifier");
+ igt_subtest_f("pipe-%s-tiling-%s-bad-aux-stride", pipe_name, ccs_modifiers[i].name)
+ test_output(&data);
+ }
}
igt_fixture
--
2.17.1
More information about the igt-dev
mailing list