[igt-dev] [PATCH i-g-t 4/4] tests/kms_color: Add GAMMA_LUT_3D tests
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Sep 3 15:18:47 UTC 2021
On Fri, Sep 03, 2021 at 05:05:03AM +0000, Modem, Bhanuprakash wrote:
> > From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Ville
> > Syrjala
> > Sent: Friday, May 14, 2021 6:57 PM
> > To: igt-dev at lists.freedesktop.org
> > Subject: [igt-dev] [PATCH i-g-t 4/4] tests/kms_color: Add GAMMA_LUT_3D tests
> >
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Add some basic tests for 3D LUTs.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > tests/kms_color.c | 95 ++++++++++++++++++++++++++++++++++++++++
> > tests/kms_color_helper.c | 58 +++++++++++++++++++++++-
> > tests/kms_color_helper.h | 18 ++++++++
> > 3 files changed, 170 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_color.c b/tests/kms_color.c
> > index 3a42532a5c27..e23e5f5fcc26 100644
> > --- a/tests/kms_color.c
> > +++ b/tests/kms_color.c
> > @@ -198,6 +198,88 @@ static void test_pipe_gamma(data_t *data,
> > free_lut(gamma_full);
> > }
> >
> > +static void test_pipe_gamma_lut_3d(data_t *data,
> > + igt_plane_t *primary)
> > +{
> > + igt_output_t *output;
> > + igt_display_t *display = &data->display;
> > + gamma_lut_t *gamma_lut_3d_linear, *gamma_lut_3d_full;
> > + color_t red_green_blue[] = {
> > + { 1.0, 0.0, 0.0 },
> > + { 0.0, 1.0, 0.0 },
> > + { 0.0, 0.0, 1.0 }
> > + };
> > +
> > + igt_require(igt_pipe_obj_has_prop(primary->pipe,
> > IGT_CRTC_GAMMA_LUT_3D));
> > +
> > + gamma_lut_3d_linear = generate_lut_3d(data->gamma_lut_3d_size, 1.0);
> > + gamma_lut_3d_full = generate_lut_3d_max(data->gamma_lut_3d_size);
> > +
> > + for_each_valid_output_on_pipe(&data->display, primary->pipe->pipe,
> > output) {
>
> Instead of running the test on all possible "pipe-connector" combinations,
> I think it is sufficient to run on single connector, since we are trying to
> validate PIPE properties. Also we can save some CI time.
>
> I am also thinking to revamp all color tests to run on single connector.
Yeah, the connector shouldn't matter here. Any single one will do.
<snip>
> > + igt_plane_set_fb(primary, &fb);
> > + igt_display_commit(&data->display);
> > + igt_wait_for_vblank(data->drm_fd,
> > + display->pipes[primary->pipe->pipe].crtc_offset);
> > + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fullcolors);
> > +
> > + /* Draw a gradient with 3D LUT to remap all
> > + * values to max red/green/blue.
> > + */
> > + paint_gradient_rectangles(data, mode, red_green_blue, &fb);
> > + igt_plane_set_fb(primary, &fb);
> > + set_gamma_lut_3d(data, primary->pipe, gamma_lut_3d_full);
> > + igt_display_commit(&data->display);
> > + igt_wait_for_vblank(data->drm_fd,
> > + display->pipes[primary->pipe->pipe].crtc_offset);
> > + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_fulllut3d);
> > +
> > + /* Verify that the CRC of the software computed output is
> > + * equal to the CRC of the degamma LUT transformation output.
>
> Typo: s/degamma/3dlut/
>
> So, is this the expectation?
> ((Solid colors + no 3dlut) == (gradient colors + 3dlut)) ? PASS : FAIL;
IIRC yes.
<snip>
> > diff --git a/tests/kms_color_helper.h b/tests/kms_color_helper.h
> > index 3f49e7cae4c0..e21adaa228ff 100644
> > --- a/tests/kms_color_helper.h
> > +++ b/tests/kms_color_helper.h
> > @@ -52,6 +52,7 @@ typedef struct {
> > uint32_t color_depth;
> > uint64_t degamma_lut_size;
> > uint64_t gamma_lut_size;
> > + uint64_t gamma_lut_3d_size;
>
> Maybe rename to gamma_3d_lut_size?
I wanted to be consistent with the naming everywhere, and because you
can't have things named "3d_lut" in C I went with the "lut_3d" order
for everything.
--
Ville Syrjälä
Intel
More information about the igt-dev
mailing list