On 04/27/2015 03:50 PM, Tvrtko Ursulin wrote:
+ for_each_sg_page(obj->pages->sgl, &obj_sg_iter, obj->pages->nents,
+ view->params.partial.offset)
+ {
+ if (st->nents >= view->params.partial.size)
+ break;
+
+ sg_set_page(sg, NULL, PAGE_SIZE, 0);
+ sg_dma_address(sg) = sg_page_iter_dma_address(&obj_sg_iter);
+ sg_dma_len(sg) = PAGE_SIZE;
+
+ sg = sg_next(sg);
+ st->nents++;
+ }
I suppose in this case (as opposed to rotated view) using
sg_alloc_table_from_pages() could produce a more compact table. With the
caveat of that it doesn't always work (see
i915_gem_userptr.c/st_set_pages).
So maybe promote to driver public st_set_pages and call in on an array
of pages?
Scratch this, on second thought it makes no sense.
Only if we had a smarter helper like sg_alloc_table_from_table_range()
but no one cared about coalescing in the past.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx