linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] inivisible cursor on vesafb
@ 2002-08-18 23:05 Petr Vandrovec
  2002-08-19  1:10 ` Antonino Daplas
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vandrovec @ 2002-08-18 23:05 UTC (permalink / raw)
  To: torvalds; +Cc: linux-fbdev-devel

Hi Linus,

Since vesafb was converted to the (strange) cfb* interface, it uses random
colors for the cursor, making cursor invisible when console uses black foreground
(f.e. Midnight Commander does that). Problem is common to all fbdevs which
use fbcon-accel interface.

This change tries to restore old behavior which existed before cfb* came in.
Unfortunately due to region.color semantic it is not possible to completely
restore previous behavior - 
+ for truecolor cfbfillrect always consults current palette, so we do not 
  have "always invert" constant available, and so we do inversion with palette
  color 15 (it is light white, ~0, by default)
+ for directcolor it assumes that display has at least 4 bits per color.
+ for pseudocolor it works as old code worked.

						Thanks,
							Petr Vandrovec
							vandrove@vc.cvut.cz


diff -urdN linux/drivers/video/fbcon-accel.c linux/drivers/video/fbcon-accel.c
--- linux/drivers/video/fbcon-accel.c	2002-08-18 01:35:06.000000000 +0200
+++ linux/drivers/video/fbcon-accel.c	2002-08-18 15:07:42.000000000 +0200
@@ -104,7 +104,10 @@
 	struct fb_info *info = p->fb_info;
 	struct fb_fillrect region;
 
-	region.color = attr_fgcol_ec(p, p->conp);
+	if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR || info->fix.visual == FB_VISUAL_TRUECOLOR)
+		region.color = 0x0F;
+	else
+		region.color = (0x0F << info->var.red.offset) | (0x0F << info->var.green.offset) | (0x0F << info->var.blue.offset);
 	region.dx = xx * fontwidth(p);
 	region.dy = yy * fontheight(p);
 	region.width  = fontwidth(p);


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] inivisible cursor on vesafb
  2002-08-18 23:05 [PATCH] inivisible cursor on vesafb Petr Vandrovec
@ 2002-08-19  1:10 ` Antonino Daplas
  0 siblings, 0 replies; 2+ messages in thread
From: Antonino Daplas @ 2002-08-19  1:10 UTC (permalink / raw)
  To: fbdev

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

On Mon, 2002-08-19 at 07:05, Petr Vandrovec wrote:
> Hi Linus,
> 
> Since vesafb was converted to the (strange) cfb* interface, it uses random
> colors for the cursor, making cursor invisible when console uses black foreground
> (f.e. Midnight Commander does that). Problem is common to all fbdevs which
> use fbcon-accel interface.
> 
> This change tries to restore old behavior which existed before cfb* came in.
> Unfortunately due to region.color semantic it is not possible to completely
> restore previous behavior - 
> + for truecolor cfbfillrect always consults current palette, so we do not 
>   have "always invert" constant available, and so we do inversion with palette
>   color 15 (it is light white, ~0, by default)
> + for directcolor it assumes that display has at least 4 bits per color.
> + for pseudocolor it works as old code worked.
> 

I think it has been agreed that all color entries in fbcon-accel should
always be an index to the pseudopalette regardless of the visuals.  So a
more consistent change is to have cfbfillrect look up the color from the
pseudopalette assuming that the driver correctly loaded the value to the
pseudopalette.



[-- Attachment #2: directcolor.diff --]
[-- Type: text/plain, Size: 470 bytes --]

--- cfbfillrect.c-orig	Mon Aug 19 00:46:03 2002
+++ cfbfillrect.c	Mon Aug 19 00:48:31 2002
@@ -52,7 +52,8 @@
 	start_index = ((unsigned long) dst1 & (bpl - 1));
 	end_index = ((unsigned long) (dst1 + n) & (bpl - 1));
 
-	if (p->fix.visual == FB_VISUAL_TRUECOLOR)
+	if (p->fix.visual == FB_VISUAL_TRUECOLOR || 
+	    p->fix.visual == FB_VISUAL_DIRECTCOLOR  )
 		fg = fgcolor = ((u32 *) (p->pseudo_palette))[rect->color];
 	else
 		fg = fgcolor = rect->color;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-19  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-18 23:05 [PATCH] inivisible cursor on vesafb Petr Vandrovec
2002-08-19  1:10 ` Antonino Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).