summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/arc
diff options
context:
space:
mode:
authorJose Abreu <Jose.Abreu@synopsys.com>2017-07-17 13:08:25 +0100
committerAlexey Brodkin <abrodkin@synopsys.com>2017-08-03 00:11:01 +0300
commita8f8fb20579cc8a4e4472728380926410f20322a (patch)
treeea40d9addb43d621a47d8cbbb884756135d0f210 /drivers/gpu/drm/arc
parent429ff616a5e8129e86312c841ca816d92f3cb8a1 (diff)
drm: arcpgu: Fix mmap() callback
Now that ARC properly supports DMA mmap() we can use the standard CMA helper to map dumb buffers. This makes ARC PGU works with standard DRM consumer applications like, for example, mpv/mplayer via DRM. While at it, use the DEFINE_DRM_GEM_CMA_FOPS() helper. This fixes the use of dumb buffers. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Fixes: 0c4250e7b15e ("drm: Add support of ARC PGU display controller") Cc: Carlos Palminha <palminha@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Dave Airlie <airlied@gmail.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Diffstat (limited to 'drivers/gpu/drm/arc')
-rw-r--r--drivers/gpu/drm/arc/arcpgu_drv.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index a12fd8f64828..b9009b31dd45 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -48,29 +48,7 @@ static void arcpgu_setup_mode_config(struct drm_device *drm)
drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
}
-static int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
-{
- int ret;
-
- ret = drm_gem_mmap(filp, vma);
- if (ret)
- return ret;
-
- vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
- return 0;
-}
-
-static const struct file_operations arcpgu_drm_ops = {
- .owner = THIS_MODULE,
- .open = drm_open,
- .release = drm_release,
- .unlocked_ioctl = drm_ioctl,
- .compat_ioctl = drm_compat_ioctl,
- .poll = drm_poll,
- .read = drm_read,
- .llseek = no_llseek,
- .mmap = arcpgu_gem_mmap,
-};
+DEFINE_DRM_GEM_CMA_FOPS(arcpgu_drm_ops);
static void arcpgu_lastclose(struct drm_device *drm)
{