Skip to contentSkip to conversation

radeonfb and newer radeons (Patch)

PATCH Claudio Ciccani 2 participants 3 messages Jul 22, 2006 – Jul 23, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,
the attached patch fixes some issues with R300 based chipsets and adds support for a number of new devices (mostly X800/X850). It also enlarges the mmio size to 0x8000 because many 3d registers of the R300 are located after offset 0x4000 and we need them for DirectFB (DRI needs too).
The patch applies to linux-2.6.18-rc2, hope there have not been changes in the meanwhile.

Signature · 6 lines
Regards,
     Claudio Ciccani

[email protected]
http://directfb.org
http://sf.net/projects/php-directfb
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +6 -12
@@ -203,9 +203,7 @@
 	host_path_cntl = INREG(HOST_PATH_CNTL);
 	rbbm_soft_reset = INREG(RBBM_SOFT_RESET);
 
-	if (rinfo->family == CHIP_FAMILY_R300 ||
-	    rinfo->family == CHIP_FAMILY_R350 ||
-	    rinfo->family == CHIP_FAMILY_RV350) {
+	if (IS_R300_VARIANT(rinfo)) {
 		u32 tmp;
 
 		OUTREG(RBBM_SOFT_RESET, (rbbm_soft_reset |
@@ -241,9 +239,7 @@
 	INREG(HOST_PATH_CNTL);
 	OUTREG(HOST_PATH_CNTL, host_path_cntl);
 
-	if (rinfo->family != CHIP_FAMILY_R300 ||
-	    rinfo->family != CHIP_FAMILY_R350 ||
-	    rinfo->family != CHIP_FAMILY_RV350)
+	if (IS_R300_VARIANT(rinfo))
 		OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset);
 
 	OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index);
@@ -254,16 +250,14 @@
 {
 	unsigned long temp;
 
-	/* disable 3D engine */
-	OUTREG(RB3D_CNTL, 0);
-
 	radeonfb_engine_reset(rinfo);
 
 	radeon_fifo_wait (1);
-	if ((rinfo->family != CHIP_FAMILY_R300) &&
-	    (rinfo->family != CHIP_FAMILY_R350) &&
-	    (rinfo->family != CHIP_FAMILY_RV350))
+	if (IS_R300_VARIANT(rinfo)) {
+		//OUTREG(RB2D_DSTCACHE_MODE, 1<<17);
+	} else {
 		OUTREG(RB2D_DSTCACHE_MODE, 0);
+	}
 
 	radeon_fifo_wait (3);
 	/* We re-read MC_FB_LOCATION from card as it can have been
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_base.c renamed from drivers/video/aty/radeon_base.c +110 -42

277 lines not on this page · raw message

usr/src/linux-2.6.18-rc2/drivers/video/aty/ati_ids.h renamed from drivers/video/aty/ati_ids.h +53 -21

106 lines not on this page · raw message

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeonfb.h renamed from drivers/video/aty/radeonfb.h +3 -1
@@ -47,7 +47,8 @@
 	CHIP_FAMILY_R350,
 	CHIP_FAMILY_RV350,
 	CHIP_FAMILY_RV380,    /* RV370/RV380/M22/M24 */
-	CHIP_FAMILY_R420,     /* R420/R423/M18 */
+	CHIP_FAMILY_RV410,
+	CHIP_FAMILY_R420,     /* R420/R423/R480/M18 */
 	CHIP_FAMILY_LAST,
 };
 
@@ -64,6 +65,7 @@
 				((rinfo)->family == CHIP_FAMILY_RV350) || \
 				((rinfo)->family == CHIP_FAMILY_R350)  || \
 				((rinfo)->family == CHIP_FAMILY_RV380) || \
+				((rinfo)->family == CHIP_FAMILY_RV410) || \
 				((rinfo)->family == CHIP_FAMILY_R420))
 
 /*
usr/src/linux-2.6.18-rc2/include/video/radeon.h renamed from include/video/radeon.h +1 -1
@@ -2,7 +2,7 @@
 #define _RADEON_H
 
 
-#define RADEON_REGSIZE			0x4000
+#define RADEON_REGSIZE			0x8000
 
 
 #define MM_INDEX                               0x0000  

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Linux-fbdev-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

#1 lore raw
Quoted 22 lines · Claudio Ciccani

the attached patch fixes some issues with R300 based chipsets and adds support for a number of new devices (mostly X800/X850). It also enlarges the mmio size to 0x8000 because many 3d registers of the R300 are located after offset 0x4000 and we need them for DirectFB (DRI needs too).
The patch applies to linux-2.6.18-rc2, hope there have not been changes in the meanwhile.

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +1 -3
@@ -203,9 +203,7 @@
 	host_path_cntl = INREG(HOST_PATH_CNTL);
 	rbbm_soft_reset = INREG(RBBM_SOFT_RESET);
 
-	if (rinfo->family == CHIP_FAMILY_R300 ||
-	    rinfo->family == CHIP_FAMILY_R350 ||
-	    rinfo->family == CHIP_FAMILY_RV350) {
+	if (IS_R300_VARIANT(rinfo)) {
 		u32 tmp;
 
 		OUTREG(RBBM_SOFT_RESET, (rbbm_soft_reset |

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 244

Quoted 4 lines
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
@@ -241,9 +239,7 @@
 	INREG(HOST_PATH_CNTL);
 	OUTREG(HOST_PATH_CNTL, host_path_cntl);
 
-	if (rinfo->family != CHIP_FAMILY_R300 ||

^^ ^^

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 245

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
-	    rinfo->family != CHIP_FAMILY_R350 ||

^^ ^^

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 246

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
-	    rinfo->family != CHIP_FAMILY_RV350)
                          ^^

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 242

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +1 -0
+	if (IS_R300_VARIANT(rinfo))
            ^^

These trigger a warning in my head...

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 245

Quoted 3 lines
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -0
 		OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset);
 
 	OUTREG(CLOCK_CNTL_INDEX, clock_cntl_index);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#2 lore raw
Quoted 28 lines · Geert Uytterhoeven
Quoted 22 lines · Claudio Ciccani

the attached patch fixes some issues with R300 based chipsets and adds support for a number of new devices (mostly X800/X850). It also enlarges the mmio size to 0x8000 because many 3d registers of the R300 are located after offset 0x4000 and we need them for DirectFB (DRI needs too).
The patch applies to linux-2.6.18-rc2, hope there have not been changes in the meanwhile.

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +1 -3
@@ -203,9 +203,7 @@
 	host_path_cntl = INREG(HOST_PATH_CNTL);
 	rbbm_soft_reset = INREG(RBBM_SOFT_RESET);
 
-	if (rinfo->family == CHIP_FAMILY_R300 ||
-	    rinfo->family == CHIP_FAMILY_R350 ||
-	    rinfo->family == CHIP_FAMILY_RV350) {
+	if (IS_R300_VARIANT(rinfo)) {
 		u32 tmp;
 
 		OUTREG(RBBM_SOFT_RESET, (rbbm_soft_reset |

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 244

Quoted 4 lines
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
@@ -241,9 +239,7 @@
 	INREG(HOST_PATH_CNTL);
 	OUTREG(HOST_PATH_CNTL, host_path_cntl);
 
-	if (rinfo->family != CHIP_FAMILY_R300 ||

^^ ^^

Quoted 7 lines

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 245

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
-	    rinfo->family != CHIP_FAMILY_R350 ||

^^ ^^

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 246

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +0 -1
-	    rinfo->family != CHIP_FAMILY_RV350)
                          ^^

usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c line 242

Quoted 1 line
usr/src/linux-2.6.18-rc2/drivers/video/aty/radeon_accel.c renamed from drivers/video/aty/radeon_accel.c +1 -0
+	if (IS_R300_VARIANT(rinfo))
            ^^

These trigger a warning in my head...

If you have a look to the code from xorg, you will see this is right. Indeed the previous code was REALLY wrong, because the condition returns always true (while it should return true for R300 based chipsets).

Signature · 12 lines
Regards,
     Claudio Ciccani

[email protected]
http://directfb.org
http://sf.net/projects/php-directfb

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV