Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix sub test crtc-lut-accuracy failure
@ 2023-06-20 19:16 Hersen Wu
  2023-06-20 20:37 ` Alex Hung
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hersen Wu @ 2023-06-20 19:16 UTC (permalink / raw)
  To: igt-dev, rodrigo.siqueira, aurabindo.pillai, alex.hung,
	stylon.wang, hamza.mahfooz
  Cc: Hersen Wu

Add reading degamma_lut_size and regamma_lut_size from Linux kernel
within test_crtc_lut_accuracy. Test fails within lut_init when
lut_size equals to zero.

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
---
 tests/amdgpu/amd_color.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/amdgpu/amd_color.c b/tests/amdgpu/amd_color.c
index 9eed1da38..34002ed88 100644
--- a/tests/amdgpu/amd_color.c
+++ b/tests/amdgpu/amd_color.c
@@ -53,7 +53,7 @@ typedef struct data {
 
 static void lut_init(lut_t *lut, uint32_t size)
 {
-	igt_assert(size > 0);
+	igt_assert_lt(0, size);
 
 	lut->size = size;
 	lut->data = malloc(size * sizeof(struct drm_color_lut));
@@ -229,7 +229,6 @@ static void test_crtc_linear_degamma(data_t *data)
 
 	data->degamma_lut_size =
 		igt_pipe_obj_get_prop(data->pipe, IGT_CRTC_DEGAMMA_LUT_SIZE);
-	igt_assert_lt(0, data->degamma_lut_size);
 
 	lut_init(&lut_linear, data->degamma_lut_size);
 	lut_gen_linear(&lut_linear, 0xffff);
@@ -277,7 +276,6 @@ static void test_crtc_linear_regamma(data_t *data)
 
 	data->regamma_lut_size =
 		igt_pipe_obj_get_prop(data->pipe, IGT_CRTC_GAMMA_LUT_SIZE);
-	igt_assert_lt(0, data->regamma_lut_size);
 
 	lut_init(&lut_linear, data->regamma_lut_size);
 	lut_gen_linear(&lut_linear, 0xffff);
@@ -340,6 +338,12 @@ static void test_crtc_lut_accuracy(data_t *data)
 	igt_require(igt_pipe_obj_has_prop(data->pipe, IGT_CRTC_DEGAMMA_LUT));
 	igt_require(igt_pipe_obj_has_prop(data->pipe, IGT_CRTC_GAMMA_LUT));
 
+	data->degamma_lut_size =
+		igt_pipe_obj_get_prop(data->pipe, IGT_CRTC_DEGAMMA_LUT_SIZE);
+
+	data->regamma_lut_size =
+		igt_pipe_obj_get_prop(data->pipe, IGT_CRTC_GAMMA_LUT_SIZE);
+
 	lut_init(&lut_degamma, data->degamma_lut_size);
 	lut_gen_degamma_srgb(&lut_degamma, 0xffff);
 
-- 
2.25.1

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

end of thread, other threads:[~2023-06-21  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 19:16 [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix sub test crtc-lut-accuracy failure Hersen Wu
2023-06-20 20:37 ` Alex Hung
2023-06-20 20:38 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-21  3:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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