[lkml]   [2013]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC] dma-buf: Implement test module
On Sat, Dec 14, 2013 at 1:37 PM, Thierry Reding
<> wrote:
> On Thu, Dec 12, 2013 at 11:30:23PM +0100, Daniel Vetter wrote:
>> On Thu, Dec 12, 2013 at 8:34 PM, Thomas Hellstrom <> wrote:
>> > On 12/12/2013 03:36 PM, Thierry Reding wrote:
>> >>
>> >> This is a simple test module that can be used to allocate, export and
>> >> delete DMA-BUF objects. It can be used to test DMA-BUF sharing in
>> >> systems that lack a real second driver.
>> >>
>> >>
>> >
>> > Looks nice. I wonder whether this could be extended to create a "streaming"
>> > dma-buf from a user space mapping. That could be used as a generic way to
>> > implement streaming (user) buffer objects, rather than to add explicit
>> > support for those in, for example, TTM.
>> Atm there's no way to get gpus to unbind their dma-buf mappings, so
>> their essentially pinned forever from first use on.
> Shouldn't this work by simply calling the GEM_CLOSE IOCTL on the handle
> returned by drmPrimeFDToHandle()? I mean that should drop the last
> reference on the GEM object and cause it to be cleaned up (which should
> include detaching the DMA-BUF).

Yeah, but that has the side-effect of also dropping the reference. And
requires an explicit action from userspace. The entire point of kernel
buffer managers is that this is all done transparently in the kernel
and when low on memory some objects get swapped out behind userspaces
back (and then pulled in again if needed).
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 -

 \ /
  Last update: 2013-12-14 17:21    [W:0.058 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site