compat: backport sg_page_iter_page() and sg_page_iter_dma_address()
This should be going into the next kernel release, assuming
this will be called 3.10 we stuff into the 3.10 header.
Although this commit does modify the struct sg_page_iter
data structure that was just done to remove something no
longer needed due to the change. This should not impact
older kernels so just keep the original implementation.
mcgrof@frijol ~/linux-next (git::master)$ git describe --contains
2db76d7c
next-
20130328~64^2~6
commit
2db76d7c3c6db93058f983c8240f7c7c25e87ee6
Author: Imre Deak <imre.deak@intel.com>
Date: Tue Mar 26 15:14:18 2013 +0200
lib/scatterlist: sg_page_iter: support sg lists w/o backing pages
The i915 driver uses sg lists for memory without backing 'struct page'
pages, similarly to other IO memory regions, setting only the DMA
address for these. It does this, so that it can program the HW MMU
tables in a uniform way both for sg lists with and without backing pages.
Without a valid page pointer we can't call nth_page to get the current
page in __sg_page_iter_next, so add a helper that relevant users can
call separately. Also add a helper to get the DMA address of the current
page (idea from Daniel).
Convert all places in i915, to use the new API.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>