[PATCH 08/18] drm/sysfb: Merge connector functions
Thomas Zimmermann
tzimmermann at suse.de
Mon Mar 24 07:37:24 UTC 2025
Hi Javier
Am 23.03.25 um 11:57 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann at suse.de> writes:
>
>> Merge the connector functions of ofdrm and simpledrm. Replace the
>> code in each driver with the shared helpers. Set up callbacks with
>> initializer macros.
>>
>> No effective code changes. The sysfb connector only returns the
>> preconfigured display mode.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
>> ---
> ...
>
>> +#define DRM_SYSFB_CONNECTOR_FUNCS \
>> + .reset = drm_atomic_helper_connector_reset, \
>> + .fill_modes = drm_helper_probe_single_connector_modes, \
>> + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, \
>> + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state
>> +
>> /*
> ...
>
>> static const struct drm_connector_funcs ofdrm_connector_funcs = {
>> - .reset = drm_atomic_helper_connector_reset,
>> - .fill_modes = drm_helper_probe_single_connector_modes,
>> + DRM_SYSFB_CONNECTOR_FUNCS,
>> .destroy = drm_connector_cleanup,
> Why not include the .destroy callback in DRM_SYSFB_CONNECTOR_FUNCS ?
These sysfb helpers provide functionality to operate on the output
(damage handling, etc).
The destroy callback depends on the way the mode-setting pipeline is
organized. The driver controls this. It might wants to allocated the
connector separately or use a container structure (e.g., struct
ofdrm_connector) that needs separate cleanup. Hence the driver has to
control the destroy callback. That argument goes for all the other
elements of the pipeline.
Best regards
Thomas
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
More information about the dri-devel
mailing list