From: Hersen Wu <hersenxs.wu@amd.com>
To: <igt-dev@lists.freedesktop.org>, <rodrigo.siqueira@amd.com>,
<aurabindo.pillai@amd.com>, <alex.hung@amd.com>,
<stylon.wang@amd.com>, <hamza.mahfooz@amd.com>
Cc: Hersen Wu <hersenxs.wu@amd.com>
Subject: [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix sub test crtc-lut-accuracy failure
Date: Tue, 20 Jun 2023 15:16:03 -0400 [thread overview]
Message-ID: <20230620191603.94265-1-hersenxs.wu@amd.com> (raw)
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
next reply other threads:[~2023-06-20 19:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 19:16 Hersen Wu [this message]
2023-06-20 20:37 ` [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix sub test crtc-lut-accuracy failure 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230620191603.94265-1-hersenxs.wu@amd.com \
--to=hersenxs.wu@amd.com \
--cc=alex.hung@amd.com \
--cc=aurabindo.pillai@amd.com \
--cc=hamza.mahfooz@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=rodrigo.siqueira@amd.com \
--cc=stylon.wang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox