Re: [PATCH v3 16/20] drm/mode-config: Create drm_mode_config_create_initial_state()

From: Maxime Ripard

Date: Tue May 12 2026 - 07:16:25 EST


On Mon, May 04, 2026 at 08:41:48PM +0300, Laurent Pinchart wrote:
> > Historically, this was one
> > + * of drm_mode_config_reset() job, so one might still encounter it in
> > + * a driver.
> > + *
> > + * - at reset time, for example during suspend/resume,
> > + * drm_mode_config_reset() will reset the software and hardware state
> > + * to a known default and will store it in the object's state pointer.
> > + * Not all objects are affected by drm_mode_config_reset() though.
>
> Does the reset implementation store a new state in the object's state
> pointer, or does it reset the contents of the already allocated state ?
> I read the documentation here as meaning the former, if it's actually
> the latter it should be reworded.

It's undefined. Both approach works, most drivers will destroy the old
one and allocate a new one, but mediatek will just clear and
re-initialize the old one:

https://elixir.bootlin.com/linux/v7.1-rc3/source/drivers/gpu/drm/mediatek/mtk_plane.c#L28

Maxime

Attachment: signature.asc
Description: PGP signature