From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
Cc: "swati2.sharma@intel.com" <swati2.sharma@intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
"karthik.b.s@intel.com" <karthik.b.s@intel.com>,
"jani.nikula@intel.com" <jani.nikula@intel.com>,
"chaitanya.kumar.borah@intel.com"
<chaitanya.kumar.borah@intel.com>,
"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
"Paul-pl Chen (陳柏霖)" <Paul-pl.Chen@mediatek.com>,
"bhanuprakash.modem@gmail.com" <bhanuprakash.modem@gmail.com>,
"gildekel@google.com" <gildekel@google.com>,
"fshao@chromium.org" <fshao@chromium.org>,
"juhapekka.heikkila@gmail.com" <juhapekka.heikkila@gmail.com>,
"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
"uma.shankar@intel.com" <uma.shankar@intel.com>,
"markyacoub@chromium.org" <markyacoub@chromium.org>,
"kamil.konieczny@linux.intel.com"
<kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH i-g-t v2] tests/kms_color: Always use atomic_commit for setting color properties
Date: Fri, 21 Nov 2025 12:38:19 +0200 [thread overview]
Message-ID: <aSBBG2n64m65CWLR@intel.com> (raw)
In-Reply-To: <0a2d25af2c0ba3c5bc26e445a46413c90a77a19e.camel@mediatek.com>
On Fri, Nov 21, 2025 at 09:47:52AM +0000, Jason-JH Lin (林睿祥) wrote:
> Hi Ville,
>
> Thanks for your rapid reply.
>
> On Fri, 2025-11-21 at 10:56 +0200, Ville Syrjälä wrote:
> >
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> >
> >
> > On Fri, Nov 21, 2025 at 03:53:54PM +0800, Jason-JH Lin wrote:
> > > When a driver makes use of gamma_lut, degamma_lut, or ctm
> > > properties
> > > from crtc state, these properties are applied only via atomic
> > > commit.
> > > This change ensures all relevant properties are properly
> > > synchronized
> > > to crtc state during testing.
> > >
> > > All upstream drivers that support color management properties also
> > > support atomic commits, so legacy commit handling in kms_color is
> > > no
> > > longer needed.
> >
> > Incorrect.
>
> The conclusion is refer from:
> https://patchwork.freedesktop.org/patch/254752/?series=50539&rev=1
>
> I'll remove it because I'm not sure for this.
>
> >
> > But rather than spreading the current mess even further, I think
> > what we want is a igt_display_commit() variant that takes care of
> > the is_atomic check. So add that, blast it over all the existing
> > places that do the check by hand (with cocci/sed/etc), and
> > and then look at using it for new stuff like this where it
> > probably makes sense to use atomic when available.
> >
>
> Sorry for missing you in the cc loop.
> Does my previous version of this patch satisfy this?
> https://patchwork.freedesktop.org/patch/687863/
I meant that you should add some kind of
igt_display_commit_something()
{
igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
}
wrapper thingy, and deploy it everwhere that currently
has that is_atomic check open coded. I guess the real problem
is coming up with a name... igt_display_commit_auto() maybe?
>
> > >
> > > Update the test logic to always use igt_display_commit_atomic with
> > > DRM_MODE_ATOMIC_ALLOW_MODESET for all color management operations.
> > > This simplifies code and guarantees correct validation of gamma,
> > > degamma, and ctm properties.
> >
> > What do you mean with "guarantees correct validation"? The current
> > code works just fine AFAIK.
>
> I have encountered that GAMM_LUT drm property is not updated into the
> gamma_lut struct in drm_crtc_state via igt_disaply_commit().
>
> I found igt_disaply_commit() will finally call
> drmModeObjectSetProperty() and igt_plane_commit() in igt_pipe_commit().
> These functions will set GAMM_LUT property to drm driver but they won't
> update the gamma_lut struct in crtc state. So our GAMMA driver won't do
> anything when running these IGT KmsColorTest.
Whether the commit comes via that atomic ioctl or the setproperty ioctl
the same exact code gets used to update the blobs in the crtc state,
and then the driver's atomic hooks get called in exactly the same way.
But with the non-atomic igt commit you obviously will see multiple
commits coming into the kernel, and you won't see the full state in
the kernel until all the commits are done.
So if you're saying that the crtc state gamma blob didn't have the
expected new stuff in it, then I think you were either looking at
the state before all the commits had arrived, or you have some kind
of driver bug where the state gets corrupted.
>
> Then I found igt_atomic_commit() will sync these properties to drm_crtc
> _state and make our HW driver work successfully. So I send the patch to
> ask for review and guidance.
>
> Or do you know what I may miss in the original igt_disaply_commit()?
IIRC the one thing that is busted in the legacy commit path is
plane properties for primary/cursor planes. Pretty sure I sent
a patch to fix that long ago, but it might have had some kind of
performance problem due to some unintended property value
ping-pong. I suppose I should take another look at it again...
Anyways, that's only about plane properties so should have nothing
to do with the crtc gamma stuff.
>
> >
> > >
> > > Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> > > ---
> > > tests/kms_color.c | 47 ++++++++++++++++++++++++-------------------
> > > ----
> > > 1 file changed, 24 insertions(+), 23 deletions(-)
> > >
> > > diff --git a/tests/kms_color.c b/tests/kms_color.c
> > > index c424083b7fd4..0d2baf8f8aad 100644
> > > --- a/tests/kms_color.c
> > > +++ b/tests/kms_color.c
> > > @@ -125,12 +125,12 @@ static bool test_pipe_degamma(data_t *data,
> > > disable_ctm(primary->pipe);
> > > disable_gamma(primary->pipe);
> > > set_degamma(data, primary->pipe, degamma_linear);
> > > - igt_display_commit(&data->display);
> > > + igt_display_commit_atomic(display,
> > > DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> > >
> > > /* Draw solid colors with linear degamma transformation. */
> > > paint_rectangles(data, mode, red_green_blue, &fb);
> > > igt_plane_set_fb(primary, &fb);
> > > - igt_display_commit(&data->display);
> > > + igt_display_commit_atomic(display,
> > > DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
> > > igt_wait_for_vblank(data->drm_fd,
> >
>
> [snip]
>
> > --
> > Ville Syrjälä
> > Intel
>
> Regards,
> Jason-JH Lin
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-11-21 10:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 7:53 [PATCH i-g-t v2] tests/kms_color: Always use atomic_commit for setting color properties Jason-JH Lin
2025-11-21 8:56 ` Ville Syrjälä
2025-11-21 9:47 ` Jason-JH Lin (林睿祥)
2025-11-21 10:38 ` Ville Syrjälä [this message]
2025-11-24 6:47 ` Jason-JH Lin (林睿祥)
2025-11-24 21:00 ` Ville Syrjälä
2025-11-25 2:19 ` Jason-JH Lin (林睿祥)
2025-11-25 17:06 ` Ville Syrjälä
2025-11-26 14:40 ` Jason-JH Lin (林睿祥)
2026-02-11 11:24 ` Jason-JH Lin (林睿祥)
2026-02-11 13:31 ` Ville Syrjälä
2026-02-12 10:15 ` Jason-JH Lin (林睿祥)
2026-02-12 11:57 ` Ville Syrjälä
2026-02-12 15:02 ` Jason-JH Lin (林睿祥)
2025-11-25 2:50 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-11-25 3:03 ` ✓ i915.CI.BAT: " Patchwork
2025-11-25 4:43 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-25 8:52 ` ✗ i915.CI.Full: " 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=aSBBG2n64m65CWLR@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=Jason-JH.Lin@mediatek.com \
--cc=Nancy.Lin@mediatek.com \
--cc=Paul-pl.Chen@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Singo.Chang@mediatek.com \
--cc=bhanuprakash.modem@gmail.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=fshao@chromium.org \
--cc=gildekel@google.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=juhapekka.heikkila@gmail.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=karthik.b.s@intel.com \
--cc=markyacoub@chromium.org \
--cc=swati2.sharma@intel.com \
--cc=uma.shankar@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.