From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 2/7] drm/atomic: reject colorop update from inactive color pipeline
Date: Tue, 09 Jun 2026 12:37:04 +0000 [thread overview]
Message-ID: <20260609123704.C9FD81F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609121230.1358786-3-mwen@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm_atomic_colorop_check() allows modifying colorops without adding the parent plane to the atomic commit, bypassing hardware updates.
--
commit c38eca82c086d2e818d8283fed72b37dc3abbab9
Author: Melissa Wen <mwen@igalia.com>
drm/atomic: reject colorop update from inactive color pipeline
This commit rejects updates on colorops that are not part of an active
pipeline. It adds drm_atomic_colorop_check() to verify the color pipeline
of a plane in its current, new or old state.
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 0d36a955c4d43..ec3c6e4e5a062 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
[ ... ]
> @@ -863,6 +863,55 @@ drm_atomic_add_pipeline_colorops(struct drm_atomic_commit *state,
> return 0;
> }
>
> +/**
> + * drm_atomic_colorop_check - check new colorop state
> + * @new_colorop_state: new colorop state to check
> + *
> + * Ensure that the colorop in @new_colorop_state belongs to an active color
> + * pipeline, i.e. it's in the chain of colorops set to the color_pipeline
> + * property of current, old or new plane state.
> + *
> + * Returns: 0 on success, -EINVAL otherwise.
> + */
> +static int drm_atomic_colorop_check(const struct drm_colorop_state *new_colorop_state)
> +{
> + struct drm_atomic_commit *state = new_colorop_state->state;
> + struct drm_plane *plane = new_colorop_state->colorop->plane;
> + struct drm_plane_state *new_plane_state, *old_plane_state;
> + struct drm_colorop *colorop;
> +
> + new_plane_state = drm_atomic_get_new_plane_state(state, plane);
> + old_plane_state = drm_atomic_get_old_plane_state(state, plane);
> +
> + /* No changes in the plane state. Check current-committed plane state */
> + if (!new_plane_state) {
> + for (colorop = plane->state->color_pipeline; colorop; colorop = colorop->next)
> + if (colorop == new_colorop_state->colorop)
> + return 0;
[Severity: High]
If a colorop property is updated but the parent plane isn't explicitly
modified, new_plane_state will be NULL and this returns 0.
Since drm_colorop does not have its own atomic_update callback, hardware
programming relies on the plane's commit paths iterating over planes in
the atomic state.
If the plane is missing from the atomic state, will the hardware ever be
reprogrammed with the new colorop parameters, or does this result in a
silent failure where only the software state is updated?
Should the affected plane be actively pulled into the atomic state
(e.g., via drm_atomic_get_plane_state()) whenever a colorop is modified?
> + return -EINVAL;
> + }
> +
> + if (WARN_ON(!old_plane_state))
> + return -EINVAL;
> +
> + /* Check if the colorop is active in the new plane state */
> + for (colorop = new_plane_state->color_pipeline; colorop; colorop = colorop->next)
> + if (colorop == new_colorop_state->colorop)
> + return 0;
> +
> + /* Same color pipeline as new; no point walking old. Colorop isn't active */
> + if (new_plane_state->color_pipeline == old_plane_state->color_pipeline)
> + return -EINVAL;
> +
> + /* Check if the colorop was active in the old plane state */
> + for (colorop = old_plane_state->color_pipeline; colorop; colorop = colorop->next)
> + if (colorop == new_colorop_state->colorop)
> + return 0;
> +
> + /* Colorop is not part of an active color pipeline. */
> + return -EINVAL;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609121230.1358786-1-mwen@igalia.com?part=2
next prev parent reply other threads:[~2026-06-09 12:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 11:51 [PATCH v3 0/7] don't allow changes to inactive colorops Melissa Wen
2026-06-09 11:51 ` [PATCH v3 1/7] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-06-09 12:33 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 2/7] drm/atomic: reject colorop update from inactive color pipeline Melissa Wen
2026-06-09 12:37 ` sashiko-bot [this message]
2026-06-09 11:51 ` [PATCH v3 3/7] drm/amd/display: don't check colorop status if its in an inactive pipeline Melissa Wen
2026-06-09 11:51 ` [PATCH v3 4/7] drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult Melissa Wen
2026-06-09 12:33 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 5/7] drm/amd/display: make shaper bypass mode cleaner Melissa Wen
2026-06-09 12:32 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 6/7] drm/amd/display: fix bnld colorop bypass mode Melissa Wen
2026-06-09 12:51 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 7/7] drm/amd/display: allow individual colorop changes Melissa Wen
2026-06-09 12:50 ` sashiko-bot
2026-06-09 12:50 ` ✗ CI.checkpatch: warning for don't allow changes to inactive colorops (rev3) Patchwork
2026-06-09 12:51 ` ✓ CI.KUnit: success " Patchwork
2026-06-09 13:32 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-09 13:36 ` ✓ i915.CI.BAT: " 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=20260609123704.C9FD81F00893@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 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.