From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: ankitprasad.r.sharma@intel.com, intel-gfx@lists.freedesktop.org
Cc: akash.goel@intel.com
Subject: Re: [PATCH 1/3] drm/i915: Add support for mapping an object page by page
Date: Fri, 13 Nov 2015 14:57:25 +0000 [thread overview]
Message-ID: <5645FA55.3050202@linux.intel.com> (raw)
In-Reply-To: <1447066589-10798-2-git-send-email-ankitprasad.r.sharma@intel.com>
Hi,
On 09/11/15 10:56, 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.
>
> 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 | 49 +++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/i915_gem_gtt.h | 5 ++++
> include/drm/intel-gtt.h | 3 +++
> 4 files changed, 66 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 016739e..9fd1f857 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2345,6 +2345,23 @@ 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)
> +{
I am not sure about the interface consistency. insert_entries works on a
sg and this would now need a DMA address which is encapsulated in the
former.
How about extending insert_pages to take a page_offset and size in
pages? The latter could default to obj size if zero.
> + 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);
> +
> + gen8_set_pte(pte, gen8_pte_encode(addr, level, true));
> + wmb();
> +
> + I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
gen8_ggtt_insert_entries doesn't do the wmb() but does a posting read on
GFX_FLSH_CNTL_GEN6. Why is that difference?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-13 14:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 10:56 [PATCH v3 0/3] Support for mapping an object page by page ankitprasad.r.sharma
2015-11-09 10:56 ` [PATCH 1/3] drm/i915: Add support " ankitprasad.r.sharma
2015-11-13 14:57 ` Tvrtko Ursulin [this message]
2015-11-09 10:56 ` [PATCH 2/3] drm/i915: Introduce i915_gem_object_get_dma_address() ankitprasad.r.sharma
2015-11-09 10:56 ` [PATCH 3/3] drm/i915: Use insert_page for pwrite_fast ankitprasad.r.sharma
2015-11-09 12:20 ` kbuild test robot
2015-11-10 7:55 ` Mika Kuoppala
2015-11-10 8:05 ` Ankitprasad Sharma
2015-11-10 8:44 ` Chris Wilson
2015-11-10 11:51 ` Chris Wilson
-- strict thread matches above, loose matches on Subject: below --
2015-11-07 8:02 [PATCH v2 0/3] Support for mapping an object page by page ankitprasad.r.sharma
2015-11-07 8:02 ` [PATCH 1/3] drm/i915: Add support " ankitprasad.r.sharma
2015-11-05 11:45 [PATCH 0/3] Support " ankitprasad.r.sharma
2015-11-05 11:45 ` [PATCH 1/3] drm/i915: Add support " ankitprasad.r.sharma
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=5645FA55.3050202@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=akash.goel@intel.com \
--cc=ankitprasad.r.sharma@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