public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: Alex Hung <alex.hung@amd.com>
Cc: igt-dev@lists.freedesktop.org, markyacoub@google.com
Subject: Re: [igt-dev] [PATCH] tests/kms_color: Reduce skips on some ctm-* tests
Date: Tue, 20 Dec 2022 18:06:07 -0100	[thread overview]
Message-ID: <20221220190607.fjrl5dyc4hzcndy3@mail.igalia.com> (raw)
In-Reply-To: <c545097f-5436-d559-f02e-8f051357d943@amd.com>

[-- Attachment #1: Type: text/plain, Size: 5810 bytes --]

On 12/20, Alex Hung wrote:
> 
> 
> On 2022-12-20 04:55, Melissa Wen wrote:
> > On 12/19, Alex Hung wrote:
> > > 64d0ff72 introduced a workaround for ctm-max but the condition caused
> > > other ctm tests to skip unintentionally on some platforms.
> > 
> > Hi Alex,
> > 
> > Can't we just drop this gamma/degamma setup for CTM tests?
> > 
> > I remember thinking about removing this setup before... From DRM docs,
> > "Each of the properties are optional." so I don't see an explicity
> > reason for degamma/gamma dependencies. I think we should only test the
> > CTM property here, or change the name of the subtest to describe a full
> > color mgmt testing.
> > 
> > I took a look at previous discussions on having or not degamma/gamma
> > here and if it's an intel limitation, than I prefer to explicitly
> > restrict it for i915 HW. What do you think?
> 
> Hi Melissa,
> 
> I may not understand you 100%.
> 
> Could you please share what you'd like to change, or create a patch for more
> discussion?

My suggestion is basically disable degamma and gamma and only set them for
i915 + not max ctm case, something like the following diff:

diff --git a/tests/kms_color.c b/tests/kms_color.c
index d016cefb..2be4095d 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -493,12 +493,16 @@ static bool test_pipe_ctm(data_t *data,
        igt_assert(fb_modeset_id);
        igt_plane_set_fb(primary, &fb_modeset);

+       disable_degamma(primary->pipe);
+       disable_gamma(primary->pipe);
+
        /*
-        * Don't program LUT's for max CTM cases, as limitation of
-        * representing intermediate values between 0 and 1.0 causes
-        * rounding issues and inaccuracies leading to crc mismatch.
+        * Program LUT's only for i915, but not in max CTM cases, as limitation
+        * of representing intermediate values between 0 and 1.0 causes
+        * rounding issues and inaccuracies leading to crc mismatch in i915
+        * devices.
         */
-       if (memcmp(before, after, sizeof(color_t))) {
+       if (is_i915_device(data->drm_fd) && 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));

@@ -507,10 +511,6 @@ static bool test_pipe_ctm(data_t *data,

                set_degamma(data, primary->pipe, degamma_linear);
                set_gamma(data, primary->pipe, gamma_linear);
-       } else {
-               /* Disable Degamma and Gamma for ctm max test */
-               disable_degamma(primary->pipe);
-               disable_gamma(primary->pipe);
        }

        disable_ctm(primary->pipe);

> 
> Cheers,
> Alex
> 
> > 
> > Best regards,
> > 
> > Melissa
> > 
> > > 
> > > The patch improves the condition by keeping the original condition
> > > for i915 and checking degamma and gamma props for others. The
> > > following subtests will be executed instead of skipped.
> > > 
> > >    kms_color@ctm-0-25@*
> > >    kms_color@ctm-0-50@*
> > >    kms_color@ctm-0-75@*
> > >    kms_color@ctm-red-to-blue@*
> > >    kms_color@ctm-negative@*
> > > 
> > > Signed-off-by: Alex Hung <alex.hung@amd.com>
> > > ---
> > >   tests/kms_color.c | 30 +++++++++++++++++++++---------
> > >   1 file changed, 21 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/tests/kms_color.c b/tests/kms_color.c
> > > index d016cefb..450bf7ca 100644
> > > --- a/tests/kms_color.c
> > > +++ b/tests/kms_color.c
> > > @@ -446,6 +446,26 @@ end:
> > >   	return ret;
> > >   }
> > > +static bool is_gamma_degamma_supported(data_t *data,
> > > +				       igt_plane_t *primary,
> > > +				       color_t *before,
> > > +				       color_t *after)
> > > +{
> > > +	/*
> > > +	 * Don't program LUT's for max CTM cases, as limitation of
> > > +	 * representing intermediate values between 0 and 1.0 causes
> > > +	 * rounding issues and inaccuracies leading to crc mismatch.
> > > +	 */
> > > +	if (is_i915_device(data->drm_fd) && memcmp(before, after, sizeof(color_t)))
> > > +		return true;
> > > +
> > > +	if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT) &&
> > > +	    igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT))
> > > +		return true;
> > > +
> > > +	return false;
> > > +}
> > > +
> > >   /*
> > >    * Draw 3 rectangles using before colors with the ctm matrix apply and verify
> > >    * the CRC is equal to using after colors with an identify ctm matrix.
> > > @@ -493,14 +513,7 @@ static bool test_pipe_ctm(data_t *data,
> > >   	igt_assert(fb_modeset_id);
> > >   	igt_plane_set_fb(primary, &fb_modeset);
> > > -	/*
> > > -	 * Don't program LUT's for max CTM cases, as limitation of
> > > -	 * representing intermediate values between 0 and 1.0 causes
> > > -	 * 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));
> > > +	if (is_gamma_degamma_supported(data, primary, before, after)) {
> > >   		degamma_linear = generate_table(data->degamma_lut_size, 1.0);
> > >   		gamma_linear = generate_table(data->gamma_lut_size, 1.0);
> > > @@ -508,7 +521,6 @@ static bool test_pipe_ctm(data_t *data,
> > >   		set_degamma(data, primary->pipe, degamma_linear);
> > >   		set_gamma(data, primary->pipe, gamma_linear);
> > >   	} else {
> > > -		/* Disable Degamma and Gamma for ctm max test */
> > >   		disable_degamma(primary->pipe);
> > >   		disable_gamma(primary->pipe);
> > >   	}
> > > -- 
> > > 2.25.1
> > > 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-12-20 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 19:21 [igt-dev] [PATCH] tests/kms_color: Reduce skips on some ctm-* tests Alex Hung
2022-12-20 11:55 ` Melissa Wen
2022-12-20 18:20   ` Alex Hung
2022-12-20 19:06     ` Melissa Wen [this message]
2022-12-20 23:49       ` Alex Hung
2022-12-20 15:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-12-20 18:14 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-21 11:08 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_color: Reduce skips on some ctm-* tests (rev2) 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=20221220190607.fjrl5dyc4hzcndy3@mail.igalia.com \
    --to=mwen@igalia.com \
    --cc=alex.hung@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=markyacoub@google.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