diff options
author | Charmaine Lee <[email protected]> | 2016-03-08 11:18:51 -0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-07-08 12:53:20 -0600 |
commit | da98cee067fcf61ac6f2c70c91b0c8eab27eba92 (patch) | |
tree | 8bf1f7aae51a2a57135960b9fa2793f498ab7c2a /src/gallium/winsys/svga/drm | |
parent | ca531aeeb120cdda966120a17cdf50aa14c3129b (diff) |
svga: invalidate gb surface before it is reused
With this patch, a guest-backed surface will be invalidated
using the SVGA_3D_CMD_INVALIDATE_GB_SURFACE command before
the surface is reused. This fixes the updating dirty image error
from the device when a surface is reused.
v2: Instead of invalidating the surface when it is reused,
send the invalidate command before the surface is put into
the recycle pool.
v3: (1) surface invalidate is a noop operation in Linux winsys, since
surface invalidation is not needed for DMA path.
(2) Instead of invalidating the surface content in
svga_screen_surface_destroy() when a surface is to be destroyed,
it is done in svga_screen_cache_flush() when the surface is
no longer referenced in a command buffer and is ready to
be moved to the unused list. At this point, the surface will
be moved to the invalidate list. When the surface invalidation
is submitted, the surface will be moved to the unused list.
Tested with piglit, glretrace.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga/drm')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_svga.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c index a18dd827c64..f8c9180e9bc 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c @@ -280,6 +280,18 @@ vmw_svga_winsys_surface_can_create(struct svga_winsys_screen *sws, } +static void +vmw_svga_winsys_surface_invalidate(struct svga_winsys_screen *sws, + 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. + */ +} + static boolean vmw_svga_winsys_surface_is_flushed(struct svga_winsys_screen *sws, struct svga_winsys_surface *surface) @@ -406,6 +418,7 @@ vmw_winsys_screen_init_svga(struct vmw_winsys_screen *vws) vws->base.surface_is_flushed = vmw_svga_winsys_surface_is_flushed; vws->base.surface_reference = vmw_svga_winsys_surface_ref; vws->base.surface_can_create = vmw_svga_winsys_surface_can_create; + vws->base.surface_invalidate = vmw_svga_winsys_surface_invalidate; vws->base.buffer_create = vmw_svga_winsys_buffer_create; vws->base.buffer_map = vmw_svga_winsys_buffer_map; vws->base.buffer_unmap = vmw_svga_winsys_buffer_unmap; |