drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()
authorJavier Martinez Canillas <javierm@redhat.com>
Mon, 14 Feb 2022 13:37:06 +0000 (14:37 +0100)
committerJavier Martinez Canillas <javierm@redhat.com>
Wed, 16 Feb 2022 12:29:04 +0000 (13:29 +0100)
commitbcf8b616deb8794179e3e9c6233a53f42664afb2
tree061f4a873d7777ef66883657ad6183e74617011b
parent4a564e59bfb7732ec168f66ee77bf1eb81ff9319
drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()

Add support to convert from XR24 to reversed monochrome for drivers that
control monochromatic display panels, that only have 1 bit per pixel.

The function does a line-by-line conversion doing an intermediate step
first from XR24 to 8-bit grayscale and then to reversed monochrome.

The drm_fb_gray8_to_mono_reversed_line() helper was based on code from
drivers/gpu/drm/tiny/repaper.c driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220214133710.3278506-3-javierm@redhat.com
drivers/gpu/drm/drm_format_helper.c
include/drm/drm_format_helper.h