drm/gma500: Implement client-based fbdev emulation
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 13 Mar 2023 15:16:09 +0000 (16:16 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 20 Mar 2023 10:19:17 +0000 (11:19 +0100)
commit8f1aaccb04b7cf63135f4e2748226dfa2fb01e3f
treebc56a017f666912564a4db9141258feb6e502194
parentd19ccb4ca5436d7500f9fb47d71ea0bfecea52ce
drm/gma500: Implement client-based fbdev emulation

Implement fbdevemulation on top of struct drm_client and its helpers.
This ad-hoc interfaces for restoring and closing fbdev emulation with
per-client callback for hotplugging, restoring and unregistering.

A single function, psb_fbdev_setup(), starts fbdev emulation after
the DRM device has been registered. Hence, fbdev acts like a regular
DRM client.

The setup call only prepares the fbdev emulation. It then implements
connector hotplugging. The first successful hotplug event initializes
fbdev emulation.

Unregistering depends on the hotplugging. Fully initialized emulation
is cleaned up through drm_fb_helper_unregister_info() and fb_destroy.
For prepared-only setups, unregistering unprepares the emulation and
releases all resources. In both cases, fbdev emulation will be cleaned
up.

v2:
* declare empty setup function as 'static inline' (kernel
  test robot)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230313151610.14367-7-tzimmermann@suse.de
drivers/gpu/drm/gma500/fbdev.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/gma500/psb_drv.h