[git commit] fbset: respect rgba configuration lines in fb.modes

Denys Vlasenko vda.linux at googlemail.com
Sat Jul 7 17:58:15 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=b5c7220e7b2b6611fe5beca494c67bfe51fcfafb
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

The fbset utility would not respect "rgba" config entries in
the fb.modes file such as this (for the ARM Integrator/CP):

mode "640x480-60-clcd"
    # D: 25.175 MHz, H: 31.469 kHz, V: 59.94 Hz
    geometry 640 480 640 480 16
    timings 39722 48 16 33 10 96 2
    rgba 5/10,5/5,5/0,1/15
endmode

This is important especially for this ARGB5551 device which
is hopeless to configure otherwise. I noticed this lacking
feature after the TI "fbtest" program managed to set up the
the colormode correctly.

Signed-off-by: Linus Walleij <triad at df.lth.se>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/fbset.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 196c2aa..e9aacce 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -271,7 +271,7 @@ static int read_mode_db(struct fb_var_screeninfo *base, const char *fn,
 		}
 		p = token[1];
 		i = index_in_strings(
-			"geometry\0timings\0interlaced\0double\0vsync\0hsync\0csync\0extsync\0",
+			"geometry\0timings\0interlaced\0double\0vsync\0hsync\0csync\0extsync\0rgba\0",
 			token[0]);
 		switch (i) {
 		case 0:
@@ -342,6 +342,30 @@ static int read_mode_db(struct fb_var_screeninfo *base, const char *fn,
 			ss(&base->sync, FB_SYNC_EXT, p, "false");
 //bb_info_msg("EXTSYNC[%s]", p);
 			break;
+		case 8: {
+			int red_offset, red_length;
+			int green_offset, green_length;
+			int blue_offset, blue_length;
+			int transp_offset, transp_length;
+
+			sscanf(p, "%d/%d,%d/%d,%d/%d,%d/%d",
+				&red_offset, &red_length,
+				&green_offset, &green_length,
+				&blue_offset, &blue_length,
+				&transp_offset, &transp_length);
+			base->red.offset = red_offset;
+			base->red.length = red_length;
+			base->red.msb_right = 0;
+			base->green.offset = green_offset;
+			base->green.length = green_length;
+			base->green.msb_right = 0;
+			base->blue.offset = blue_offset;
+			base->blue.length = blue_length;
+			base->blue.msb_right = 0;
+			base->transp.offset = transp_offset;
+			base->transp.length = transp_length;
+			base->transp.msb_right = 0;
+		}
 		}
 	}
 	return 0;


More information about the busybox-cvs mailing list