Index | Thread | Search

From:
Paul Fertser <fercerpav@gmail.com>
Subject:
Fix simplefb colours for BPP16 and BPP24
To:
tech@openbsd.org
Date:
Sun, 3 Nov 2024 03:15:27 +0300

Download raw body.

Thread
Hi,

rasops defaults to BGR arrangements for all bit depths so the colour
offsets need to be specified explicitly for RGB formats.

diff --git sys/dev/fdt/simplefb.c sys/dev/fdt/simplefb.c
index 48c00d3d8..1c2cb7c2b 100644
--- sys/dev/fdt/simplefb.c
+++ sys/dev/fdt/simplefb.c
@@ -47,10 +47,10 @@ struct simplefb_format {
  * rasops defaults.
  */
 const struct simplefb_format simplefb_formats[] = {
-	{ "r5g6b5", 16 },
-	{ "x1r5g5b5", 15 },
-	{ "a1r5g5b5", 15 },
-	{ "r8g8b8", 24 },
+	{ "r5g6b5", 16, 11, 5, 5, 6, 0, 5 },
+	{ "x1r5g5b5", 15, 10, 5, 5, 5, 0, 5 },
+	{ "a1r5g5b5", 15, 10, 5, 5, 5, 0, 5 },
+	{ "r8g8b8", 24, 16, 8, 8, 8, 0, 8 },
 	{ "x8r8g8b8", 32, 16, 8, 8, 8, 0, 8 },
 	{ "a8r8g8b8", 32, 16, 8, 8, 8, 0, 8 },
 	{ "x8b8g8r8", 32 },