lkml.org 
[lkml]   [2003]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: tdfxfb palette fix for 2.6.0-test2
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/
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);
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.276 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site