dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/virtio: Fix same-context optimization
@ 2022-08-12 22:40 Rob Clark
  2022-08-25  9:59 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Clark @ 2022-08-12 22:40 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Clark, David Airlie, open list, Gurchetan Singh,
	Gerd Hoffmann, Lingfeng Yang, open list:VIRTIO GPU DRIVER

From: Rob Clark <robdclark@chromium.org>

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")
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index fa2f757583f7..9e6cb3c2666e 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -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);
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/virtio: Fix same-context optimization
  2022-08-12 22:40 [PATCH] drm/virtio: Fix same-context optimization Rob Clark
@ 2022-08-25  9:59 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2022-08-25  9:59 UTC (permalink / raw)
  To: Rob Clark
  Cc: Rob Clark, David Airlie, open list, dri-devel, Gurchetan Singh,
	Lingfeng Yang, open list:VIRTIO GPU DRIVER

On Fri, Aug 12, 2022 at 03:40:00PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> 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")
> Signed-off-by: Rob Clark <robdclark@chromium.org>

Pushed to drm-misc-next.

thanks,
  Gerd


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-25 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 22:40 [PATCH] drm/virtio: Fix same-context optimization Rob Clark
2022-08-25  9:59 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).