[Intel-gfx] [PATCH] drm/i915: Mark the final obj->pages sg entry as last

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 9 03:06:25 PDT 2015


On Tue, Jun 09, 2015 at 10:53:23AM +0100, Chris Wilson wrote:
> > >  		if (!i || page_to_pfn(page) != last_pfn + 1) {
> > >  			if (i)
> > > -				sg = sg_next(sg);
> > > +				sg = sg_next(end = sg);
> > 
> > But this looks incorrect to me, sg points now to the last element for
> > which we set the page below and end points to one before the last. Or
> > I'm (still) missing something..
> 
> Nah, this was a change I made to try and reduce te patch size.
> Originally I did sg_set_page(); end = sg; but then thought I could avoid
> resetting end to the same sg in a few cases.

And without the complication of swiotlb_nr_tlb(), then sg after the loop
is pointing to the last set page anyway. The current code is correct,
sorry for the noise.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list