<br><br><div class="gmail_quote">2012/12/8 Aaron Plattner <span dir="ltr"><<a href="mailto:aplattner@nvidia.com" target="_blank">aplattner@nvidia.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 12/06/2012 10:36 PM, Inki Dae wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
<br>
CCing media guys.<br>
<br>
I agree with you but we should consider one issue released to v4l2.<br>
<br>
As you may know, V4L2-based driver uses vb2 as buffer manager and the<br>
vb2 includes dmabuf feature>(import and export) And v4l2 uses streaming<br>
concept>(qbuf and dqbuf)<br>
With dmabuf and iommu, generally qbuf imports a fd into its own buffer<br>
and maps it with its own iommu table calling dma_buf_map_attachment().<br>
And dqbuf calls dma_buf_unmap_attachment() to unmap that buffer from its<br>
own iommu table.<br>
But now vb2's unmap_dma_buf callback is nothing to do. I think that the<br>
reason is the below issue,<br>
<br>
If qbuf maps buffer with iomm table and dqbuf unmaps it from iommu table<br>
then it has performance deterioration because qbuf and dqbuf are called<br>
repeatedly.<br>
And this means map/unmap are repeated also. So I think media guys moved<br>
dma_unmap_sg call from its own unmap_dma_buf callback to detach callback<br>
instead.<br>
For this, you can refer to vb2_dc_dmabuf_ops_unmap and<br>
vb2_dc_dmabuf_ops_detach function.<br>
<br>
So I added the below patch to avoid that performance deterioration and<br>
am testing it now.(this patch is derived from videobuf2-dma-contig.c)<br>
<a href="http://git.kernel.org/?p=linux/kernel/git/daeinki/drm-exynos.git;a=commit;h=576b1c3de8b90cf1570b8418b60afd1edaae4e30" target="_blank">http://git.kernel.org/?p=<u></u>linux/kernel/git/daeinki/drm-<u></u>exynos.git;a=commit;h=<u></u>576b1c3de8b90cf1570b8418b60afd<u></u>1edaae4e30</a><br>
<br>
Thus, I'm not sure that your common set could cover all the cases<br>
including other frameworks. Please give me any opinions.<br>
</blockquote>
<br></div></div>
It seems like this adjustment would make perfect sense to add to the helper layer I suggested. E.g., instead of having an exynos_attach structure that caches the sgt, there'd be a struct drm_gem_prime_attach that would do the same thing, and save the sgt it gets from driver->gem_prime_get_sg. Then it would benefit nouveau and radeon, too.<br>
</blockquote><div><br>If this change is applied to common helper and also that could be accepted by other maintainers then I think it's better to use this common helper instead of specific one.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Alternatively, patch #4 could be dropped and Exynos can continue to reimplement all of this core functionality, since the helpers are optional, but I don't see anything about this change that should make it Exynos-specific,</blockquote>
<div><br>I agree with you. I also think this change isn't specific to Exynos. But you need to check if this is a reasonable change for other drivers also.<br><br>Thanks,<br>Inki Dae<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
unless I'm missing something.<br>
<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--<br>
Aaron<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.<u></u>org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br>