From: Thomas Zimmermann <tzimmermann@suse.de>
To: Minseo Park <hiyoukou@gmail.com>, dri-devel@lists.freedesktop.org
Cc: alain.volmat@foss.st.com, rgallaispou@gmail.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, simona@ffwll.ch, benjamin.gaignard@linaro.org
Subject: Re: [PATCH 3/3] drm/sti: hqvdp: start the XP70 from .atomic_update()
Date: Wed, 25 Nov 2026 15:44:58 +0100 [thread overview]
Message-ID: <0bb655d0-336f-4455-9c9c-e620cf3ce2fd@suse.de> (raw)
In-Reply-To: <20261125142330.15298-4-hiyoukou@gmail.com>
Hi
Am 25.11.26 um 15:23 schrieb Minseo Park:
> sti_hqvdp_atomic_check() boots the XP70 coprocessor, which loads its
> firmware, then enables the main pixel clock and registers a VTG vsync
> notifier.
>
> .atomic_check() must not touch the hardware. A commit with
> DRM_MODE_ATOMIC_TEST_ONLY only runs the check hooks, so a client asking
> whether a configuration is possible ends up loading firmware and
> enabling a clock.
>
> Both are one-shot, guarded by hqvdp->xp70_initialized and
> hqvdp->vtg_registered, so nothing leaks, but they belong in the commit
> phase. Move them to .atomic_update(). As with the GDP, the failure
> paths now log and return instead of rejecting the commit.
>
> Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes")
> Signed-off-by: Minseo Park <hiyoukou@gmail.com>
> ---
> drivers/gpu/drm/sti/sti_hqvdp.c | 43 ++++++++++++++++-----------------
> 1 file changed, 21 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 360d213f2094..66abbe4de864 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -1081,28 +1081,6 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
> return -EINVAL;
> }
>
> - if (!hqvdp->xp70_initialized)
> - /* Start HQVDP XP70 coprocessor */
> - sti_hqvdp_start_xp70(hqvdp);
> -
> - if (!hqvdp->vtg_registered) {
> - /* Prevent VTG shutdown */
> - if (clk_prepare_enable(hqvdp->clk_pix_main)) {
> - DRM_ERROR("Failed to prepare/enable pix main clk\n");
> - return -EINVAL;
> - }
> -
> - /* Register VTG Vsync callback to handle bottom fields */
> - if (sti_vtg_register_client(hqvdp->vtg,
> - &hqvdp->vtg_nb,
> - crtc)) {
> - DRM_ERROR("Cannot register VTG notifier\n");
> - clk_disable_unprepare(hqvdp->clk_pix_main);
> - return -EINVAL;
> - }
> - hqvdp->vtg_registered = true;
> - }
> -
> DRM_DEBUG_KMS("CRTC:%d (%s) drm plane:%d (%s)\n",
> crtc->base.id, sti_mixer_to_str(to_sti_mixer(crtc)),
> drm_plane->base.id, sti_plane_to_str(plane));
> @@ -1152,6 +1130,27 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,
> }
>
> mode = &crtc->mode;
> +
> + if (!hqvdp->xp70_initialized)
> + /* Start HQVDP XP70 coprocessor */
> + sti_hqvdp_start_xp70(hqvdp);
> +
> + if (!hqvdp->vtg_registered) {
> + /* Prevent VTG shutdown */
> + if (clk_prepare_enable(hqvdp->clk_pix_main)) {
> + DRM_ERROR("Failed to prepare/enable pix main clk\n");
> + return;
> + }
> +
> + /* Register VTG Vsync callback to handle bottom fields */
> + if (sti_vtg_register_client(hqvdp->vtg, &hqvdp->vtg_nb, crtc)) {
> + DRM_ERROR("Cannot register VTG notifier\n");
> + clk_disable_unprepare(hqvdp->clk_pix_main);
> + return;
> + }
> + hqvdp->vtg_registered = true;
> + }
> +
This looks like it belongs int device init instead of plane updates.
Best regards
Thomas
> dst_x = newstate->crtc_x;
> dst_y = newstate->crtc_y;
> dst_w = clamp_val(newstate->crtc_w, 0, mode->hdisplay - dst_x);
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-11-25 14:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 14:23 [PATCH 0/3] drm/sti: move commit work out of .atomic_check() Minseo Park
2026-11-25 14:23 ` [PATCH 1/3] drm/sti: cursor: do not resize the pixmap from .atomic_check() Minseo Park
2026-11-25 14:39 ` Thomas Zimmermann
2026-11-25 14:23 ` [PATCH 2/3] drm/sti: gdp: set the pixel clock from .atomic_update() Minseo Park
2026-11-25 14:41 ` Thomas Zimmermann
2026-11-25 14:23 ` [PATCH 3/3] drm/sti: hqvdp: start the XP70 " Minseo Park
2026-11-25 14:44 ` Thomas Zimmermann [this message]
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=0bb655d0-336f-4455-9c9c-e620cf3ce2fd@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=alain.volmat@foss.st.com \
--cc=benjamin.gaignard@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hiyoukou@gmail.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=rgallaispou@gmail.com \
--cc=simona@ffwll.ch \
/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.