diff options
author | Thomas Hellstrom <[email protected]> | 2019-05-08 15:50:18 +0200 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2019-05-17 08:44:31 +0200 |
commit | eed24156ec9ca24dfab71234d0938d358a214ecb (patch) | |
tree | 4b631c0ed5e310789b3cf91d7090096f0b062596 /src/gallium/drivers/svga | |
parent | 0f598ed7b3d2b3886ea5d742e7b0ced2b1702f28 (diff) |
svga: Remove the surface_invalidate winsys function
Instead unconditionally call SVGA3D_InvalidateGBSurface() since it's needed
also for Linux for dirty buffers and operation without SurfaceDMA.
For non-guest-backed operation, remove the surface cache surface invalidation
altogether.
Signed-off-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_cache.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_winsys.h | 7 |
3 files changed, 12 insertions, 13 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index 82dd2b2c3a0..e2282d6a15c 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -33,7 +33,7 @@ #include "svga_screen.h" #include "svga_screen_cache.h" #include "svga_context.h" - +#include "svga_cmd.h" #define SVGA_SURFACE_CACHE_ENABLED 1 @@ -291,7 +291,12 @@ svga_screen_cache_add(struct svga_screen *svgascreen, SVGA_DBG(DEBUG_CACHE|DEBUG_DMA, "cache sid %p\n", entry->handle); - LIST_ADD(&entry->head, &cache->validated); + + /* If we don't have gb objects, we don't need to invalidate. */ + if (sws->have_gb_objects) + LIST_ADD(&entry->head, &cache->validated); + else + LIST_ADD(&entry->head, &cache->invalidated); cache->total_size += surf_size; } @@ -355,6 +360,7 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, entry = LIST_ENTRY(struct svga_host_surface_cache_entry, curr, head); assert(entry->handle); + assert(svga_have_gb_objects(svga)); if (sws->surface_is_flushed(sws, entry->handle)) { /* remove entry from the validated list */ @@ -363,7 +369,7 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, /* It is now safe to invalidate the surface content. * It will be done using the current context. */ - if (svga->swc->surface_invalidate(svga->swc, entry->handle) != PIPE_OK) { + if (SVGA3D_InvalidateGBSurface(svga->swc, entry->handle) != PIPE_OK) { MAYBE_UNUSED enum pipe_error ret; /* Even though surface invalidation here is done after the command @@ -375,7 +381,7 @@ svga_screen_cache_flush(struct svga_screen *svgascreen, * this function itself is called inside svga_context_flush(). */ svga->swc->flush(svga->swc, NULL); - ret = svga->swc->surface_invalidate(svga->swc, entry->handle); + ret = SVGA3D_InvalidateGBSurface(svga->swc, entry->handle); assert(ret == PIPE_OK); } diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 73208cf58ac..5d1f369fa90 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -591,9 +591,9 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s) * need to update the host-side copy with the invalid * content when the associated mob is first bound to the surface. */ - if (svga->swc->surface_invalidate(svga->swc, stex->handle) != PIPE_OK) { + if (SVGA3D_InvalidateGBSurface(svga->swc, stex->handle) != PIPE_OK) { svga_context_flush(svga, NULL); - ret = svga->swc->surface_invalidate(svga->swc, stex->handle); + ret = SVGA3D_InvalidateGBSurface(svga->swc, stex->handle); assert(ret == PIPE_OK); } stex->validated = TRUE; diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h index 14782e19a7d..174b5f3b78f 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -412,13 +412,6 @@ struct svga_winsys_context boolean *rebind); /** - * Invalidate the content of this surface - */ - enum pipe_error - (*surface_invalidate)(struct svga_winsys_context *swc, - struct svga_winsys_surface *surface); - - /** * Create and define a DX GB shader that resides in the device COTable. * Caller of this function will issue the DXDefineShader command. */ |