[U-Boot] Wired cursor colors....
Reinhard Arlt
reinhard.arlt at esd.eu
Fri Mar 21 14:54:04 CET 2014
Hello,
here is an idea, how to fix the
void video_invertchar(int xx, int yy)
routine in
cfb_console.c
This is not a patch yet, just a idea.
Reinhard
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..33d5a2c 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -619,8 +619,37 @@ static void video_invertchar(int xx, int yy)
int x, y;
for (y = firsty; y < lasty; y += VIDEO_LINE_LEN) {
for (x = firstx; x < lastx; x++) {
- u8 *dest = (u8 *)(video_fb_address) + x + y;
- *dest = ~*dest;
+ u8 *dest8;
+ u16 *dest16;
+ u32 *dest32;
+
+ switch (VIDEO_DATA_FORMAT) {
+ case GDF__8BIT_INDEX:
+ dest8 = (u8 *)(video_fb_address) + x + y;
+
+ *dest8 ^= 0x01;
+ break;
+
+ case GDF__8BIT_332RGB:
+ dest8 = (u8 *)(video_fb_address) + x + y;
+
+ *dest8 = ~*dest8;
+ break;
+
+ case GDF_15BIT_555RGB:
+ case GDF_16BIT_565RGB:
+ dest16 = (u16 *)(video_fb_address) + x + y;
+
+ *dest16 = ~*dest16;
+ break;
+
+ case GDF_32BIT_X888RGB:
+ case GDF_24BIT_888RGB:
+ dest32 = (u32 *)(video_fb_address) + x + y;
+
+ *dest32 = ~*dest32;
+ break;
+ }
}
}
}
More information about the U-Boot
mailing list