[igt-dev] [PATCH i-g-t v2] tests/kms_color: check degamma and gamma props in CTM subtests

Melissa Wen mwen at igalia.com
Tue Nov 8 19:52:28 UTC 2022


On 11/07, Alex Hung wrote:
> 
> 
> On 2022-11-07 12:52, Melissa Wen wrote:
> > Some CTM subtests generate and set degamma/gamma LUTs without checking
> > if these properties are supported by the driver. Therefore, if degamma
> > and gamma are used in the subtest, check the color properties before
> > generate and set LUTs. If these properties are not supported, these
> > subtests will skip instead of failing.
> > 
> > v2:
> > - remove unnecessary set_luts check (Alex Hung)
> > 
> > Signed-off-by: Melissa Wen <mwen at igalia.com>
> > ---
> >   tests/kms_color.c | 9 ++++++---
> >   1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/kms_color.c b/tests/kms_color.c
> > index e4dc2465..1902cd0c 100644
> > --- a/tests/kms_color.c
> > +++ b/tests/kms_color.c
> > @@ -472,9 +472,6 @@ static bool test_pipe_ctm(data_t *data,
> >   	igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_CTM));
> > -	degamma_linear = generate_table(data->degamma_lut_size, 1.0);
> > -	gamma_linear = generate_table(data->gamma_lut_size, 1.0);
> > -
> >   	igt_output_set_pipe(output, primary->pipe->pipe);
> >   	igt_output_override_mode(output, mode);
> > @@ -502,6 +499,12 @@ static bool test_pipe_ctm(data_t *data,
> >   	 * rounding issues and inaccuracies leading to crc mismatch.
> >   	 */
> >   	if (memcmp(before, after, sizeof(color_t))) {
> > +		igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT));
> > +		igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
> > +
> > +		degamma_linear = generate_table(data->degamma_lut_size, 1.0);
> > +		gamma_linear = generate_table(data->gamma_lut_size, 1.0);
> > +
> >   		set_degamma(data, primary->pipe, degamma_linear);
> >   		set_gamma(data, primary->pipe, gamma_linear);
> >   	} else {
> 
> Reviewed-by: Alex Hung <alex.hung at amd.com>
Hi Alex,

Thanks for review.

I just sent a v3 to address the crashes detected by intel CI.
https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8062/index.html

Degamma and gamma LUT should be initialized as NULL to free_lut works
correctly.

I added your r-b in v3.
https://patchwork.freedesktop.org/patch/510802/?series=110500&rev=3

Let me know if it's still okay for you.

Melissa


More information about the igt-dev mailing list