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
{
#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)
{