[igt-dev] [PATCH i-g-t 2/4] tests/kms_rotation_crc: use DRM_FORMAT_MOD_LINEAR as default modifier

Maíra Canal mcanal at igalia.com
Mon Apr 3 13:01:22 UTC 2023


If the rotation is 90 or 270 degrees, the function prepare_fbs() uses a
i915-specific modifier, I915_FORMAT_MOD_Y_TILED. In order to make the
function more generic, use a i915-specific modifier only if the device
is i915. Otherwise, use the DRM_FORMAT_MOD_LINEAR modifier.

Signed-off-by: Maíra Canal <mcanal at igalia.com>
---
 tests/kms_rotation_crc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 0d7b3962..cf02306f 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -296,7 +296,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	 * frame can fit in
 	 */
 	if (igt_rotation_90_or_270(data->rotation)) {
-		modifier = data->override_modifier ?: I915_FORMAT_MOD_Y_TILED;
+		if (is_i915_device(data->gfx_fd))
+			modifier = data->override_modifier ?: I915_FORMAT_MOD_Y_TILED;
 
 		igt_swap(w, h);
 	}
-- 
2.39.2



More information about the igt-dev mailing list