From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
"Ze Huang" <ze.huang@oss.qualcomm.com>,
"Alexey Brodkin" <abrodkin@synopsys.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Joel Stanley" <joel@jms.id.au>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Linus Walleij" <linusw@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Alex Lanzano" <lanzano.alex@gmail.com>,
"Oleksandr Andrushchenko" <oleksandr_andrushchenko@epam.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<linux-aspeed@lists.ozlabs.org>,
<linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 5/8] drm/gm12u320: replace struct drm_simple_display_pipe with regular atomic helpers
Date: Sat, 18 Jul 2026 23:42:10 +0800 [thread overview]
Message-ID: <DK1T85P7OAAY.RXCY4AX71VRX@oss.qualcomm.com> (raw)
In-Reply-To: <26981ae1-4aef-4965-8600-f5e30a1b564a@suse.de>
On Fri Jul 17, 2026 at 3:18 PM CST, Thomas Zimmermann wrote:
> Hi
>
> Am 16.07.26 um 11:01 schrieb Ze Huang:
>> Convert gm12u320 to direct primary plane, CRTC and encoder setup.
>>
>> Keep shadow-plane helper state, framebuffer access helpers and
>> no-scaling plane-state check from simple-KMS path.
>>
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>> drivers/gpu/drm/tiny/gm12u320.c | 132 ++++++++++++++++++++++++++++++++--------
>> 1 file changed, 107 insertions(+), 25 deletions(-)
>>
> [...]
>>
>> -static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
>> - struct drm_crtc_state *crtc_state,
>> - struct drm_plane_state *plane_state)
>> +static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> + struct drm_atomic_commit *commit)
>> {
>> struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
>> - struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
>> + struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
>> + struct drm_plane_state *plane_state = gm12u320->plane.state;
>
> Did you see the reply from the Sashiko bot?
>
> What happens is that user space can apply multiple atomic commits in a
> row, but they are applied to hardware asynchronously. So if you take the
> plane state here directly from the plane, it could have been replaced by
> a later atomic commit already. Rather get the correct plane state with
> the helper drm_atomic_get_new_plane_state().
>
I think I misunderstood this point. I had assumed that
drm_atomic_get_*_state() was only needed for the state object directly
matching the helper callback, for example crtc_state in
*_crtc_helper_atomic_enable() and plane_state in
*_plane_helper_atomic_update(), while other state could be accessed via
the device-private structure.
From your explanation, I see that this is wrong. In the atomic commit
path, any state associated with the current commit should be obtained
through drm_atomic_get_*_state(), because the object’s ->state may
already refer to a later commit.
> I did not look at all of the series' patches for this problem, but the rule
> applies to all of the mode-setting code.
>
> Best regards
> Thomas
This affects other patches in the series as well, and some drivers may
need additional fixes in internal helpers too, e.g. arc_pgu_set_pxl_fmt()
in arcpgu.c [1].
I will audit the full series and fix such cases in the next version.
Best regards
Ze
next prev parent reply other threads:[~2026-07-18 15:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 9:01 [PATCH v2 0/8] drm: replace simple display pipe users with atomic helpers Ze Huang
2026-07-16 9:01 ` [PATCH v2 1/8] drm/arcpgu: replace struct drm_simple_display_pipe with regular " Ze Huang
2026-07-16 9:01 ` [PATCH v2 2/8] drm/aspeed: " Ze Huang
2026-07-16 9:01 ` [PATCH v2 3/8] drm/mcde: " Ze Huang
2026-07-16 9:01 ` [PATCH v2 4/8] drm/pl111: " Ze Huang
2026-07-16 9:01 ` [PATCH v2 5/8] drm/gm12u320: " Ze Huang
2026-07-17 7:18 ` Thomas Zimmermann
2026-07-18 15:42 ` Ze Huang [this message]
2026-07-16 9:01 ` [PATCH v2 6/8] drm/repaper: " Ze Huang
2026-07-16 9:01 ` [PATCH v2 7/8] drm/tve200: " Ze Huang
2026-07-16 9:02 ` [PATCH v2 8/8] drm/xen: " Ze Huang
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=DK1T85P7OAAY.RXCY4AX71VRX@oss.qualcomm.com \
--to=ze.huang@oss.qualcomm.com \
--cc=Frank.Li@nxp.com \
--cc=abrodkin@synopsys.com \
--cc=airlied@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=hansg@kernel.org \
--cc=imx@lists.linux.dev \
--cc=joel@jms.id.au \
--cc=kernel@pengutronix.de \
--cc=lanzano.alex@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oleksandr_andrushchenko@epam.com \
--cc=s.hauer@pengutronix.de \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=xen-devel@lists.xenproject.org \
/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