OSDN Git Service

svga: invalidate gb surface before it is reused
authorCharmaine Lee <charmainel@vmware.com>
Tue, 8 Mar 2016 19:18:51 +0000 (11:18 -0800)
committerBrian Paul <brianp@vmware.com>
Fri, 8 Jul 2016 18:53:20 +0000 (12:53 -0600)
commitda98cee067fcf61ac6f2c70c91b0c8eab27eba92
tree8bf1f7aae51a2a57135960b9fa2793f498ab7c2a
parentca531aeeb120cdda966120a17cdf50aa14c3129b
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 <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
src/gallium/drivers/svga/svga_screen_cache.c
src/gallium/drivers/svga/svga_screen_cache.h
src/gallium/drivers/svga/svga_winsys.h
src/gallium/winsys/svga/drm/vmw_screen_svga.c