drm/sysfb: Merge primary-plane functions
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 1 Apr 2025 09:37:14 +0000 (11:37 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 7 Apr 2025 09:02:07 +0000 (11:02 +0200)
commit177dfbdb7e67db24d86dbd41cde20813d6e820cc
tree84aa63bc0130359a49655bceee78253c8897dbe5
parentea86aba47c3a724ea18a26ad498c1835f087dc63
drm/sysfb: Merge primary-plane functions

Merge the primary plane code of ofdrm and simpledrm. Replace the
plane implementation in each driver with the shared helpers. Set
up driver callbacks and format modifiers with initializer macros.

The plane code in ofdrm and simpledrm is very similar. Ofdrm has a
more sophisticated implementation of atomic_disable, which clears
individual scanlines. The code in simpledrm clears the whole buffer
at once. Take the ofdrm version.

Simpledrm supports get_scanout_buffer. Import it into the shared
helpers, which makes it available in ofdrm.

The supported formats are all native formats plus an optional enulated
XRGB8888 if that's not already a native format. Provide an initializer
macro that computes the size of the formats array.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250401094056.32904-12-tzimmermann@suse.de
drivers/gpu/drm/sysfb/drm_sysfb_helper.c
drivers/gpu/drm/sysfb/drm_sysfb_helper.h
drivers/gpu/drm/sysfb/ofdrm.c
drivers/gpu/drm/sysfb/simpledrm.c