Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: Disable command buffers on svga3 without gbobjects

With very limited vram on svga3 it's difficult to handle all the surface
migrations. Without gbobjects, i.e. the ability to store surfaces in
guest mobs, there's no reason to support intermediate svga2 features,
especially because we can fall back to fb traces and svga3 will never
support those in-between features.

On svga3 we wither want to use fb traces or screen targets
(i.e. gbobjects), nothing in between. This fixes presentation on a lot
of fusion/esxi tech previews where the exposed svga3 caps haven't been
finalized yet.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3")
Cc: <stable@vger.kernel.org> # v5.14+
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-5-zack@kde.org

+7 -4
+7 -4
drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
··· 675 675 */ 676 676 bool vmw_cmd_supported(struct vmw_private *vmw) 677 677 { 678 - if ((vmw->capabilities & (SVGA_CAP_COMMAND_BUFFERS | 679 - SVGA_CAP_CMD_BUFFERS_2)) != 0) 680 - return true; 678 + bool has_cmdbufs = 679 + (vmw->capabilities & (SVGA_CAP_COMMAND_BUFFERS | 680 + SVGA_CAP_CMD_BUFFERS_2)) != 0; 681 + if (vmw_is_svga_v3(vmw)) 682 + return (has_cmdbufs && 683 + (vmw->capabilities & SVGA_CAP_GBOBJECTS) != 0); 681 684 /* 682 685 * We have FIFO cmd's 683 686 */ 684 - return vmw->fifo_mem != NULL; 687 + return has_cmdbufs || vmw->fifo_mem != NULL; 685 688 }