dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Jason Ekstrand <jason@jlekstrand.net>, dri-devel@lists.freedesktop.org
Cc: Jason Ekstrand <jason.ekstrand@intel.com>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH 0/9] drm/syncobj: Add full-featured wait support (v2)
Date: Sun, 13 Aug 2017 17:52:06 +0200	[thread overview]
Message-ID: <676f6b65-0ab5-e69e-19a5-ebcebd6754a3@amd.com> (raw)
In-Reply-To: <15ddc33d250.277a.c6988b7ea6112e3e892765a0d4287e0c@jlekstrand.net>

Am 13.08.2017 um 17:26 schrieb Jason Ekstrand:
> On August 13, 2017 6:19:53 AM Christian König 
> <christian.koenig@amd.com> wrote:
>
>> Patches #1-#4 are Acked-by: Christian König <christian.koenig@amd.com>.
>>
>> Patch #5: NAK, that will break radeon.
>>
>> On radeon we need the non-default wait or otherwise we can run into a
>> situation where we never signal a fence.
>>
>> The general question is why do you need this?
>
> Because i915 sets a non-default wait function so calling wait_any just 
> bails with fences from i915 immediately bails with -EINVAL. This makes 
> it work even with non-default waits.

Ok well, let me refine the question: Why does i915 sets a non-default 
wait function?

In radeon we have it because we need to handle 10+ years of different 
hardware generation, each which a bunch of separate bugs in their fence 
handling (and some even not solved by today).

>
>> Patch #6: Yes, please. Patch is Reviewed-by: Christian König
>> <christian.koenig@amd.com>.
>>
>> Patch #7: Already gave my rb on the patch Chris send out earlier.
>>
>> Patch #8: NAK to the whole approach.
>>
>> IIRC we discussed a very similar thing during the initial fence bringup
>> and also during the fence_array development.
>>
>> The problem is that you can easily build ring dependencies and so
>> deadlocks with it.
>>
>> I would really prefer an approach which is completely contained inside
>> the syncobj code base.
>
> Are you use to the approach of internally making a proxy so long as 
> all the proxy code is inside syncobj?
Yes, that would be a start.

In general if possible I would rather like to avoid the whole handling 
with the proxy/callback altogether, but that possible only works with 
wait for any if the waitqueue is global and that wouldn't be ideal either.

> Is also be happy to go back to the original approach with v3 of the 
> last patch.
v3 looked like it should work as well, I would just drop abusing the 
fence callback structure for the signaling.

Ideally we would finally come up with an interface to wait for multiple 
waitqueue at the same time, but that probably goes a bit to far.

For now just use a single linked list to start all processes waiting for 
a fence to arrive or something like this.

Regards,
Christian.

>
>> Regards,
>> Christian.
>>
>> Am 12.08.2017 um 00:39 schrieb Jason Ekstrand:
>>> This series does the same thing as my earlier series in that it adds 
>>> a sync
>>> object wait interface complete with WAIT_FOR_SUBMIT flag. While the 
>>> uapi
>>> remains unchanged, the guts look a bit different.  Instead of adding a
>>> callback mechanism to drm_syncobj that fired whenever replace_fence was
>>> called, it's now using proxy fences.  The drm_syncobj_fence_get still
>>> returns NULL whenever the sync object is in an unsubmitted state but 
>>> there
>>> is a new drm_syncobj_fence_proxy_get which returns either the real 
>>> fence or
>>> a proxy fence that will be triggered the next time replace_fence is 
>>> called
>>> with a non-NULL replacement.  This does make both 
>>> drm_syncobj_fence_get and
>>> drm_syncobj_replace_fence a tiny bit more expensive, but it lets us 
>>> do it
>>> all without locking.
>>>
>>> This series can be found as a branch here:
>>>
>>> https://cgit.freedesktop.org/~jekstrand/linux/log/?h=drm-syncobj-wait-submit-v4 
>>>
>>>
>>> IGT tests for DRM_IOCTL_SYNCOBJ_WAIT and DRM_IOCTL_SYNCOBJ_RESET can be
>>> found on patchwork here:
>>>
>>> https://patchwork.freedesktop.org/series/28666/
>>>
>>> Patches to the Intel Vulkan driver to implement 
>>> VK_KHR_external_fence on
>>> top of this kernel interface can be found here:
>>>
>>> https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/anv-external-fence 
>>>
>>>
>>> Cc: Dave Airlie <airlied@redhat.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Christian König <christian.koenig@amd.com>
>>>
>>> Chris Wilson (2):
>>>    dma-buf/dma-fence: Signal all callbacks from dma_fence_release()
>>>    dma-buf/dma-fence: Add a mechanism for proxy fences
>>>
>>> Dave Airlie (1):
>>>    drm/syncobj: add sync obj wait interface. (v8)
>>>
>>> Jason Ekstrand (6):
>>>    drm/syncobj: Rename fence_get to find_fence
>>>    drm/syncobj: Add a race-free drm_syncobj_fence_get helper
>>>    i915: Add support for drm syncobjs
>>>    dma-buf/dma-fence: Allow wait_any_timeout without default_wait (v2)
>>>    drm/syncobj: Add a reset ioctl
>>>    drm/syncobj: Allow wait for submit and signal behavior (v4)
>>>
>>>   drivers/dma-buf/Makefile                   |   4 +-
>>>   drivers/dma-buf/dma-fence-proxy.c          | 186 +++++++++++++++++++
>>>   drivers/dma-buf/dma-fence.c                |  34 ++--
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c     |   2 +-
>>>   drivers/gpu/drm/drm_internal.h             |   4 +
>>>   drivers/gpu/drm/drm_ioctl.c                |   4 +
>>>   drivers/gpu/drm/drm_syncobj.c              | 275 
>>> +++++++++++++++++++++++++++--
>>>   drivers/gpu/drm/i915/i915_drv.c            |   3 +-
>>>   drivers/gpu/drm/i915/i915_gem_execbuffer.c | 146 ++++++++++++++-
>>>   include/drm/drm_syncobj.h                  |  15 +-
>>>   include/linux/dma-fence-proxy.h            |  25 +++
>>>   include/uapi/drm/drm.h                     |  19 ++
>>>   include/uapi/drm/i915_drm.h                |  30 +++-
>>>   13 files changed, 710 insertions(+), 37 deletions(-)
>>>   create mode 100644 drivers/dma-buf/dma-fence-proxy.c
>>>   create mode 100644 include/linux/dma-fence-proxy.h
>>>
>>
>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-08-13 16:08 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 22:46 [PATCH 0/9] drm/syncobj: Add full-featured wait support Jason Ekstrand
2017-08-08 22:46 ` [PATCH 1/9] drm/syncobj: Rename fence_get to find_fence Jason Ekstrand
2017-08-08 22:46 ` [PATCH 2/9] drm/syncobj: Lock around drm_syncobj::fence Jason Ekstrand
2017-08-09 21:21   ` Chris Wilson
2017-08-10  0:31     ` Jason Ekstrand
2017-08-10 10:55       ` Chris Wilson
2017-08-10 19:10       ` Chris Wilson
2017-08-08 22:46 ` [PATCH 3/9] drm/syncobj: Remove file_private from replace_fence Jason Ekstrand
2017-08-08 22:46 ` [PATCH 4/9] i915: Add support for drm syncobjs Jason Ekstrand
2017-08-08 22:46 ` [PATCH 5/9] drm/syncobj: add sync obj wait interface. (v8) Jason Ekstrand
2017-08-08 22:46 ` [PATCH 6/9] dma-buf/dma-fence: Allow wait_any_timeout without default_wait Jason Ekstrand
2017-08-08 22:46 ` [PATCH 7/9] drm/syncobj: Add a reset ioctl Jason Ekstrand
2017-08-08 22:46 ` [PATCH 8/9] drm/syncobj: Add a callback mechanism for replace_fence Jason Ekstrand
2017-08-08 22:46 ` [PATCH 9/9] drm/syncobj: Allow wait for submit and signal behavior Jason Ekstrand
2017-08-09 17:00   ` [PATCH] drm/syncobj: Allow wait for submit and signal behavior (v2) Jason Ekstrand
2017-08-09 17:57     ` Chris Wilson
2017-08-09 18:25       ` Christian König
2017-08-09 21:09         ` Jason Ekstrand
2017-08-09 22:41       ` Chris Wilson
2017-08-09 23:53         ` Jason Ekstrand
2017-08-10 11:00           ` Chris Wilson
2017-08-10 14:42             ` Jason Ekstrand
2017-08-10 12:26           ` Christian König
2017-08-10 14:32             ` Jason Ekstrand
2017-08-10 14:41               ` Christian König
2017-08-09 21:31     ` Chris Wilson
2017-08-09 21:54       ` Jason Ekstrand
2017-08-10 12:26       ` Christian König
2017-08-10  1:35     ` [PATCH v3 9/9] drm/syncobj: Allow wait for submit and signal behavior (v3) Jason Ekstrand
2017-08-11 22:39 ` [PATCH 0/9] drm/syncobj: Add full-featured wait support (v2) Jason Ekstrand
2017-08-11 22:39   ` [PATCH 1/9] drm/syncobj: Rename fence_get to find_fence Jason Ekstrand
2017-08-11 22:39   ` [PATCH 2/9] drm/syncobj: Add a race-free drm_syncobj_fence_get helper Jason Ekstrand
2017-08-14  2:03     ` kbuild test robot
2017-08-11 22:39   ` [PATCH 3/9] i915: Add support for drm syncobjs Jason Ekstrand
2017-08-14  2:58     ` Jason Ekstrand
2017-08-11 22:39   ` [PATCH 4/9] drm/syncobj: add sync obj wait interface. (v8) Jason Ekstrand
2017-08-11 22:39   ` [PATCH 5/9] dma-buf/dma-fence: Allow wait_any_timeout without default_wait (v2) Jason Ekstrand
2017-08-11 22:39   ` [PATCH 6/9] drm/syncobj: Add a reset ioctl Jason Ekstrand
2017-08-11 22:39   ` [PATCH 7/9] dma-buf/dma-fence: Signal all callbacks from dma_fence_release() Jason Ekstrand
2018-01-31 12:32     ` Gustavo Padovan
2018-01-31 15:53       ` Chris Wilson
2017-08-11 22:39   ` [PATCH 8/9] dma-buf/dma-fence: Add a mechanism for proxy fences Jason Ekstrand
2017-08-11 22:39   ` [PATCH 9/9] drm/syncobj: Allow wait for submit and signal behavior (v4) Jason Ekstrand
2017-08-13 13:19   ` [PATCH 0/9] drm/syncobj: Add full-featured wait support (v2) Christian König
2017-08-13 15:26     ` Jason Ekstrand
2017-08-13 15:52       ` Christian König [this message]
2017-08-13 23:14         ` Jason Ekstrand
2017-08-14  5:49           ` Jason Ekstrand
2017-08-14  7:36           ` Christian König
2017-08-14 15:08             ` Jason Ekstrand
2017-08-16 15:52               ` Jason Ekstrand
2017-08-16 16:53                 ` Christian König
2017-08-16 20:10                   ` Jason Ekstrand
2017-08-21 21:42                     ` Jason Ekstrand
2017-08-22  8:30                       ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=676f6b65-0ab5-e69e-19a5-ebcebd6754a3@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason.ekstrand@intel.com \
    --cc=jason@jlekstrand.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox