diff options
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen_cache.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_winsys.h | 2 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index bf66fc60105..0816ff68c8a 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -362,7 +362,21 @@ 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. */ - svga->swc->surface_invalidate(svga->swc, entry->handle); + if (svga->swc->surface_invalidate(svga->swc, entry->handle) != PIPE_OK) { + enum pipe_error ret; + + /* Even though surface invalidation here is done after the command + * buffer is flushed, it is still possible that it will + * fail because there might be just enough of this command that is + * filling up the command buffer, so in this case we will call + * the winsys flush directly to flush the buffer. + * Note, we don't want to call svga_context_flush() here because + * this function itself is called inside svga_context_flush(). + */ + svga->swc->flush(svga->swc, NULL); + ret = svga->swc->surface_invalidate(svga->swc, entry->handle); + assert(ret == PIPE_OK); + } /* add the entry to the invalidated list */ LIST_ADD(&entry->head, &cache->invalidated); diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 04173266ff0..29d91fd3221 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -531,7 +531,11 @@ 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. */ - svga->swc->surface_invalidate(svga->swc, stex->handle); + if (svga->swc->surface_invalidate(svga->swc, stex->handle) != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = svga->swc->surface_invalidate(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 8b8b45b47f4..8823c115db5 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -407,7 +407,7 @@ struct svga_winsys_context /** * Invalidate the content of this surface */ - void + enum pipe_error (*surface_invalidate)(struct svga_winsys_context *swc, struct svga_winsys_surface *surface); |