• Dave Airlie's avatar
    drm: base prime/dma-buf support (v5) · 3248877e
    Dave Airlie authored
    This adds the basic drm dma-buf interface layer, called PRIME. This
    commit doesn't add any driver support, it is simply and agreed upon starting
    point so we can work towards merging driver support for the next merge window.
    
    Current drivers with work done are nouveau, i915, udl, exynos and omap.
    
    The main APIs exposed to userspace allow translating a 32-bit object handle
    to a file descriptor, and a file descriptor to a 32-bit object handle.
    
    The flags value is currently limited to O_CLOEXEC.
    
    Acknowledgements:
    Daniel Vetter: lots of review
    Rob Clark: cleaned up lots of the internals and did lifetime review.
    
    v2: rename some functions after Chris preferred a green shed
    fix IS_ERR_OR_NULL -> IS_ERR
    v3: Fix Ville pointed out using buffer + kmalloc
    v4: add locking as per ickle review
    v5: allow re-exporting the original dma-buf (Daniel)
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: default avatarRob Clark <rob.clark@linaro.org>
    Reviewed-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
    Reviewed-by: default avatarInki Dae <inki.dae@samsung.com>
    Acked-by: default avatarBen Widawsky <benjamin.widawsky@intel.com>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    3248877e
drmP.h 57.8 KB