summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2016-01-25 15:47:28 +0100
committerLucas Stach <l.stach@pengutronix.de>2016-01-26 18:54:01 +0100
commita0a5ab3e99b8e617221caabf074dcabd1659b9d8 (patch)
tree07e0b3d8d276f388fa572f6abf82324bc8e4a6fe /drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
parentce3088fdb51eda7b9ef3d119e7c302c08428f274 (diff)
drm/etnaviv: call correct function when trying to vmap a DMABUF
When trying to get the vmap address of an imported buffer, we must call into the appropriate helper function, to allow the exporter to establish the vmap, instead of trying to vmap the buffer on our own. Add an indirection through etnaviv_gem_ops to allow the correct implementation to be called. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
index 9c054b6c24d6..4e67395f5fa1 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -77,9 +77,17 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)
drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt);
}
+static void *etnaviv_gem_prime_vmap_impl(struct etnaviv_gem_object *etnaviv_obj)
+{
+ lockdep_assert_held(&etnaviv_obj->lock);
+
+ return dma_buf_vmap(etnaviv_obj->base.import_attach->dmabuf);
+}
+
static const struct etnaviv_gem_ops etnaviv_gem_prime_ops = {
/* .get_pages should never be called */
.release = etnaviv_gem_prime_release,
+ .vmap = etnaviv_gem_prime_vmap_impl,
};
struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,