summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2016-11-18 15:15:16 +0100
committerLucas Stach <l.stach@pengutronix.de>2016-12-02 19:30:21 +0100
commit5688e57eb50c08922d0ff88bb30fe65b508917a0 (patch)
treebcf24c889e0419485f4f397ce8db9e8f53d63a2a /drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff)
drm/etnaviv: implement dma-buf mmap
This adds the required boilerplate to allow direct mmap of exported etnaviv BOs. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
index b93618c1aa69..7e8fdb1859dd 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -39,6 +39,19 @@ void etnaviv_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
/* TODO msm_gem_vunmap() */
}
+int etnaviv_gem_prime_mmap(struct drm_gem_object *obj,
+ struct vm_area_struct *vma)
+{
+ struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
+ int ret;
+
+ ret = drm_gem_mmap_obj(obj, obj->size, vma);
+ if (ret < 0)
+ return ret;
+
+ return etnaviv_obj->ops->mmap(etnaviv_obj, vma);
+}
+
int etnaviv_gem_prime_pin(struct drm_gem_object *obj)
{
if (!obj->import_attach) {