From: Harry Wentland <harry.wentland@amd.com>
To: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org
Cc: contact@emersion.fr, alex.hung@amd.com, daniels@collabora.com,
mwen@igalia.com, sebastian.wick@redhat.com,
uma.shankar@intel.com, ville.syrjala@linux.intel.com,
maarten.lankhorst@linux.intel.com, jani.nikula@intel.com,
louis.chauvet@bootlin.com, stable@vger.kernel.org
Subject: Re: [PATCH 0/2] drm/colorop: Keep colorop state consistent across atomic commits
Date: Mon, 23 Feb 2026 16:14:06 -0500 [thread overview]
Message-ID: <f670f350-7230-4bbc-9443-a6307429d7b3@amd.com> (raw)
In-Reply-To: <20260218065713.326417-1-chaitanya.kumar.borah@intel.com>
On 2026-02-18 01:57, Chaitanya Kumar Borah wrote:
> This series aims to keep colorop state consistent across atomic
> transactions by ensuring it accurately reflects committed hardware
> state and remains part of the atomic update whenever its associated
> plane is involved.
>
> It contains two changes:
> - Preserves the bypass value in duplicated colorop state.
>
> _drm_atomic_helper_colorop_duplicate_state() unconditionally reset
> bypass to true, which means the duplicated state no longer reflects the
> committed hardware state. Since bypass directly controls whether the
> colorop is active in hardware, this can lead to an unintended disable
> during subsequent commits.
>
> This could potentially be a problem also for colorops where bypass value
> is immutably false.
>
> Conceptually, I consider 'bypass' to behave similar to 'visible' in plane
> state - it represents current HW state and should therefore be preserved
> across duplication.
>
> - Add affected colorops with affected plane
>
> Colorops are unique in the DRM model. While they are DRM objects with their
> own states, they are logically attached to a plane and exposed through
> a plane property. In some sense, they share the same hierarchy as CRTC and
> planes while following a different 'ownership' model.
>
> Given that enabling a CRTC pulls in all its affected planes into the atomic
> state, it follows that when a plane is added, its associated colorops are
> also included. Otherwise, during modesets or internal commits, colorop state
> may be missing from the transaction, resulting in inconsistent or incomplete
> state updates.
>
That tends to reflect my thinking when I wrote the colorop stuff.
> That said, I do have a concern about potentially inflating the atomic
> state by automatically pulling in colorops from the core. It is not
> entirely clear to me whether inclusion of affected colorops should be
> handled in core, or left to individual drivers.
>
Could this lead drivers to reprogram possibly expensive colorops
when they didn't change? It won't be an issue for amdgpu since we
have another level of state tracking, but for drivers that strictly
follow the atomic model it might lead to issues.
On the other hand it makes colorop handling less error-prone in amdgpu,
and possibly fixes a bug I've come across where we get confused if an
active colorop isn't part of the state.
Harry
> My understanding of the atomic framework is still evolving, so
> I would appreciate feedback from those more familiar with the intended
> design direction.
>
> ==
> Chaitanya
>
> P.S/Background/TL;DR:
>
> I discovered inconsistency with the colorop state while analysing CRC mismatches
> in kms_color_pipeline test cases[1]. Visual inspection reveals that while CRC is
> being collected degamma block has been reset. This was traced back to the internal
> commit that the driver does to disable PSR2 and selective fetch for CRC collection.
>
> crtc_crc_open
> -> intel_crtc_set_crc_source
> -> intel_crtc_crc_setup_workarounds
> -> drm_atomic_commit
>
> During this flow colorop states are never added to the atomic state which in turn
> makes intel_plane_color_copy_uapi_to_hw_state() disable the colorops.
>
> If we add the colorops, to the atomic state, the problem still persisted because
> while duplicating the colorop state, 'bypass' was getting reset to true.
>
> The two changes made in this series fixes the issue.
>
> [1] https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18001/shard-mtlp-6/igt@kms_color_pipeline@plane-lut1d.html
>
> Cc: Simon Ser <contact@emersion.fr>
> Cc: Alex Hung <alex.hung@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Daniel Stone <daniels@collabora.com>
> Cc: Melissa Wen <mwen@igalia.com>
> Cc: Sebastian Wick <sebastian.wick@redhat.com>
> Cc: Alex Hung <alex.hung@amd.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Louis Chauvet <louis.chauvet@bootlin.com>
> Cc: <stable@vger.kernel.org> #v6.19+
>
> Chaitanya Kumar Borah (2):
> drm/colorop: Preserve bypass value in duplicate_state()
> drm/atomic: Add affected colorops with affected planes
>
> drivers/gpu/drm/drm_atomic.c | 5 +++++
> drivers/gpu/drm/drm_colorop.c | 2 --
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
next prev parent reply other threads:[~2026-02-23 21:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 6:57 [PATCH 0/2] drm/colorop: Keep colorop state consistent across atomic commits Chaitanya Kumar Borah
2026-02-18 6:57 ` [PATCH 1/2] drm/colorop: Preserve bypass value in duplicate_state() Chaitanya Kumar Borah
2026-02-23 20:33 ` Shankar, Uma
2026-02-18 6:57 ` [PATCH 2/2] drm/atomic: Add affected colorops with affected planes Chaitanya Kumar Borah
2026-02-23 20:37 ` Shankar, Uma
2026-03-10 21:07 ` Borah, Chaitanya Kumar
2026-02-18 7:42 ` ✓ CI.KUnit: success for drm/colorop: Keep colorop state consistent across atomic commits Patchwork
2026-02-18 8:15 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-18 8:32 ` ✓ Xe.CI.FULL: " Patchwork
2026-02-18 10:52 ` ✓ CI.KUnit: success for drm/colorop: Keep colorop state consistent across atomic commits (rev2) Patchwork
2026-02-18 12:23 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-18 13:01 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-23 21:14 ` Harry Wentland [this message]
2026-02-24 8:59 ` [PATCH 0/2] drm/colorop: Keep colorop state consistent across atomic commits Shankar, Uma
2026-02-26 5:59 ` Borah, Chaitanya Kumar
2026-03-10 21:00 ` Borah, Chaitanya Kumar
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=f670f350-7230-4bbc-9443-a6307429d7b3@amd.com \
--to=harry.wentland@amd.com \
--cc=alex.hung@amd.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mwen@igalia.com \
--cc=sebastian.wick@redhat.com \
--cc=stable@vger.kernel.org \
--cc=uma.shankar@intel.com \
--cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox