From 7e491583dfec02d0b24990e603b7c5ec894dccd9 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Thu, 4 May 2017 11:45:47 -0700 Subject: drm/prime: Introduce drm_gem_prime_import_dev The existing drm_gem_prime_import function uses the underlying struct device of a drm_device for attaching to a dma_buf. Some drivers (notably vgem) may not have an underlying device structure. Offer an alternate function to attach using any available device structure. Signed-off-by: Laura Abbott Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1493923548-20878-3-git-send-email-labbott@redhat.com --- include/drm/drm_prime.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/drm/drm_prime.h') diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h index 0b2a235c4be0..46fd1fb4fb05 100644 --- a/include/drm/drm_prime.h +++ b/include/drm/drm_prime.h @@ -65,6 +65,11 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, int *prime_fd); struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf); + +struct drm_gem_object *drm_gem_prime_import_dev(struct drm_device *dev, + struct dma_buf *dma_buf, + struct device *attach_dev); + int drm_gem_prime_fd_to_handle(struct drm_device *dev, struct drm_file *file_priv, int prime_fd, uint32_t *handle); struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, -- cgit v1.2.3