diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-04-28 12:06:24 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-04-28 12:06:24 +0000 |
commit | c205240b389e6d629326c5a68389481e13e6a77d (patch) | |
tree | 627c5cef490c7769ab15703483832975f5a66a0b | |
parent | b31d1f7987514f9b180d76798e1da49a820d7bdc (diff) |
Don't map agp tex mem, shortcircuit some more ops when not in focus
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_ioctl.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_lock.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 10 |
4 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 741b74b006..7b325b6b31 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -81,6 +81,7 @@ int RADEON_DEBUG = (0); static void radeonGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height ) { +#if _HAVE_FULL_GL GET_CURRENT_CONTEXT(ctx); radeonContextPtr rmesa = RADEON_CONTEXT(ctx); @@ -88,6 +89,7 @@ static void radeonGetBufferSize( GLframebuffer *buffer, *width = rmesa->dri.drawable->w; *height = rmesa->dri.drawable->h; UNLOCK_HARDWARE( rmesa ); +#endif } /** diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 03351a0dcb..bba2c94ef2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -1249,6 +1249,10 @@ void radeonFlush( GLcontext *ctx ) void radeonFinish( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + + if (!rmesa->radeonScreen->buffers) + return; + radeonFlush( ctx ); if (rmesa->do_irqs) { diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.h b/src/mesa/drivers/dri/radeon/radeon_lock.h index 3dffa89bb1..61b74eae11 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.h +++ b/src/mesa/drivers/dri/radeon/radeon_lock.h @@ -90,8 +90,6 @@ extern int prevLockLine; do { \ char __ret = 0; \ DEBUG_CHECK_LOCK(); \ - if (0 && !rmesa->radeonScreen->buffers) \ - fprintf(stderr, "LOCK_HARDWARE in %s -- no buffers\n", __FUNCTION__); \ DRM_CAS( rmesa->dri.hwLock, rmesa->dri.hwContext, \ (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret ); \ if ( __ret ) \ diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 744d171733..5e99c2bb91 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -188,6 +188,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) radeonScreen->scratch = (__volatile__ GLuint *) ((GLubyte *)radeonScreen->status.map + RADEON_SCRATCH_REG_OFFSET); +#if !_HAVE_FULL_GL radeonScreen->buffers = drmMapBufs( sPriv->fd ); if ( !radeonScreen->buffers ) { drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); @@ -204,7 +205,8 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) radeonScreen->agpTextures.handle, radeonScreen->agpTextures.size, (drmAddressPtr)&radeonScreen->agpTextures.map ) ) { - drmUnmapBufs( radeonScreen->buffers ); + if (radeonScreen->buffers) + drmUnmapBufs( radeonScreen->buffers ); drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); FREE( radeonScreen ); @@ -212,6 +214,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) return NULL; } } +#endif radeonScreen->chipset = 0; switch ( radeonDRIPriv->deviceID ) { @@ -280,11 +283,12 @@ void radeonDestroyScreen( __DRIscreenPrivate *sPriv ) if (!radeonScreen) return; - if ( !radeonScreen->IsPCI ) { + if ( radeonScreen->agpTextures.map ) { drmUnmap( radeonScreen->agpTextures.map, radeonScreen->agpTextures.size ); } - drmUnmapBufs( radeonScreen->buffers ); + if (radeonScreen->buffers) + drmUnmapBufs( radeonScreen->buffers ); drmUnmap( radeonScreen->status.map, radeonScreen->status.size ); drmUnmap( radeonScreen->mmio.map, radeonScreen->mmio.size ); |