All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Zielinski <grim@undead.cc>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Frame Buffer Device Development
	<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: 2.6 fbcon and 15/16 bpp
Date: Tue, 23 Dec 2003 18:16:51 -0500	[thread overview]
Message-ID: <3FE8CCE3.4010709@undead.cc> (raw)
In-Reply-To: <1070410792.21174.83.camel@gaston>

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

Benjamin Herrenschmidt wrote:

>>Little.  It's an single processor Athalon box.  I'll do the test later 
>>tonight as I don't want to reboot the other machine at the moment.
>>    
>>
>
>Ok, so this isn't an endian problem in the cfb_ routines. Thanks.
>I'll try to figure out what's up here as well later this week, I'm
>a bit too busy with other things at the moment.
>
>Ben.
>  
>

Here's a patch that fixed things on my machine.  I found it by trial and 
error since I don't have a hardware reference document and the code is a 
little confusing to me.  I don't know if this is the root cause or just 
a fix for the symptoms.  Changing the u16's to u32's fixed the verticle 
grille appearance and most of the color corruption.  Commenting out that 
small block of code fixed the rest of the color problems.

I have a few questions.  Why are we going through the palette instead of 
just writing the proper directcolor/truecolor bitvalues for that color?  
Does that have to do with the disabled HW acceleration code?   Or is it 
because the hw palette color components are 8 bits wide so the displayed 
colors are more accurate?

And the code that I commented out, why is it accesing palette array 
elements that have been set on a previous call or haven't been set yet?  
Why is it trying to compensate for the wider green field when we're 
programming 8 bit values to the hw palette?

My understanding of the low level video hardware control is very limited 
beyond standard VGA register programming so I'm hoping to learn 
something with all my questions.  :)

John


[-- Attachment #2: patch.16bppfix --]
[-- Type: text/plain, Size: 1462 bytes --]

diff -urNX dontdiff linux.old/drivers/video/aty/radeon_base.c linux/drivers/video/aty/radeon_base.c
--- linux.old/drivers/video/aty/radeon_base.c	2003-12-21 17:54:33.000000000 -0500
+++ linux/drivers/video/aty/radeon_base.c	2003-12-23 17:41:07.000000000 -0500
@@ -1179,12 +1179,12 @@
 				return 1;
 
 			/* For 565, the green component is mixed one order below */
-			if (rinfo->depth == 16) {
-		                OUTREG(PALETTE_INDEX, pindex>>1);
-	       	         	OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) |
-	                        	(green << 8) | (rinfo->palette[regno>>1].blue));
-	                	green = rinfo->palette[regno<<1].green;
-	        	}
+//			if (rinfo->depth == 16) {
+//		                OUTREG(PALETTE_INDEX, pindex>>1);
+//	       	         	OUTREG(PALETTE_DATA, (rinfo->palette[regno>>1].red << 16) |
+//	                        	(green << 8) | (rinfo->palette[regno>>1].blue));
+//	                	green = rinfo->palette[regno<<1].green;
+//	        	}
 		}
 
 		if (rinfo->depth != 16 || regno < 32) {
@@ -1197,11 +1197,11 @@
  	if (regno < 16) {
         	switch (rinfo->depth) {
 		case 15:
-			((u16 *) (info->pseudo_palette))[regno] =
+			((u32 *) (info->pseudo_palette))[regno] =
 			    (regno << 10) | (regno << 5) | regno;
 			break;
 		case 16:
-			((u16 *) (info->pseudo_palette))[regno] =
+			((u32 *) (info->pseudo_palette))[regno] =
 			    (regno << 11) | (regno << 6) | regno;
 			break;
 		case 24:

  parent reply	other threads:[~2003-12-23 23:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-02  7:04 2.6 fbcon and 15/16 bpp Benjamin Herrenschmidt
2003-12-02  7:32 ` John Zielinski
2003-12-02 22:22   ` Benjamin Herrenschmidt
2003-12-02 22:53     ` John Zielinski
2003-12-03  0:19       ` Benjamin Herrenschmidt
2003-12-10  6:43         ` John Zielinski
2003-12-23 23:16         ` John Zielinski [this message]
2003-12-24  1:45           ` Benjamin Herrenschmidt
2003-12-24  2:54             ` John Zielinski
2003-12-24  3:31               ` Benjamin Herrenschmidt
2003-12-24  4:45                 ` John Zielinski
2003-12-24  5:23                   ` Benjamin Herrenschmidt
2003-12-24  6:02                     ` John Zielinski
2003-12-24 12:10                       ` Geert Uytterhoeven
2003-12-24 21:34                         ` John Zielinski
2003-12-24 22:44                           ` Benjamin Herrenschmidt
2003-12-25  0:55                             ` John Zielinski
2003-12-26 11:01                             ` Geert Uytterhoeven
2003-12-24 12:08             ` Geert Uytterhoeven

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=3FE8CCE3.4010709@undead.cc \
    --to=grim@undead.cc \
    --cc=benh@kernel.crashing.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.