<div dir="ltr"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/13 Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div class="im">On Mon, May 13, 2013 at 8:21 AM, Inki Dae <<a href="mailto:inki.dae@samsung.com">inki.dae@samsung.com</a>> wrote:<br>
><br>
>> In that case you still wouldn't give userspace control over the fences. I<br>
>> don't see any way that can end well.<br>
>> What if userspace never signals? What if userspace gets killed by oom<br>
>> killer. Who keeps track of that?<br>
>><br>
><br>
> In all cases, all kernel resources to user fence will be released by kernel<br>
> once the fence is timed out: never signaling and process killing by oom<br>
> killer makes the fence timed out. And if we use mmap mechanism you mentioned<br>
> before, I think user resource could also be freed properly.<br>
<br>
<br>
</div>I tend to agree w/ Maarten here.. there is no good reason for<br>
userspace to be *signaling* fences. The exception might be some blob<br>
gpu drivers which don't have enough knowledge in the kernel to figure<br>
out what to do. (In which case you can add driver private ioctls for<br>
that.. still not the right thing to do but at least you don't make a<br>
public API out of it.)<br>
<br></blockquote><div> </div><div>Please do not care whether those are generic or not. Let's see the following three things. First, it's cache operation. As you know, ARM SoC has ACP (Accelerator Coherency Port) and can be connected to DMA engine or similar devices. And this port is used for cache coherency between CPU cache and DMA device. However, most devices on ARM based embedded systems don't use the ACP port. So they need proper cache operation before and after of DMA or CPU access in case of using cachable mapping. Actually, I see many Linux based platforms call cache control interfaces directly for that. I think the reason, they do so, is that kernel isn't aware of when and how CPU accessed memory.</div>
<div> </div><div>And second, user process has to do so many things in case of using shared memory with DMA device. User process should understand how DMA device is operated and when interfaces for controling the DMA device are called. Such things would make user application so complicated.</div>
<div> </div><div>And third, it's performance optimization to multimedia and graphics devices. As I mentioned already, we should consider sequential processing for buffer sharing between CPU and DMA device. This means that CPU should stay with idle until DMA device is completed and vise versa.</div>
<div> </div><div>That is why I proposed such user interfaces. Of course, these interfaces might be so ugly yet: for this, Maarten pointed already out and I agree with him. But there must be another better way. Aren't you think we need similar thing? With such interfaces, cache control and buffer synchronization can be performed in kernel level. Moreover, user applization doesn't need to consider DMA device controlling anymore. Therefore, one thread can access a shared buffer and the other can control DMA device with the shared buffer in parallel. We can really make the best use of CPU and DMA idle time. In other words, we can really make the best use of multi tasking OS, Linux.</div>
<div> </div><div>So could you please tell me about that there is any reason we don't use public API for it? I think we can add and use public API if NECESSARY.</div><div> </div><div>Thanks,</div><div>Inki Dae</div><div>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
BR,<br>
-R<br>
<div><div class="h5">_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br></div></div>