Message ID | 1383451680-11173-20-git-send-email-benjamin.widawsky@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Nov 02, 2013 at 09:07:17PM -0700, Ben Widawsky wrote:
> With gen6 PTE type in place, pave the way for the new gen8 type.
Wouldn't this patch make more sense before patch 18, so that we always
use sizeof(gen8_gtt_pte_t) rather than 8?
-Chris
On Sat, 2013-11-02 at 21:07 -0700, Ben Widawsky wrote: > With gen6 PTE type in place, pave the way for the new gen8 type. > > Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Imre Deak <imre.deak@intel.com> > --- > drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c > index c6d38d0..8bf2184 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -30,6 +30,7 @@ > > #define GEN6_PPGTT_PD_ENTRIES 512 > #define I915_PPGTT_PT_ENTRIES (PAGE_SIZE / sizeof(gen6_gtt_pte_t)) > +typedef uint64_t gen8_gtt_pte_t; > > /* PPGTT stuff */ > #define GEN6_GTT_ADDR_ENCODE(addr) ((addr) | (((addr) >> 28) & 0xff0)) > @@ -942,7 +943,7 @@ static int gen8_gmch_probe(struct drm_device *dev, > *stolen = gen8_get_stolen_size(snb_gmch_ctl); > > gtt_size = gen8_get_total_gtt_size(snb_gmch_ctl); > - *gtt_total = (gtt_size / 8) << PAGE_SHIFT; > + *gtt_total = (gtt_size / sizeof(gen8_gtt_pte_t)) << PAGE_SHIFT; > > ret = ggtt_probe_common(dev, gtt_size); >
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index c6d38d0..8bf2184 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -30,6 +30,7 @@ #define GEN6_PPGTT_PD_ENTRIES 512 #define I915_PPGTT_PT_ENTRIES (PAGE_SIZE / sizeof(gen6_gtt_pte_t)) +typedef uint64_t gen8_gtt_pte_t; /* PPGTT stuff */ #define GEN6_GTT_ADDR_ENCODE(addr) ((addr) | (((addr) >> 28) & 0xff0)) @@ -942,7 +943,7 @@ static int gen8_gmch_probe(struct drm_device *dev, *stolen = gen8_get_stolen_size(snb_gmch_ctl); gtt_size = gen8_get_total_gtt_size(snb_gmch_ctl); - *gtt_total = (gtt_size / 8) << PAGE_SHIFT; + *gtt_total = (gtt_size / sizeof(gen8_gtt_pte_t)) << PAGE_SHIFT; ret = ggtt_probe_common(dev, gtt_size);
With gen6 PTE type in place, pave the way for the new gen8 type. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> --- drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)