static void r200RegainedLock(r200ContextPtr r200) { __DRIdrawablePrivate *dPriv = r200->radeon.dri.drawable; int i; if (r200->radeon.lastStamp != dPriv->lastStamp) { radeonUpdatePageFlipping(&r200->radeon); R200_STATECHANGE(r200, ctx); r200->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = r200->radeon.state.color.drawOffset + r200->radeon.radeonScreen->fbLocation; r200->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = r200->radeon.state.color.drawPitch; if (r200->radeon.glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) radeonSetCliprects(&r200->radeon, GL_BACK_LEFT); else radeonSetCliprects(&r200->radeon, GL_FRONT_LEFT); r200UpdateViewportOffset(r200->radeon.glCtx); r200->radeon.lastStamp = dPriv->lastStamp; } for (i = 0; i < r200->nr_heaps; i++) { DRI_AGE_TEXTURES(r200->texture_heaps[i]); } }
static void r300RegainedLock(radeonContextPtr radeon) { __DRIdrawablePrivate *dPriv = radeon->dri.drawable; if (radeon->lastStamp != dPriv->lastStamp) { _mesa_resize_framebuffer(radeon->glCtx, (GLframebuffer*)dPriv->driverPrivate, dPriv->w, dPriv->h); radeonUpdatePageFlipping(radeon); if (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) radeonSetCliprects(radeon, GL_BACK_LEFT); else radeonSetCliprects(radeon, GL_FRONT_LEFT); radeonUpdateScissor(radeon->glCtx); radeon->lastStamp = dPriv->lastStamp; } #if R200_MERGED for (i = 0; i < r200->nr_heaps; i++) { DRI_AGE_TEXTURES(r200->texture_heaps[i]); } #endif }
/* 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 * moves, resizes or restacks a window -- the change will be reflected * in the drawable position and clip rects. Since the X server grabs * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags ) { __DRIdrawablePrivate *dPriv = mmesa->driDrawable; __DRIscreenPrivate *sPriv = mmesa->driScreen; drm_mach64_sarea_t *sarea = mmesa->sarea; int i; drmGetLock( mmesa->driFd, mmesa->hHWContext, flags ); /* The window might have moved, so we might need to get new clip * rects. * * NOTE: This releases and regrabs the hw lock to allow the X server * to respond to the DRI protocol request for new drawable info. * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( mmesa->lastStamp != dPriv->lastStamp ) { mmesa->lastStamp = dPriv->lastStamp; if (mmesa->glCtx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_BACK_LEFT) mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT ); else mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT ); driUpdateFramebufferSize( mmesa->glCtx, dPriv ); mach64CalcViewport( mmesa->glCtx ); } mmesa->dirty |= (MACH64_UPLOAD_CONTEXT | MACH64_UPLOAD_MISC | MACH64_UPLOAD_CLIPRECTS); /* EXA render acceleration uses the texture engine, so restore it */ mmesa->dirty |= (MACH64_UPLOAD_TEXTURE); if ( sarea->ctx_owner != mmesa->hHWContext ) { sarea->ctx_owner = mmesa->hHWContext; mmesa->dirty = MACH64_UPLOAD_ALL; } for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) { DRI_AGE_TEXTURES( mmesa->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 * moves, resizes or restacks a window -- the change will be reflected * in the drawable position and clip rects. Since the X server grabs * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ void r200GetLock( r200ContextPtr rmesa, GLuint flags ) { __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; __DRIscreenPrivate *sPriv = rmesa->dri.screen; drm_radeon_sarea_t *sarea = rmesa->sarea; int i; drmGetLock( rmesa->dri.fd, rmesa->dri.hwContext, flags ); /* The window might have moved, so we might need to get new clip * rects. * * NOTE: This releases and regrabs the hw lock to allow the X server * to respond to the DRI protocol request for new drawable info. * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( rmesa->lastStamp != dPriv->lastStamp ) { r200UpdatePageFlipping( rmesa ); if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) r200SetCliprects( rmesa, GL_BACK_LEFT ); else r200SetCliprects( rmesa, GL_FRONT_LEFT ); r200UpdateViewportOffset( rmesa->glCtx ); rmesa->lastStamp = dPriv->lastStamp; } R200_STATECHANGE( rmesa, ctx ); if (rmesa->sarea->tiling_enabled) { rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] |= R200_COLOR_TILE_ENABLE; } else rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] &= ~R200_COLOR_TILE_ENABLE; if ( sarea->ctx_owner != rmesa->dri.hwContext ) { sarea->ctx_owner = rmesa->dri.hwContext; } for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { DRI_AGE_TEXTURES( rmesa->texture_heaps[ i ] ); } rmesa->lost_context = GL_TRUE; }
/* 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 * moves, resizes or restacks a window -- the change will be reflected * in the drawable position and clip rects. Since the X server grabs * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) { __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); drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags); /* The window might have moved, so we might need to get new clip * rects. * * NOTE: This releases and regrabs the hw lock to allow the X server * to respond to the DRI protocol request for new drawable info. * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); if (drawable != readable) { DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); } 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; }
/* Update the hardware state. This is called if another main/context.has * grabbed the hardware lock, which includes the X server. This * function also updates the driver's window state after the X server * moves, resizes or restacks a window -- the change will be reflected * in the drawable position and clip rects. Since the X server grabs * the hardware lock when it changes the window state, this routine will * automatically be called after such a change. */ void r128GetLock( r128ContextPtr rmesa, GLuint flags ) { __DRIdrawable *dPriv = rmesa->driDrawable; __DRIscreen *sPriv = rmesa->driScreen; drm_r128_sarea_t *sarea = rmesa->sarea; int i; drmGetLock( rmesa->driFd, rmesa->hHWContext, flags ); /* The window might have moved, so we might need to get new clip * rects. * * NOTE: This releases and regrabs the hw lock to allow the X server * to respond to the DRI protocol request for new drawable info. * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); if ( rmesa->lastStamp != dPriv->lastStamp ) { r128UpdatePageFlipping( rmesa ); driUpdateFramebufferSize(rmesa->glCtx, dPriv); rmesa->lastStamp = dPriv->lastStamp; rmesa->new_state |= R128_NEW_CLIP; RENDERINPUTS_ONES( rmesa->tnl_state_bitset ); } rmesa->dirty |= R128_UPLOAD_CONTEXT | R128_UPLOAD_CLIPRECTS; rmesa->numClipRects = dPriv->numClipRects; rmesa->pClipRects = dPriv->pClipRects; if ( sarea->ctx_owner != rmesa->hHWContext ) { sarea->ctx_owner = rmesa->hHWContext; rmesa->dirty = R128_UPLOAD_ALL; } for ( i = 0 ; i < rmesa->nr_heaps ; i++ ) { DRI_AGE_TEXTURES( rmesa->texture_heaps[i] ); } }