Module Name:    src
Committed By:   macallan
Date:           Thu Apr 12 18:55:26 UTC 2012

Modified Files:
        src/sys/dev/pci: radeonfb.c

Log Message:
- set colour channel info only in 32bit colour
- fix comment ( don't claim to run in some byte-swapped mode when we don't )


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/radeonfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.60 src/sys/dev/pci/radeonfb.c:1.61
--- src/sys/dev/pci/radeonfb.c:1.60	Mon Mar 26 21:59:01 2012
+++ src/sys/dev/pci/radeonfb.c	Thu Apr 12 18:55:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.60 2012/03/26 21:59:01 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.60 2012/03/26 21:59:01 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2221,23 +2221,27 @@ radeonfb_init_screen(void *cookie, struc
 	if (ri->ri_depth == 32) {
 		ri->ri_flg |= RI_ENABLE_ALPHA;
 	}
-	if (ri->ri_depth == 8) {
-		ri->ri_flg |= RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
+	switch (ri->ri_depth) {
+		case 8:
+			ri->ri_flg |= RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
+			break;
+		case 32:
+			/* we run radeons in RGB even on SPARC hardware */
+			ri->ri_rnum = 8;
+			ri->ri_gnum = 8;
+			ri->ri_bnum = 8;
+			ri->ri_rpos = 16;
+			ri->ri_gpos = 8;
+			ri->ri_bpos = 0;
+			break;
 	}
+
 	ri->ri_bits = (void *)dp->rd_fbptr;
 
 #ifdef VCONS_DRAW_INTR
 	scr->scr_flags |= VCONS_DONT_READ;
 #endif
 
-	/* this is rgb in "big-endian order..." */
-	ri->ri_rnum = 8;
-	ri->ri_gnum = 8;
-	ri->ri_bnum = 8;
-	ri->ri_rpos = 16;
-	ri->ri_gpos = 8;
-	ri->ri_bpos = 0;
-
 	if (existing) {
 		ri->ri_flg |= RI_CLEAR;
 

Reply via email to