From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RFC v2 8/9] drm/atomic: Allow filling a commit with pristine object states
Date: Wed, 12 Aug 2026 13:18:27 +0000 [thread overview]
Message-ID: <20260812131828.098131F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-drm-reset-state-flag-v2-8-e96ce13317dd@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Missing lock acquisition for `colorop->plane->mutex` before accessing and modifying colorop state.
- [Low] Grammar error in code comment ('there' instead of 'their').
--
--- Patch [8]: [PATCH RFC v2 8/9] drm/atomic: Allow filling a commit with pristine object states ---
commit be70167a2a5eebe655b84ef35f7fed5d15989a8f
Author: Maxime Ripard <mripard@kernel.org>
drm/atomic: Allow filling a commit with pristine object states
This commit introduces drm_atomic_commit_fill_with_defaults() to populate
an atomic commit with pristine initial states for all display objects. It
uses atomic_create_state() hooks to provide a fresh default state for
reset operations.
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index d8251447e44a5..d5ac10dd3148e 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
[ ... ]
> +int drm_atomic_commit_fill_with_defaults(struct drm_atomic_commit *commit)
> +{
[ ... ]
> + /*
> + * Private objects are ignored because none have userspace
> + * properties we might want to reset. atomic_check
> + * implementations will derive or infer there private obj state
^^^^^
[Severity: Low]
This isn't a bug, but there's a grammatical error here. Should "there" be
"their"?
> + * from the state that will end up being committed anyway.
> + */
> + drm_for_each_colorop(colorop, dev) {
> + struct drm_colorop_state *colorop_state;
> +
> + colorop_state = drm_atomic_helper_colorop_create_state(colorop);
> + if (IS_ERR(colorop_state))
> + return PTR_ERR(colorop_state);
> +
> + drm_modeset_lock_assert_held(&colorop->plane->mutex);
> +
> + ret = drm_atomic_commit_set_colorop_state(commit, colorop, colorop_state);
[Severity: High]
Does this loop need to acquire the lock before asserting it is held?
Unlike the loops for planes, CRTCs, and connectors below which explicitly
call drm_modeset_lock(), this colorop loop calls
drm_modeset_lock_assert_held() on colorop->plane->mutex without acquiring
it first.
Will this cause a lockdep assertion failure and leave colorop->state
unprotected against concurrent modifications?
> + if (ret) {
> + drm_colorop_atomic_destroy_state(colorop, colorop_state);
> + return ret;
> + }
> + }
> +
> + drm_for_each_plane(plane, dev) {
> + struct drm_plane_state *plane_state;
> +
> + ret = drm_modeset_lock(&plane->mutex, commit->acquire_ctx);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-drm-reset-state-flag-v2-0-e96ce13317dd@kernel.org?part=8
next prev parent reply other threads:[~2026-08-12 13:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 12:56 [PATCH RFC v2 0/9] drm: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-08-12 12:56 ` [PATCH RFC v2 1/9] drm/atomic: colorop: Rename state to state_to_destroy Maxime Ripard
2026-08-12 12:56 ` [PATCH RFC v2 2/9] drm/atomic: Create function to insert CRTC state into a commit Maxime Ripard
2026-08-12 12:56 ` [PATCH RFC v2 3/9] drm/atomic: Create function to insert plane " Maxime Ripard
2026-08-12 12:56 ` [PATCH RFC v2 4/9] drm/atomic: Create function to insert colorop " Maxime Ripard
2026-08-12 12:57 ` [PATCH RFC v2 5/9] drm/atomic: Create function to insert private obj " Maxime Ripard
2026-08-12 12:57 ` [PATCH RFC v2 6/9] drm/atomic: Create function to insert connector " Maxime Ripard
2026-08-12 12:57 ` [PATCH RFC v2 7/9] drm/atomic: Add drm_atomic_can_create_state() helper Maxime Ripard
2026-08-12 12:57 ` [PATCH RFC v2 8/9] drm/atomic: Allow filling a commit with pristine object states Maxime Ripard
2026-08-12 13:18 ` sashiko-bot [this message]
2026-08-12 12:57 ` [PATCH RFC v2 9/9] drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-08-12 13:24 ` 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=20260812131828.098131F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mripard@kernel.org \
--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.