diff options
author | Charmaine Lee <[email protected]> | 2017-01-26 18:46:23 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-04-07 13:46:44 -0600 |
commit | 16bd2c6d04b0a80f3808266fa530dcfd219d5c9d (patch) | |
tree | aac701b7e3037471b519947022e6771c25499783 /src/gallium/drivers/svga/svga_screen_cache.c | |
parent | e000b17f87bd960c4ce1c0892017023d4dc59609 (diff) |
svga: add context pointer to the invalidate surface interface
With this patch, we will specify the current context
when we invalidate the surface before the surface is
put back to the recycled surface pool. This allows the
winsys layer to use the specified context to do the
invalidation rather than using the last context that
referenced the surface. This prevents race condition if
the last referenced context is now made current in another thread.
Tested with MTT glretrace, NobelClinicianViewer.
Reviewed-by: Sinclair Yeh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen_cache.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_cache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index d26e79a5c4a..82d2ebce976 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -32,6 +32,7 @@ #include "svga_winsys.h" #include "svga_screen.h" #include "svga_screen_cache.h" +#include "svga_context.h" #define SVGA_SURFACE_CACHE_ENABLED 1 @@ -310,6 +311,7 @@ svga_screen_cache_add(struct svga_screen *svgascreen, */ void svga_screen_cache_flush(struct svga_screen *svgascreen, + struct svga_context *svga, struct pipe_fence_handle *fence) { struct svga_host_surface_cache *cache = &svgascreen->cache; @@ -357,8 +359,10 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, /* remove entry from the validated list */ LIST_DEL(&entry->head); - /* it is now safe to invalidate the surface content. */ - sws->surface_invalidate(sws, entry->handle); + /* It is now safe to invalidate the surface content. + * It will be done using the current context. + */ + svga->swc->surface_invalidate(svga->swc, entry->handle); /* add the entry to the invalidated list */ LIST_ADD(&entry->head, &cache->invalidated); |