Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Akash Goel <akash.goel@intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] intel: New libdrm interface to create unbound wc user mappings for objects
Date: Sun, 26 Oct 2014 14:06:57 +0530	[thread overview]
Message-ID: <1414312617.7355.57.camel@akashgoe-desktop> (raw)
In-Reply-To: <20141025124505.GA2660@strange.ger.corp.intel.com>

On Sat, 2014-10-25 at 13:45 +0100, Damien Lespiau wrote:
> On Sat, Oct 25, 2014 at 05:21:53PM +0530, akash.goel@intel.com wrote:
> > From: Akash Goel <akash.goel@intel.com>
> > 
> > A new libdrm interface 'drm_intel_gem_bo_map_wc' is provided by this
> > patch. Through this interface Gfx clients can create write combining
> > virtual mappings of the Gem object. It will provide the same funtionality
> > of 'mmap_gtt' interface without the constraints of limited aperture space,
> > but provided clients handles the linear to tile conversion on their own.
> > This patch is intended for improving the CPU write operation performance,
> > as with such mapping, writes are almost 50% faster than with mmap_gtt.
> > Also it avoids the Cache flush after update from CPU side, when object is
> > passed on to GPU, which will be the case if regular mmap interface is used.
> > This type of mapping is specially useful in case of sub-region
> > update, i.e. when only a portion of the object is to be updated.
> > Also there is a support for the unsynchronized version of this interface
> > named 'drm_intel_gem_bo_map_wc_unsynchronized', through which wc virtual
> > mappings, but unsynchronized one, can be created of the Gem object.
> > To ensure the cache coherency, before using this mapping, the GTT domain has
> > been reused here. This provides the required Cache flush if the object is in
> > CPU domain or synchronization against the concurrent rendering
> > 
> > The drm_i915_gem_mmap structure (for the DRM_I915_GEM_MMAP_IOCTL) has been
> > extended with a new flags field (defaulting to 0 for existent users). In
> > order for userspace to detect the extended ioctl, a new parameter
> > I915_PARAM_HAS_EXT_MMAP has been added for versioning the ioctl interface.
> > 
> > v2: Aligned with the v2 of the corresponding kernel patch (Chris)
> > 
> > Signed-off-by: Akash Goel <akash.goel@intel.com>
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> From a quick glance at the patch:
> 
> It looks like you copy/pasted the map() implementation and changed a few
> things here and there instead of adding flag to drm_intel_gem_bo_map()
> and reusing the current code.
> 
> Can we expose another version of map that takes flags (_WC,
> _UNSYNCHRONIZED, ...) instead of starting to have every single
> combination possible?
> 

Thanks for the review. Yes its almost a copy-paste of the 'mmap_gtt'
implementation.
Yes adding a new flag parameter could be an alternative.

> Do we really need a separate mem_wc_virtual? Using _map() or _map_wc()
> in an exclusively way makes some sense to me.
> 

Initially made _map() & _map_wc() exclusive to each other. Had a
discussion with Chris, he suggested to maintain all 3 mappings i.e allow
them to co-exist.  

> With the introduction of mem_wc_virtual, you left aside the vma cache
> handling and so we'll never end up unmapping it, drm_intel_gem_bo_free()
> doesn't unmap it either, ...
> 
Sorry I completely missed this. Thanks for spotting this. Will do the
needful. 

Best Regards
Akash

> I'd just expect users to use _unmap().
> 

  reply	other threads:[~2014-10-26  8:31 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 13:20 [PATCH] drm/i915: Broaden application of set-domain(GTT) Chris Wilson
2014-10-14 12:47 ` Chris Wilson
2014-10-23 10:33   ` [PATCH] drm/i915: Support to create uncached user mapping for a Gem object akash.goel
2014-10-23 10:37     ` [PATCH] intel: New libdrm interface to create uncached CPU mapping akash.goel
2014-10-23 10:54     ` [PATCH] drm/i915: Support to create uncached user mapping for a Gem object Chris Wilson
2014-10-23 11:03     ` Chris Wilson
2014-10-23 11:56     ` Chris Wilson
2014-10-23 13:23       ` Chris Wilson
2014-12-10  4:48         ` Chad Versace
2014-12-10  8:02           ` Chris Wilson
2014-10-23 16:55     ` [PATCH] drm/i915: Support creation of unbound wc user mappings for objects Chris Wilson
2014-10-23 19:05       ` [PATCH 1/3] igt/gem_evict_(alignment|everything): contend with GPU hangs Chris Wilson
2014-10-23 19:05         ` [PATCH 2/3] lib/core: Check for kernel error messages and WARN if any are found Chris Wilson
2014-10-23 19:05         ` [PATCH 3/3] reg-read-8 Chris Wilson
2014-10-23 19:12         ` [PATCH 1/3] igt/gem_evict_(alignment|everything): contend with GPU hangs Chris Wilson
2014-10-23 19:11       ` [PATCH 1/3] igt/gem_mmap_wc: Exercise mmap(wc) interface Chris Wilson
2014-10-23 19:11         ` [PATCH 2/3] igt/gem_gtt_speed: compare against WC mmaps Chris Wilson
2014-10-23 19:11         ` [PATCH 3/3] igt/gem_concurrent_blit: Exercise wc mappings Chris Wilson
2014-10-25 11:51       ` [PATCH] intel: New libdrm interface to create unbound wc user mappings for objects akash.goel
2014-10-25 12:45         ` Damien Lespiau
2014-10-26  8:36           ` Akash Goel [this message]
2014-10-26  8:41             ` Chris Wilson
2014-10-28 13:09         ` [PATCH v3] " akash.goel
2014-10-28 16:11           ` Damien Lespiau
2014-12-03 14:13           ` Damien Lespiau
2014-12-03 18:18             ` Chris Wilson
2014-12-09 10:54             ` Chris Wilson
2014-12-09 16:53               ` Damien Lespiau
2014-12-14  8:41                 ` [PATCH v4] " akash.goel
2016-03-09  9:09                   ` [PATCH v5] " akash.goel
2016-03-10  8:39                     ` Martin Peres
2016-03-14 16:51                       ` Martin Peres
2016-03-15  8:41                         ` Daniel Vetter
2015-03-03 14:20                 ` [PATCH v3] " Damien Lespiau
2015-03-03 17:05                   ` Chris Wilson
2015-03-03 17:11                     ` Damien Lespiau
2015-03-03 17:13                       ` Chris Wilson
2015-03-03 17:16                         ` Damien Lespiau
2014-11-05 12:48       ` [PATCH] drm/i915: Support creation of " Chris Wilson
2014-11-06 14:50         ` Daniel Vetter
2014-12-17 12:46       ` Tvrtko Ursulin
2014-12-17 12:52         ` Chris Wilson
2014-10-24  8:40     ` [PATCH] drm/i915: Support to create uncached user mapping for a Gem object Daniel Vetter
2014-10-24  9:23       ` Chris Wilson
2014-11-05 12:49   ` [PATCH] drm/i915: Broaden application of set-domain(GTT) Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2015-01-02 11:06 [PATCH] intel: New libdrm interface to create unbound wc user mappings for objects akash.goel

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=1414312617.7355.57.camel@akashgoe-desktop \
    --to=akash.goel@intel.com \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox