All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 14/19] drm/atomic: set hidden CRTC color mgmt model to default values
Date: Tue, 24 Nov 2026 18:42:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-231844@kernel.org> (raw)
In-Reply-To: <20261124181652.1333986-15-mwen@igalia.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/atomic: hidden CRTC color model not reset outside
  drm_mode_atomic_ioctl()
--

commit 988786e967d206ee7e346b8385770656e4c8ad9e
Author: Melissa Wen <mwen@igalia.com>

drm/atomic: set hidden CRTC color mgmt model to default values

This commit resets the hidden CRTC color management properties (either the
legacy LUT/CTM blobs or the colorop pipeline) to default values on each
CRTC included in an atomic ioctl commit.

> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index afac90d5d7e0a..fe676e612d414 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1687,6 +1687,32 @@ static void complete_signaling(struct drm_device *dev,
>  	kfree(fence_state);
>  }
>  
> +static void
> +reset_crtc_color_mgmt_props(struct drm_atomic_commit *state,
> +			    struct drm_file *file_priv,
> +			    bool async_flip)
> +{
> +	struct drm_crtc_state *crtc_state;
> +	struct drm_crtc *crtc;
> +	bool changed;
> +	int i;
> +
> +	/* Async page flip doesn't change properties */
> +	if (async_flip)
> +		return;
> +
> +	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
> +		if (file_priv->crtc_color_pipeline) {
> +			changed = drm_property_replace_blob(&crtc_state->degamma_lut, NULL);
> +			changed |= drm_property_replace_blob(&crtc_state->ctm, NULL);
> +			changed |= drm_property_replace_blob(&crtc_state->gamma_lut, NULL);
> +		} else {
> +			changed = drm_atomic_set_colorop_for_crtc(crtc_state, NULL);
> +		}
> +		crtc_state->color_mgmt_changed |= changed;
> +	}
> +}
> +
>  static void
>  set_async_flip(struct drm_atomic_commit *state)
>  {
> @@ -1845,6 +1871,8 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
>  		drm_mode_object_put(obj);
>  	}
>  
> +	reset_crtc_color_mgmt_props(state, file_priv, async_flip);

[Severity: Medium]
Does calling reset_crtc_color_mgmt_props() only in drm_mode_atomic_ioctl()
leave crtc_state->color_pipeline active when a later client updates CRTC
color properties through other atomic commit paths?

For example, after a client with DRM_CLIENT_CAP_CRTC_COLOR_PIPELINE sets a
CRTC color pipeline, switching to a client or helper that updates gamma or
CTM via drm_crtc_legacy_gamma_set() (DRM_IOCTL_MODE_SETGAMMA),
set_property_atomic() (DRM_IOCTL_MODE_OBJ_SETPROPERTY), or fbdev's
setcmap_atomic() commits the new LUT/CTM blobs without clearing
crtc_state->color_pipeline.  Because drivers program CRTC color management
from color_pipeline whenever it is non-NULL and only fall back to
degamma_lut, ctm, and gamma_lut otherwise, those updates are silently
ignored while the previous client's color pipeline remains active.

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

  reply	other threads:[~2026-11-24 18:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 18:03 [PATCH v3 00/19] drm/drm_colorop: add post-blend colorop support to AMD display driver Melissa Wen
2026-11-24 18:03 ` [PATCH v3 01/19] drm/crtc: Add color pipeline to CRTC state Melissa Wen
2026-11-24 18:03 ` [PATCH v3 02/19] drm/colorop: Allow parenting colorop to CRTC Melissa Wen
2026-11-24 18:03 ` [PATCH v3 03/19] drm/atomic: handle CRTC colorops in drm_atomic_commit_set_colorop_state() Melissa Wen
2026-11-24 18:03 ` [PATCH v3 04/19] drm/atomic: duplicate CRTC colorop states Melissa Wen
2026-11-24 18:03 ` [PATCH v3 05/19] drm: Factor out common color_pipeline property initialization code Melissa Wen
2026-11-24 18:03 ` [PATCH v3 06/19] drm/crtc: Add COLOR_PIPELINE property Melissa Wen
2026-11-24 18:03 ` [PATCH v3 07/19] drm/atomic: track individual CRTC colorop updates Melissa Wen
2026-11-24 18:03 ` [PATCH v3 08/19] drm: Introduce DRM_CLIENT_CAP_CRTC_COLOR_PIPELINE Melissa Wen
2026-11-24 18:03 ` [PATCH v3 09/19] drm/atomic: Print the color pipeline as part of the CRTC state print Melissa Wen
2026-11-24 18:03 ` [PATCH v3 10/19] drm/colorop: Factor out common paths from colorops helpers Melissa Wen
2026-11-24 18:36   ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 11/19] drm/colorop: Introduce colorop helpers for crtc Melissa Wen
2026-11-24 18:36   ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 12/19] drm/colorop: distinguish whether a colorop belongs to a plane or a CRTC Melissa Wen
2026-11-24 18:03 ` [PATCH v3 13/19] drm/drm_mode_object: hide deprecated CRTC color mgmt props if colorop is set Melissa Wen
2026-11-24 18:03 ` [PATCH v3 14/19] drm/atomic: set hidden CRTC color mgmt model to default values Melissa Wen
2026-11-24 18:42   ` sashiko-bot [this message]
2026-11-24 18:03 ` [PATCH v3 15/19] drm/drm_ioctl: guard DRM_CLIENT_CAP_CRTC_COLOR_PIPELINE Melissa Wen
2026-11-24 18:03 ` [PATCH v3 16/19] drm/amd/display: move CRTC CTM color mgmt prop to check helper Melissa Wen
2026-11-24 18:03 ` [PATCH v3 17/19] drm/amd/display: enable post-blend CTM colorop Melissa Wen
2026-11-24 18:46   ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 18/19] drm/amd/display: add support to post-blend 1D-Curve colorop Melissa Wen
2026-11-24 18:42   ` sashiko-bot
2026-11-24 18:03 ` [PATCH v3 19/19] drm/amd/display: add support to post-blend 1D-LUT colorop Melissa Wen
2026-11-24 18:38   ` sashiko-bot

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=sashiko-outbox-231844@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.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 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.