All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: "Zhou,
	David(ChunMing)" <David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Rakos, Daniel" <Daniel.Rakos-5C7GfCeVMHo@public.gmane.org>,
	Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4
Date: Fri, 14 Sep 2018 09:47:55 +0200	[thread overview]
Message-ID: <5ed8303e-32af-7908-cb7c-80491f4ba45c@amd.com> (raw)
In-Reply-To: <BY1PR12MB050245C96DE62338FB349AE5B4190-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

Am 14.09.2018 um 09:46 schrieb Zhou, David(ChunMing):
>
>> -----Original Message-----
>> From: Koenig, Christian
>> Sent: Friday, September 14, 2018 3:27 PM
>> To: Zhou, David(ChunMing) <David1.Zhou@amd.com>; Zhou,
>> David(ChunMing) <David1.Zhou@amd.com>; dri-
>> devel@lists.freedesktop.org
>> Cc: Dave Airlie <airlied@redhat.com>; Rakos, Daniel
>> <Daniel.Rakos@amd.com>; amd-gfx@lists.freedesktop.org; Daniel Vetter
>> <daniel@ffwll.ch>
>> Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4
>>
>> Am 14.09.2018 um 05:59 schrieb zhoucm1:
>>>
>>> On 2018年09月14日 11:14, zhoucm1 wrote:
>>>>
>>>> On 2018年09月13日 18:22, Christian König wrote:
>>>>> Am 13.09.2018 um 11:35 schrieb Zhou, David(ChunMing):
>>>>>>> -----Original Message-----
>>>>>>> From: Koenig, Christian
>>>>>>> Sent: Thursday, September 13, 2018 5:20 PM
>>>>>>> To: Zhou, David(ChunMing) <David1.Zhou@amd.com>; dri-
>>>>>>> devel@lists.freedesktop.org
>>>>>>> Cc: Dave Airlie <airlied@redhat.com>; Rakos, Daniel
>>>>>>> <Daniel.Rakos@amd.com>; amd-gfx@lists.freedesktop.org
>>>>>>> Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support v4
>>>>>>>
>>>>>>> Am 13.09.2018 um 11:11 schrieb Zhou, David(ChunMing):
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Christian König <ckoenig.leichtzumerken@gmail.com>
>>>>>>>>> Sent: Thursday, September 13, 2018 4:50 PM
>>>>>>>>> To: Zhou, David(ChunMing) <David1.Zhou@amd.com>; Koenig,
>>>>>>>>> Christian <Christian.Koenig@amd.com>;
>>>>>>>>> dri-devel@lists.freedesktop.org
>>>>>>>>> Cc: Dave Airlie <airlied@redhat.com>; Rakos, Daniel
>>>>>>>>> <Daniel.Rakos@amd.com>; amd-gfx@lists.freedesktop.org
>>>>>>>>> Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline support
>>>>>>>>> v4
>>>>>>>>>
>>>>>>>>> Am 13.09.2018 um 09:43 schrieb Zhou, David(ChunMing):
>>>>>>>>>>> -----Original Message-----
>>>>>>>>>>> From: Koenig, Christian
>>>>>>>>>>> Sent: Thursday, September 13, 2018 2:56 PM
>>>>>>>>>>> To: Zhou, David(ChunMing) <David1.Zhou@amd.com>; Zhou,
>>>>>>>>>>> David(ChunMing) <David1.Zhou@amd.com>; dri-
>>>>>>>>>>> devel@lists.freedesktop.org
>>>>>>>>>>> Cc: Dave Airlie <airlied@redhat.com>; Rakos, Daniel
>>>>>>>>>>> <Daniel.Rakos@amd.com>; amd-gfx@lists.freedesktop.org
>>>>>>>>>>> Subject: Re: [PATCH 1/3] [RFC]drm: add syncobj timeline
>>>>>>>>>>> support v4
>>>>>>>>>>>
>>>>>>>>>>> Am 13.09.2018 um 04:15 schrieb zhoucm1:
>>>>>>>>>>>> On 2018年09月12日 19:05, Christian König wrote:
>>>>>>>>>>>>>>>>> [SNIP]
>>>>>>>>>>>>>>>>> +static void
>>>>>>>>>>>>>>>>> +drm_syncobj_find_signal_pt_for_wait_pt(struct
>>>>>>>>>>>>>>>>> drm_syncobj *syncobj,
>>>>>>>>>>>>>>>>> +                           struct drm_syncobj_wait_pt
>>>>>>>>>>>>>>>>> +*wait_pt) {
>>>>>>>>>>>>>>>> That whole approach still looks horrible complicated to me.
>>>>>>>>>>>>>> It's already very close to what you said before.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Especially the separation of signal and wait pt is
>>>>>>>>>>>>>>>> completely unnecessary as far as I can see.
>>>>>>>>>>>>>>>> When a wait pt is requested we just need to search for
>>>>>>>>>>>>>>>> the signal point which it will trigger.
>>>>>>>>>>>>>> Yeah, I tried this, but when I implement cpu wait ioctl on
>>>>>>>>>>>>>> specific point, we need a advanced wait pt fence,
>>>>>>>>>>>>>> otherwise, we could still need old syncobj cb.
>>>>>>>>>>>>> Why? I mean you just need to call drm_syncobj_find_fence()
>>>>>>>>>>>>> and
>>>>>>>>> when
>>>>>>>>>>>>> that one returns NULL you use wait_event_*() to wait for a
>>>>>>>>>>>>> signal point >= your wait point to appear and try again.
>>>>>>>>>>>> e.g. when there are 3 syncobjs(A,B,C) to wait, all syncobjABC
>>>>>>>>>>>> have no fence yet, as you said, during
>>>>>>>>>>>> drm_syncobj_find_fence(A) is working on wait_event,
>> syncobjB
>>>>>>>>>>>> and syncobjC could already be signaled, then we don't know
>>>>>>>>>>>> which one is first signaled, which is need when wait ioctl
>>>>>>>>>>>> returns.
>>>>>>>>>>> I don't really see a problem with that. When you wait for the
>>>>>>>>>>> first one you need to wait for A,B,C at the same time anyway.
>>>>>>>>>>>
>>>>>>>>>>> So what you do is to register a fence callback on the fences
>>>>>>>>>>> you already have and for the syncobj which doesn't yet have a
>>>>>>>>>>> fence you make sure that they wake up your thread when they
>>>>>>>>>>> get one.
>>>>>>>>>>>
>>>>>>>>>>> So essentially exactly what
>>>>>>>>>>> drm_syncobj_fence_get_or_add_callback()
>>>>>>>>>>> already does today.
>>>>>>>>>> So do you mean we need still use old syncobj CB for that?
>>>>>>>>> Yes, as far as I can see it should work.
>>>>>>>>>
>>>>>>>>>>      Advanced wait pt is bad?
>>>>>>>>> Well it isn't bad, I just don't see any advantage in it.
>>>>>>>> The advantage is to replace old syncobj cb.
>>>>>>>>
>>>>>>>>> The existing mechanism
>>>>>>>>> should already be able to handle that.
>>>>>>>> I thought more a bit, we don't that mechanism at all, if use
>>>>>>>> advanced wait
>>>>>>> pt, we can easily use fence array to achieve it for wait ioctl, we
>>>>>>> should use kernel existing feature as much as possible, not invent
>>>>>>> another, shouldn't we?
>>>>>>> I remember  you said  it before.
>>>>>>>
>>>>>>> Yeah, but the syncobj cb is an existing feature.
>>>>>> This is obviously a workaround when doing for wait ioctl, Do you
>>>>>> see it used in other place?
>>>>>>
>>>>>>> And I absolutely don't see a
>>>>>>> need to modify that and replace it with something far more complex.
>>>>>> The wait ioctl is simplified much more by fence array, not complex,
>>>>>> and we just need  to allocate a wait pt.  If keeping old syncobj cb
>>>>>> workaround, all wait pt logic still is there, just save allocation
>>>>>> and wait pt handling, in fact, which part isn't complex at all. But
>>>>>> compare with ugly syncobj cb, which is simpler.
>>>>> I strongly disagree on that. You just need to extend the syncobj cb
>>>>> with the sequence number and you are done.
>>>>>
>>>>> We could clean that up in the long term by adding some wait_multi
>>>>> event macro, but for now just adding the sequence number should do
>>>>> the trick.
>>>> Quote from Daniel Vetter comment when v1, "
>>>>
>>>> Specifically for this stuff here having unified future fence
>>>> semantics will allow drivers to do clever stuff with them.
>>>>
>>>> "
>>>> I think the advanced wait pt is a similar concept as 'future fence'
>>>> what Daniel Vetter said before, which obviously a right direction.
>>>>
>>>>
>>>> Anyway, I will change the patch as you like if no other comment, so
>>>> that the patch can pass soon.
>>> When I try to remove wait pt future fence, I encounter another
>>> problem, drm_syncobj_find_fence cannot get a fence if signal pt
>>> already is collected as garbage, then CS will report error, any idea
>>> for that?
>> Well when the signal pt is already garbage collected you know that it is
>> already signaled. So you can just return a dummy fence.
>>
>> I actually thought that this was the intention of the dummy fence rename :)
> In fact, this is one of future fence functionality, then why not we unify them? Daniel Vetter also commented that before v1.
> Future fence can unify both your dummy fence and old syncobj cb.
> If you have no objection, I will prepare a patch to let us  see how simple wait_ioctl using fence array.

I do have objections, please keep the existing wait as it is.

Regards,
Christian.

>
>
> Thanks,
> David Zhou
>> Christian.
>>
>>> I still think the future fence is right thing, Could you give futher
>>> thought on it again? Otherwise, we could need various workarounds.
>>>
>>> Thanks,
>>> David Zhou
>>>> Thanks,
>>>> David Zhou
>>>>> Regards,
>>>>> Christian.
>>>>>
>>>>>> Thanks,
>>>>>> David Zhou
>>>>>>> Regards,
>>>>>>> Christian.
>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> David Zhou
>>>>>>>>> Christian.
>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> David Zhou
>>>>>>>>>>> Regards,
>>>>>>>>>>> Christian.
>>>>>>>>>>>
>>>>>>>>>>>> Back to my implementation, it already fixes all your concerns
>>>>>>>>>>>> before, and can be able to easily used in wait_ioctl. When
>>>>>>>>>>>> you feel that is complicated, I guess that is because we
>>>>>>>>>>>> merged all logic to that and much clean up in one patch. In
>>>>>>>>>>>> fact, it already is very simple, timeline_init/fini, create
>>>>>>>>>>>> signal/wait_pt, find signal_pt for wait_pt, garbage
>>>>>>>>>>>> collection, just them.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> David Zhou
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>> Christian.
>>>>>>>>>> _______________________________________________
>>>>>>>>>> amd-gfx mailing list
>>>>>>>>>> amd-gfx@lists.freedesktop.org
>>>>>>>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-09-14  7:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  6:25 [PATCH 1/3] [RFC]drm: add syncobj timeline support v4 Chunming Zhou
2018-09-06  6:25 ` [PATCH 2/3] drm: add support of syncobj timeline point wait Chunming Zhou
     [not found]   ` <20180906062523.16542-2-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-09-06  7:27     ` Christian König
     [not found] ` <20180906062523.16542-1-david1.zhou-5C7GfCeVMHo@public.gmane.org>
2018-09-06  6:25   ` [PATCH 3/3] drm: add timeline syncobj payload query ioctl Chunming Zhou
2018-09-06  7:25   ` [PATCH 1/3] [RFC]drm: add syncobj timeline support v4 Christian König
     [not found]     ` <4374aa17-c659-0c22-a487-c5e236690108-5C7GfCeVMHo@public.gmane.org>
2018-09-12  7:22       ` Christian König
     [not found]         ` <b69c0d93-5e46-fc25-2545-e2e1de18295e-5C7GfCeVMHo@public.gmane.org>
2018-09-12 10:20           ` zhoucm1
     [not found]             ` <e90fbb9b-f201-9887-c722-fa91c300441b-5C7GfCeVMHo@public.gmane.org>
2018-09-12 11:05               ` Christian König
     [not found]                 ` <7117b33b-c24f-6cb5-5372-143385f7a7b5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-13  2:15                   ` zhoucm1
2018-09-13  6:55                     ` Christian König
     [not found]                       ` <6879599a-0270-3eae-f8a2-1efc154159bb-5C7GfCeVMHo@public.gmane.org>
2018-09-13  7:43                         ` Zhou, David(ChunMing)
     [not found]                           ` <BY1PR12MB0502C7E29899EBF4B0379B0BB41A0-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-13  8:50                             ` Christian König
     [not found]                               ` <ead45230-65dd-ecd8-5153-8312dd2a9480-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-13  9:11                                 ` Zhou, David(ChunMing)
     [not found]                                   ` <BY1PR12MB0502DD202E93FFAD340FE931B41A0-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-13  9:20                                     ` Christian König
     [not found]                                       ` <54f6a4e6-36e1-fb6d-967a-81a105ea271d-5C7GfCeVMHo@public.gmane.org>
2018-09-13  9:35                                         ` Zhou, David(ChunMing)
     [not found]                                           ` <BY1PR12MB05020A2E66D19438D4069CFCB41A0-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-13 10:22                                             ` Christian König
     [not found]                                               ` <c077c499-dcad-2545-d918-75f13a1d3a14-5C7GfCeVMHo@public.gmane.org>
2018-09-14  3:14                                                 ` zhoucm1
     [not found]                                                   ` <a47d925d-c37f-d60c-db8d-dfb4ea570dca-5C7GfCeVMHo@public.gmane.org>
2018-09-14  3:59                                                     ` zhoucm1
2018-09-14  7:26                                                       ` Christian König
2018-09-14  7:46                                                         ` Zhou, David(ChunMing)
     [not found]                                                           ` <BY1PR12MB050245C96DE62338FB349AE5B4190-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-14  7:47                                                             ` Christian König [this message]
2018-09-06  8:57 Chunming Zhou

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=5ed8303e-32af-7908-cb7c-80491f4ba45c@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Daniel.Rakos-5C7GfCeVMHo@public.gmane.org \
    --cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
    --cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.