diff options
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_driver.c | 66 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_tracker.h | 1 |
2 files changed, 37 insertions, 30 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 1ee79ae..66685ec 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -538,44 +538,37 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) return TRUE; } -static void drv_block_handler(int i, pointer blockData, pointer pTimeout, - pointer pReadmask) +void xorg_flush(ScreenPtr pScreen) { - ScreenPtr pScreen = screenInfo.screens[i]; modesettingPtr ms = modesettingPTR(xf86Screens[pScreen->myNum]); - pScreen->BlockHandler = ms->blockHandler; - pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); - pScreen->BlockHandler = drv_block_handler; - if (ms->ctx) { - int j; + int j; - ms->ctx->flush(ms->ctx, PIPE_FLUSH_RENDER_CACHE, - ms->dirtyThrottling ? - &ms->fence[XORG_NR_FENCES-1] : - NULL); + ms->ctx->flush(ms->ctx, PIPE_FLUSH_RENDER_CACHE, + ms->dirtyThrottling ? + &ms->fence[XORG_NR_FENCES-1] : + NULL); - if (ms->dirtyThrottling) { - if (ms->fence[0]) - ms->ctx->screen->fence_finish(ms->ctx->screen, - ms->fence[0], 0); + if (ms->dirtyThrottling) { + if (ms->fence[0]) + ms->ctx->screen->fence_finish(ms->ctx->screen, + ms->fence[0], 0); - /* The amount of rendering generated by a block handler can be - * quite small. Let us get a fair way ahead of hardware before - * throttling. - */ - for (j = 0; j < XORG_NR_FENCES - 1; j++) - ms->screen->fence_reference(ms->screen, - &ms->fence[j], - ms->fence[j+1]); - - ms->screen->fence_reference(ms->screen, - &ms->fence[XORG_NR_FENCES-1], - NULL); - } + /* The amount of rendering generated by a block handler can be + * quite small. Let us get a fair way ahead of hardware before + * throttling. + */ + for (j = 0; j < XORG_NR_FENCES - 1; j++) + ms->screen->fence_reference(ms->screen, + &ms->fence[j], + ms->fence[j+1]); + + ms->screen->fence_reference(ms->screen, + &ms->fence[XORG_NR_FENCES-1], + NULL); + } } - #ifdef DRM_MODE_FEATURE_DIRTYFB { @@ -608,6 +601,19 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout, #endif } +static void drv_block_handler(int i, pointer blockData, pointer pTimeout, + pointer pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + modesettingPtr ms = modesettingPTR(xf86Screens[pScreen->myNum]); + + pScreen->BlockHandler = ms->blockHandler; + pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler = drv_block_handler; + + xorg_flush(pScreen); +} + static Bool drv_create_screen_resources(ScreenPtr pScreen) { diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index a3fb5e5..56397b8 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -156,6 +156,7 @@ CustomizerPtr xorg_customizer(ScrnInfoPtr pScrn); Bool xorg_has_gallium(ScrnInfoPtr pScrn); +void xorg_flush(ScreenPtr pScreen); /*********************************************************************** * xorg_exa.c */ |