• Thomas Zimmermann's avatar
    drm/fb-helper: Replace bpp/depth parameter by color mode · d3533a8a
    Thomas Zimmermann authored
    Replace the combination of bpp and depth with a single color-mode
    argument. Handle special cases in simpledrm and ofdrm. Hard-code
    XRGB8888 as fallback format for cases where no given format works.
    
    The color-mode argument accepts the same values as the kernel's video
    parameter. These are mostly bpp values between 1 and 32. The exceptions
    are 15, which has a color depth of 15 and a bpp value of 16; and 32,
    which has a color depth of 24 and a bpp value of 32.
    
    v4:
    	* add back lost test for bpp_specified (Maira)
    	* add Fixes tag (Daniel)
    v3:
    	* fix ofdrm build (Maxime)
    v2:
    	* minimize changes (Daniel)
    	* use drm_driver_legacy_fb_format() (Daniel)
    Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Tested-by: Maíra Canal <mcanal@igalia.com> # vc4 and vkms
    Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Fixes: 37c90d58 ("drm/fb-helper: Fix single-probe color-format selection")
    Cc: Thomas Zimmermann <tzimmermann@suse.de>
    Cc: Javier Martinez Canillas <javierm@redhat.com>
    Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Cc: Maxime Ripard <mripard@kernel.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230106112324.22055-1-tzimmermann@suse.de
    d3533a8a
drm_fb_helper.c 65.7 KB