]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/sysfb: Lookup blit function during atomic check
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 18 Sep 2025 15:39:50 +0000 (17:39 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 23 Sep 2025 13:06:06 +0000 (15:06 +0200)
commitcb71de092553b8bde210da686909a8ea0eab0d11
treebbeaf870e4e8d05088468f6623bccee53947e83e
parente45f72b6782f88ed50932033ad206df5dd3d7103
drm/sysfb: Lookup blit function during atomic check

Some configurations of sysfb outputs require format conversion from
framebuffer to scanout buffer. It is a driver bug if the conversion
helper is missing, yet it might happen on odd scanout formats. The old
code, based on drm_fb_blit(), only detects this situation during the
commit's hardware update, which is too late to abort the update.

Lookup the correct blit helper as part of the check phase. Then store
it in the sysfb plane state. Allows for detection of a missing helper
before the commit has started. Also avoids drm_fb_blit()'s large switch
statement on each updated scanline. Only a single lookup has to be done.

The lookup is in drm_sysfb_get_blit_func(), which only tracks formats
supported by sysfb drivers.

The lookup happens in sysfb's begin_fb_access helper instead of its
atomic_check helper. This allows vesadrm, and possibly other drivers,
to implement their own atomic_check without interfering with blit
lookups. Vesadrm implements XRGB8888 on top of R8 formats with the
help of the atomic_check. Doing the blit lookup in begin_fb_access then
always uses the correct CRTC format on all drivers.

v2:
- vesadrm: use drm_sysfb_plane_helper_begin_fb_access()
- fix type in commit description (Javier)

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