提交 7c397cd9 编写于 作者: J Joonyoung Shim 提交者: Dave Airlie

drm: add mmap function to prime helpers

This adds to call low-level mmap() from prime helpers.
Signed-off-by: NJoonyoung Shim <jy0922.shim@samsung.com>
Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 f9d8a129
...@@ -245,7 +245,13 @@ static void drm_gem_dmabuf_kunmap(struct dma_buf *dma_buf, ...@@ -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, static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf,
struct vm_area_struct *vma) 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 = { static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = {
......
...@@ -937,6 +937,8 @@ struct drm_driver { ...@@ -937,6 +937,8 @@ struct drm_driver {
struct sg_table *sgt); struct sg_table *sgt);
void *(*gem_prime_vmap)(struct drm_gem_object *obj); void *(*gem_prime_vmap)(struct drm_gem_object *obj);
void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); 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 */ /* vga arb irq handler */
void (*vgaarb_irq)(struct drm_device *dev, bool state); void (*vgaarb_irq)(struct drm_device *dev, bool state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册