mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: arcpgu: Fix mmap() callback
@ 2017-07-14 15:46 Jose Abreu
  0 siblings, 0 replies; only message in thread
From: Jose Abreu @ 2017-07-14 15:46 UTC (permalink / raw)
  To: dri-devel, linux-kernel
  Cc: Jose Abreu, Carlos Palminha, Alexey Brodkin, Daniel Vetter, Dave Airlie

Now that ARC properly supports DMA mmapping 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 via DRM.

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@ffwll.ch>
Cc: Dave Airlie <airlied@linux.ie>
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 1926b20..890bc87 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -48,18 +48,6 @@ 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,
@@ -69,7 +57,7 @@ static int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 	.poll = drm_poll,
 	.read = drm_read,
 	.llseek = no_llseek,
-	.mmap = arcpgu_gem_mmap,
+	.mmap = drm_gem_cma_mmap,
 };
 
 static void arcpgu_lastclose(struct drm_device *drm)
-- 
1.9.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-14 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 15:46 [PATCH] drm: arcpgu: Fix mmap() callback Jose Abreu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®