drm/fb-helper: Add support for DRM_FORMAT_C[124]
authorGeert Uytterhoeven <geert@linux-m68k.org>
Fri, 8 Jul 2022 18:20:51 +0000 (20:20 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Sat, 9 Jul 2022 13:07:09 +0000 (15:07 +0200)
commitba71593217b5b03c9e3385b268ff8613a71fc6ce
tree5bdab1b2711c00662c6ee1a8df46ecd86d281ccd
parente5bd7e3e4a68f0befe53f59954b25eec9a792d60
drm/fb-helper: Add support for DRM_FORMAT_C[124]

Add support for color-indexed frame buffer formats with two, four, and
sixteen colors to the DRM framebuffer helper functions:
  1. Add support for 1, 2, and 4 bits per pixel to the damage helper,
  2. For color-indexed modes, the length of the color bitfields must be
     set to the color depth, else the logo code may pick a logo with too
     many colors.  Drop the incorrect DAC width comment, which
     originates from the i915 driver.
  3. Accept C[124] modes when validating or filling in struct
     fb_var_screeninfo, and use the correct number of bits per pixel.
  4. Set the visual to FB_VISUAL_PSEUDOCOLOR for all color-indexed
     modes.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/db3e80b445df661ff0cd7e698507a8d24a4c867e.1657294931.git.geert@linux-m68k.org
drivers/gpu/drm/drm_fb_helper.c