Commit 75cccac4 authored by Eric Anholt's avatar Eric Anholt

drm/cma: Fix recent regression of mmap() in the MMU case.

The stub get_unmapped_area() function was actually getting called, so
all of our mmap()s failed.

Cc: Yannick Fertre <yannick.fertre@st.com>
Fixes: 97bf3a9a ("drm/cma: Update DEFINE_DRM_GEM_CMA_FOPS to add get_unmapped_area")
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170417233124.18420-1-eric@anholt.netReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 765393db
...@@ -26,6 +26,13 @@ to_drm_gem_cma_obj(struct drm_gem_object *gem_obj) ...@@ -26,6 +26,13 @@ to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
return container_of(gem_obj, struct drm_gem_cma_object, base); return container_of(gem_obj, struct drm_gem_cma_object, base);
} }
#ifndef CONFIG_MMU
#define DRM_GEM_CMA_UNMAPPED_AREA_FOPS \
.get_unmapped_area = drm_gem_cma_get_unmapped_area,
#else
#define DRM_GEM_CMA_UNMAPPED_AREA_FOPS
#endif
/** /**
* DEFINE_DRM_GEM_CMA_FOPS() - macro to generate file operations for CMA drivers * DEFINE_DRM_GEM_CMA_FOPS() - macro to generate file operations for CMA drivers
* @name: name for the generated structure * @name: name for the generated structure
...@@ -50,7 +57,7 @@ to_drm_gem_cma_obj(struct drm_gem_object *gem_obj) ...@@ -50,7 +57,7 @@ to_drm_gem_cma_obj(struct drm_gem_object *gem_obj)
.read = drm_read,\ .read = drm_read,\
.llseek = noop_llseek,\ .llseek = noop_llseek,\
.mmap = drm_gem_cma_mmap,\ .mmap = drm_gem_cma_mmap,\
.get_unmapped_area = drm_gem_cma_get_unmapped_area,\ DRM_GEM_CMA_UNMAPPED_AREA_FOPS \
} }
/* free GEM object */ /* free GEM object */
...@@ -86,15 +93,6 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp, ...@@ -86,15 +93,6 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
unsigned long len, unsigned long len,
unsigned long pgoff, unsigned long pgoff,
unsigned long flags); unsigned long flags);
#else
static inline unsigned long drm_gem_cma_get_unmapped_area(struct file *filp,
unsigned long addr,
unsigned long len,
unsigned long pgoff,
unsigned long flags)
{
return -EINVAL;
}
#endif #endif
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment