drm/fbdev-generic: Minimize client unregistering
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 25 Jan 2023 20:04:13 +0000 (21:04 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 26 Jan 2023 07:52:34 +0000 (08:52 +0100)
commit032116bbe152594f5528683c671a04259e6b4ed7
treef3a32ec3ed3edc81dac3e7cba3ea7f70b0d1ab57
parent643231b28380c9e9cba11675ef8f480016feaec3
drm/fbdev-generic: Minimize client unregistering

For uninitialized framebuffers, only release the DRM client and
free the fbdev memory. Do not attempt to clean up the framebuffer.

DRM fbdev clients have a two-step initialization: first create
the DRM client; then create the framebuffer device on the first
successful hotplug event. In cases where the client never creates
the framebuffer, only the client state needs to be released. We
can detect which case it is, full or client-only cleanup, by
looking at the presence of fb_helper's info field.

v3:
* fix typo in commit message (Javier)
* release client before unpreparing fbdev
v2:
* remove test for (fbi != NULL) in drm_fbdev_cleanup() (Sam)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125200415.14123-9-tzimmermann@suse.de
drivers/gpu/drm/drm_fbdev_generic.c