dm: video: show correct colors in graphical console
Get RGB sequence in pixels right (swap blue and red). Do not set reserved bits. qemu-system-i386 -display sdl -vga virtio and qemu-system-i386 -display sdl -vga cirrus now display the similar colors (highlighting still missing) as qemu-system-i386 -nographic Testing is possible via setenv efi_selftest test output bootefi selftest Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5e62f82825
commit
3aeb0cbe12
@ -127,15 +127,14 @@ static void set_color(struct video_priv *priv, unsigned idx, unsigned *c)
|
|||||||
{
|
{
|
||||||
switch (priv->bpix) {
|
switch (priv->bpix) {
|
||||||
case VIDEO_BPP16:
|
case VIDEO_BPP16:
|
||||||
*c = ((colors[idx].r >> 3) << 0) |
|
*c = ((colors[idx].r >> 3) << 11) |
|
||||||
((colors[idx].g >> 2) << 5) |
|
((colors[idx].g >> 2) << 5) |
|
||||||
((colors[idx].b >> 3) << 11);
|
((colors[idx].b >> 3) << 0);
|
||||||
break;
|
break;
|
||||||
case VIDEO_BPP32:
|
case VIDEO_BPP32:
|
||||||
*c = 0xff000000 |
|
*c = (colors[idx].r << 16) |
|
||||||
(colors[idx].r << 0) |
|
(colors[idx].g << 8) |
|
||||||
(colors[idx].g << 8) |
|
(colors[idx].b << 0);
|
||||||
(colors[idx].b << 16);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* unsupported, leave current color in place */
|
/* unsupported, leave current color in place */
|
||||||
|
@ -186,7 +186,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts)
|
|||||||
/* test colors (30-37 fg color, 40-47 bg color) */
|
/* test colors (30-37 fg color, 40-47 bg color) */
|
||||||
vidconsole_put_string(con, ANSI_ESC"[30;41mfoo"); /* black on red */
|
vidconsole_put_string(con, ANSI_ESC"[30;41mfoo"); /* black on red */
|
||||||
vidconsole_put_string(con, ANSI_ESC"[33;44mbar"); /* yellow on blue */
|
vidconsole_put_string(con, ANSI_ESC"[33;44mbar"); /* yellow on blue */
|
||||||
ut_asserteq(268, compress_frame_buffer(dev));
|
ut_asserteq(267, compress_frame_buffer(dev));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user