[RFC PATCH 2/8] drm/virtio: allocate a fence context for every 3D context

Gurchetan Singh gurchetansingh at chromium.org
Tue Mar 10 01:08:12 UTC 2020


We don't want fences from different 3D contexts (GL, VK) to
be on the same timeline.

Signed-off-by: Gurchetan Singh <gurchetansingh at chromium.org>
---
 drivers/gpu/drm/virtio/virtgpu_drv.h | 1 +
 drivers/gpu/drm/virtio/virtgpu_kms.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 9627cd08f5be..b4f85c5fedb9 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -215,6 +215,7 @@ struct virtio_gpu_device {
 struct virtio_gpu_fpriv {
 	uint32_t ctx_id;
 	bool context_created;
+	uint64_t fence_context;
 	struct mutex context_lock;
 };
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 023a030ca7b9..76b0f18e6691 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -267,6 +267,7 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file)
 	}
 
 	vfpriv->ctx_id = handle + 1;
+	vfpriv->fence_context = dma_fence_context_alloc(1);
 	file->driver_priv = vfpriv;
 	return 0;
 }
-- 
2.25.1.481.gfbce0eb801-goog



More information about the dri-devel mailing list