From 2e3f6f7737c2af58cace666b23cd5034b72b6379 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Sat, 10 Jan 2009 14:59:53 +0000 Subject: For the radeon mesa driver, don't try and map the card's mmio region. We really don't need it. There's one case where it's used, and that is on ``older'' drms, newer ones provide that one value via a parameter. This is the first stage in my project to stop all cards mapping registers. This does mean that drivers that depend on this may eventually die (tdfx, i'm looking at you!). ok matthieu@ --- .../src/mesa/drivers/dri/radeon/radeon_screen.c | 22 ---------------------- .../src/mesa/drivers/dri/radeon/radeon_screen.h | 1 - 2 files changed, 23 deletions(-) (limited to 'dist/Mesa') diff --git a/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c b/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c index 84b5c46bf..6e8b6d611 100644 --- a/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -357,7 +357,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) { radeonScreenPtr screen; RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; - unsigned char *RADEONMMIO; int i; int ret; uint32_t temp; @@ -422,26 +421,12 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) screen->drmSupportsVertexProgram = (sPriv->drm_version.minor >= 25); } - 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; - 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; @@ -452,7 +437,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) 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; @@ -467,7 +451,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) (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; @@ -840,13 +823,9 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) 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; } @@ -980,7 +959,6 @@ radeonDestroyScreen( __DRIscreenPrivate *sPriv ) } drmUnmapBufs( screen->buffers ); drmUnmap( screen->status.map, screen->status.size ); - drmUnmap( screen->mmio.map, screen->mmio.size ); /* free all option information */ driDestroyOptionInfo (&screen->optionCache); diff --git a/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h b/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h index ab859d55b..533425ece 100644 --- a/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/dist/Mesa/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -78,7 +78,6 @@ typedef struct { int texSize[RADEON_NR_TEX_HEAPS]; int logTexGranularity[RADEON_NR_TEX_HEAPS]; - radeonRegionRec mmio; radeonRegionRec status; radeonRegionRec gartTextures; -- cgit v1.2.3