}
}
-/**
- * Called by radeonGetLock() after the lock has been obtained.
- */
-static void r300RegainedLock(radeonContextPtr rmesa)
-{
- int i;
- __DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
- r300ContextPtr r300 = (r300ContextPtr) rmesa;
- drm_radeon_sarea_t *sarea = rmesa->sarea;
-
- if (rmesa->lastStamp != drawable->lastStamp) {
- radeonUpdatePageFlipping(rmesa);
- radeonSetCliprects(rmesa);
-#if 1
- r300UpdateViewportOffset(rmesa->glCtx);
- driUpdateFramebufferSize(rmesa->glCtx, drawable);
-#else
- radeonUpdateScissor(rmesa->glCtx);
-#endif
- }
-
- if (sarea->ctx_owner != rmesa->dri.hwContext) {
- sarea->ctx_owner = rmesa->dri.hwContext;
-
- for (i = 0; i < r300->nr_heaps; i++) {
- DRI_AGE_TEXTURES(r300->texture_heaps[i]);
- }
- }
-}
-
/* Update the hardware state. This is called if another context has
* grabbed the hardware lock, which includes the X server. This
* function also updates the driver's window state after the X server
__DRIdrawablePrivate *const drawable = rmesa->dri.drawable;
__DRIdrawablePrivate *const readable = rmesa->dri.readable;
__DRIscreenPrivate *sPriv = rmesa->dri.screen;
+ drm_radeon_sarea_t *sarea = rmesa->sarea;
+ r300ContextPtr r300 = (r300ContextPtr) rmesa;
assert(drawable != NULL);
DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable);
}
- if (IS_R300_CLASS(rmesa->radeonScreen))
- r300RegainedLock(rmesa);
+ if (rmesa->lastStamp != drawable->lastStamp) {
+ radeonUpdatePageFlipping(rmesa);
+ radeonSetCliprects(rmesa);
+ r300UpdateViewportOffset(rmesa->glCtx);
+ driUpdateFramebufferSize(rmesa->glCtx, drawable);
+ }
+
+ if (sarea->ctx_owner != rmesa->dri.hwContext) {
+ int i;
+
+ sarea->ctx_owner = rmesa->dri.hwContext;
+ for (i = 0; i < r300->nr_heaps; i++) {
+ DRI_AGE_TEXTURES(r300->texture_heaps[i]);
+ }
+ }
rmesa->lost_context = GL_TRUE;
}
#endif
#include "radeon_context.h"
-extern void radeonGetLock(radeonContextPtr radeon, GLuint flags);
-extern void radeonUpdatePageFlipping(radeonContextPtr radeon);
+extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags);
+extern void radeonUpdatePageFlipping(radeonContextPtr rmesa);
/* Turn DEBUG_LOCKING on to find locking conflicts.
*/
#define DEBUG_CHECK_LOCK() \
do { \
- if ( prevLockFile ) { \
- fprintf( stderr, \
+ if (prevLockFile) { \
+ fprintf(stderr, \
"LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \
- prevLockFile, prevLockLine, __FILE__, __LINE__ ); \
- exit( 1 ); \
+ prevLockFile, prevLockLine, __FILE__, __LINE__); \
+ exit(1); \
} \
} while (0)
/* Lock the hardware and validate our state.
*/
-#define LOCK_HARDWARE( radeon ) \
+#define LOCK_HARDWARE( rmesa ) \
do { \
char __ret = 0; \
DEBUG_CHECK_LOCK(); \
- DRM_CAS( (radeon)->dri.hwLock, (radeon)->dri.hwContext, \
- (DRM_LOCK_HELD | (radeon)->dri.hwContext), __ret ); \
- if ( __ret ) \
- radeonGetLock( (radeon), 0 ); \
+ DRM_CAS(rmesa->dri.hwLock, rmesa->dri.hwContext, \
+ (DRM_LOCK_HELD | rmesa->dri.hwContext), __ret); \
+ if (__ret) \
+ radeonGetLock(rmesa, 0); \
DEBUG_LOCK(); \
} while (0)
#if R200_MERGED
-#define UNLOCK_HARDWARE( radeon ) \
+#define UNLOCK_HARDWARE( rmesa ) \
do { \
- DRM_UNLOCK( (radeon)->dri.fd, \
- (radeon)->dri.hwLock, \
- (radeon)->dri.hwContext ); \
+ DRM_UNLOCK(rmesa->dri.fd, \
+ rmesa->dri.hwLock, \
+ rmesa->dri.hwContext); \
DEBUG_RESET(); \
- if (IS_R200_CLASS(radeon->radeonScreen)) { \
- r200ContextPtr __r200 = (r200ContextPtr)(radeon); \
+ if (IS_R200_CLASS(rmesa->radeonScreen)) { \
+ r200ContextPtr __r200 = (r200ContextPtr)rmesa; \
if (__r200->save_on_next_unlock) \
- r200SaveHwState( __r200 ); \
+ r200SaveHwState(__r200); \
__r200->save_on_next_unlock = GL_FALSE; \
} \
} while (0)
#else
-#define UNLOCK_HARDWARE( radeon ) \
+#define UNLOCK_HARDWARErmesa \
do { \
- DRM_UNLOCK( (radeon)->dri.fd, \
- (radeon)->dri.hwLock, \
- (radeon)->dri.hwContext ); \
+ DRM_UNLOCK(rmesa->dri.fd, \
+ rmesa->dri.hwLock, \
+ rmesa->dri.hwContext); \
DEBUG_RESET(); \
} while (0)
#endif