summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2013-06-28 05:24:53 (GMT)
committerInki Dae <inki.dae@samsung.com>2014-10-15 11:05:12 (GMT)
commitd39f7cab558e888c022bd8f360fbf9167309d01f (patch)
tree194b2099357bc33b9d67fb73fd205439f3ba5eb3
parent80951df34dc38e11838d931365118ca3b6c0772f (diff)
downloadlinux-3.10-d39f7cab558e888c022bd8f360fbf9167309d01f.zip
linux-3.10-d39f7cab558e888c022bd8f360fbf9167309d01f.tar.gz
linux-3.10-d39f7cab558e888c022bd8f360fbf9167309d01f.tar.bz2
drm: add mmap function to prime helpers
This adds to call low-level mmap() from prime helpers. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_prime.c8
-rw-r--r--include/drm/drmP.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index ae851b0..068a8f2 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -245,7 +245,13 @@ static void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf,
static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,
struct vm_area_struct *vma)
{
- return -EINVAL;
+ struct drm_gem_object *obj = dma_buf->priv;
+ struct drm_device *dev = obj->dev;
+
+ if (!dev->driver->gem_prime_mmap)
+ return -ENOSYS;
+
+ return dev->driver->gem_prime_mmap(obj, vma);
}
static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = {
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index a6128a6..c3f97ad 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -940,6 +940,8 @@ struct drm_driver {
struct sg_table *sgt);
void *(*gem_prime_vmap)(struct drm_gem_object *obj);
void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr);
+ int (*gem_prime_mmap)(struct drm_gem_object *obj,
+ struct vm_area_struct *vma);
/* vga arb irq handler */
void (*vgaarb_irq)(struct drm_device *dev, bool state);