aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2010-11-24 15:15:42 +0100
committerThomas Hellstrom <[email protected]>2010-11-24 15:23:10 +0100
commit0b1c0460a0ec52a7bff7887022f080d85228a658 (patch)
tree398ce16b3ca61f2e2ae0547f42b31558ba5926d2 /src
parent1f4c55128b7e4a2aa08600ae9338071a97cee8fa (diff)
st/xorg: Add a function to flush pending rendering and damage
This is needed to properly sync with host side rendering. For example, make sure we flush colorkey painting before updating the overlay. Signed-off-by: Thomas Hellstrom <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c66
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h1
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 1ee79ae177e..66685ecec64 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 a3fb5e5dad0..56397b8fea8 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
*/