drm/gem: Fix builds with CONFIG_MMU=n
Subsystems (2)
PATCH 1/1 drm/gem: Fix builds with CONFIG_MMU=n
drm_gem_get_unmapped_area() relies on mm_get_unmapped_area() which is only available if CONFIG_MMU=y.
Fixes 99bda20d6d4c ("drm/gem: Introduce drm_gem_get_unmapped_area() fop")
Cc Loïc Molinari <[email protected]>
Signed-off-by Boris Brezillon <[email protected]>
--- drivers/gpu/drm/drm_gem.c | 2 ++ include/drm/drm_gem.h | 5 +++++ 2 files changed, 7 insertions(+)
drivers/gpu/drm/drm_gem.c +2 -0
@@ -1267,6 +1267,7 @@ drm_gem_object_lookup_at_offset(struct file *filp, unsigned long start,return obj; } +#ifdef CONFIG_MMU /** * drm_gem_get_unmapped_area - get memory mapping region routine for GEM objects * @filp: DRM file pointer
@@ -1309,6 +1310,7 @@ unsigned long drm_gem_get_unmapped_area(struct file *filp, unsigned long uaddr, return ret; }EXPORT_SYMBOL_GPL (drm_gem_get_unmapped_area); +#endif /** * drm_gem_mmap - memory map routine for GEM objects
include/drm/drm_gem.h +5 -0
@@ -537,9 +537,14 @@ void drm_gem_vm_close(struct vm_area_struct *vma);int drm_gem_mmap_obj (struct drm_gem_object *obj,unsigned long obj_size,struct vm_area_struct *vma);int drm_gem_mmap (struct file *filp,struct vm_area_struct *vma); + +#ifdef CONFIG_MMU unsigned long drm_gem_get_unmapped_area (struct file *filp,unsigned long uaddr,unsigned long len,unsigned long pgoff,unsigned long flags); +#else +#define drm_gem_get_unmapped_area NULL +#endif /** * drm_gem_object_get - acquire a GEM buffer object reference
Signature · 1 line
2.52.0
Hi Boris,
I missed that one, thanks for the fix.
Quoted 6 lines · Boris Brezillon
drm_gem_get_unmapped_area()relies onmm_get_unmapped_area()which is only available ifCONFIG_MMU=y.Fixes 99bda20d6d4c ("drm/gem: Introduce drm_gem_get_unmapped_area() fop")Cc Loïc Molinari <[email protected]>Signed-off-by Boris Brezillon <[email protected]>
Reviewed-by Loïc Molinari <[email protected]>
Regards,
Loïc
Quoted 44 lines
--- drivers/gpu/drm/drm_gem.c | 2 ++ include/drm/drm_gem.h | 5 +++++ 2 files changed, 7 insertions(+)drivers/gpu/drm/drm_gem.c +2
-0@@ -1267,6 +1267,7 @@ drm_gem_object_lookup_at_offset(struct file *filp, unsigned long start,return obj; } +#ifdef CONFIG_MMU /** * drm_gem_get_unmapped_area - get memory mapping region routine for GEM objects * @filp: DRM file pointer @@ -1309,6 +1310,7 @@ unsigned long drm_gem_get_unmapped_area(struct file *filp, unsigned long uaddr, return ret; }EXPORT_SYMBOL_GPL (drm_gem_get_unmapped_area); +#endif /** * drm_gem_mmap - memory map routine for GEM objects include/drm/drm_gem.h +5
-0@@ -537,9 +537,14 @@ void drm_gem_vm_close(struct vm_area_struct *vma);int drm_gem_mmap_obj (struct drm_gem_object *obj,unsigned long obj_size,struct vm_area_struct *vma);int drm_gem_mmap (struct file *filp,struct vm_area_struct *vma); + +#ifdef CONFIG_MMU unsigned long drm_gem_get_unmapped_area (struct file *filp,unsigned long uaddr,unsigned long len,unsigned long pgoff,unsigned long flags); +#else +#define drm_gem_get_unmapped_area NULL +#endif /** * drm_gem_object_get - acquire a GEM buffer object reference
Quoted 5 lines · On Wed, 10 Dec 2025 14:35:51 +0100 Loïc Molinari <[email protected]>…
Hi Boris,
I missed that one, thanks for the fix.
On 09/12/2025 18:11, Boris Brezillon wrote:
Quoted 8 lines
Quoted 6 lines
drm_gem_get_unmapped_area()relies onmm_get_unmapped_area()which is only available ifCONFIG_MMU=y.Fixes 99bda20d6d4c ("drm/gem: Introduce drm_gem_get_unmapped_area() fop")Cc Loïc Molinari <[email protected]>Signed-off-by Boris Brezillon <[email protected]>Reviewed-by Loïc Molinari <[email protected]>
Thanks, queued to drm-misc-next immediately so we don't get new kbot reports.
Quoted 49 lines
Regards,
LoïcQuoted 44 lines
--- drivers/gpu/drm/drm_gem.c | 2 ++ include/drm/drm_gem.h | 5 +++++ 2 files changed, 7 insertions(+)drivers/gpu/drm/drm_gem.c +2
-0@@ -1267,6 +1267,7 @@ drm_gem_object_lookup_at_offset(struct file *filp, unsigned long start,return obj; } +#ifdef CONFIG_MMU /** * drm_gem_get_unmapped_area - get memory mapping region routine for GEM objects * @filp: DRM file pointer @@ -1309,6 +1310,7 @@ unsigned long drm_gem_get_unmapped_area(struct file *filp, unsigned long uaddr, return ret; }EXPORT_SYMBOL_GPL (drm_gem_get_unmapped_area); +#endif /** * drm_gem_mmap - memory map routine for GEM objects include/drm/drm_gem.h +5
-0@@ -537,9 +537,14 @@ void drm_gem_vm_close(struct vm_area_struct *vma);int drm_gem_mmap_obj (struct drm_gem_object *obj,unsigned long obj_size,struct vm_area_struct *vma);int drm_gem_mmap (struct file *filp,struct vm_area_struct *vma); + +#ifdef CONFIG_MMU unsigned long drm_gem_get_unmapped_area (struct file *filp,unsigned long uaddr,unsigned long len,unsigned long pgoff,unsigned long flags); +#else +#define drm_gem_get_unmapped_area NULL +#endif /** * drm_gem_object_get - acquire a GEM buffer object reference