drm/vgem: Enable dmabuf interface for export
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 11 Jul 2016 13:08:07 +0000 (14:08 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 12 Jul 2016 10:44:25 +0000 (12:44 +0200)
commite6f15b763ab2bc47000ec302123e2fb3bf2ad7d4
tree3812c1881dd040f56675d3674e8b9a3ab4bec9a0
parent5ba6c9ff961a79809ec0daf2713e8d39e3f77199
drm/vgem: Enable dmabuf interface for export

Enable the standard GEM dma-buf interface provided by the DRM core, but
only for exporting the VGEM object. This allows passing around the VGEM
objects created from the dumb interface and using them as sources
elsewhere. Creating a VGEM object for a foriegn handle is not supported.

v2: With additional completeness.
v3: Need to clear the CPU cache upon exporting the dma-addresses.
v4: Use drm_gem_put_pages() as well.
v5: Use drm_prime_pages_to_sg()

Testcase: igt/vgem_basic/dmabuf-*
Testcase: igt/prime_vgem
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Zach Reizner <zachr@google.com>
Acked-by: Zach Reizner <zachr@google.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1468242488-1505-3-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/vgem/vgem_drv.c