From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, x86@kernel.org,
Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 2/2] drm/i915: use the ICL stolen memory
Date: Mon, 9 Jul 2018 12:13:21 -0700 [thread overview]
Message-ID: <20180709191321.GE28253@intel.com> (raw)
In-Reply-To: <CAKi4VALiW0bvvhZj7upDp-EwXkUNYUQe83hhMXnX97wjjNjcKA@mail.gmail.com>
On Fri, Jul 06, 2018 at 07:09:15PM -0700, Lucas De Marchi wrote:
> On Fri, May 4, 2018 at 1:33 PM Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
> >
> > Now that our stolen memory is already reserved by the x86 subsystem
> > (since commit "x86/gpu: reserve ICL's graphics stolen memory"), make
> > use of it.
> >
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > Cc: x86@kernel.org
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_gem_stolen.c | 38 +++++++++++++++++++++++++++++++++-
> > drivers/gpu/drm/i915/i915_reg.h | 1 +
> > 2 files changed, 38 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > index ad949cc30928..99556f0dbedc 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > @@ -343,6 +343,35 @@ static void bdw_get_stolen_reserved(struct drm_i915_private *dev_priv,
> > *size = stolen_top - *base;
> > }
> >
> > +static void icl_get_stolen_reserved(struct drm_i915_private *dev_priv,
> > + resource_size_t *base,
> > + resource_size_t *size)
> > +{
> > + u64 reg_val = I915_READ64(GEN6_STOLEN_RESERVED);
>
> are you sure it's still the same address? Either I'm looking to the
> wrong place or this needs to be changed.
The only thing that changed was the size s/32/64
and the reg name s/MPAVPC/PAVPC_REG
BSpec: 19481
So, since this question made me look to the spec:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Lucas De Marchi
>
> > +
> > + DRM_DEBUG_DRIVER("GEN6_STOLEN_RESERVED = 0x%016llx\n", reg_val);
> > +
> > + *base = reg_val & GEN11_STOLEN_RESERVED_ADDR_MASK;
> > +
> > + switch (reg_val & GEN8_STOLEN_RESERVED_SIZE_MASK) {
> > + case GEN8_STOLEN_RESERVED_1M:
> > + *size = 1024 * 1024;
> > + break;
> > + case GEN8_STOLEN_RESERVED_2M:
> > + *size = 2 * 1024 * 1024;
> > + break;
> > + case GEN8_STOLEN_RESERVED_4M:
> > + *size = 4 * 1024 * 1024;
> > + break;
> > + case GEN8_STOLEN_RESERVED_8M:
> > + *size = 8 * 1024 * 1024;
> > + break;
> > + default:
> > + *size = 8 * 1024 * 1024;
> > + MISSING_CASE(reg_val & GEN8_STOLEN_RESERVED_SIZE_MASK);
> > + }
> > +}
> > +
> > int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
> > {
> > resource_size_t reserved_base, stolen_top;
> > @@ -399,7 +428,9 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
> > gen7_get_stolen_reserved(dev_priv,
> > &reserved_base, &reserved_size);
> > break;
> > - default:
> > + case 8:
> > + case 9:
> > + case 10:
> > if (IS_LP(dev_priv))
> > chv_get_stolen_reserved(dev_priv,
> > &reserved_base, &reserved_size);
> > @@ -407,6 +438,11 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
> > bdw_get_stolen_reserved(dev_priv,
> > &reserved_base, &reserved_size);
> > break;
> > + case 11:
> > + default:
> > + icl_get_stolen_reserved(dev_priv, &reserved_base,
> > + &reserved_size);
> > + break;
> > }
> >
> > /*
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index 15daf3553d40..c5bc7c808e31 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -398,6 +398,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
> > #define GEN8_STOLEN_RESERVED_4M (2 << 7)
> > #define GEN8_STOLEN_RESERVED_8M (3 << 7)
> > #define GEN6_STOLEN_RESERVED_ENABLE (1 << 0)
> > +#define GEN11_STOLEN_RESERVED_ADDR_MASK (0xFFFFFFFFFFFULL << 20)
> >
> > /* VGA stuff */
> >
> > --
> > 2.14.3
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
>
>
> --
> Lucas De Marchi
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-09 19:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 0:23 [PATCH] drm/i915/icl, x86/gpu: implement ICL stolen memory support Paulo Zanoni
2018-05-03 0:52 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-05-03 1:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-03 9:59 ` [PATCH] " Joonas Lahtinen
2018-05-03 15:24 ` Paulo Zanoni
2018-05-03 15:35 ` Chris Wilson
2018-05-03 16:28 ` Joonas Lahtinen
2018-05-03 10:18 ` ✓ Fi.CI.IGT: success for " Patchwork
2018-05-04 20:32 ` [PATCH 1/2] x86/gpu: reserve ICL's graphics stolen memory Paulo Zanoni
2018-05-04 20:32 ` [PATCH 2/2] drm/i915: use the ICL " Paulo Zanoni
2018-07-07 2:09 ` Lucas De Marchi
2018-07-09 19:13 ` Rodrigo Vivi [this message]
2018-07-09 23:44 ` Paulo Zanoni
2018-05-07 8:46 ` [PATCH 1/2] x86/gpu: reserve ICL's graphics " Joonas Lahtinen
2018-06-01 21:44 ` Paulo Zanoni
2018-06-18 17:47 ` Rodrigo Vivi
2018-07-03 19:11 ` Rodrigo Vivi
2018-07-04 5:50 ` Ingo Molnar
2018-07-05 14:52 ` Rodrigo Vivi
2018-07-10 23:40 ` [Intel-gfx] " Rodrigo Vivi
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=20180709191321.GE28253@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.de.marchi@gmail.com \
--cc=paulo.r.zanoni@intel.com \
--cc=x86@kernel.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