On Mon, Nov 3, 2014 at 6:20 PM, Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> wrote: > I did not like your idea, well I did not think it is feasible - as in easily > doable, of stealing the DMA addresses since the SG tables between view don't > have a 1:1 relationship in number of chunk/pages. Ok, so sg table coalescing is getting in the way. On the source sg table stored in obj->pages we can fix this by using one of the per-page sg table walkers - they'll take care of all the annoying details. See how we walk the sg tables in the pte insert fucntions for examples. On the new target sg table I'd simply not bother with merging and allocate a full sg table with sg_alloc_table. Due to the rotation there won't be a lot of contiguous stuff anyway. That leaves the ugly problem of resorting the table without going nuts. Either allocate a temporary array (allocated with drm_malloc_ab since kmalloc won't be enough for this) of dma_addr_t and use your approach. Or just walk the sg_tables row-vise on the rotate layout and only fill in the relevant holes for an O(rows*num_pages) complexity. I don't expect anyone to actually notice this little inefficient tbh ;-) In short, I don't see a problem ;-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx