[PATCH v3 03/71] drm/encoder: Introduce drmm_encoder_init

Maxime Ripard maxime at cerno.tech
Wed Jun 29 14:41:20 UTC 2022


On Wed, Jun 29, 2022 at 03:32:12PM +0200, Philipp Zabel wrote:
> On Mi, 2022-06-29 at 14:34 +0200, Maxime Ripard wrote:
> > The DRM-managed function to register an encoder is
> > drmm_encoder_alloc() and its variants, which will allocate the underlying
> > structure and initialisation the encoder.
> > 
> > However, we might want to separate the structure creation and the encoder
> > initialisation, for example if the structure is shared across multiple DRM
> > entities, for example an encoder and a connector.
> > 
> > Let's create an helper to only initialise an encoder that would be passed
> > as an argument.
> 
> Daniel pointed out here [1], that it might be good to check the passed
> encoders are actually in drmm managed memory.

Yeah that's a good idea. I thought about it, but I have no idea how we
can even tell from a pointer if it's drmm managed?

Maxime


More information about the dri-devel mailing list