]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gma500: fbdev: Calculate buffer geometry with format helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 6 Feb 2026 13:21:56 +0000 (14:21 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 3 Mar 2026 08:28:50 +0000 (09:28 +0100)
commitaaea2359a6ba7442a4cacb66d915d66b618fe9b6
tree473275c2fddb16097f39704ba2a96ed3fb51b346
parentbbc1d2105481d47d2441ba061529c490ccb7f27f
drm/gma500: fbdev: Calculate buffer geometry with format helpers

Replace the geometry and size calculation in gma500's fbdev emulation
with DRM format helpers. This consists of 4CC lookup from the fbdev
parameters, format loockup, pitch calculation and size calculation.
Then allocate the GEM buffer object for the framebuffer memory from
the calculated size.

As before, fallback to 16-bit colors if the stolen memory is insufficient
for 32-bit colors. But look at the result from psb_gem_create() instead
of guessing before the allocation. The new method is more reliable when
others allocate from stolen video memory (e.g., cursors).

Set up mode_cmd with the calculated values just before allocating the
framebuffer. This code will later be replaced with a DRM client buffer.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patch.msgid.link/20260206133458.226467-4-tzimmermann@suse.de
drivers/gpu/drm/gma500/fbdev.c