diff options
author | Inki Dae <inki.dae@samsung.com> | 2013-08-20 17:35:43 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:44:03 +0900 |
commit | ff800d3fecf2186039301b7a8f92be464549891e (patch) | |
tree | 111b11d3c7079f228a54b915e12fbd514d19d07d /drivers | |
parent | dc56fd4e61a85ea12edf890cafd6dba0e83dc2f0 (diff) | |
download | linux-3.10-ff800d3fecf2186039301b7a8f92be464549891e.tar.gz linux-3.10-ff800d3fecf2186039301b7a8f92be464549891e.tar.bz2 linux-3.10-ff800d3fecf2186039301b7a8f92be464549891e.zip |
drm/exynos: add exynos_drm_gem_get_dmabuf function
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers')
-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); |