Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Hersen Wu <hersenxs.wu@amd.com>,
	igt-dev@lists.freedesktop.org, rodrigo.siqueira@amd.com,
	aurabindo.pillai@amd.com, stylon.wang@amd.com,
	hamza.mahfooz@amd.com
Subject: Re: [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix test crash within crtc_lut_accuracy
Date: Tue, 20 Jun 2023 11:21:30 -0600	[thread overview]
Message-ID: <aa6f236e-3263-6841-5663-b4363a81270e@amd.com> (raw)
In-Reply-To: <20230620135425.32639-1-hersenxs.wu@amd.com>



On 2023-06-20 07:54, Hersen Wu wrote:
> Add reading degamma_lut_size and regamma_lut_size from Linux kernel.
> Test crash when lut_size equals to zero.
> 
> Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
> ---
>   tests/amdgpu/amd_color.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/tests/amdgpu/amd_color.c b/tests/amdgpu/amd_color.c
> index 9eed1da38..97a3c16ec 100644
> --- a/tests/amdgpu/amd_color.c
> +++ b/tests/amdgpu/amd_color.c
> @@ -340,6 +340,14 @@ 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);
> +	igt_assert_lt(0, data->degamma_lut_size);
> +
> +	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_degamma, data->degamma_lut_size);
>   	lut_gen_degamma_srgb(&lut_degamma, 0xffff);
>   

The size check can be placed in "lut_init" so they aren't duplicated at 
various places since both data->degamma_lut_size and 
data->regamma_lut_size are past to lut_init.

Then similar checks in other functions can also be removed as well.

  parent reply	other threads:[~2023-06-20 17:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 13:54 [igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_color: fix test crash within crtc_lut_accuracy Hersen Wu
2023-06-20 14:48 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-20 17:21 ` Alex Hung [this message]
2023-06-20 20:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-26 19:55 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu/amd_color: fix test crash within crtc_lut_accuracy (rev2) Patchwork
2023-06-27 16:05 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu/amd_color: fix test crash within crtc_lut_accuracy (rev3) Patchwork
2023-06-28 14:31 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/amdgpu/amd_color: fix test crash within crtc_lut_accuracy (rev4) 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=aa6f236e-3263-6841-5663-b4363a81270e@amd.com \
    --to=alex.hung@amd.com \
    --cc=aurabindo.pillai@amd.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=hersenxs.wu@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