mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: fix drm_vm for NOMMU builds
@ 2017-01-11 13:33 Arnd Bergmann
  2017-01-11 13:33 ` [PATCH 2/2] drm: add more MMU dependencies Arnd Bergmann
  2017-01-11 16:27 ` [PATCH 1/2] drm: fix drm_vm for NOMMU builds Daniel Vetter
  0 siblings, 2 replies; 9+ messages in thread
From: Arnd Bergmann @ 2017-01-11 13:33 UTC (permalink / raw)
  To: Daniel Vetter, Daniel Vetter
  Cc: Benjamin Gaignard, Arnd Bergmann, Jani Nikula, Sean Paul,
	David Airlie, dri-devel, linux-kernel

When building DRM without an MMU, we run into a compile-time error because
pte_wrprotect() is not defined:

drivers/gpu/drm/drm_vm.c: In function 'drm_mmap_dma':
drivers/gpu/drm/drm_vm.c:496:9: error: implicit declaration of function 'pte_wrprotect' [-Werror=implicit-function-declaration]

The line is not meaningful here, so we can simply add another
compile-time check around it.

Fixes: 62a0d98a188c ("drm: allow to use mmuless SoC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/drm_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index bd311c77c254..038946588ed7 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -488,7 +488,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
 		vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
 #if defined(__i386__) || defined(__x86_64__)
 		pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
-#else
+#elif IS_ENABLED(CONFIG_MMU)
 		/* Ye gads this is ugly.  With more thought
 		   we could move this up higher and use
 		   `protection_map' instead.  */
@@ -572,7 +572,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 		vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
 #if defined(__i386__) || defined(__x86_64__)
 		pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
-#else
+#elif defined (CONFIG_MMU)
 		/* Ye gads this is ugly.  With more thought
 		   we could move this up higher and use
 		   `protection_map' instead.  */
-- 
2.9.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-11 17:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 13:33 [PATCH 1/2] drm: fix drm_vm for NOMMU builds Arnd Bergmann
2017-01-11 13:33 ` [PATCH 2/2] drm: add more MMU dependencies Arnd Bergmann
2017-01-11 14:02   ` Lucas Stach
2017-01-11 16:25     ` Daniel Vetter
2017-01-11 16:27 ` [PATCH 1/2] drm: fix drm_vm for NOMMU builds Daniel Vetter
2017-01-11 16:33   ` Arnd Bergmann
2017-01-11 16:36     ` Daniel Vetter
2017-01-11 16:59       ` Arnd Bergmann
2017-01-11 17:03         ` Benjamin Gaignard

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®