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>
This commit is contained in:
committed by
Anatolij Gustschin
parent
c1cad06f69
commit
4ea1548210
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user