summaryrefslogtreecommitdiff
path: root/drivers/video/video_bmp.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-19 13:23:59 -0700
committerAnatolij Gustschin <agust@denx.de>2021-12-26 23:23:52 +0100
commit4ea15482101bd2ef6d2086b1a8afb255de2e65e5 (patch)
treef9635b0e9e7a91c53c8b1d643fe764cad8f3b1bf /drivers/video/video_bmp.c
parentc1cad06f69a8f3207bdb20ad038db930c0f5c139 (diff)
downloadu-boot-4ea15482101bd2ef6d2086b1a8afb255de2e65e5.tar.gz
u-boot-4ea15482101bd2ef6d2086b1a8afb255de2e65e5.tar.bz2
u-boot-4ea15482101bd2ef6d2086b1a8afb255de2e65e5.zip
video: theadorable: Use RGB565 for BMP blitting
At present this uses RGB555 format for blitting to a display. Sandbox uses 565 and that seems to be more normal for BMP as well. Update the code accordingly and add a test. Note that this likely breaks the theadorable board so we may need to discuss supporting both formats. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/video_bmp.c')
-rw-r--r--drivers/video/video_bmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index ba36589eff..1c61356765 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -338,9 +338,9 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
if (bpix == 16) {
- /* 16bit 555RGB format */
- *(u16 *)fb = ((bmap[2] >> 3) << 10) |
- ((bmap[1] >> 3) << 5) |
+ /* 16bit 565RGB format */
+ *(u16 *)fb = ((bmap[2] >> 3) << 11) |
+ ((bmap[1] >> 2) << 5) |
(bmap[0] >> 3);
bmap += 3;
fb += 2;