The goal with this series is to add support for 2bit grayscale with the xrgb8888 pixel format for the st7571 display controller.
The first patch only corrects a comment of the pixel format. The next four patches adds support for inverting pixels. This is necessary as the connected display may or may not use the "right" (0 => black, 1 => white) pixel format expected by the supported formats (R1/R2/XRGB8888). The fifth patch adds a helper function (drm_fb_xrgb8888_to_gray2) to convert xrgb8888 to gray2. The last path adds support for gray2 in the st7571 driver. Compare the mono [1] and the gray2 [2] variants of our penguin. [1] https://www.marcusfolkesson.se/gray2.png [2] https://www.marcusfolkesson.se/xrgb8888.png Signed-off-by: Marcus Folkesson <[email protected]> --- Changes in v2: - Do not share code between _to_mono() and _to_gray2() - Correct formatting (remove "|") in the dt bindings - Implement support for inverting pixels for st7567 - Link to v1: https://lore.kernel.org/r/[email protected] --- Marcus Folkesson (6): drm/st7571-i2c: correct pixel data format description dt-bindings: display: sitronix,st7571: add optional inverted property dt-bindings: display: sitronix,st7567: add optional inverted property drm/st7571-i2c: add support for inverted pixel format drm/format-helper: introduce drm_fb_xrgb8888_to_gray2() drm/st7571-i2c: add support for 2bit grayscale for XRGB8888 .../bindings/display/sitronix,st7567.yaml | 5 + .../bindings/display/sitronix,st7571.yaml | 5 + drivers/gpu/drm/drm_format_helper.c | 108 +++++++++++++++++++++ drivers/gpu/drm/sitronix/st7571-i2c.c | 41 ++++---- include/drm/drm_format_helper.h | 4 + 5 files changed, 144 insertions(+), 19 deletions(-) --- base-commit: ca2a6abdaee43808034cdb218428d2ed85fd3db8 change-id: 20250520-st7571-format-2ce6badc48c6 Best regards, -- Marcus Folkesson <[email protected]>
