Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/kms_plane: Handle hw without legacy gamma support
@ 2023-07-28 20:17 Rob Clark
  2023-07-28 21:16 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rob Clark @ 2023-07-28 20:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Rob Clark

From: Rob Clark <robdclark@chromium.org>

Skip the tests which require legacy gamma, instead of failing, if the hw
does not support legacy gamma.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 tests/kms_plane.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 67cff61d6cd1..9f72a5bceae9 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -463,7 +463,7 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
 	igt_pipe_t *pipe_obj = &data->display.pipes[pipe];
 	drmModeCrtc *crtc;
 	uint16_t *lut;
-	int i, lut_size;
+	int i, lut_size, ret;
 
 	crtc = drmModeGetCrtc(data->drm_fd, pipe_obj->crtc_id);
 	lut_size = crtc->gamma_size;
@@ -474,8 +474,10 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
 	for (i = 0; i < lut_size; i++)
 		lut[i] = (i * 0xffff / (lut_size - 1)) & mask;
 
-	igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, pipe_obj->crtc_id,
-					  lut_size, lut, lut, lut), 0);
+	ret = drmModeCrtcSetGamma(data->drm_fd, pipe_obj->crtc_id,
+				  lut_size, lut, lut, lut);
+	igt_require(ret != -ENOSYS);
+	igt_assert_eq(ret, 0);
 
 	free(lut);
 }
-- 
2.41.0

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

end of thread, other threads:[~2023-08-07 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 20:17 [igt-dev] [PATCH] tests/kms_plane: Handle hw without legacy gamma support Rob Clark
2023-07-28 21:16 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-07-28 21:41 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-28 22:36 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2023-08-07 15:02 ` [igt-dev] [PATCH] " Kamil Konieczny

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