dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Leo Li <sunpeng.li@amd.com>
Cc: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 66/75] drm/amdgpu: dm: Convert to atomic_create_state
Date: Thu, 22 Oct 2026 09:35:14 +0200	[thread overview]
Message-ID: <atm70iyECxY3aCV7@houat> (raw)
In-Reply-To: <141dad9e-6868-42e7-836e-d14e1ba78fe9@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

On Tue, Oct 20, 2026 at 12:11:56PM -0400, Leo Li wrote:
> Thanks for cleaning up all the drivers, are these all part of the
> DRM_MODE_ATOMIC_RESET effort?

Somewhat, yes. It actually originated from the state readout work I've
been doing, but it's now a dependency to enable DRM_MODE_ATOMIC_RESET
indeed.

> > On Mon, Oct 19, 2026 at 12:38:47PM -0400, Leo Li wrote:
> >>> @@ -736,11 +736,11 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
> >>>  
> >>>  	/*
> >>>  	 * Initialize connector state before adding the connectror to drm and
> >>>  	 * framebuffer lists
> >>>  	 */
> >>> -	amdgpu_dm_connector_funcs_reset(connector);
> >>
> >> I'm actually not sure why there was a state reset here.
> >> amdgpu_dm_connector_init_helper() is called earlier in this func and
> >> that already did a reset.
> > 
> > Yeah, it's something sashiko flagged too and I removed that call (and
> > updated the comment).
> > 
> >>> +	connector->state = amdgpu_dm_connector_atomic_create_state(connector);
> >>
> >> That asside, looks like this can overwrite the alloc'd state from
> >> init_helper() without freeing. So to keep the previous behavior and
> >> avoid regressing, perhaps we can do this:
> >>
> >> 	conn_state = amdgpu_dm_connector_atomic_create_state(connector);
> >> 	if (!IS_ERR(conn_state)) {
> >> 		if (connector->state)
> >> 			connector->funcs->atomic_destroy_state(connector, connector->state);
> >> 		connector->state = conn_state;
> >> 	}
> > 
> > If we are to handle errors properly and remain equivalent, then
> > something like the following would be more accurate I guess?
> > 
> > if (connector->state) {
> >     connector->funcs->atomic_destroy_state(connector, connector->state);
> >     connector->state = NULL;
> > }
> > 
> > conn_state = amdgpu_dm_connector_atomic_create_state(connector);
> > if (IS_ERR(conn_state))
> >     return NULL;
> > 
> > connector->state = conn_state;
> > 
> > Would you prefer that, or should I remove the call to create_state
> > entirely because it's redundant?
> 
> My preference would be to copy existing behavior, and keep the scope of this
> series to just dropping the reset hook. Dropping the redundant create_state and
> handling associated testing/regressions can be a followup.
> 
> In my parsing of the old reset behavior, we don't return a NULL connector on
> error. Rather, we keep the existing connector->state and return the connector as
> is. The rest of reset() only runs if state was alloc'd successfully. My previous
> snippet should copy this.

Ack. I'll use your earlier suggestion then

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2026-10-22  7:35 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 17:26 [PATCH 00/75] drm/connector: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-10-14 17:26 ` [PATCH 01/75] drm/panel: Add atomic_create_state support Maxime Ripard
2026-10-14 17:45   ` sashiko-bot
2026-10-20 13:40   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 02/75] drm/adp: Switch to drm_atomic_helper_connector_create_state Maxime Ripard
2026-10-16 10:20   ` Aditya Garg
2026-10-14 17:26 ` [PATCH 03/75] drm/amdgpu: vkms: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 04/75] drm/amdgpu: dm: " Maxime Ripard
2026-10-14 17:52   ` sashiko-bot
2026-10-16 16:41   ` Leo Li
2026-10-14 17:26 ` [PATCH 05/75] drm/arm: komeda: " Maxime Ripard
2026-10-15 15:45   ` Liviu Dudau
2026-10-14 17:26 ` [PATCH 06/75] drm/aspeed: " Maxime Ripard
2026-10-20 13:43   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 07/75] drm/ast: " Maxime Ripard
2026-10-20 13:41   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 08/75] drm/bridge: analogix-anx6345: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 09/75] drm/bridge: analogix-anx78xx: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 10/75] drm/bridge: chrontel-ch7033: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 11/75] drm/bridge: lontium-lt8912b: " Maxime Ripard
2026-10-15 14:47   ` Francesco Dolcini
2026-10-14 17:26 ` [PATCH 12/75] drm/bridge: megachips: " Maxime Ripard
2026-10-15 12:37   ` Ian Ray
2026-10-14 17:26 ` [PATCH 13/75] drm/bridge: nxp-ptn3460: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 14/75] drm/panel: " Maxime Ripard
2026-10-14 17:48   ` sashiko-bot
2026-10-14 17:26 ` [PATCH 15/75] drm/bridge: sii902x: " Maxime Ripard
2026-10-14 18:26   ` Dmitry Baryshkov
2026-10-14 17:26 ` [PATCH 16/75] drm/bridge: simple-bridge: " Maxime Ripard
2026-10-14 18:27   ` Dmitry Baryshkov
2026-10-14 17:26 ` [PATCH 17/75] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 18/75] drm/bridge: tc358767: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 19/75] drm/bridge: tda998x: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 20/75] drm/bridge: ti-tfp410: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 21/75] drm/exynos: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 22/75] drm/fsl-dcu: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 23/75] drm/hisilicon: hibmc: " Maxime Ripard
2026-10-20 13:44   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 24/75] drm/hyperv: " Maxime Ripard
2026-10-15 11:14   ` Saurabh Singh Sengar
2026-10-20 13:45   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 25/75] drm/imx: ipuv3: " Maxime Ripard
2026-10-14 18:38   ` Frank Li
2026-10-14 17:26 ` [PATCH 26/75] drm/logicvc: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 27/75] drm/loongson: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 28/75] drm/mgag200: " Maxime Ripard
2026-10-20 13:46   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 29/75] drm/mipi-dbi: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 30/75] drm/msm: dpu1: " Maxime Ripard
2026-10-14 18:25   ` Dmitry Baryshkov
2026-10-14 17:26 ` [PATCH 31/75] drm/qxl: " Maxime Ripard
2026-10-20 13:47   ` Thomas Zimmermann
2026-10-14 17:26 ` [PATCH 32/75] drm/renesas: shmobile: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 33/75] drm/sitronix: st7571: " Maxime Ripard
2026-10-14 17:26 ` [PATCH 34/75] drm/sitronix: st7920: " Maxime Ripard
2026-10-21 17:39   ` Iker Pedrosa
2026-10-14 17:26 ` [PATCH 35/75] drm/solomon: ssd130x: " Maxime Ripard
2026-10-14 20:21   ` Javier Martinez Canillas
2026-10-14 17:26 ` [PATCH 36/75] drm/sti: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 37/75] drm/stm: " Maxime Ripard
2026-10-16 15:16   ` Raphael Gallais-Pou
2026-10-14 17:27 ` [PATCH 38/75] drm/sun4i: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 39/75] drm/sysfb: " Maxime Ripard
2026-10-14 20:21   ` Javier Martinez Canillas
2026-10-20 13:49   ` Thomas Zimmermann
2026-10-22  7:21     ` Maxime Ripard
2026-10-14 17:27 ` [PATCH 40/75] drm/tegra: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 41/75] drm/tests: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 42/75] drm/tiny: arcpgu: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 43/75] drm/tiny: bochs: " Maxime Ripard
2026-10-20 13:51   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 44/75] drm/tiny: cirrus: " Maxime Ripard
2026-10-20 13:51   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 45/75] drm/tiny: gm12u320: " Maxime Ripard
2026-10-20 13:51   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 46/75] drm/tiny: pixpaper: " Maxime Ripard
2026-10-20 13:52   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 47/75] drm/tiny: repaper: " Maxime Ripard
2026-10-20 13:52   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 48/75] drm/tiny: sharp: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 49/75] drm/udl: " Maxime Ripard
2026-10-20 13:52   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 50/75] drm/vboxvideo: " Maxime Ripard
2026-10-20 13:53   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 51/75] drm/vc4: " Maxime Ripard
2026-10-15 10:36   ` Maíra Canal
2026-10-14 17:27 ` [PATCH 52/75] drm/virtio: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 53/75] drm/vkms: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 54/75] drm/xen: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 55/75] drm/atomic-state-helper: Rename connector_tv_margins_reset to state_init Maxime Ripard
2026-10-15 10:40   ` Maíra Canal
2026-10-20 13:57   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 56/75] drm/atomic-state-helper: Rename connector_tv_reset " Maxime Ripard
2026-10-14 18:03   ` sashiko-bot
2026-10-15 10:56   ` Maíra Canal
2026-10-16 12:35     ` Maxime Ripard
2026-10-14 17:27 ` [PATCH 57/75] drm/bridge: synopsys: dw-hdmi: Convert to atomic_create_state Maxime Ripard
2026-10-14 18:14   ` sashiko-bot
2026-10-14 17:27 ` [PATCH 58/75] drm/meson: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 59/75] drm/gud: " Maxime Ripard
2026-10-20 13:59   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 60/75] drm/sun4i: hdmi: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 61/75] drm/sun4i: tv: " Maxime Ripard
2026-10-14 18:08   ` sashiko-bot
2026-10-14 17:27 ` [PATCH 62/75] drm/tests: hdmi: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 63/75] drm/vc4: " Maxime Ripard
2026-10-15 11:07   ` Maíra Canal
2026-10-16 12:48     ` Maxime Ripard
2026-10-14 17:27 ` [PATCH 64/75] drm/vc4: vec: " Maxime Ripard
2026-10-14 18:10   ` sashiko-bot
2026-10-15 11:09   ` Maíra Canal
2026-10-14 17:27 ` [PATCH 65/75] drm/connector: Remove drm_atomic_helper_connector_reset() Maxime Ripard
2026-10-14 17:27 ` [PATCH 66/75] drm/amdgpu: dm: Convert to atomic_create_state Maxime Ripard
2026-10-14 18:16   ` sashiko-bot
2026-10-19 16:38   ` Leo Li
2026-10-20 13:08     ` Maxime Ripard
2026-10-20 16:11       ` Leo Li
2026-10-22  7:35         ` Maxime Ripard [this message]
2026-10-14 17:27 ` [PATCH 67/75] drm/malidp: " Maxime Ripard
2026-10-15 15:45   ` Liviu Dudau
2026-10-14 17:27 ` [PATCH 68/75] drm/ast: " Maxime Ripard
2026-10-20 14:01   ` Thomas Zimmermann
2026-10-14 17:27 ` [PATCH 69/75] drm/i915: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 70/75] drm/nouveau: " Maxime Ripard
2026-10-14 18:13   ` sashiko-bot
2026-10-14 17:27 ` [PATCH 71/75] drm/rcar-du: " Maxime Ripard
2026-10-19 15:26   ` Laurent Pinchart
2026-10-14 17:27 ` [PATCH 72/75] drm/tegra: " Maxime Ripard
2026-10-14 17:27 ` [PATCH 73/75] drm/vmwgfx: " Maxime Ripard
2026-10-17  2:42   ` Maaz Mombasawala
2026-10-14 17:27 ` [PATCH 74/75] drm/connector: Remove __drm_atomic_helper_connector_reset() Maxime Ripard
2026-10-14 17:27 ` [PATCH 75/75] drm/connector: Remove reset Maxime Ripard
2026-10-16 15:06 ` (subset) [PATCH 00/75] drm/connector: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-10-16 15:12 ` Maxime Ripard
2026-10-19 15:15 ` Maxime Ripard

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=atm70iyECxY3aCV7@houat \
    --to=mripard@kernel.org \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    /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