On 11/14/19 1:40 PM, Christoph Hellwig wrote:
On Thu, Nov 14, 2019 at 11:56:45AM +0100, Thomas Hellström (VMware) wrote:
From: Thomas Hellstrom thellstrom@vmware.com
We're gradually moving towards using DMA coherent memory in most situations, although TTM interactions with the DMA layers is still a work-in-progress. Meanwhile, use coherent memory when there are size restrictions meaning that there is a chance that streaming dma mapping of large buffer objects may fail.
Unofrtunately that dma mapping size check really is completely broken. For example the sparc32 iommus have mapping size limitations (which we just haven't wired up yet), but will never bounce buffer.
Let me cook up a real API for you instead. dma_addressing_limited() is fundamentally the right call for this, we just need to make it handle the corner cases you mentioned in reply to the last version of your patch.
Sounds great!
Thanks,
Thomas
dri-devel@lists.freedesktop.org