From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Ben Widawsky <benjamin.widawsky@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: Re: [PATCH 5/6] drm/i915: Move GSM mapping into dev_priv
Date: Thu, 20 Dec 2012 14:19:26 +0200 [thread overview]
Message-ID: <871uekex0x.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1355855487-20424-5-git-send-email-ben@bwidawsk.net>
Ben Widawsky <benjamin.widawsky@intel.com> writes:
> This removes an unused field from the AGP structure and moves it into
> the dev_priv structure (with a slightly better name). This builds upon
> the kill-agp series already merged.
>
> GSM is a well defined term in the bspec:
> GSM: Graphics Stolen Memory
>
> GTT stolen space is defined for storage of the GFX GTT entries in
> physical memory. IA can not access GSM directly , it can only access via
> GTTMMADR. GT can access GSM directly or through GTTMMADR.
>
> This is not the entire stolen space.
>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/char/agp/intel-gtt.c | 1 -
> drivers/gpu/drm/i915/i915_drv.h | 3 +++
> drivers/gpu/drm/i915/i915_gem_gtt.c | 14 +++++++-------
> include/drm/intel-gtt.h | 2 --
> 4 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
> index dbd901e..c8d9dcb 100644
> --- a/drivers/char/agp/intel-gtt.c
> +++ b/drivers/char/agp/intel-gtt.c
> @@ -602,7 +602,6 @@ static int intel_gtt_init(void)
> iounmap(intel_private.registers);
> return -ENOMEM;
> }
> - intel_private.base.gtt = intel_private.gtt;
>
> global_cache_flush(); /* FIXME: ? */
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 75003c3..49f465a 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -799,6 +799,9 @@ typedef struct drm_i915_private {
> unsigned long gtt_end;
> unsigned long stolen_base; /* limited to low memory (32-bit) */
>
> + /** "Graphics Stolen Memory" holds the global PTEs */
> + uint32_t __iomem *gsm;
> +
> struct io_mapping *gtt_mapping;
> phys_addr_t gtt_base_addr;
> int gtt_mtrr;
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index fc3c08a..b4c1e34 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -290,7 +290,7 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
> return;
>
>
> - pd_addr = dev_priv->mm.gtt->gtt + ppgtt->pd_offset/sizeof(gtt_pte_t);
> + pd_addr = dev_priv->mm.gsm + ppgtt->pd_offset/sizeof(gtt_pte_t);
> for (i = 0; i < ppgtt->num_pd_entries; i++) {
> dma_addr_t pt_addr;
>
> @@ -367,7 +367,7 @@ static void i915_ggtt_clear_range(struct drm_device *dev,
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> gtt_pte_t scratch_pte;
> - gtt_pte_t __iomem *gtt_base = dev_priv->mm.gtt->gtt + first_entry;
> + gtt_pte_t __iomem *gtt_base = (gtt_pte_t __iomem *) dev_priv->mm.gsm + first_entry;
> const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
> int i;
>
> @@ -432,7 +432,7 @@ static void gen6_ggtt_bind_object(struct drm_i915_gem_object *obj,
> struct scatterlist *sg = st->sgl;
> const int first_entry = obj->gtt_space->start >> PAGE_SHIFT;
> const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry;
> - gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gtt->gtt + first_entry;
> + gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gsm + first_entry;
> int unused, i = 0;
> unsigned int len, m = 0;
> dma_addr_t addr;
> @@ -751,9 +751,9 @@ int i915_gem_gtt_init(struct drm_device *dev)
> goto err_out;
> }
>
> - dev_priv->mm.gtt->gtt = ioremap_wc(gtt_bus_addr,
> - dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t));
> - if (!dev_priv->mm.gtt->gtt) {
> + dev_priv->mm.gsm = ioremap_wc(gtt_bus_addr,
> + dev_priv->mm.gtt->gtt_total_entries * sizeof(gtt_pte_t));
> + if (!dev_priv->mm.gsm) {
> DRM_ERROR("Failed to map the gtt page table\n");
> teardown_scratch_page(dev);
> ret = -ENOMEM;
> @@ -777,7 +777,7 @@ err_out:
> void i915_gem_gtt_fini(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> - iounmap(dev_priv->mm.gtt->gtt);
> + iounmap(dev_priv->mm.gsm);
> teardown_scratch_page(dev);
> if (INTEL_INFO(dev)->gen < 6)
> intel_gmch_remove();
> diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
> index 6eb76a1..3e3a166 100644
> --- a/include/drm/intel-gtt.h
> +++ b/include/drm/intel-gtt.h
> @@ -18,8 +18,6 @@ struct intel_gtt {
> /* Share the scratch page dma with ppgtts. */
> dma_addr_t scratch_page_dma;
> struct page *scratch_page;
> - /* for ppgtt PDE access */
> - u32 __iomem *gtt;
> /* needed for ioremap in drm/i915 */
> phys_addr_t gma_bus_addr;
> } *intel_gtt_get(void);
> --
> 1.8.0.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2012-12-20 12:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 18:31 [PATCH 1/6] drm/i915: BUG() if fences are used on unsupported platform Ben Widawsky
2012-12-18 18:31 ` [PATCH 2/6] drm/i915: Bug on unsupported swizzled platforms Ben Widawsky
2012-12-18 18:31 ` [PATCH 3/6] drm/i915: Missed conversion to gtt_pte_t Ben Widawsky
2012-12-18 21:34 ` Daniel Vetter
2012-12-18 18:31 ` [PATCH 4/6] drm/i915: Move even more gtt code to i915_gem_gtt Ben Widawsky
2012-12-20 11:22 ` Mika Kuoppala
2012-12-18 18:31 ` [PATCH 5/6] drm/i915: Move GSM mapping into dev_priv Ben Widawsky
2012-12-20 12:19 ` Mika Kuoppala [this message]
2012-12-18 18:31 ` [PATCH 6/6 v2] drm/i915: Make GSM void Ben Widawsky
2012-12-19 11:45 ` Ville Syrjälä
2012-12-19 19:20 ` Ben Widawsky
2012-12-20 15:33 ` 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=871uekex0x.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=ben@bwidawsk.net \
--cc=benjamin.widawsky@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.