From: jsg Date: Wed, 15 Feb 2023 10:28:39 +0000 (+0000) Subject: drm/i915: Move fd_install after last use of fence X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0acc5a26bcea3e26e503068f604cd6b049d8ec8c;p=openbsd drm/i915: Move fd_install after last use of fence From Rob Clark bfa700d12274bd3509b64fd545d1046eef89d564 in linux-6.1.y/6.1.12 251e8c5b1b1fadcc387a8e618c7437d330bdac3e in mainline linux --- diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_execbuffer.c b/sys/dev/pci/drm/i915/gem/i915_gem_execbuffer.c index f897a9e16c0..d704fa97f9c 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_execbuffer.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_execbuffer.c @@ -3537,6 +3537,13 @@ err_request: eb.composite_fence : &eb.requests[0]->fence); + if (unlikely(eb.gem_context->syncobj)) { + drm_syncobj_replace_fence(eb.gem_context->syncobj, + eb.composite_fence ? + eb.composite_fence : + &eb.requests[0]->fence); + } + if (out_fence) { if (err == 0) { fd_install(out_fence_fd, out_fence->file); @@ -3548,13 +3555,6 @@ err_request: } } - if (unlikely(eb.gem_context->syncobj)) { - drm_syncobj_replace_fence(eb.gem_context->syncobj, - eb.composite_fence ? - eb.composite_fence : - &eb.requests[0]->fence); - } - if (!out_fence && eb.composite_fence) dma_fence_put(eb.composite_fence);