Skip to content
  • Charmaine Lee's avatar
    svga: use the winsys interface to invalidate surface · c56792f7
    Charmaine Lee authored and Andres Gomez's avatar Andres Gomez committed
    
    
    Instead of directly sending the InvalidateGBSurface command,
    this patch uses the invalidate_surface interface.
    
    Fixes Linux VM piglit failures including
       ext_texture_array-gen-mipmap, fbo-generatemipmap-array S3TC_DXT1
    
    Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
    (cherry picked from commit 019d5d53
    
    )
    
    Squashed with commit:
    
    svga: fix pre-mature flushing of the command buffer
    
    When surface_invalidate is called to invalidate a newly created surface
    in svga_validate_surface_view(), it is possible that the command
    buffer is already full, and in this case, currently, the associated wddm
    winsys function will flush the command buffer and resend the invalidate
    surface command. However, this can pre-maturely flush the command buffer
    if there is still pending image updates to be patched.
    
    To fix the problem, this patch will add a return status to the
    surface_invalidate interface and if it returns FALSE, the caller will
    call svga_context_flush() to do the proper context flush.
    Note, we don't call svga_context_flush() if surface_invalidate()
    fails when flushing the screen surface cache though, because it is
    already in the process of context flush, all the image updates are already
    patched, calling svga_context_flush() can trigger a deadlock.
    So in this case, we call the winsys context flush interface directly
    to flush the command buffer.
    
    Fixes driver errors and graphics corruption running Tropics. VMware bug 1891975.
    
    Also tested with MTT glretrace, piglit and various OpenGL apps such as
    Heaven, CinebenchR15, NobelClinicianViewer, Lightsmark, GoogleEarth.
    
    cc: mesa-stable@lists.freedesktop.org
    Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
    (cherry picked from commit 3fbdab87)
    c56792f7