Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2] tests/kms_universal_plane: Re-work expectations for non-intel hw
@ 2024-02-15 22:20 Rob Clark
  2024-02-16 10:47 ` ✓ CI.xeBAT: success for tests/kms_universal_plane: Re-work expectations for non-intel hw (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rob Clark @ 2024-02-15 22:20 UTC (permalink / raw)
  To: igt-dev; +Cc: Rob Clark

From: Rob Clark <robdclark@chromium.org>

The expectation assumptions do not fit for non-intel hw.  So re-work the
expectations and add msm support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 tests/kms_universal_plane.c | 58 +++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 22 deletions(-)

diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 6a39f93cc5aa..a6e11777d04e 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -402,7 +402,7 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 	sanity_test_t test = { .data = data };
 	igt_plane_t *primary;
 	drmModeModeInfo *mode;
-	int i;
+	int i, ret;
 	int expect = 0;
 
 	igt_output_set_pipe(output, pipe);
@@ -432,29 +432,43 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	igt_plane_set_position(primary, 0, 0);
 
-	/* Try to use universal plane API to scale down (should fail on pre-gen9) */
+	/* Try to use universal plane API to scale down */
 	if (is_intel_device(data->drm_fd))
 		expect = (data->display_ver < 9) ? -ERANGE : 0;
-	igt_assert(drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
-				   output->config.crtc->crtc_id,
-				   test.oversized_fb.fb_id, 0,
-				   0, 0,
-				   mode->hdisplay + 100,
-				   mode->vdisplay + 100,
-				   IGT_FIXED(0,0), IGT_FIXED(0,0),
-				   IGT_FIXED(mode->hdisplay,0),
-				   IGT_FIXED(mode->vdisplay,0)) == expect);
-
-	/* Try to use universal plane API to scale up (should fail on pre-gen9) */
-	igt_assert(drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
-				   output->config.crtc->crtc_id,
-				   test.oversized_fb.fb_id, 0,
-				   0, 0,
-				   mode->hdisplay,
-				   mode->vdisplay,
-				   IGT_FIXED(0,0), IGT_FIXED(0,0),
-				   IGT_FIXED(mode->hdisplay - 100,0),
-				   IGT_FIXED(mode->vdisplay - 100,0)) == expect);
+	ret = drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
+			      output->config.crtc->crtc_id,
+			      test.oversized_fb.fb_id, 0,
+			      0, 0,
+			      mode->hdisplay + 100,
+			      mode->vdisplay + 100,
+			      IGT_FIXED(0,0), IGT_FIXED(0,0),
+			      IGT_FIXED(mode->hdisplay,0),
+			      IGT_FIXED(mode->vdisplay,0));
+	if (is_intel_device(data->drm_fd)) {
+		/* should fail on pre-gen9 */
+		igt_assert_eq(ret, (data->display_ver < 9) ? -ERANGE : 0);
+	} else {
+		/* Could succeed or fail with -ERANGE depending on hw limits: */
+		igt_assert((ret == 0) || (ret == -ERANGE));
+	}
+
+	/* Try to use universal plane API to scale up */
+	ret = drmModeSetPlane(data->drm_fd, primary->drm_plane->plane_id,
+			      output->config.crtc->crtc_id,
+			      test.oversized_fb.fb_id, 0,
+			      0, 0,
+			      mode->hdisplay,
+			      mode->vdisplay,
+			      IGT_FIXED(0,0), IGT_FIXED(0,0),
+			      IGT_FIXED(mode->hdisplay - 100,0),
+			      IGT_FIXED(mode->vdisplay - 100,0));
+	if (is_intel_device(data->drm_fd)) {
+		/* should fail on pre-gen9 */
+		igt_assert_eq(ret, (data->display_ver < 9) ? -ERANGE : 0);
+	} else {
+		/* Could succeed or fail with -ERANGE depending on hw limits: */
+		igt_assert((ret == 0) || (ret == -ERANGE));
+	}
 
 	/* Find other crtcs and try to program our primary plane on them */
 	for (i = 0; i < test.moderes->count_crtcs; i++)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-21 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 22:20 [PATCH i-g-t v2] tests/kms_universal_plane: Re-work expectations for non-intel hw Rob Clark
2024-02-16 10:47 ` ✓ CI.xeBAT: success for tests/kms_universal_plane: Re-work expectations for non-intel hw (rev2) Patchwork
2024-02-16 11:10 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-02-21 12:49   ` Kamil Konieczny
2024-02-21 12:47 ` [PATCH i-g-t v2] tests/kms_universal_plane: Re-work expectations for non-intel hw Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox