radeon: remove kernel mm, dri2 path takes care of it
authorDave Airlie <airlied@redhat.com>
Tue, 28 Apr 2009 05:26:24 +0000 (15:26 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 28 Apr 2009 05:26:24 +0000 (15:26 +1000)
src/mesa/drivers/dri/radeon/radeon_screen.c

index 15414120289e36e48cf03bc7e7d944ebed445e39..ed542d71fcc30f78c7eb8acf37d7944c0a2c9fad 100644 (file)
@@ -787,19 +787,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
    {
       int ret;
 
-#ifdef RADEON_PARAM_KERNEL_MM
-     ret = radeonGetParam(sPriv, RADEON_PARAM_KERNEL_MM, &screen->kernel_mm);
-
-      if (ret && ret != -EINVAL) {
-         FREE( screen );
-         fprintf(stderr, "drm_radeon_getparam_t (RADEON_OFFSET): %d\n", ret);
-         return NULL;
-      }
-
-      if (ret == -EINVAL)
-          screen->kernel_mm = 0;
-#endif
-
       ret = radeonGetParam(sPriv, RADEON_PARAM_GART_BUFFER_OFFSET,
                            &screen->gart_buffer_offset);
 
@@ -833,63 +820,60 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
       screen->drmSupportsVertexProgram = (sPriv->drm_version.minor >= 25);
    }
 
-   if (!screen->kernel_mm) {
-     screen->mmio.handle = dri_priv->registerHandle;
-     screen->mmio.size   = dri_priv->registerSize;
-     if ( drmMap( sPriv->fd,
-                 screen->mmio.handle,
-                 screen->mmio.size,
-                 &screen->mmio.map ) ) {
-       FREE( screen );
-       __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ );
-       return NULL;
-     }
+   screen->mmio.handle = dri_priv->registerHandle;
+   screen->mmio.size   = dri_priv->registerSize;
+   if ( drmMap( sPriv->fd,
+               screen->mmio.handle,
+               screen->mmio.size,
+               &screen->mmio.map ) ) {
+     FREE( screen );
+     __driUtilMessage("%s: drmMap failed\n", __FUNCTION__ );
+     return NULL;
+   }
 
-     RADEONMMIO = screen->mmio.map;
+   RADEONMMIO = screen->mmio.map;
 
-     screen->status.handle = dri_priv->statusHandle;
-     screen->status.size   = dri_priv->statusSize;
-     if ( drmMap( sPriv->fd,
-                 screen->status.handle,
-                 screen->status.size,
-                 &screen->status.map ) ) {
-       drmUnmap( screen->mmio.map, screen->mmio.size );
-       FREE( screen );
-       __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ );
-       return NULL;
-     }
-     screen->scratch = (__volatile__ uint32_t *)
-       ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
+   screen->status.handle = dri_priv->statusHandle;
+   screen->status.size   = dri_priv->statusSize;
+   if ( drmMap( sPriv->fd,
+               screen->status.handle,
+               screen->status.size,
+               &screen->status.map ) ) {
+     drmUnmap( screen->mmio.map, screen->mmio.size );
+     FREE( screen );
+     __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ );
+     return NULL;
+   }
+   screen->scratch = (__volatile__ uint32_t *)
+     ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET);
+
+   screen->buffers = drmMapBufs( sPriv->fd );
+   if ( !screen->buffers ) {
+     drmUnmap( screen->status.map, screen->status.size );
+     drmUnmap( screen->mmio.map, screen->mmio.size );
+     FREE( screen );
+     __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ );
+     return NULL;
+   }
 
-     screen->buffers = drmMapBufs( sPriv->fd );
-     if ( !screen->buffers ) {
+   if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) {
+     screen->gartTextures.handle = dri_priv->gartTexHandle;
+     screen->gartTextures.size   = dri_priv->gartTexMapSize;
+     if ( drmMap( sPriv->fd,
+                 screen->gartTextures.handle,
+                 screen->gartTextures.size,
+                 (drmAddressPtr)&screen->gartTextures.map ) ) {
+       drmUnmapBufs( screen->buffers );
        drmUnmap( screen->status.map, screen->status.size );
        drmUnmap( screen->mmio.map, screen->mmio.size );
        FREE( screen );
-       __driUtilMessage("%s: drmMapBufs failed\n", __FUNCTION__ );
+       __driUtilMessage("%s: drmMap failed for GART texture area\n", __FUNCTION__);
        return NULL;
-     }
-
-     if ( dri_priv->gartTexHandle && dri_priv->gartTexMapSize ) {
-       screen->gartTextures.handle = dri_priv->gartTexHandle;
-       screen->gartTextures.size   = dri_priv->gartTexMapSize;
-       if ( drmMap( sPriv->fd,
-                   screen->gartTextures.handle,
-                   screen->gartTextures.size,
-                   (drmAddressPtr)&screen->gartTextures.map ) ) {
-        drmUnmapBufs( screen->buffers );
-        drmUnmap( screen->status.map, screen->status.size );
-        drmUnmap( screen->mmio.map, screen->mmio.size );
-        FREE( screen );
-        __driUtilMessage("%s: drmMap failed for GART texture area\n", __FUNCTION__);
-        return NULL;
-       }
+    }
 
-       screen->gart_texture_offset = dri_priv->gartTexOffset + screen->gart_base;
-     }
+     screen->gart_texture_offset = dri_priv->gartTexOffset + screen->gart_base;
    }
 
-
    ret = radeon_set_screen_flags(screen, dri_priv->deviceID);
    if (ret == -1)
      return NULL;