summaryrefslogtreecommitdiff
path: root/drivers/video/cfb_console.c
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2017-03-06 01:13:38 +0000
committerAnatolij Gustschin <agust@denx.de>2017-03-07 21:18:23 +0100
commit1d4ed26fafb4250a1a9f9aba55de05062330ea5b (patch)
tree9b6a2e2c41744d19a5e36ea8b4b6a06e5a7f783e /drivers/video/cfb_console.c
parent3fd2b3aa19b9479b5e785087e4951d3a7bbb87be (diff)
video: cfb_console: fix 32-bit display on 64-bit architectures
"unsigned long" is a lousy data type when it comes to match peripheral hardware registers with a fixed size. Just do the obvious and match a 32-bit display format with an "u32" data type for casting. This fixes the logo display on 64-bit architectures, which produced a black line on the right side of the logo with non-black backgrounds. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/video/cfb_console.c')
-rw-r--r--drivers/video/cfb_console.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 3c0696eb11..d75abb660f 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1079,8 +1079,8 @@ __weak void video_set_lut(unsigned int index, unsigned char r,
}
#define FILL_32BIT_X888RGB(r,g,b) { \
- *(unsigned long *)fb = \
- SWAP32((unsigned long)(((r<<16) | \
+ *(u32 *)fb = \
+ SWAP32((unsigned int)(((r<<16) | \
(g<<8) | \
b))); \
fb += 4; \
@@ -1161,7 +1161,7 @@ static void draw_bitmap(uchar **fb, uchar *bm, struct palette *p,
break;
case GDF_32BIT_X888RGB:
for (i = 0; i < cnt; i++) {
- *(unsigned long *) addr = p[bm[*off]].ce.dw;
+ *(u32 *) addr = p[bm[*off]].ce.dw;
addr += 4;
}
break;
@@ -1825,8 +1825,8 @@ static void plot_logo_or_black(void *screen, int x, int y, int black)
(b >> 3)));
break;
case GDF_32BIT_X888RGB:
- *(unsigned long *) dest =
- SWAP32((unsigned long) (
+ *(u32 *) dest =
+ SWAP32((u32) (
(r << 16) |
(g << 8) |
b));