Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556685

Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Daniel Vetter <daniel@ffwll.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds
Date Wed, 11 Jan 2017 17:30:01 +0100
Message-ID <sYtWF-In-13@gated-at.bofh.it> (permalink)
References <sYria-7uK-5@gated-at.bofh.it>
X-Original-To Arnd Bergmann <arnd@arndb.de>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AW4eaR1ucQqThheT1hSbzGGHDE+n8rZOjj9R8GdOMD4=; b=XLeukWKpBgy7/wimgv1b2puoBNyfv39W67n1RPYkSC2b3eaMWwWxvSeK5Cob4C+kPA k+qVc0QJzuqs0yPCS0nMCoxEszqfzLh284RV8V22sLHZHYuD3nT9QP3Fc3BcTA2IpYhb oLRn2eU8bvdg8Db4/FQ3agdL2nmIl5rj6bsko=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=AW4eaR1ucQqThheT1hSbzGGHDE+n8rZOjj9R8GdOMD4=; b=IEpHSzYRg7tsa8HErypTHMKNKuVCXhfB1nI0T4Qmunkldkyipre04uY7sEiV8WOuKV nNO9XKF/9yIDWFFmjEqiEAMakgY3NDYqtlVZVlRyLGd6rcgRjtO9H8ckSHyj9AvguE2R WSaqKtMVx0H4zPqVDq74Nwu/WeTELn2SvIuWfnSsFxPQgixNr1IQgNDWageFC6qFVHnD AKqkzc+Q3C63sPs4xDKHjT/u1GuLC/HbN+jtEW9AGa7m9sWW4EH90jQFALmtmsDUT5P9 ILanFbN6blaO/3dZnmPvntX/Fc+a0FoiI4+iCrqpAuN8Y4NQUno2zKVxAfZiXbxwF4ug LL+g==
X-Gm-Message-State AIkVDXKBlTobv/zNPyoP2Vz+d+kBvNU44h5jMDND6I70wZUkCGRyJ/mAP/G7Ib+hXB8yOA==
X-Received by 10.28.98.66 with SMTP id w63mr4132306wmb.142.1484152036644; Wed, 11 Jan 2017 08:27:16 -0800 (PST)
Mail-Followup-To Arnd Bergmann <arnd@arndb.de>, Daniel Vetter <daniel.vetter@intel.com>, Benjamin Gaignard <benjamin.gaignard@linaro.org>, Jani Nikula <jani.nikula@linux.intel.com>, Sean Paul <seanpaul@chromium.org>, David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Operating-System Linux phenom 4.8.0-1-amd64
User-Agent NeoMutt/20161126 (1.7.1)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 60
Organization linux.* mail to news gateway
X-Original-Cc Daniel Vetter <daniel.vetter@ffwll.ch>, Daniel Vetter <daniel.vetter@intel.com>, Benjamin Gaignard <benjamin.gaignard@linaro.org>, Jani Nikula <jani.nikula@linux.intel.com>, Sean Paul <seanpaul@chromium.org>, David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
X-Original-Date Wed, 11 Jan 2017 17:27:13 +0100
X-Original-Message-ID <20170111162713.veyyu56sbjaym3fe@phenom.ffwll.local>
X-Original-References <20170111133357.3664191-1-arnd@arndb.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1556685

Show key headers only | View raw


On Wed, Jan 11, 2017 at 02:33:34PM +0100, Arnd Bergmann wrote:
> 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>

We don't need drm_vm.c on modern drivers, and the idea was to simply not
compile it when not needed. See:

commit 99c48e1e38f0aeaa107ad67c8d91f6c9d9d567a9
Author: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Date:   Wed Jan 4 10:12:56 2017 +0100

    drm: compile drm_vm.c only when needed


How did you manage to enable this stuff?
-Daniel

> ---
>  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
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] drm: fix drm_vm for NOMMU builds Arnd Bergmann <arnd@arndb.de> - 2017-01-11 14:40 +0100
  [PATCH 2/2] drm: add more MMU dependencies Arnd Bergmann <arnd@arndb.de> - 2017-01-11 14:40 +0100
    Re: [PATCH 2/2] drm: add more MMU dependencies Lucas Stach <l.stach@pengutronix.de> - 2017-01-11 15:10 +0100
      Re: [PATCH 2/2] drm: add more MMU dependencies Daniel Vetter <daniel@ffwll.ch> - 2017-01-11 17:30 +0100
  Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Daniel Vetter <daniel@ffwll.ch> - 2017-01-11 17:30 +0100
    Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Arnd Bergmann <arnd@arndb.de> - 2017-01-11 17:40 +0100
      Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Daniel Vetter <daniel@ffwll.ch> - 2017-01-11 17:40 +0100
        Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Arnd Bergmann <arnd@arndb.de> - 2017-01-11 18:10 +0100
          Re: [PATCH 1/2] drm: fix drm_vm for NOMMU builds Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-01-11 18:20 +0100

csiph-web