public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Campbell <jon@nerdgrounds.com>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: ATI Radeon DIRECTCOLOR -> TRUECOLOR patch
Date: Wed, 25 Feb 2009 03:24:35 -0800	[thread overview]
Message-ID: <49A52A73.2000406@nerdgrounds.com> (raw)

I wrote this patch several months ago against 2.6.27.4 out of personal 
preference (I don't think radeonfb has changed enough that it would fail 
against the current 2.6.28 all that much):

I'm pasting the URL here to avoid another round of discussion on whether 
or not my Mozilla Thunderbird client is mangling the patch:
http://nerdgrounds.com/linux-patches/linux-aty-force-truecolor.patch

I don't know about you but when I ask the framebuffer to set up 16-bit 
or 32-bit RGB modes I expect a video mode to be set up with R, G, and B 
mapped linearly so that I can display images properly, not some odd 
"directcolor" mode that seems to serve no other purpose than to avoid a 
few shifts converting the fbcon palette to an RGB triplet.

Looking at radeonfb: setting the framebuffer palette is accomplished by 
converting fbcon's RGB to 16bpp and storing that in a lookup table. 
Rendering of text for fbcon is done by referring to that lookup table, 
because radeonfb provides the 16bpp RGB values. So what exactly is 
abusing the palette/gamma registers to make a nonstandard RGB ramp 
supposed to accomplish? Is something like this that might make an 
infrequently called function like setcolor() 10 nanoseconds faster 
really worth it?

When my software running and periodically showing what dvgrab last wrote 
to disk the last thing I want clients to see when walking by is a bad 
acid trip rendition of what we're filming on camera just because 
radeonfb decided to use DIRECTCOLOR and some weird RGB ramp.

This patch changes radeonfb to remove DIRECTCOLOR behavior and act like 
a proper TRUECOLOR framebuffer. I consider it a cleaner option than 
having to use KD_GRAPHICS (XFree86), which locks out the framebuffer 
console, or CMAP ioctls (mplayer), which makes the mapping correct but 
then makes the framebuffer console's text dark purple and hard to see.

So far I've tested on three machines that I know have ATI-based video 
chipsets:
     An AMD64 dual-core 32-bit system, and two ppc-based machines, one a 
mac mini and the other a Powerbook G4.

If anyone still needs this weird DIRECTCOLOR behavior I'd be willing to 
make the patch into one that allows you to choose as an option in "make 
menuconfig"

and... a quick glance reveals that nvidiafb pulls this stunt too. anyone 
want a patch for that too?


             reply	other threads:[~2009-02-25 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 11:24 Jonathan Campbell [this message]
2009-02-25 11:57 ` ATI Radeon DIRECTCOLOR -> TRUECOLOR patch David Miller
2009-02-25 20:42   ` Benjamin Herrenschmidt
2009-02-25 21:00     ` Jonathan Campbell
     [not found]     ` <49A5B150.8070703@nerdgrounds.com>
2009-02-26  2:18       ` Benjamin Herrenschmidt

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=49A52A73.2000406@nerdgrounds.com \
    --to=jon@nerdgrounds.com \
    --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