Generic Transform API
Create an intermediate layer for impelementing transform dma_operators. This layer helps separating the concern of iterating over a layout to find contiguous elements from performing the contiguous copy. Thanks to transform API, dma_operator implementers can implement a generic transform and a generic copy with only taking care of the memcopy implementation. Of course, tuning dma operation may require to merge abstraction layers i.e discard Transform API to provide layout and driver specific tuned dma_operator. However, this version provides a generic transform to limit development effort to get a working dma for different drivers.
The current transform implementation will walk all elements of a layout to identify contiguous regions and use only one memcpy per contiguous region instead of one memcpy per element.
In the future, it would be nice to implement a dense_layout_merge() function to coarsen the layout view and get least amount of largest contiguous chunks inside a layout. By doing this, the generic transform function, will have a smaller number of elements to walk to perform the transform, without needing to reimplement everything from scratch.