Hi Jonathan,

On Fri, Jul 22, 2011 at 01:55:47PM -0600, Jonathan Corbet wrote:
> > >  You *can't* do the mapping at allocation time...
> > 
> > Could you elaborate why you can't create the mapping at allocation time? 
> > DMA-mapping api requires the following call sequence:
> > dma_map_single()
> > ...
> > dma_sync_single_for_cpu()
> > dma_sync_single_for_device()
> > ...
> > dma_unmap_single()
> > 
> > I see no problem to call dma_map_single() on buffer creation and 
> > dma_unmap_single() on release. dma_sync_single_for_{device,cpu} can
> > be used on buffer_{prepare,finish}.
> 
> Yes, it could be done that way.  I guess I've always, rightly or wrongly,
> seen streaming mappings as transient things that aren't meant to be kept
> around for long periods of time.  Especially if they might, somehow, be
> taking up limited resources like IOMMU slots.  But I honestly have no idea
> whether it's better to keep a set of mappings around and use the sync
> functions, or whether it's better to remake them each time.

Creating IOMMU mappings (and removing them) usually takes considerable
amount of time but usually consume practically no resources, so they are
kept while the buffers are pinned to system memory.

Do you have hardware which has limitations on IOMMU mappings?

For example, the OMA 3 IOMMU can be used to map the whole system memory (if
you need it) and it does page tabe walking, too.

-- 
Sakari Ailus
sakari.ai...@iki.fi
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to