summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-15 00:02:47 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-21 19:12:26 +0900
commit1ade17514b82c7c7d419f77f2ff4ea8336c5c602 (patch)
tree7c39c3ff0a5704b2732fa7832a583bc17aaaf468 /include
parent66d2009169bb981072c32c618aca2b203d6bf897 (diff)
downloadlinux-3.10-1ade17514b82c7c7d419f77f2ff4ea8336c5c602.tar.gz
linux-3.10-1ade17514b82c7c7d419f77f2ff4ea8336c5c602.tar.bz2
linux-3.10-1ade17514b82c7c7d419f77f2ff4ea8336c5c602.zip
drm/prime: Simplify drm_gem_remove_prime_handles
with the reworking semantics and locking of the obj->dma_buf pointer this pointer is always set as long as there's still a gem handle around and a dma_buf associated with this gem object. Also, the per file-priv lookup-cache for dma-buf importing is also unified between foreign and native objects. Hence we don't need to special case the clean any more and can simply drop the clause which only runs for foreing objects, i.e. with obj->import_attach set. Note that with this change (actually with the previous one to always set up obj->dma_buf even for foreign objects) it is no longer required to set obj->import_attach when importing a foreing object. So update comments accordingly, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drmP.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index cf0646da165..225a5ebd176 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -693,7 +693,21 @@ struct drm_gem_object {
*/
struct dma_buf *dma_buf;
- /* dma buf attachment backing this object */
+ /**
+ * import_attach - dma buf attachment backing this object
+ *
+ * Any foreign dma_buf imported as a gem object has this set to the
+ * attachment point for the device. This is invariant over the lifetime
+ * of a gem object.
+ *
+ * The driver's ->gem_free_object callback is responsible for cleaning
+ * up the dma_buf attachment and references acquired at import time.
+ *
+ * Note that the drm gem/prime core does not depend upon drivers setting
+ * this field any more. So for drivers where this doesn't make sense
+ * (e.g. virtual devices or a displaylink behind an usb bus) they can
+ * simply leave it as NULL.
+ */
struct dma_buf_attachment *import_attach;
};