From: Gil Dekel <gildekel@google.com>
To: Melissa Wen <mwen@igalia.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
Uma Shankar <uma.shankar@intel.com>,
Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
Sean Paul <sean@poorly.run>,
airlied@gmail.com, simona@ffwll.ch, mripard@kernel.org,
tzimmermann@suse.de, maarten.lankhorst@linux.intel.com,
alexander.deucher@amd.com, alex.hung@amd.com,
aurabindo.pillai@amd.com, christian.koenig@amd.com,
harry.wentland@amd.com, sunpeng.li@amd.com, contact@emersion.fr,
daniels@collabora.com, sebastian.wick@redhat.com,
siqueira@igalia.com, Xaver Hugl <xaver.hugl@gmail.com>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
Matthew Schwartz <matthew.schwartz@linux.dev>,
kernel-dev@igalia.com, Rob Clark <robin.clark@oss.qualcomm.com>,
Dmitry Baryshkov <lumag@kernel.org>,
Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
louis.chauvet@bootlin.com,
John Harrison <John.Harrison@igalia.com>
Subject: Re: [PATCH v5 06/15] drm/atomic: reject colorop update from inactive color pipeline
Date: Fri, 4 Dec 2026 18:42:32 -0500 [thread overview]
Message-ID: <20261204234232.2131698-1-gildekel@google.com> (raw)
In-Reply-To: <20261111160814.21326-7-mwen@igalia.com>
Hi Melissa,
Checked this against i915/xe and userspace behavior. Main question
inline is whether rejecting idempotent no-op writes on inactive colorops
is actually intended by the uAPI contract, plus a couple of smaller
items.
> A colorop can only be changed while it is part of an active color
> pipeline, or in the same commit that activates or deactivates that
> pipeline. Enforce this contract by checking that the colorop belongs to
> the color pipeline of a plane in its current, new or old state, and
> rejecting the state change otherwise.
Unlike patch 08/15, this patch does not update DOC: overview in
drm_colorop.c. Documenting the active/transitioning-only update rule,
the -EINVAL behavior, and inactive-state persistence there would make
the uAPI contract clear to userspace.
> + /* No changes in the plane state. Check current-committed plane state */
> + if (!new_plane_state) {
> + drm_for_each_colorop_in_pipeline(colorop, plane->state->color_pipeline)
> + if (colorop == new_colorop_state->colorop)
> + return 0;
> + return -EINVAL;
> + }
drm_atomic_get_colorop_state() already holds plane->mutex, so reading
plane->state here is safe; adding
drm_modeset_lock_assert_held(&plane->mutex) would make that invariant
explicit.
> + /* 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;
Because drm_atomic_set_property() calls drm_atomic_get_colorop_state()
before checking whether the property value changed, even an idempotent
no-op write (e.g. BYPASS=1 when already 1, DATA=0 when already 0) adds
the colorop to state->colorops[] and fails the entire commit here (and
in the !new_plane_state branch above) with -EINVAL.
The commit message and contract forbid changing properties of an
inactive colorop, and drm_atomic_uapi.c already treats unchanged writes
as no-ops (!replaced). Unless the uAPI contract explicitly forbids even
mentioning an inactive colorop in a commit, shouldn't unchanged/no-op
writes keep succeeding rather than failing the commit?
> + for_each_new_colorop_in_state(state, colorop, new_colorop_state, i) {
> + ret = drm_atomic_colorop_check(new_colorop_state);
> + if (ret) {
> + drm_dbg_atomic(dev, "[COLOROP:%d:%d] isn't in an active color pipeline.\n",
> + colorop->base.id, colorop->type);
> + return ret;
> + }
> + }
Once patch 08/15 adds the missing-DATA check inside
drm_atomic_colorop_check(), failing that check prints both "enabled
without a DATA blob" and the false "isn't in an active color pipeline."
message here. Moving the inactive-pipeline log into
drm_atomic_colorop_check() and logging "[COLOROP:%d:%d] atomic core
check failed" here would match the plane/crtc/connector checks below.
(Side note on IGT: tests/kms_colorop_helper.c:279 still calls mutative
igt_colorop_try_prop_enum() for KMS_COLOROP_FIXED_MATRIX instead of
igt_colorop_has_prop_enum_value(), which looks like it will hit -EINVAL
here during YUV subtest probing. Happy to send a 1-line fix on igt-dev.)
Assisted-by: Gemini
Assisted-by: Claude:claude-fable-5.2
Thanks,
Gil
next prev parent reply other threads:[~2026-12-04 23:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 16:05 [PATCH v5 00/15] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-11-11 16:05 ` [PATCH v5 01/15] drm/amd/display: Update colorop pipeline tests for new fixed matrix op Melissa Wen
2026-11-11 16:05 ` [PATCH v5 02/15] drm/amd/display: add missing FIXED_MATRIX colorop to AMD KUnit tests Melissa Wen
2026-11-11 16:05 ` [PATCH v5 03/15] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-11-11 17:12 ` sashiko-bot
2026-12-04 23:42 ` Gil Dekel
2026-11-11 16:05 ` [PATCH v5 04/15] drm/amd/display: add plane to commit on KUnit cursor mode tests Melissa Wen
2026-11-11 16:05 ` [PATCH v5 05/15] drm/amd/display: only check colorops of an active color pipeline Melissa Wen
2026-11-11 16:05 ` [PATCH v5 06/15] drm/atomic: reject colorop update from inactive " Melissa Wen
2026-12-04 23:42 ` Gil Dekel [this message]
2026-11-11 16:05 ` [PATCH v5 07/15] drm/atomic: duplicate state of all colorops Melissa Wen
2026-11-11 17:38 ` sashiko-bot
2026-12-04 23:42 ` Gil Dekel
2026-11-11 16:05 ` [PATCH v5 08/15] drm/atomic: check if an active colorop has a blob if its type requires one Melissa Wen
2026-12-04 23:42 ` Gil Dekel
2026-11-11 16:05 ` [PATCH v5 09/15] drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult Melissa Wen
2026-11-11 16:05 ` [PATCH v5 10/15] drm/amd/display: make shaper bypass mode cleaner Melissa Wen
2026-11-11 16:05 ` [PATCH v5 11/15] drm/amd/display: make blnd bypass mode clearer Melissa Wen
2026-11-11 16:05 ` [PATCH v5 12/15] drm/amd/display: don't ignore failure on blend colorop setup Melissa Wen
2026-11-11 16:05 ` [PATCH v5 13/15] drm/amd/display: allow individual colorop changes Melissa Wen
2026-12-04 23:42 ` Gil Dekel
2026-11-11 16:05 ` [PATCH v5 14/15] drm/atomic: make drm_atomic_add_affected_colorops() static Melissa Wen
2026-12-04 23:42 ` Gil Dekel
2026-11-11 16:05 ` [PATCH v5 15/15] drm/amd/display: distinguish colorop setup error from no colorop support Melissa Wen
2026-11-11 16:18 ` ✗ CI.checkpatch: warning for drm/atomic: only add states of active or transient active colorops Patchwork
2026-11-11 16:20 ` ✓ CI.KUnit: success " Patchwork
2026-11-11 16:54 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-11 17:57 ` ✓ i915.CI.BAT: " Patchwork
2026-11-12 1:57 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-12 11:52 ` ✓ i915.CI.Full: " Patchwork
2026-12-04 10:36 ` [PATCH v5 00/15] " Melissa Wen
2026-12-05 2:59 ` Gil Dekel
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=20261204234232.2131698-1-gildekel@google.com \
--to=gildekel@google.com \
--cc=John.Harrison@igalia.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=christian.koenig@amd.com \
--cc=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=matthew.schwartz@linux.dev \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=pekka.paalanen@collabora.com \
--cc=robin.clark@oss.qualcomm.com \
--cc=sean@poorly.run \
--cc=sebastian.wick@redhat.com \
--cc=simona@ffwll.ch \
--cc=siqueira@igalia.com \
--cc=sunpeng.li@amd.com \
--cc=tzimmermann@suse.de \
--cc=uma.shankar@intel.com \
--cc=xaver.hugl@gmail.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.