From: Daniel Vetter Date: Wed, 14 Aug 2013 22:02:33 +0000 (+0200) Subject: drm/prime: add a bit of documentation about gem_obj->import_attach X-Git-Tag: firefly_0821_release~176^2~5263^2~95 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7106bf96f81b0c207aaab4b46aa2acc5cab334d4;p=firefly-linux-kernel-4.4.55.git drm/prime: add a bit of documentation about gem_obj->import_attach Lifetime rules seem to be solid around ->import_attach. So this patch just properly documents them. Note that pointing directly at the attachment might have issues for devices that have multiple struct device *dev parts constituting the logical gpu and so might need multiple attachment points. Similarly for drm devices which don't need a dma attachment at all (like udl). But fixing that up is material for different patches. Reviewed-by: Rob Clark Signed-off-by: Daniel Vetter Signed-off-by: Dave Airlie --- diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 5ebed3ea10ba..5dc98947375c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -665,7 +665,16 @@ struct drm_gem_object { /* dma buf exported from this GEM object */ struct dma_buf *export_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. + */ struct dma_buf_attachment *import_attach; };