From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [RFC v3] drm/i915: Android native sync support
Date: Wed, 28 Jan 2015 16:52:53 +0000 [thread overview]
Message-ID: <54C913E5.3010605@linux.intel.com> (raw)
In-Reply-To: <20150128092918.GM4764@phenom.ffwll.local>
On 01/28/2015 09:29 AM, Daniel Vetter wrote:
> On Tue, Jan 27, 2015 at 11:29:36AM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Add Android native sync support with fences exported as file descriptors via
>> the execbuf ioctl (rsvd2 field is used).
>>
>> This is a continuation of Jesse Barnes's previous work, squashed to arrive at
>> the final destination, cleaned up, with some fixes and preliminary light
>> testing.
>>
>> GEM requests are extended with fence structures which are associated with
>> Android sync fences exported to user space via file descriptors. Fences which
>> are waited upon, and while exported to userspace, are referenced and added to
>> the irq_queue so they are signalled when requests are completed. There is no
>> overhead apart from the where fences are not requested.
>>
>> Based on patches by Jesse Barnes:
>> drm/i915: Android sync points for i915 v3
>> drm/i915: add fences to the request struct
>> drm/i915: sync fence fixes/updates
>>
>> To do:
>> * Extend driver data with context id / ring id (TBD).
>>
>> v2:
>> * Code review comments. (Chris Wilson)
>> * ring->add_request() was a wrong thing to call - rebase on top of John
>> Harrison's (drm/i915: Early alloc request) to ensure correct request is
>> present before creating a fence.
>> * Take a request reference from signalling path as well to ensure request
>> sticks around while fence is on the request completion wait queue.
>>
>> v3:
>> * Use worker to unreference on completion so it can lock the mutex from
>> interrupt context.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
>> Cc: John Harrison <John.C.Harrison@Intel.com>
>
> btw for merging we need to split the conversion to fences out from the
> actual userspace interface. And imo we should replace a lot of our
> existing usage of i915_gem_request with fences within the driver, too. Not
> tacked on the side like in your patch here. All the recent refactoring
> have been aiming to match i915 requests to the internal fence interfaces,
> so we should be pretty much there.
Ok I did not realize this. It did not make sense to me to split it out
if the only access point to create them is via Android native sync, but
from what you are saying fences should be initialized and active for all
requests all the time. With the native sync part established on demand.
In what respects has the refactoring been aligning requests and fences?
> We also need this to be able to integrate with the scheduler properly - if
> that needs to deal both with fences and i915 requests separately it'll be
> a bit more messy. If it's all just fences the code should be streamlined a
> lot.
Requests will remain as main data structure representing the unit of GPU
work?
Is so, it sounds logical that fences are associated (or aggregated) with
requests. I don't see how scheduler would work with fences and not requests.
Regards,
Tvrtko
P.S. Thanks for pointing out self-tuning busy loads in another thread -
it works nicely.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-01-28 16:52 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 11:15 [RFC] drm/i915: Android native sync support Tvrtko Ursulin
2015-01-22 11:42 ` Chris Wilson
2015-01-22 13:41 ` Tvrtko Ursulin
2015-01-22 13:49 ` Chris Wilson
2015-01-22 13:56 ` Tvrtko Ursulin
2015-01-22 14:04 ` Damien Lespiau
2015-01-22 15:28 ` Tvrtko Ursulin
2015-01-22 15:47 ` Damien Lespiau
2015-01-22 15:54 ` Tvrtko Ursulin
2015-01-22 16:07 ` Damien Lespiau
2015-01-23 11:13 ` [RFC v2] " Tvrtko Ursulin
2015-01-23 11:27 ` Chris Wilson
2015-01-23 14:02 ` Tvrtko Ursulin
2015-01-23 15:53 ` Daniel Vetter
2015-01-23 16:49 ` Tvrtko Ursulin
2015-01-24 9:47 ` Daniel Vetter
2015-01-26 11:08 ` Tvrtko Ursulin
2015-01-28 9:20 ` Daniel Vetter
2015-01-23 17:30 ` Chris Wilson
2015-01-24 9:41 ` Daniel Vetter
2015-01-24 16:08 ` Chris Wilson
2015-01-26 7:52 ` Daniel Vetter
2015-01-26 9:08 ` Chris Wilson
2015-01-28 9:22 ` Daniel Vetter
2015-01-28 9:23 ` Chris Wilson
2015-01-28 9:50 ` Daniel Vetter
2015-01-28 10:07 ` Chris Wilson
2015-02-25 20:46 ` Jesse Barnes
2015-02-26 9:13 ` Chris Wilson
2015-01-27 11:29 ` [RFC v3] " Tvrtko Ursulin
2015-01-27 11:40 ` Chris Wilson
2015-01-27 12:13 ` Tvrtko Ursulin
2015-01-27 12:18 ` Chris Wilson
2015-01-27 13:43 ` Tvrtko Ursulin
2015-01-28 9:25 ` Daniel Vetter
2015-01-28 9:29 ` Daniel Vetter
2015-01-28 16:52 ` Tvrtko Ursulin [this message]
2015-01-29 16:14 ` Daniel Vetter
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=54C913E5.3010605@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
/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