Hi, Guys,
I have an interesting problem. My application sends me a buffer
(it’s a 3-dimensional buffer, but for the sake of simplicity you
can assume it’s a 2D buffer), say, from x,y coordinates from 0,0
to xmax,ymax. Now, inside that buffer there’s a rectangular
subbuffer from xbegin,ybegin to xend,yend. I want to DMA the
subbuffer out to my chip, but I do not want to move data around:
it would be easy to copy the subbuffer to a kernel buffer and
DMA it from there, but I do not want to spend the time and the
memory doing that, if nothing else because even the subvolumes
on occasion can be pretty big.
I know how to generate a scatter-gather list by hand, no
problem, but I want to give Windows a chance. So, here’s my
question: is there any functionality in the DMA calls to set up
a scatter-gather list for such a subbuffer ? Note that the
scanlines are linearly contiguous within themselves but not
relative to each other; they may not be physically contiguous,
there’s no assurance that one or more scanlines will not cross a
page boundary and be broken into two physically discontinuous
line segments. The problem is way more complex when I have a 3D
image, because now I have not only scanlines but also plane
slices that build up a subvolume of the big volume.
Is there any hope the API can help me, or must I do it by hand ?
Tks,
Alberto.