mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
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 <thellstrom@vmware.com>
This commit is contained in:
parent
1f4c55128b
commit
0b1c0460a0
2 changed files with 36 additions and 29 deletions
|
|
@ -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]);
|
||||
/* 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);
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ CustomizerPtr xorg_customizer(ScrnInfoPtr pScrn);
|
|||
|
||||
Bool xorg_has_gallium(ScrnInfoPtr pScrn);
|
||||
|
||||
void xorg_flush(ScreenPtr pScreen);
|
||||
/***********************************************************************
|
||||
* xorg_exa.c
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue