From: Jakub Bogusz <qboosh@pld.org.pl>
To: linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: PATCH: tdfxfb palette fix for 2.6.0-test2
Date: Wed, 30 Jul 2003 00:14:11 +0200 [thread overview]
Message-ID: <20030729221411.GA3434@satan.blackhosts> (raw)
[-- 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);
next reply other threads:[~2003-07-29 22:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-29 22:14 Jakub Bogusz [this message]
2003-07-29 22:26 ` PATCH: tdfxfb palette fix for 2.6.0-test2 James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030729221411.GA3434@satan.blackhosts \
--to=qboosh@pld.org.pl \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).