From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Intel-gfx@lists.freedesktop.org
Subject: Re: [RFC] drm/i915: Infrastructure for supporting different GGTT views per object
Date: Mon, 24 Nov 2014 12:32:12 +0000 [thread overview]
Message-ID: <5473254C.4010009@linux.intel.com> (raw)
In-Reply-To: <20141112170258.GC25711@phenom.ffwll.local>
On 11/12/2014 05:02 PM, Daniel Vetter wrote:
> On Thu, Nov 06, 2014 at 02:39:25PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Things like reliable GGTT mmaps and mirrored 2d-on-3d display will need
>> to map objects into the same address space multiple times.
>>
>> This also means that objects now can have multiple VMA entries.
>>
>> Added a GGTT view concept and linked it with the VMA to distinguish betwen
>> multiple instances per address space.
>>
>> New objects and GEM functions which do not take this new view as a parameter
>> assume the default of zero (I915_GGTT_VIEW_NORMAL) which preserves the
>> previous behaviour.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Let's hope I've picked the latest version, not sure. Please either have
> in-patch changelogs or coverletters with what's new to help confused
> maintainers ;-)
I had a cover letter and version when it was a patch series _and_ the
concept split into multiple VMA and GGTT view. Once only one patch
remained from the patch series and it was redesigned to kind of merge
two concepts into one simplified approach I did not think cover letter
makes sense any more. Will definitely version as this design goes forward.
> Looks good overal, just a few things around the lifetime rules for sg
> tables and related stuff that we've discussed offline. And one nit.
>
> I think with these addressed this is ready for detailed review and merging
> (also applies to the -internal series).
Excellent, thank you! Just one question below:
>> -int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
>> +int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj,
>> + const struct i915_ggtt_view *view)
>> {
>> - if (obj->has_dma_mapping)
>> + if (obj->has_dma_mapping || view->type != I915_GGTT_VIEW_NORMAL)
>
> This check and the one for finish_gtt are wrong. prepare/finish_gtt set up
> the dma_addr fields in the sg table (if available also the iommu mappings
> on big core). And that _must_ be done when the first view shows up, no
> matter which one it is. E.g. userspace might display a rotate buffer right
> aways without even rendering or writing into it (i.e. leaving it black).
The plan was to ensure that the "normal" view is always there first.
Otherwise we can't "steal" DMA addresses and the other views do not have
a proper SG table to generate DMA addresses from. So the internal code
was doing that. Am I missing something?
> The change around finish_gtt is actually a leak since if the last view
> around is the rotate one (which can happen if userspace drops the buffer
> but leaves it displayed) we won't clean up (and so leak) the iommu
> mapping.
So I somehow need to ensure finish_gtt on a "normal" view is done last,
correct? Move it from VMA destructon to object destruction? Would this
have any implications for the shrinker?
Thanks,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-24 12:32 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 16:39 [RFC 0/5] Preparation for multiple VMA and GGTT views per GEM object Tvrtko Ursulin
2014-10-30 16:39 ` [PATCH 1/5] drm/i915: Move flags describing VMA mappings into the VMA Tvrtko Ursulin
2014-10-30 16:39 ` [RFC 2/5] drm/i915: Prepare for the idea there can be multiple VMA per VM Tvrtko Ursulin
2014-10-30 16:39 ` [RFC 3/5] drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko Ursulin
2014-10-30 16:41 ` Chris Wilson
2014-10-30 16:55 ` Tvrtko Ursulin
2014-11-03 15:58 ` Daniel Vetter
2014-11-03 16:34 ` Tvrtko Ursulin
2014-11-03 16:52 ` Daniel Vetter
2014-11-03 17:20 ` Tvrtko Ursulin
2014-11-03 17:29 ` Daniel Vetter
2014-11-04 11:15 ` Tvrtko Ursulin
2014-11-04 11:23 ` Daniel Vetter
2014-11-03 17:35 ` Daniel Vetter
2014-11-04 10:25 ` Tvrtko Ursulin
2014-10-30 16:39 ` [PATCH 4/5] drm/i915: Make scatter-gather helper available to the driver Tvrtko Ursulin
2014-11-03 16:02 ` Daniel Vetter
2014-11-03 16:18 ` Tvrtko Ursulin
2014-11-03 16:53 ` Daniel Vetter
2014-11-03 16:05 ` Daniel Vetter
2014-11-03 20:30 ` Chris Wilson
2014-11-04 11:56 ` Imre Deak
2014-10-30 16:39 ` [RFC 5/5] drm/i915: Make intel_pin_and_fence_fb_obj take plane and framebuffer Tvrtko Ursulin
2014-11-03 16:18 ` Daniel Vetter
2014-11-06 14:39 ` [RFC] drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko Ursulin
2014-11-12 17:02 ` Daniel Vetter
2014-11-24 12:32 ` Tvrtko Ursulin [this message]
2014-11-24 12:36 ` Chris Wilson
2014-11-24 13:57 ` Daniel Vetter
2014-11-27 14:52 ` [PATCH] " Tvrtko Ursulin
2014-11-28 0:59 ` [PATCH] drm/i915: Infrastructure for supporting shuang.he
2014-11-28 17:31 ` [PATCH] drm/i915: Infrastructure for supporting different GGTT views per object Daniel Vetter
2014-12-01 11:32 ` Tvrtko Ursulin
2014-12-01 14:46 ` Tvrtko Ursulin
2014-12-01 16:01 ` Daniel Vetter
2014-12-01 16:39 ` Tvrtko Ursulin
2014-12-01 17:16 ` Daniel Vetter
2014-12-01 17:24 ` Tvrtko Ursulin
2014-12-01 16:07 ` Daniel Vetter
2014-12-01 16:34 ` Tvrtko Ursulin
2014-12-01 17:19 ` Daniel Vetter
2014-12-01 17:50 ` Tvrtko Ursulin
2014-12-02 9:12 ` 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=5473254C.4010009@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=daniel.vetter@ffwll.ch \
--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;
as well as URLs for NNTP newsgroup(s).