[Intel-gfx] [PATCH] drm/i915: correct the calculation of first_pd_entry_in_global_pt

Daniel Vetter daniel at ffwll.ch
Sat Apr 27 13:40:57 CEST 2013


On Sat, Apr 27, 2013 at 09:53:33AM +0000, Zhang, Xiong Y wrote:
> When ppgtt is enabled, dev_priv->gtt.total has excluded the gtt space occupied by ppgtt table in i915_gem_init_global_gtt() function. So the calculation of first_pd_entry_in_global_pt doesn't need to subtract I915_PPGTT_PD_ENTRIES again. Or else PPGTT directory table will be destroyed by global gtt allocation.
> 
> Signed-off-by: Xiong Zhang<xiong.y.zhang at intel.com>

Nice catch, patch applied to -fixes. I've also amended the commit message
with a note for the commit which introduced this regression and a cc:
stable tag.

Aside: The patch was whitespace-mangled and the commit meesage not
line-broken to 72 chars. I've fixed both things up. Please check your mail
setup. If all else fails please simply attach a git patch created with
git format-patch.

Thanks, Daniel

> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index ce024bd..3cd48e2 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -258,8 +258,7 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
>         /* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024
>          * entries. For aliasing ppgtt support we just steal them at the end for
>          * now. */
> -       first_pd_entry_in_global_pt =
> -               gtt_total_entries(dev_priv->gtt) - I915_PPGTT_PD_ENTRIES;
> +       first_pd_entry_in_global_pt = gtt_total_entries(dev_priv->gtt);
> 
>         if (IS_HASWELL(dev)) {
>                 ppgtt->pte_encode = hsw_pte_encode;
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list