[PATCH 1/2] fbdev: simplefb: Add mono framebuffer format
- From
- Sebastian Raase <hidden>
- Date
- 2026-11-04 02:35:25
- Also in
- dri-devel, linux-devicetree, lkml
- Reply to
- Sebastian Raase, 2026-11-04
Add a new simple-framebuffer format for monochrome 1 bit-per-pixel
framebuffers. Monochrome framebuffers are not true color, so their
visual is set to FB_VISUAL_MONO10 (set pixels are bright).
Signed-off-by: Sebastian Raase <redacted>
---
drivers/video/fbdev/simplefb.c | 2 ++
include/linux/platform_data/simplefb.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 60e5dcec201f..4662101885ec 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c@@ -583,6 +583,8 @@ static int simplefb_probe(struct platform_device *pdev) info->fix.smem_start = mem->start; info->fix.smem_len = resource_size(mem); info->fix.line_length = params.stride; + if (params.format->bits_per_pixel == 1) + info->fix.visual = FB_VISUAL_MONO10; info->var = simplefb_var; info->var.xres = params.width;
diff --git a/include/linux/platform_data/simplefb.h b/include/linux/platform_data/simplefb.h
index 4f94d52ac99f..9b6d822145c9 100644
--- a/include/linux/platform_data/simplefb.h
+++ b/include/linux/platform_data/simplefb.h@@ -15,6 +15,7 @@ /* format array, use it to initialize a "struct simplefb_format" array */ #define SIMPLEFB_FORMATS \ { \ + { "mono", 1, {0, 1}, {0, 1}, {0, 1}, {0, 0}, DRM_FORMAT_R1 }, \ { "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 }, \ { "r5g5b5a1", 16, {11, 5}, {6, 5}, {1, 5}, {0, 1}, DRM_FORMAT_RGBA5551 }, \ { "x1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {0, 0}, DRM_FORMAT_XRGB1555 }, \
--
2.47.3