[Nouveau] [PATCH 1/3] drm: Add separate state structure for legacy, non-KMS drivers

Thomas Zimmermann tzimmermann at suse.de
Wed Feb 26 05:28:15 UTC 2020


Hi Emil

Am 25.02.20 um 18:37 schrieb Emil Velikov:
> Hi Thomas,
> 
> On Tuesday, 25 February 2020, Thomas Zimmermann <tzimmermann at suse.de
> <mailto:tzimmermann at suse.de>> wrote:
> 
>     Non-KMS drivers store state in struct drm_driver. This bloats the
>     structure for KMS drivers and prevents it from being declared with
>     'static const' qualifiers. Moving the non-KMS state into a separate
>     data structure resolves this.
> 
> 
> Have you considered subclassing the const drm_driver for legacy drivers.
> This way the legacy (pointer) data does not need to be exposed to
> non-legacy drivers.

I didn't want to do an upcast each time the legacy data is required. I
know that subclassing is closer to the style of current DRM, but given
the current code base, the additional legacy pointer seemed like the
lesser evil.

Best regards
Thomas

> 
> Not to mention that const data (drm_driver), which has (const) pointer
> to mutable data (legacy bits) is a trap IMHO
> 
> Emil

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20200226/fe2e3bdc/attachment.sig>


More information about the Nouveau mailing list