X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_context.c;h=3b30b9e341ea3de8116c3e604effe4e80874049c;hb=3ed0a099c70e9d771e60e0ddf70bc0b5ba83a483;hp=3228a6d3d7fe7d8c265c2af5c437eb47d767d1aa;hpb=1318848f782cce716d6376ca13aebf68b728e24c;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index 3228a6d3d7f..3b30b9e341e 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -194,6 +194,7 @@ void svga_context_flush( struct svga_context *svga, struct pipe_fence_handle **pfence ) { struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); + struct pipe_fence_handle *fence = NULL; svga->curr.nr_fbs = 0; @@ -202,21 +203,26 @@ void svga_context_flush( struct svga_context *svga, u_upload_flush(svga->upload_vb); u_upload_flush(svga->upload_ib); - /* Flush screen, to ensure that texture dma uploads are processed + /* Ensure that texture dma uploads are processed * before submitting commands. */ - svga_screen_flush(svgascreen, NULL); - svga_context_flush_buffers(svga); /* Flush pending commands to hardware: */ - svga->swc->flush(svga->swc, pfence); + svga->swc->flush(svga->swc, &fence); + + svga_screen_cache_flush(svgascreen, fence); if (SVGA_DEBUG & DEBUG_SYNC) { - if (pfence && *pfence) - svga->pipe.screen->fence_finish( svga->pipe.screen, *pfence, 0); + if (fence) + svga->pipe.screen->fence_finish( svga->pipe.screen, fence, 0); } + + if(pfence) + *pfence = fence; + else + svgascreen->sws->fence_reference(svgascreen->sws, &fence, NULL); } @@ -233,3 +239,8 @@ void svga_hwtnl_flush_retry( struct svga_context *svga ) assert(ret == 0); } +struct svga_winsys_context * +svga_winsys_context( struct pipe_context *pipe ) +{ + return svga_context( pipe )->swc; +}