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/winsys | |
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/winsys')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_context.c | 7 | ||||
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_svga.c | 13 | ||||
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_surface.c | 12 | ||||
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_surface.h | 3 |
4 files changed, 19 insertions, 16 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c index 6e691756d12..c306d988e0c 100644 --- a/src/gallium/winsys/svga/drm/vmw_context.c +++ b/src/gallium/winsys/svga/drm/vmw_context.c @@ -808,11 +808,12 @@ vmw_svga_winsys_context_create(struct svga_winsys_screen *sws) 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; + vswc->base.shader_create = vmw_svga_winsys_vgpu10_shader_create; + vswc->base.shader_destroy = vmw_svga_winsys_vgpu10_shader_destroy; - vswc->base.resource_rebind = vmw_svga_winsys_resource_rebind; + vswc->base.resource_rebind = vmw_svga_winsys_resource_rebind; if (sws->have_vgpu10) vswc->base.cid = vmw_ioctl_extended_context_create(vws, sws->have_vgpu10); diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c index 17a1e760dd0..31cbda9af6f 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c @@ -280,18 +280,6 @@ 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) @@ -434,7 +422,6 @@ 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; diff --git a/src/gallium/winsys/svga/drm/vmw_surface.c b/src/gallium/winsys/svga/drm/vmw_surface.c index 69408ffe9d9..80cc0914cc0 100644 --- a/src/gallium/winsys/svga/drm/vmw_surface.c +++ b/src/gallium/winsys/svga/drm/vmw_surface.c @@ -177,6 +177,18 @@ vmw_svga_winsys_surface_unmap(struct svga_winsys_context *swc, } void +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. + */ +} + +void vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst, struct vmw_svga_winsys_surface *src) { diff --git a/src/gallium/winsys/svga/drm/vmw_surface.h b/src/gallium/winsys/svga/drm/vmw_surface.h index baeef5056bd..d6f2381220a 100644 --- a/src/gallium/winsys/svga/drm/vmw_surface.h +++ b/src/gallium/winsys/svga/drm/vmw_surface.h @@ -94,5 +94,8 @@ void vmw_svga_winsys_surface_unmap(struct svga_winsys_context *swc, struct svga_winsys_surface *srf, boolean *rebind); +void +vmw_svga_winsys_surface_invalidate(struct svga_winsys_context *swc, + struct svga_winsys_surface *srf); #endif /* VMW_SURFACE_H_ */ |