r300: add initial rs690 support to Mesa
authorDave Airlie <airlied@linux.ie>
Sun, 27 Jan 2008 02:16:06 +0000 (12:16 +1000)
committerDave Airlie <airlied@linux.ie>
Sun, 27 Jan 2008 02:16:06 +0000 (12:16 +1000)
The rs690 has an rs4xx style vertex-shader less 3D engine. It uses the new
r500 output engine though. It also needs a new drm with rs690 support,
which is just getting cleaned up.

src/mesa/drivers/dri/radeon/radeon_chipset.h
src/mesa/drivers/dri/radeon/radeon_screen.c

index 7318099093a9f524f50300344d0d557eb69f62e9..618f50ce07af6c77b36f8907d0a5c362851d289a 100644 (file)
 #define PCI_CHIP_RV410_5E4F            0x5E4F
 #define PCI_CHIP_RS350_7834            0x7834
 #define PCI_CHIP_RS350_7835            0x7835
+#define PCI_CHIP_RS690_791E             0x791E
 
 enum {
    CHIP_FAMILY_R100,
@@ -165,6 +166,7 @@ enum {
    CHIP_FAMILY_R420,
    CHIP_FAMILY_RV410,
    CHIP_FAMILY_RS400,
+   CHIP_FAMILY_RS690,
    CHIP_FAMILY_LAST
 };
 
index f2af532834fb9f6f847eca29cce837797806a9de..b4c26be57e49f60614645cca038885c77b808550 100644 (file)
@@ -362,6 +362,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
    RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
    unsigned char *RADEONMMIO;
    int i;
+   int ret;
+   uint32_t temp;
 
    if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
       fprintf(stderr,"\nERROR!  sizeof(RADEONDRIRec) does not match passed size from device driver\n");
@@ -684,6 +686,11 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
       fprintf(stderr, "Warning, xpress200 detected.\n");
       break;
 
+   case PCI_CHIP_RS690_791E:
+      screen->chip_family = CHIP_FAMILY_RS690;
+      fprintf(stderr, "Warning, RS690 detected, 3D support is incomplete.\n");
+      break;
+
    default:
       fprintf(stderr, "unknown chip id 0x%x, can't guess.\n",
              dri_priv->deviceID);
@@ -705,7 +712,19 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
    screen->cpp = dri_priv->bpp / 8;
    screen->AGPMode = dri_priv->AGPMode;
 
-   screen->fbLocation  = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff ) << 16;
+   ret = radeonGetParam( sPriv->fd, RADEON_PARAM_FB_LOCATION,
+                         &temp);
+   if (ret) {
+       if (screen->chip_family < CHIP_FAMILY_RS690)
+          screen->fbLocation      = ( INREG( RADEON_MC_FB_LOCATION ) & 0xffff) << 16;
+       else {
+           FREE( screen );
+           fprintf(stderr, "Unable to get fb location need newer drm\n");
+           return NULL;
+       }
+   } else {
+       screen->fbLocation = (temp & 0xffff) << 16;
+   }
 
    if ( sPriv->drm_version.minor >= 10 ) {
       drm_radeon_setparam_t sp;