summaryrefslogtreecommitdiff
path: root/drivers/video/vidconsole-uclass.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2021-09-25 22:47:36 +0200
committerAnatolij Gustschin <agust@denx.de>2021-10-09 18:43:51 +0200
commit0efe41ca158ef5b0e4457b4265f48860f382f3f8 (patch)
tree2b56fb9f8703236020f71a09ec8e8f37c065e901 /drivers/video/vidconsole-uclass.c
parent94e922c76a0e1fcdead3359e340f53fd0709a963 (diff)
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>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r--drivers/video/vidconsole-uclass.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 8132efa55a..f42db40d4c 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -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: