dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v9 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes
Date: Tue, 09 Jun 2026 11:17:34 +0000	[thread overview]
Message-ID: <20260609111734.B52791F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609110420.1298352-5-mwen@igalia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The logic in `should_reset_plane` fails to trigger a reset for all planes on a CRTC when another plane's color management changes via the new DRM Color Pipeline API, leading to plane z-order corruption.
--

commit 52aefc9e9f5291e7e9724eb87eff29b790339396
Author: Melissa Wen <mwen@igalia.com>

drm/amd/display: use plane color_mgmt_changed to track colorop changes

Ensure the driver tracks changes in any colorop property of a plane
color pipeline by using the same mechanism of CRTC color management and
update plane color blocks when any colorop property changes.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 8f80420e9f0b8..56ba9bf40ed9f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
[ ... ]
> @@ -12208,6 +12208,10 @@ static bool should_reset_plane(struct drm_atomic_state *state,
>  	if (new_crtc_state->color_mgmt_changed)
>  		return true;
>  
> +	/* Plane color pipeline or its colorop changes. */
> +	if (new_plane_state->color_mgmt_changed)
> +		return true;
> +
>  	/*
>  	 * On zpos change, planes need to be reordered by removing and re-adding

[Severity: High]
Does this code need to check color_mgmt_changed for other planes on the
CRTC as well?

Looking further down in should_reset_plane(), there is a loop over
other planes that checks legacy AMD color properties, but it misses checking
new_other_state->color_mgmt_changed:

	for_each_oldnew_plane_in_state(state, other, old_other_state, new_other_state, i) {
		...
		/* HDR/Transfer Function changes. */
		if (dm_old_other_state->degamma_tf != dm_new_other_state->degamma_tf ||
		...

If Plane A has color_mgmt_changed == true, should_reset_plane() correctly
returns true and Plane A gets reset.

However, when should_reset_plane() is evaluated for Plane B on the same CRTC,
it iterates over the other planes (including Plane A). Since the loop does
not check Plane A's color_mgmt_changed state, it could return false for Plane B.

Could this cause only some planes on the CRTC to be removed and re-added,
resulting in a scrambled hardware z-order or pipeline acquisition errors?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609110420.1298352-1-mwen@igalia.com?part=4

      reply	other threads:[~2026-06-09 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 10:20 [PATCH v9 0/4] drm/atomic: track individual colorop updates Melissa Wen
2026-06-09 10:20 ` [PATCH v9 1/4] drm/colorop: Remove read-only comments from interpolation fields Melissa Wen
2026-06-09 10:20 ` [PATCH v9 2/4] drm/colorop: make lut(1/3)d_interpolation props correctly behave as mutable Melissa Wen
2026-06-09 11:17   ` sashiko-bot
2026-06-09 10:20 ` [PATCH v9 3/4] drm/atomic: track individual colorop updates Melissa Wen
2026-06-09 11:21   ` sashiko-bot
2026-06-09 10:20 ` [PATCH v9 4/4] drm/amd/display: use plane color_mgmt_changed to track colorop changes Melissa Wen
2026-06-09 11:17   ` sashiko-bot [this message]

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=20260609111734.B52791F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mwen@igalia.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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