Skip to contentSkip to conversation

drm/virtio: Fix same-context optimization

PATCH Applied Rob Clark 2 participants 2 messages Aug 12, 2022 – Aug 25, 2022

Subsystems (4)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm/virtio: Fix same-context optimization

From: Rob Clark <[email protected]>

When VIRTGPU_EXECBUF_RING_IDX is used, we should be considering the timeline that the EB if running on rather than the global driver fence context.

Fixes 85c83ea915ed ("drm/virtio: implement context init: allocate an array of fence contexts")
---
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 -1
index fa2f757583f7..9e6cb3c2666e 100644
@@ -168,7 +168,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
 		 * array contains any fence from a foreign context.
 		 */
 		ret = 0;
-		if (!dma_fence_match_context(in_fence, vgdev->fence_drv.context))
+		if (!dma_fence_match_context(in_fence, fence_ctx + ring_idx))
 			ret = dma_fence_wait(in_fence, true);
 
 		dma_fence_put(in_fence);
Signature · 1 line
2.36.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Rob Clark

From: Rob Clark <[email protected]>

When VIRTGPU_EXECBUF_RING_IDX is used, we should be considering the timeline that the EB if running on rather than the global driver fence context.

Fixes 85c83ea915ed ("drm/virtio: implement context init: allocate an array of fence contexts")

Pushed to drm-misc-next.

thanks,
Gerd