* [PATCH] drm/gem: Fix builds with CONFIG_MMU=n
@ 2025-12-09 17:11 Boris Brezillon
2025-12-10 13:35 ` Loïc Molinari
0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2025-12-09 17:11 UTC (permalink / raw)
To: dri-devel
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Boris Brezillon, kernel, Loïc Molinari
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 <loic.molinari@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
drivers/gpu/drm/drm_gem.c | 2 ++
include/drm/drm_gem.h | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 6021c4087a08..ca1956608261 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -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
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index cca815dc87f3..f4da8ed0d630 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -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
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drm/gem: Fix builds with CONFIG_MMU=n
2025-12-09 17:11 [PATCH] drm/gem: Fix builds with CONFIG_MMU=n Boris Brezillon
@ 2025-12-10 13:35 ` Loïc Molinari
2025-12-10 13:53 ` Boris Brezillon
0 siblings, 1 reply; 3+ messages in thread
From: Loïc Molinari @ 2025-12-10 13:35 UTC (permalink / raw)
To: Boris Brezillon, dri-devel
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, kernel
Hi Boris,
I missed that one, thanks for the fix.
On 09/12/2025 18:11, Boris Brezillon wrote:
> 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 <loic.molinari@collabora.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Loïc Molinari <loic.molinari@collabora.com>
Regards,
Loïc
> ---
> drivers/gpu/drm/drm_gem.c | 2 ++
> include/drm/drm_gem.h | 5 +++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 6021c4087a08..ca1956608261 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -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
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index cca815dc87f3..f4da8ed0d630 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drm/gem: Fix builds with CONFIG_MMU=n
2025-12-10 13:35 ` Loïc Molinari
@ 2025-12-10 13:53 ` Boris Brezillon
0 siblings, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2025-12-10 13:53 UTC (permalink / raw)
To: Loïc Molinari
Cc: dri-devel, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, kernel
On Wed, 10 Dec 2025 14:35:51 +0100
Loïc Molinari <loic.molinari@collabora.com> wrote:
> Hi Boris,
>
> I missed that one, thanks for the fix.
>
> On 09/12/2025 18:11, Boris Brezillon wrote:
> > 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 <loic.molinari@collabora.com>
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
>
> Reviewed-by: Loïc Molinari <loic.molinari@collabora.com>
Thanks, queued to drm-misc-next immediately so we don't get new kbot
reports.
>
> Regards,
> Loïc
>
> > ---
> > drivers/gpu/drm/drm_gem.c | 2 ++
> > include/drm/drm_gem.h | 5 +++++
> > 2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index 6021c4087a08..ca1956608261 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -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
> > diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> > index cca815dc87f3..f4da8ed0d630 100644
> > --- a/include/drm/drm_gem.h
> > +++ b/include/drm/drm_gem.h
> > @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-10 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 17:11 [PATCH] drm/gem: Fix builds with CONFIG_MMU=n Boris Brezillon
2025-12-10 13:35 ` Loïc Molinari
2025-12-10 13:53 ` Boris Brezillon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.