[RFC 4/4] drm: Add NVIDIA Tegra support
m.szyprowski at samsung.com
Thu Apr 12 07:20:16 PDT 2012
On Thursday, April 12, 2012 3:42 PM Thierry Reding wrote:
> > > Also this doesn't yet solve the vmap() problem that is needed for the kernel
> > > virtual mapping. I did try using dma_alloc_writecombine(), but that only
> > > works for chunks of 2 MB or smaller, unless I use init_consistent_dma_size()
> > > during board setup, which isn't provided for in a DT setup. I couldn't find
> > > a better alternative, but I admit I'm not very familiar with all the VM APIs.
> > > Do you have any suggestions on how to solve this? Otherwise I'll try and dig
> > > in some more.
> > Yes, I'm aware of this issue I'm currently working on solving it. I hope to use
> > standard vmalloc range for all coherent/writecombine allocations and get rid of
> > the custom 'consistent_dma' region at all.
> Does your work aim at removing the 2 MB limitation or at remapping non-
> contiguous memory to a virtually linear buffer? I have some trouble
> understanding how removing the 2 MB limit would help, because if all buffers
> can be allocated contiguously then there wouldn't be any need for the IOMMU,
I would like to remove 2MiB limitation by moving these mapping to generic vmalloc
area. Please notice that this 2MiB limit is only applied to CPU virtual address
space and no physical memory is preallocated for consistent dma.
ARM linear dma mapping implementation allocates coherent buffers by calling
alloc_pages() and then creating a coherent mapping for the allocated buffer.
With IOMMU you can allocate chunks of memory and create a contiguous DMA mapping.
To fulfill dma mapping request you also need to create a cpu coherent mapping for
them and right now my core uses the same remapping function as linear version.
The only limitation here will be vmalloc space and its fragmentation.
Samsung Poland R&D Center
More information about the dri-devel