From a16f6ba43d9d19996ace3aa08218fa399009f4b7 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 9 Oct 2025 15:16:28 +0200 Subject: drm/client: Add client free callback to unprepare fb_helper Add free callback to struct drm_client_funcs. Invoke function to free the client memory as part of the release process. Implement free for fbdev emulation. Fbdev emulation allocates and prepares client memory in drm_fbdev_client_setup(). The release happens in fb_destroy from struct fb_ops. Multiple implementations of this callback exist in the various drivers that provide an fbdev implementation. Each of them needs to follow the implementation details of the fbdev setup code. Adding a free callback for the client puts the unprepare and release of the fbdev client in a single place. Signed-off-by: Thomas Zimmermann Reviewed-by: Dmitry Baryshkov # core, msm Acked-by: Tomi Valkeinen # omapdrm Acked-by: Patrik Jakobsson # gma500 Acked-by: Alex Deucher Link: https://lore.kernel.org/r/20251009132006.45834-2-tzimmermann@suse.de --- include/drm/drm_client.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/drm') diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h index 3556928d3938..715b422952ee 100644 --- a/include/drm/drm_client.h +++ b/include/drm/drm_client.h @@ -28,6 +28,16 @@ struct drm_client_funcs { */ struct module *owner; + /** + * @free: + * + * Called when the client gets unregistered. Implementations should + * release all client-specific data and free the memory. + * + * This callback is optional. + */ + void (*free)(struct drm_client_dev *client); + /** * @unregister: * -- cgit v1.2.3