diff options
| author | Linus Walleij <triad@df.lth.se> | 2012-07-01 22:34:42 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-07-07 19:58:15 +0200 |
| commit | b5c7220e7b2b6611fe5beca494c67bfe51fcfafb (patch) | |
| tree | ce818cd017121a94e49fcabecfdcdd169279f4db /util-linux | |
| parent | 5345b8db8b30326d9ab0db9ac11fde9e7b9d3686 (diff) | |
| download | busybox-w32-b5c7220e7b2b6611fe5beca494c67bfe51fcfafb.tar.gz busybox-w32-b5c7220e7b2b6611fe5beca494c67bfe51fcfafb.tar.bz2 busybox-w32-b5c7220e7b2b6611fe5beca494c67bfe51fcfafb.zip | |
fbset: respect rgba configuration lines in fb.modes
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@df.lth.se>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
| -rw-r--r-- | 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 196c2aa24..e9aacce4f 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, | |||
| 271 | } | 271 | } |
| 272 | p = token[1]; | 272 | p = token[1]; |
| 273 | i = index_in_strings( | 273 | i = index_in_strings( |
| 274 | "geometry\0timings\0interlaced\0double\0vsync\0hsync\0csync\0extsync\0", | 274 | "geometry\0timings\0interlaced\0double\0vsync\0hsync\0csync\0extsync\0rgba\0", |
| 275 | token[0]); | 275 | token[0]); |
| 276 | switch (i) { | 276 | switch (i) { |
| 277 | case 0: | 277 | case 0: |
| @@ -342,6 +342,30 @@ static int read_mode_db(struct fb_var_screeninfo *base, const char *fn, | |||
| 342 | ss(&base->sync, FB_SYNC_EXT, p, "false"); | 342 | ss(&base->sync, FB_SYNC_EXT, p, "false"); |
| 343 | //bb_info_msg("EXTSYNC[%s]", p); | 343 | //bb_info_msg("EXTSYNC[%s]", p); |
| 344 | break; | 344 | break; |
| 345 | case 8: { | ||
| 346 | int red_offset, red_length; | ||
| 347 | int green_offset, green_length; | ||
| 348 | int blue_offset, blue_length; | ||
| 349 | int transp_offset, transp_length; | ||
| 350 | |||
| 351 | sscanf(p, "%d/%d,%d/%d,%d/%d,%d/%d", | ||
| 352 | &red_offset, &red_length, | ||
| 353 | &green_offset, &green_length, | ||
| 354 | &blue_offset, &blue_length, | ||
| 355 | &transp_offset, &transp_length); | ||
| 356 | base->red.offset = red_offset; | ||
| 357 | base->red.length = red_length; | ||
| 358 | base->red.msb_right = 0; | ||
| 359 | base->green.offset = green_offset; | ||
| 360 | base->green.length = green_length; | ||
| 361 | base->green.msb_right = 0; | ||
| 362 | base->blue.offset = blue_offset; | ||
| 363 | base->blue.length = blue_length; | ||
| 364 | base->blue.msb_right = 0; | ||
| 365 | base->transp.offset = transp_offset; | ||
| 366 | base->transp.length = transp_length; | ||
| 367 | base->transp.msb_right = 0; | ||
| 368 | } | ||
| 345 | } | 369 | } |
| 346 | } | 370 | } |
| 347 | return 0; | 371 | return 0; |
