diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-02-08 21:47:09 +0100 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2018-03-06 10:00:32 +0100 |
commit | 3aeb0cbe126849bd8aaa332a18b7ab2fe0699c02 (patch) | |
tree | e82b6a7b2d0f6ff3270f40a616b259c143a04665 /drivers/video/vidconsole-uclass.c | |
parent | 5e62f828256d66e2b28def4f9ef20a2a05c2d04f (diff) |
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>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 5f63c12d6c..8a2a377161 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -127,15 +127,14 @@ static void set_color(struct video_priv *priv, unsigned idx, unsigned *c) { switch (priv->bpix) { case VIDEO_BPP16: - *c = ((colors[idx].r >> 3) << 0) | - ((colors[idx].g >> 2) << 5) | - ((colors[idx].b >> 3) << 11); + *c = ((colors[idx].r >> 3) << 11) | + ((colors[idx].g >> 2) << 5) | + ((colors[idx].b >> 3) << 0); break; case VIDEO_BPP32: - *c = 0xff000000 | - (colors[idx].r << 0) | - (colors[idx].g << 8) | - (colors[idx].b << 16); + *c = (colors[idx].r << 16) | + (colors[idx].g << 8) | + (colors[idx].b << 0); break; default: /* unsupported, leave current color in place */ |