Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Jason Ekstrand <jason@jlekstrand.net>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915: Implement SINGLE_TIMELINE with a syncobj
Date: Tue, 23 Mar 2021 09:35:34 +0000	[thread overview]
Message-ID: <963d089f-a08a-c3e7-4497-6f7d27b18520@linux.intel.com> (raw)
In-Reply-To: <CAOFGe97y67n4EPb6745QsJdz=ERMn3K-gsLR8Qjmemp92nwMoQ@mail.gmail.com>


On 22/03/2021 16:10, Jason Ekstrand wrote:
> On Mon, Mar 22, 2021 at 7:28 AM Tvrtko Ursulin

[snip]

>>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>>> index 96403130a373d..2c56796f6a71b 100644
>>> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
>>> @@ -3295,6 +3295,15 @@ i915_gem_do_execbuffer(struct drm_device *dev,
>>>                goto err_vma;
>>>        }
>>>
>>> +     if (eb.gem_context->syncobj) {
>>> +             struct dma_fence *fence;
>>> +
>>> +             fence = drm_syncobj_fence_get(eb.gem_context->syncobj);
>>
>> Who drops this reference?
> 
> i915_request_await_dma_fence() below consumes a reference.

Not sure, please check on difference wrt input fence handling.

>>> +             err = i915_request_await_dma_fence(eb.request, fence);
>>> +             if (err)
>>> +                     goto err_ext;
>>> +     }
>>> +
>>>        if (in_fence) {
>>>                if (args->flags & I915_EXEC_FENCE_SUBMIT)
>>>                        err = i915_request_await_execution(eb.request,
>>> @@ -3351,6 +3360,12 @@ i915_gem_do_execbuffer(struct drm_device *dev,
>>>                        fput(out_fence->file);
>>>                }
>>>        }
>>> +
>>> +     if (eb.gem_context->syncobj) {
>>> +             drm_syncobj_replace_fence(eb.gem_context->syncobj,
>>> +                                       &eb.request->fence);
>>> +     }
>>> +
>>>        i915_request_put(eb.request);
>>>
>>>    err_vma:
>>>
>>
>> So essentially moving the synchronisation to top level which is extra
>> work, but given limited and questionable usage of the uapi may be
>> acceptable. Need full picture on motivation to understand.
> 
> For one thing, the GuC scheduler doesn't natively have a concept of
> "timelines" which can be shared like this.  To work with the GuC

Confused - neither does execlists. It is handled in common layer in 
i915. GuC scheduler has the same concept of one hw context is one 
timeline because that is the hw concept and not backend specific.

> scheduler as currently proposed in DII, they've asked the media driver
> to stop using this flag in favor of passing a sync file from batch to
> batch.  If we want to slide GuC scheduling in smoothly, we've got to
> keep it working.  This means either making timelines a concept there
> or doing an emulation like this.

Hm not aware and don't see that GuC backend can't or doesn't implement 
this. Perhaps this would be best discussed once GuC patches are posted.

>> Semantics are also not 1:1 since dma fence context will be different.
> 
> Could you elaborate?

Exported dma fence context as an "timeline" id will be single with the 
current patch and multiple contexts with this implementation.

Daniel also raised another difference caused by lack of serialisation 
due multiple tl->mutex here.

I don't think this is important, it was never part of a contract what 
happens with racing execbufs, but it is definitely required covering 
both topics in the commit message.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-23  9:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 22:38 [Intel-gfx] [PATCH 0/4] drm/i915: uAPI clean-ups part 2 Jason Ekstrand
2021-03-19 22:38 ` [Intel-gfx] [PATCH 1/4] drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE Jason Ekstrand
2021-03-20 14:48   ` Jason Ekstrand
2021-03-22 10:52     ` Matthew Auld
2021-03-22 16:00       ` Jason Ekstrand
2021-03-22 12:01     ` Jani Nikula
2021-03-22 16:01       ` Jason Ekstrand
2021-03-22 16:26         ` Daniel Vetter
2021-03-19 22:38 ` [Intel-gfx] [PATCH 2/4] drm/i915: Drop I915_CONTEXT_PARAM_NO_ZEROMAP Jason Ekstrand
2021-03-22 13:00   ` [Intel-gfx] [drm/i915] 014c1518e8: assertion_failure kernel test robot
2021-03-19 22:38 ` [Intel-gfx] [PATCH 3/4] drm/i915: Drop the CONTEXT_CLONE API Jason Ekstrand
2021-03-22 11:22   ` Tvrtko Ursulin
2021-03-22 14:09     ` Daniel Vetter
2021-03-22 14:32       ` Tvrtko Ursulin
2021-03-22 14:57         ` Daniel Vetter
2021-03-22 15:31           ` Tvrtko Ursulin
2021-03-22 16:24             ` Jason Ekstrand
2021-03-23  9:46               ` Tvrtko Ursulin
2021-03-22 16:43             ` Daniel Vetter
2021-03-23  9:14               ` Tvrtko Ursulin
2021-03-23 13:23                 ` Daniel Vetter
2021-03-23 16:23                   ` Tvrtko Ursulin
2021-03-23 17:50                     ` Jason Ekstrand
2021-03-19 22:38 ` [Intel-gfx] [PATCH 4/4] drm/i915: Implement SINGLE_TIMELINE with a syncobj Jason Ekstrand
2021-03-22 12:28   ` Tvrtko Ursulin
2021-03-22 16:10     ` Jason Ekstrand
2021-03-23  9:35       ` Tvrtko Ursulin [this message]
2021-03-23 17:44         ` Jason Ekstrand
2021-03-22 16:59   ` Daniel Vetter
2021-03-22 19:12     ` Jason Ekstrand
2021-03-23 17:51   ` [Intel-gfx] [PATCH] drm/i915: Implement SINGLE_TIMELINE with a syncobj (v2) Jason Ekstrand
2021-03-24  9:28     ` Tvrtko Ursulin
2021-03-24  9:52       ` Daniel Vetter
2021-03-24 11:36         ` Tvrtko Ursulin
2021-03-24 17:18           ` Jason Ekstrand
2021-03-25  9:48             ` Tvrtko Ursulin
2021-03-25  9:54               ` Daniel Vetter
2021-03-24  9:46     ` Daniel Vetter
2021-03-25 21:13     ` Matthew Brost
2021-03-25 22:19       ` Jason Ekstrand
2021-03-25 22:21     ` [Intel-gfx] [PATCH 4/4] drm/i915: Implement SINGLE_TIMELINE with a syncobj (v3) Jason Ekstrand
2021-03-19 23:14 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: uAPI clean-ups part 2 Patchwork
2021-03-22 11:55   ` Jani Nikula
2021-03-22 16:11     ` Jason Ekstrand
2021-03-23 21:32 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: uAPI clean-ups part 2 (rev2) Patchwork
2021-03-26  3:01 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: uAPI clean-ups part 2 (rev3) Patchwork

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=963d089f-a08a-c3e7-4497-6f7d27b18520@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --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