[PATCH 2/2] drm/virtio: set max_segment
From: Gerd Hoffmann
Date: Tue Aug 18 2020 - 03:48:42 EST
When initializing gem objects call virtio_max_dma_size() to figure the
scatter list limit. Needed to make virtio-gpu work properly with SEV.
Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
---
drivers/gpu/drm/virtio/virtgpu_object.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index 1359eb8f1a02..26b608e2554e 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -214,6 +214,7 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
goto err_free_gem;
bo->dumb = params->dumb;
+ shmem_obj->base.max_segment = virtio_max_dma_size(vgdev->vdev);
if (fence) {
ret = -ENOMEM;
--
2.18.4