#include "svga_screen.h"
#include "svga_screen_cache.h"
#include "svga_context.h"
-
+#include "svga_cmd.h"
#define SVGA_SURFACE_CACHE_ENABLED 1
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;
}
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 */
/* 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
* 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);
}
* 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;
struct svga_winsys_surface *surface,
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.
vswc->base.flush = vmw_swc_flush;
vswc->base.surface_map = vmw_svga_winsys_surface_map;
vswc->base.surface_unmap = vmw_svga_winsys_surface_unmap;
- vswc->base.surface_invalidate = vmw_svga_winsys_surface_invalidate;
vswc->base.shader_create = vmw_svga_winsys_vgpu10_shader_create;
vswc->base.shader_destroy = vmw_svga_winsys_vgpu10_shader_destroy;
mtx_unlock(&vsrf->mutex);
}
-enum pipe_error
-vmw_svga_winsys_surface_invalidate(struct svga_winsys_context *swc,
- struct svga_winsys_surface *surf)
-{
- /* this is a noop since surface invalidation is not needed for DMA path.
- * DMA is enabled when guest-backed surface is not enabled or
- * guest-backed dma is enabled. Since guest-backed dma is enabled
- * when guest-backed surface is enabled, that implies DMA is always enabled;
- * hence, surface invalidation is not needed.
- */
- return PIPE_OK;
-}
-
void
vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst,
struct vmw_svga_winsys_surface *src)
vmw_svga_winsys_surface_unmap(struct svga_winsys_context *swc,
struct svga_winsys_surface *srf,
boolean *rebind);
-enum pipe_error
-vmw_svga_winsys_surface_invalidate(struct svga_winsys_context *swc,
- struct svga_winsys_surface *srf);
-
#endif /* VMW_SURFACE_H_ */