video: Add 30bpp support

Add support for 30bpp mode where pixels are picked in 32-bit
integers but use 10 bits instead of 8 bits for each component.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
This commit is contained in:
Mark Kettenis
2021-09-25 22:47:36 +02:00
committed by Anatolij Gustschin
parent 94e922c76a
commit 0efe41ca15
2 changed files with 17 additions and 3 deletions

View File

@@ -155,9 +155,14 @@ u32 vid_console_color(struct video_priv *priv, unsigned int idx)
break;
case VIDEO_BPP32:
if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
return (colors[idx].r << 16) |
(colors[idx].g << 8) |
(colors[idx].b << 0);
if (priv->format == VIDEO_X2R10G10B10)
return (colors[idx].r << 22) |
(colors[idx].g << 12) |
(colors[idx].b << 2);
else
return (colors[idx].r << 16) |
(colors[idx].g << 8) |
(colors[idx].b << 0);
}
break;
default: