All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Maxime Ripard <mripard@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org,
	Huacai Chen <chenhuacai@kernel.org>,
	Icenowy Zheng <zhengxingda@iscas.ac.cn>,
	Jianmin Lv <lvjianmin@loongson.cn>,
	Mingcong Bai <jeffbai@aosc.io>,
	Qianhai Wu <wuqianhai@loongson.cn>,
	Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH 50/70] drm/loongsoon: Move hardware reset to CRTC creation
Date: Mon, 24 Aug 2026 13:20:29 +0200	[thread overview]
Message-ID: <c795c9f8-65da-49c5-8384-9e29ea015665@suse.de> (raw)
In-Reply-To: <20260821-drm-no-more-crtc-reset-v1-50-fb793475c05a@kernel.org>

Hi Maxime

Am 21.08.26 um 16:39 schrieb Maxime Ripard:
> The loongsoon crtc reset hook performs both atomic state initialization
> using __drm_atomic_helper_crtc_reset() and hardware-level register
> writes to reset the CRTC.
>
> The hardware reset is not related to atomic state initialization, and
> the reset hook is being converted to atomic_create_state which only
> deals with state allocation. Move the hardware reset to the CRTC
> creation path instead.
>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
> Cc: Huacai Chen <chenhuacai@kernel.org>
> Cc: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> Cc: Jianmin Lv <lvjianmin@loongson.cn>
> Cc: Mingcong Bai <jeffbai@aosc.io>
> Cc: Qianhai Wu <wuqianhai@loongson.cn>
> Cc: Xi Ruoyao <xry111@xry111.site>
> ---
>   drivers/gpu/drm/loongson/lsdc_crtc.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_crtc.c b/drivers/gpu/drm/loongson/lsdc_crtc.c
> index 16b8f36a4071..97a3443739e1 100644
> --- a/drivers/gpu/drm/loongson/lsdc_crtc.c
> +++ b/drivers/gpu/drm/loongson/lsdc_crtc.c
> @@ -388,12 +388,10 @@ static const struct lsdc_crtc_hw_ops ls7a2000_crtc_hw_ops[2] = {
>   	},
>   };
>   
>   static void lsdc_crtc_reset(struct drm_crtc *crtc)
>   {
> -	struct lsdc_crtc *lcrtc = to_lsdc_crtc(crtc);
> -	const struct lsdc_crtc_hw_ops *ops = lcrtc->hw_ops;
>   	struct lsdc_crtc_state *priv_crtc_state;
>   
>   	if (crtc->state)
>   		crtc->funcs->atomic_destroy_state(crtc, crtc->state);
>   
> @@ -401,13 +399,10 @@ static void lsdc_crtc_reset(struct drm_crtc *crtc)
>   
>   	if (!priv_crtc_state)
>   		__drm_atomic_helper_crtc_reset(crtc, NULL);
>   	else
>   		__drm_atomic_helper_crtc_reset(crtc, &priv_crtc_state->base);
> -
> -	/* Reset the CRTC hardware, this is required for S3 support */
> -	ops->reset(lcrtc);

As the Sashiko bot noted, removing this here will likely break S3 
resume. IIUC you could instead add it before resuming DRM state at [1]

[1] 
https://elixir.bootlin.com/linux/v7.2/source/drivers/gpu/drm/loongson/lsdc_drv.c#L390

Best regards
Thomas

>   }
>   
>   static void lsdc_crtc_atomic_destroy_state(struct drm_crtc *crtc,
>   					   struct drm_crtc_state *state)
>   {
> @@ -981,10 +976,13 @@ int ls7a1000_crtc_init(struct drm_device *ddev,
>   	if (ret)
>   		return ret;
>   
>   	drm_crtc_enable_color_mgmt(crtc, 0, false, 256);
>   
> +	/* Reset the CRTC hardware, this is required for S3 support */
> +	lcrtc->hw_ops->reset(lcrtc);
> +
>   	return 0;
>   }
>   
>   int ls7a2000_crtc_init(struct drm_device *ddev,
>   		       struct drm_crtc *crtc,
> @@ -1020,7 +1018,10 @@ int ls7a2000_crtc_init(struct drm_device *ddev,
>   	if (ret)
>   		return ret;
>   
>   	drm_crtc_enable_color_mgmt(crtc, 0, false, 256);
>   
> +	/* Reset the CRTC hardware, this is required for S3 support */
> +	lcrtc->hw_ops->reset(lcrtc);
> +
>   	return 0;
>   }
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)



  parent reply	other threads:[~2026-08-24 11:20 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 14:38 [PATCH 00/70] drm/crtc: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-08-21 14:38 ` Maxime Ripard
2026-08-21 14:38 ` [PATCH 01/70] drm/adp: Switch to drm_atomic_helper_crtc_create_state Maxime Ripard
2026-08-21 14:55   ` sashiko-bot
2026-08-21 14:38 ` [PATCH 02/70] drm/amdgpu: vkms: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 03/70] drm/arm: hdlcd: " Maxime Ripard
2026-08-24 10:48   ` Liviu Dudau
2026-08-21 14:38 ` [PATCH 04/70] drm/armada: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 05/70] drm/exynos: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 06/70] drm/fsl-dcu: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 07/70] drm/gud: " Maxime Ripard
2026-08-23 16:36   ` Ruben Wauters
2026-08-21 14:38 ` [PATCH 08/70] drm/hisilicon: hibmc: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 09/70] drm/hisilicon: kirin: " Maxime Ripard
2026-08-21 20:06   ` John Stultz
2026-08-21 14:38 ` [PATCH 10/70] drm/hyperv: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 11/70] drm/imx: dc: " Maxime Ripard
2026-08-21 15:00   ` sashiko-bot
2026-08-21 14:38 ` [PATCH 12/70] drm/imx: dcss: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 13/70] drm/ingenic: " Maxime Ripard
2026-08-24  9:43   ` Paul Cercueil
2026-08-21 14:38 ` [PATCH 14/70] drm/kmb: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 15/70] drm/logicvc: " Maxime Ripard
2026-08-24 11:39   ` Paul Kocialkowski
2026-08-21 14:38 ` [PATCH 16/70] drm/meson: " Maxime Ripard
2026-08-21 14:38   ` Maxime Ripard
2026-08-21 14:38 ` [PATCH 17/70] drm/msm: mdp4: " Maxime Ripard
2026-08-22  7:51   ` Dmitry Baryshkov
2026-08-21 14:38 ` [PATCH 18/70] drm/mxs: mxsfb: " Maxime Ripard
2026-08-21 15:12   ` sashiko-bot
2026-08-21 14:38 ` [PATCH 19/70] drm/qxl: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 20/70] drm/renesas: shmobile: " Maxime Ripard
2026-08-21 14:38 ` [PATCH 21/70] drm/simple-kms: Remove unused reset_crtc hook Maxime Ripard
2026-08-21 14:38 ` [PATCH 22/70] drm/simple-kms: Switch to drm_atomic_helper_crtc_create_state Maxime Ripard
2026-08-21 14:38 ` [PATCH 23/70] drm/sitronix: st7571: " Maxime Ripard
2026-08-21 15:14   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 24/70] drm/sprd: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 25/70] drm/sti: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 26/70] drm/stm: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 27/70] drm/sun4i: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 28/70] drm/tests: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 29/70] drm/tilcdc: Move hardware reset to CRTC creation Maxime Ripard
2026-08-21 15:13   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 30/70] drm/tilcdc: Switch to drm_atomic_helper_crtc_create_state Maxime Ripard
2026-08-21 14:39 ` [PATCH 31/70] drm/tiny: appletbdrm: " Maxime Ripard
2026-08-21 15:16   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 32/70] drm/tiny: bochs: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 33/70] drm/tiny: cirrus: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 34/70] drm/tiny: pixpaper: " Maxime Ripard
2026-08-21 15:26   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 35/70] drm/tiny: sharp: " Maxime Ripard
2026-08-21 15:25   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 36/70] drm/udl: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 37/70] drm/vbox: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 38/70] drm/verisilicon: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 39/70] drm/virtio: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 40/70] drm/xlnx: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 41/70] drm/mipi-dbi: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 42/70] drm/atomic-helper: Remove drm_atomic_helper_crtc_reset Maxime Ripard
2026-08-21 14:39 ` [PATCH 43/70] sysfb: Convert to create_state Maxime Ripard
2026-08-21 14:39 ` [PATCH 44/70] drm/amdgpu: dm: Convert to atomic_create_state Maxime Ripard
2026-08-21 15:28   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 45/70] drm/komeda: " Maxime Ripard
2026-08-24 10:48   ` Liviu Dudau
2026-08-21 14:39 ` [PATCH 46/70] drm/malidp: " Maxime Ripard
2026-08-24 10:49   ` Liviu Dudau
2026-08-21 14:39 ` [PATCH 47/70] drm/ast: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 48/70] drm/atmel-hlcdc: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 49/70] drm/imx: ipuv3: " Maxime Ripard
2026-08-24 14:32   ` Philipp Zabel
2026-08-21 14:39 ` [PATCH 50/70] drm/loongsoon: Move hardware reset to CRTC creation Maxime Ripard
2026-08-21 15:36   ` sashiko-bot
2026-08-24 11:20   ` Thomas Zimmermann [this message]
2026-08-21 14:39 ` [PATCH 51/70] drm/loongson: Convert to atomic_create_state Maxime Ripard
2026-08-21 15:35   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 52/70] drm/mediatek: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 53/70] drm/mgag200: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 54/70] drm/msm: dpu1: " Maxime Ripard
2026-08-22  8:14   ` Dmitry Baryshkov
2026-08-21 14:39 ` [PATCH 55/70] drm/msm: mdp5: " Maxime Ripard
2026-08-22  8:47   ` Dmitry Baryshkov
2026-08-21 14:39 ` [PATCH 56/70] drm/mxsfb: lcdif: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 57/70] drm/nouveau: " Maxime Ripard
2026-08-21 14:39   ` Maxime Ripard
2026-08-21 20:51   ` lyude
2026-08-21 14:39 ` [PATCH 58/70] drm/omapdrm: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 59/70] drm/rcar-du: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 60/70] drm/rzg2l-du: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 61/70] drm/rockchip: vop: " Maxime Ripard
2026-08-21 14:39   ` Maxime Ripard
2026-08-21 14:39 ` [PATCH 62/70] drm/rockchip: vop2: " Maxime Ripard
2026-08-21 14:39   ` Maxime Ripard
2026-08-21 14:39 ` [PATCH 63/70] drm/sitronix: st7920: " Maxime Ripard
2026-08-21 15:41   ` sashiko-bot
2026-08-21 14:39 ` [PATCH 64/70] drm/solomon: ssd130x: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 65/70] drm/tegra: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 66/70] drm/vc4: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 67/70] drm/vkms: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 68/70] drm/vmwgfx: " Maxime Ripard
2026-08-21 14:39 ` [PATCH 69/70] drm/atomic-helper: Remove __drm_atomic_helper_crtc_reset Maxime Ripard
2026-08-21 15:45   ` sashiko-bot
2026-08-22  8:47   ` Dmitry Baryshkov
2026-08-21 14:39 ` [PATCH 70/70] drm/crtc: Remove reset Maxime Ripard
2026-08-21 15:51   ` sashiko-bot
2026-08-23 21:19   ` Dmitry Baryshkov
2026-08-24 11:28 ` [PATCH 00/70] drm/crtc: Convert all drivers to atomic_create_state and remove reset Thomas Zimmermann
2026-08-24 11:28   ` Thomas Zimmermann

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=c795c9f8-65da-49c5-8384-9e29ea015665@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jeffbai@aosc.io \
    --cc=lvjianmin@loongson.cn \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=wuqianhai@loongson.cn \
    --cc=xry111@xry111.site \
    --cc=zhengxingda@iscas.ac.cn \
    /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.