[U-Boot] Wired cursor colors....

Reinhard Arlt reinhard.arlt at esd.eu
Fri Mar 21 13:17:33 CET 2014


Hello,

if have updated the u-boot for the cpci750 recently.

If i use the console on the CPCI-DVI VGA graphic board, i now get 
strange coursor colors.

I have investigated the problem, and find out, that with commit

03d31fcf4c37d90a00e66f06b38742960139f090

video: cfb_console: Make the software cursor non-destructive

the software cursor handling is change dramatic.

I my opinion, it is broken now for most pixel format.

The routine

static void video_invertchar(int xx, int yy)

handle only framebuffer with 8 bit data per pixel, and if even in 8 bit 
per pixel mode, it do not work for, if you use GDF__8BIT_332RGB mode.

In GDF__8BIT_INDEX mode, there are only entries in the CLUT for index 
0x00  and 0x01. So inverting a pixel from 0x00 to 0xff results in 
displaying typical uninitialized CLUT entry, so we get a cursor with a 
random color.

I do not have graphic hardware to test all possible cases for a tested 
patch, so how can we proceed fix this problem?

In GDF__8BIT_INDEX mode, the correct handling would be

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..344d2b6 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -620,7 +620,11 @@ static void video_invertchar(int xx, int yy)
  	for (y = firsty; y < lasty; y += VIDEO_LINE_LEN) {
  		for (x = firstx; x < lastx; x++) {
  			u8 *dest = (u8 *)(video_fb_address) + x + y;
+#if 0
  			*dest = ~*dest;
+#else
+			*dest ^= 0x01;
+#endif
  		}
  	}
  }

but this break all other graphic mode of course.

Kind regards

Reinhard Arlt


More information about the U-Boot mailing list