diff options
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 5b6f6e214c1..55289cda85a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -319,6 +319,23 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, drm_gem_object_unreference_unlocked(obj); } +void *exynos_drm_gem_get_dmabuf(struct drm_device *dev, + unsigned int gem_handle, + struct drm_file *filp) +{ + struct drm_gem_object *obj; + + obj = drm_gem_object_lookup(dev, filp, gem_handle); + if (!obj) { + DRM_ERROR("failed to lookup gem object.\n"); + return ERR_PTR(-EINVAL); + } + + drm_gem_object_unreference_unlocked(obj); + + return obj->export_dma_buf; +} + int exynos_drm_gem_map_offset_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h index 468766bee45..78a083302c6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h @@ -111,6 +111,10 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, unsigned int gem_handle, struct drm_file *filp); +void *exynos_drm_gem_get_dmabuf(struct drm_device *dev, + unsigned int gem_handle, + struct drm_file *filp); + /* get buffer offset to map to user space. */ int exynos_drm_gem_map_offset_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); |