Thread (63 messages) 63 messages, 9 authors, 2015-06-04

Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

From: Rob Clark <hidden>
Date: 2015-02-02 22:36:14
Also in: dri-devel, linux-arm-kernel, linux-media, lkml

On Mon, Feb 2, 2015 at 4:46 PM, Russell King - ARM Linux
[off-list ref] wrote:
On Mon, Feb 02, 2015 at 03:30:21PM -0500, Rob Clark wrote:
quoted
On Mon, Feb 2, 2015 at 11:54 AM, Daniel Vetter [off-list ref] wrote:
quoted
quoted
My initial thought is for dma-buf to not try to prevent something than
an exporter can actually do.. I think the scenario you describe could
be handled by two sg-lists, if the exporter was clever enough.
That's already needed, each attachment has it's own sg-list. After all
there's no array of dma_addr_t in the sg tables, so you can't use one sg
for more than one mapping. And due to different iommu different devices
can easily end up with different addresses.

Well, to be fair it may not be explicitly stated, but currently one
should assume the dma_addr_t's in the dmabuf sglist are bogus.  With
gpu's that implement per-process/context page tables, I'm not really
sure that there is a sane way to actually do anything else..
That's incorrect - and goes dead against the design of scatterlists.
yeah, a bit of an abuse, although I'm not sure I see a much better way
when a device vaddr depends on user context..
Not only that, but it is entirely possible that you may get handed
memory via dmabufs for which there are no struct page's associated
with that memory - think about display systems which have their own
video memory which is accessible to the GPU, but it isn't system
memory.
well, I guess anyways when it comes to sharing buffers, it won't be
the vram placement of the bo that gets shared ;-)

BR,
-R
In those circumstances, you have to use the dma_addr_t's and not the
pages.

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help