intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, akash.goel@intel.com,
	shashidhar.hiremath@intel.com
Subject: Re: [PATCH 01/10] drm/i915: Add support for mapping an object page by page
Date: Thu, 18 Feb 2016 14:03:01 +0530	[thread overview]
Message-ID: <1455784381.2500.10.camel@ankitprasad-desktop> (raw)
In-Reply-To: <56BC6789.3080007@linux.intel.com>

Hi,
On Thu, 2016-02-11 at 10:50 +0000, Tvrtko Ursulin wrote:
> 
> On 04/02/16 09:30, ankitprasad.r.sharma@intel.com wrote:
> > From: Chris Wilson <chris@chris-wilson.co.uk>
> >
> > Introduced a new vm specfic callback insert_page() to program a single pte in
> > ggtt or ppgtt. This allows us to map a single page in to the mappable aperture
> > space. This can be iterated over to access the whole object by using space as
> > meagre as page size.
> >
> > v2: Added low level rpm assertions to insert_page routines (Chris)
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > ---
> >   drivers/char/agp/intel-gtt.c        |  9 +++++
> >   drivers/gpu/drm/i915/i915_gem_gtt.c | 65 +++++++++++++++++++++++++++++++++++++
> >   drivers/gpu/drm/i915/i915_gem_gtt.h |  5 +++
> >   include/drm/intel-gtt.h             |  3 ++
> >   4 files changed, 82 insertions(+)
> >
> > diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
> > index 1341a94..7c68576 100644
> > --- a/drivers/char/agp/intel-gtt.c
> > +++ b/drivers/char/agp/intel-gtt.c
> > @@ -838,6 +838,15 @@ static bool i830_check_flags(unsigned int flags)
> >   	return false;
> >   }
> >
> > +void intel_gtt_insert_page(dma_addr_t addr,
> > +			   unsigned int pg,
> > +			   unsigned int flags)
> > +{
> > +	intel_private.driver->write_entry(addr, pg, flags);
> > +	wmb();
> > +}
> > +EXPORT_SYMBOL(intel_gtt_insert_page);
> > +
> >   void intel_gtt_insert_sg_entries(struct sg_table *st,
> >   				 unsigned int pg_start,
> >   				 unsigned int flags)
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index 715a771..a64018f 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -2341,6 +2341,28 @@ static void gen8_set_pte(void __iomem *addr, gen8_pte_t pte)
> >   #endif
> >   }
> >
> > +static void gen8_ggtt_insert_page(struct i915_address_space *vm,
> > +				  dma_addr_t addr,
> > +				  uint64_t offset,
> > +				  enum i915_cache_level level,
> > +				  u32 unused)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(vm->dev);
> > +	gen8_pte_t __iomem *pte =
> > +		(gen8_pte_t __iomem *)dev_priv->gtt.gsm +
> > +		(offset >> PAGE_SHIFT);
> > +	int rpm_atomic_seq;
> > +
> > +	rpm_atomic_seq = assert_rpm_atomic_begin(dev_priv);
> > +
> > +	gen8_set_pte(pte, gen8_pte_encode(addr, level, true));
> > +	wmb();
> 
> gen8_ggtt_insert_entries does a read-back of the PTE after having 
> written it with a big fat comment talking about how that could be really 
> important. This is not needed in this path?
As per our discussion with Chris, wmb() is faster than doing a memory
access for reading the PTE.
So, I guess a barrier here should be better to keep things in sync.
> 
> > +
> > +	I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
> 
> Why is the posting read not required here as in gen8_ggtt_insert_entries?
I agree with this, a POSTING_READ is required.
> 
> > +
> > +	assert_rpm_atomic_end(dev_priv, rpm_atomic_seq);
> > +}
> > +
> >   static void gen8_ggtt_insert_entries(struct i915_address_space *vm,
> >   				     struct sg_table *st,
> >   				     uint64_t start,
> > @@ -2412,6 +2434,28 @@ static void gen8_ggtt_insert_entries__BKL(struct i915_address_space *vm,
> >   	stop_machine(gen8_ggtt_insert_entries__cb, &arg, NULL);
> >   }
> >
> > +static void gen6_ggtt_insert_page(struct i915_address_space *vm,
> > +				  dma_addr_t addr,
> > +				  uint64_t offset,
> > +				  enum i915_cache_level level,
> > +				  u32 flags)
> > +{
> > +	struct drm_i915_private *dev_priv = to_i915(vm->dev);
> > +	gen6_pte_t __iomem *pte =
> > +		(gen6_pte_t __iomem *)dev_priv->gtt.gsm +
> > +		(offset >> PAGE_SHIFT);
> > +	int rpm_atomic_seq;
> > +
> > +	rpm_atomic_seq = assert_rpm_atomic_begin(dev_priv);
> > +
> > +	iowrite32(vm->pte_encode(addr, level, true, flags), pte);
> > +	wmb();
> > +
> > +	I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
> > +
> > +	assert_rpm_atomic_end(dev_priv, rpm_atomic_seq);
> > +}
> 
> Same questions as for the gen8 version.
> 
> Regards,
> 
> Tvrtko

Thanks,
Ankit

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

  reply	other threads:[~2016-02-18  8:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  9:30 [PATCH v16 0/10] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 01/10] drm/i915: Add support for mapping an object page by page ankitprasad.r.sharma
2016-02-11 10:50   ` Tvrtko Ursulin
2016-02-18  8:33     ` Ankitprasad Sharma [this message]
2016-02-04  9:30 ` [PATCH 02/10] drm/i915: Introduce i915_gem_object_get_dma_address() ankitprasad.r.sharma
2016-02-11 10:52   ` Tvrtko Ursulin
2016-02-04  9:30 ` [PATCH 03/10] drm/i915: Use insert_page for pwrite_fast ankitprasad.r.sharma
2016-02-04 10:49   ` kbuild test robot
2016-02-04  9:30 ` [PATCH 04/10] drm/i915: Clearing buffer objects via CPU/GTT ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 05/10] drm/i915: Support for creating Stolen memory backed objects ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 06/10] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 07/10] drm/i915: Add support for stealing purgable stolen pages ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 08/10] drm/i915: Support for pread/pwrite from/to non shmem backed objects ankitprasad.r.sharma
2016-02-11 11:40   ` Tvrtko Ursulin
2016-02-18  8:26     ` Ankitprasad Sharma
2016-02-19  5:54     ` Ankitprasad Sharma
2016-02-04  9:30 ` [PATCH 09/10] drm/i915: Migrate stolen objects before hibernation ankitprasad.r.sharma
2016-02-04  9:30 ` [PATCH 10/10] drm/i915: Disable use of stolen area by User when Intel RST is present ankitprasad.r.sharma
2016-02-04 15:46   ` Lukas Wunner
2016-02-04 16:05     ` Chris Wilson
2016-02-04 16:43       ` Lukas Wunner
2016-02-11 19:08         ` Lukas Wunner
2016-02-11 11:54   ` Tvrtko Ursulin
  -- strict thread matches above, loose matches on Subject: below --
2016-03-18  6:22 [PATCH v19 0/10] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2016-03-18  6:22 ` [PATCH 01/10] drm/i915: Add support for mapping an object page by page ankitprasad.r.sharma
2016-02-29  7:39 [PATCH v1 0/10] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2016-02-29  7:39 ` [PATCH 01/10] drm/i915: Add support for mapping an object page by page ankitprasad.r.sharma
2016-02-19  6:51 [PATCH v17 0/10] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2016-02-19  6:51 ` [PATCH 01/10] drm/i915: Add support for mapping an object page by page ankitprasad.r.sharma
2016-02-19 10:26   ` Tvrtko Ursulin
2016-01-25 19:43 [PATCH v15 0/10] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2016-01-25 19:43 ` [PATCH 01/10] drm/i915: Add support for mapping an object page by page ankitprasad.r.sharma
2016-01-26 10:55   ` Chris Wilson

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=1455784381.2500.10.camel@ankitprasad-desktop \
    --to=ankitprasad.r.sharma@intel.com \
    --cc=akash.goel@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashidhar.hiremath@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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).