* PATCH: tdfxfb palette fix for 2.6.0-test2
@ 2003-07-29 22:14 Jakub Bogusz
2003-07-29 22:26 ` James Simmons
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Bogusz @ 2003-07-29 22:14 UTC (permalink / raw)
To: linux-fbdev-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
Hello,
In 2.6.0-test2 text palette is broken in 16/24/32bpp modes on tdfxfb
console (because of not using component length information).
This patch fixes it; see also note inside.
--
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/
PLD Linux http://www.pld-linux.org/
[-- Attachment #2: linux-tdfxfb-palette.patch --]
[-- Type: text/plain, Size: 1379 bytes --]
This fixes palette used for text in 16/24/32bpp modes on tdfxfb console.
Note that pseudo_palette is always referenced as array od 32-bit uints
in cfbimgblt.c, regardless of current bpp.
--- linux-2.6.0-test2/drivers/video/tdfxfb.c.orig 2003-07-14 05:32:29.000000000 +0200
+++ linux-2.6.0-test2/drivers/video/tdfxfb.c 2003-07-29 23:42:07.000000000 +0200
@@ -559,6 +559,8 @@
var->red.length = var->green.length = var->blue.length = 8;
break;
}
+ var->transp.offset = 32;
+ var->transp.length = 0;
var->height = var->width = -1;
var->accel_flags = FB_ACCELF_TEXT;
@@ -788,14 +790,10 @@
break;
/* Truecolor has no hardware color palettes. */
case FB_VISUAL_TRUECOLOR:
- rgbcol = (red << info->var.red.offset) |
- (green << info->var.green.offset) |
- (blue << info->var.blue.offset) |
- (transp << info->var.transp.offset);
- if (info->var.bits_per_pixel <= 16)
- ((u16*)(info->pseudo_palette))[regno] = rgbcol;
- else
- ((u32*)(info->pseudo_palette))[regno] = rgbcol;
+ rgbcol = ((red >> (16 - info->var.red.length)) << info->var.red.offset) |
+ ((green >> (16 - info->var.green.length)) << info->var.green.offset) |
+ ((blue >> (16 - info->var.blue.length)) << info->var.blue.offset);
+ ((u32*)(info->pseudo_palette))[regno] = rgbcol;
break;
default:
DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: tdfxfb palette fix for 2.6.0-test2
2003-07-29 22:14 PATCH: tdfxfb palette fix for 2.6.0-test2 Jakub Bogusz
@ 2003-07-29 22:26 ` James Simmons
0 siblings, 0 replies; 2+ messages in thread
From: James Simmons @ 2003-07-29 22:26 UTC (permalink / raw)
To: Jakub Bogusz; +Cc: linux-fbdev-devel, linux-kernel
I have patches that fix this. I will make a new patch soon against
test 2.
> Hello,
>
> In 2.6.0-test2 text palette is broken in 16/24/32bpp modes on tdfxfb
> console (because of not using component length information).
> This patch fixes it; see also note inside.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-07-29 22:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 22:14 PATCH: tdfxfb palette fix for 2.6.0-test2 Jakub Bogusz
2003-07-29 22:26 ` James Simmons
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).