[Intel-gfx] [RFC 5/7] drm/i915: Use i915_sg_create for dmabuf

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Oct 13 09:49:38 UTC 2016


On 13/10/2016 10:15, Chris Wilson wrote:
> On Thu, Oct 13, 2016 at 10:04:02AM +0100, Tvrtko Ursulin wrote:
>> -	src = obj->pages->sgl;
>> -	dst = st->sgl;
>> -	for (i = 0; i < obj->pages->nents; i++) {
>> -		sg_set_page(dst, sg_page(src), src->length, 0);
>> -		dst = sg_next(dst);
>> -		src = sg_next(src);
>> -	}
>> +	for_each_sgt_page(page, sgt_iter, obj->pages)
>> +		i915_sg_add_page(state, page);
> This (and partial_pages) can just copy the existing compact obj->pages.
> The previous code should already be as compact as its input. And that is
> not a simpler loop!

Ah yes, you are right. A bit too mindless "search and replace" on my part.

Regards,

Tvrtko



More information about the Intel-gfx mailing list