Skip to content

Commit 4c08f01

Browse files
committed
drm/vmwgfx: Enable DMA mappings with SEV
Enable DMA mappings in vmwgfx after TTM has been fixed in commit 3bf3710 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") This enables full guest-backed memory support and in particular allows usage of screen targets as the presentation mechanism. Signed-off-by: Zack Rusin <[email protected]> Reported-by: Ye Li <[email protected]> Tested-by: Ye Li <[email protected]> Fixes: 3b0d645 ("drm/vmwgfx: Refuse DMA operation when SEV encryption is active") Cc: Broadcom internal kernel review list <[email protected]> Cc: [email protected] Cc: <[email protected]> # v6.6+ Reviewed-by: Martin Krastev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3eadd88 commit 4c08f01

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,12 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
666666
[vmw_dma_map_populate] = "Caching DMA mappings.",
667667
[vmw_dma_map_bind] = "Giving up DMA mappings early."};
668668

669-
/* TTM currently doesn't fully support SEV encryption. */
670-
if (cc_platform_has(CC_ATTR_MEM_ENCRYPT))
671-
return -EINVAL;
672-
673-
if (vmw_force_coherent)
669+
/*
670+
* When running with SEV we always want dma mappings, because
671+
* otherwise ttm tt pool pages will bounce through swiotlb running
672+
* out of available space.
673+
*/
674+
if (vmw_force_coherent || cc_platform_has(CC_ATTR_MEM_ENCRYPT))
674675
dev_priv->map_mode = vmw_dma_alloc_coherent;
675676
else if (vmw_restrict_iommu)
676677
dev_priv->map_mode = vmw_dma_map_bind;

0 commit comments

Comments
 (0)