[Intel-gfx] [PATCH 1/2] drm/i915/gtt: Fix pte clear range

Chris Wilson chris at chris-wilson.co.uk
Tue Nov 1 10:28:20 UTC 2016


On Tue, Nov 01, 2016 at 12:22:45PM +0200, Mika Kuoppala wrote:
> Joonas Lahtinen <joonas.lahtinen at linux.intel.com> writes:
> >> @@ -735,8 +737,8 @@ static bool gen8_ppgtt_clear_pt(struct i915_address_space *vm,
> >>  
> >>  	pt_vaddr = kmap_px(pt);
> >>  
> >> -	for (pte = pte_start; pte < num_entries; pte++)
> >> -		pt_vaddr[pte] = scratch_pte;
> >> +	while (pte < pte_end)
> >> +		pt_vaddr[pte++] = scratch_pte;
> >
> > I'd prefer the for loop still. Just fix "pte < pte_end".
> >
> 
> I changed to this due to pte being already set and
> used before the loop, to get rid of superfluous pte_start.

Yes, I think the change to while() made sense with the new flow of pte
being used a few times before we set the scratch_pte.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list