lkml.org 
[lkml]   [2017]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 6/6] drm/i915/gvt: Adding interface so user space can get the dma-buf
From
Date
  Hi,

> > Why the ref count is one?  
>
> The gem object is created by us while creating the dma-buf(the ref
> count of the gem object is initialized to 1).
> Later when user import the dma-buf the ref count of the gem object
> associate with the dma-buf will increased.

Creating the dma-buf should increase the gem object reference count
too. So you should be able to unref the gem object after creating the
dma-buf. That way the dma-buf is the only instance holding a reference
to the gem object, and when the dma-buf goes away (due to userspace
closing all file handles referring to it) the gem object will be
released too because the refcount goes down to zero then.

cheers,
Gerd

\
 
 \ /
  Last update: 2017-06-12 00:40    [W:0.060 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site