[igt-dev] [PATCH i-g-t] kms_psr2_su: Use FB_DAMAGE_CLIPS only when supported

Jouni Högander jouni.hogander at intel.com
Wed Apr 27 12:04:06 UTC 2022


Currently we are seeing failures in ICL platforms due to
missing support for IGT_PLANE_FB_DAMAGE_CLIPS. Use
IGT_PLANE_FB_DAMAGE_CLIPS only if it is supported

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4148

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
Cc: Petri Latvala <petri.latvala at intel.com>
Cc: José Roberto de Souza <jose.souza at intel.com>
---
 tests/i915/kms_psr2_su.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/i915/kms_psr2_su.c b/tests/i915/kms_psr2_su.c
index 474b1dfd..caccf713 100644
--- a/tests/i915/kms_psr2_su.c
+++ b/tests/i915/kms_psr2_su.c
@@ -168,17 +168,21 @@ static bool update_screen_and_test(data_t *data)
 
 	switch (data->op) {
 	case PAGE_FLIP: {
-		struct drm_mode_rect clip;
 		igt_plane_t *primary;
 
-		clip.x1 = clip.y1 = SQUARE_OFFSET;
-		clip.x2 = clip.y2 = SQUARE_OFFSET + SQUARE_SIZE;
-
 		primary = igt_output_get_plane_type(data->output,
 						    DRM_PLANE_TYPE_PRIMARY);
 
-		igt_plane_replace_prop_blob(primary, IGT_PLANE_FB_DAMAGE_CLIPS,
-					    &clip, sizeof(clip));
+		if (igt_plane_has_prop(primary, IGT_PLANE_FB_DAMAGE_CLIPS)) {
+			struct drm_mode_rect clip;
+
+			clip.x1 = clip.y1 = SQUARE_OFFSET;
+			clip.x2 = clip.y2 = SQUARE_OFFSET + SQUARE_SIZE;
+
+			igt_plane_replace_prop_blob(primary, IGT_PLANE_FB_DAMAGE_CLIPS,
+						    &clip, sizeof(clip));
+		}
+
 		igt_plane_set_fb(primary, &data->fb[data->screen_changes & 1]);
 		igt_display_commit2(&data->display, COMMIT_ATOMIC);
 		break;
-- 
2.25.1



More information about the igt-dev mailing list