From patchwork Wed Dec 7 10:06:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9464205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC83860512 for ; Wed, 7 Dec 2016 10:08:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F1F228478 for ; Wed, 7 Dec 2016 10:08:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83C18284D5; Wed, 7 Dec 2016 10:08:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 345EF28478 for ; Wed, 7 Dec 2016 10:08:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E7B36E52A; Wed, 7 Dec 2016 10:08:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08B0D6E18F for ; Wed, 7 Dec 2016 10:08:01 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id u144so33422837wmu.1 for ; Wed, 07 Dec 2016 02:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pcJeeG4LalZ4h4UO5fSiL5PZJjSjkw0eXScgTCfghjM=; b=C1t88q6xS3gcWHgy5Tm4WUw4zOD/A/aMVKDK5UbqwvheRZUJnto8+0FKkpf6Ivi46L CWpY9mtpYR1WiHQAh6iGpdB+moO5TV2CDLc8VZ4edWNoNH5BnFzebP+d5L3avT17WQLt kBiKAagDi76rEYnYFkpxzhf9fYs4lqw3Te80o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pcJeeG4LalZ4h4UO5fSiL5PZJjSjkw0eXScgTCfghjM=; b=GK5sq35jBsT61Pv6dstz96rGSoRLv8BDSN3uNKgTKSdJrZ72IhMnZe41MJa2ilTQFp SptIVNesOpaFrtXq+JRWhX9IHf8Xixn31wRhfw5GOi11Dgp+QPlcRDdGGspb8w+nwjmr laTwyh/m7ByREkYcSyiModnBZ9wDwyM1gL+496fB6oZo7qQbg+v4Q0qA932AVFhZGHZ5 yAEbno9sJufbx3Hcv++ZPi2e7sX6V10UHMA5URts73HyqTcFTsCFuobXaJYKOEB+GhS/ YWxEmP5cMlDASalmfzrdmnRtsXH95NnJ0g908pruBBYELYA1mRlSil1Wq5MiTvFopGYY 3vzw== X-Gm-Message-State: AKaTC01hbjdW8MzpFg5Otj/4/mfXnczYas2pRF07xD/pfqwaivcb6XUA+IEAqe3tjb0SkSu7 X-Received: by 10.28.12.84 with SMTP id 81mr1851104wmm.51.1481105279339; Wed, 07 Dec 2016 02:07:59 -0800 (PST) Received: from lmenx321.st.com. ([80.215.165.156]) by smtp.gmail.com with ESMTPSA id x140sm8748561wme.19.2016.12.07.02.07.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 02:07:58 -0800 (PST) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, airlied@redhat.com, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, michel@daenzer.net Subject: [PATCH v4 3/4] drm: compile drm_vm.c only when needed Date: Wed, 7 Dec 2016 11:06:50 +0100 Message-Id: <1481105211-18020-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481105211-18020-1-git-send-email-benjamin.gaignard@linaro.org> References: <1481105211-18020-1-git-send-email-benjamin.gaignard@linaro.org> Cc: yannick.fertre@st.com, linaro-kernel@lists.linaro.org, philippe.cornu@st.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP drm_vm.c functions are only need for DRM_LEGACY and DRM_NOUVEAU. Use a new DRM_VM to define when drm_vm.c in needed. stub drm_legacy_vma_flush() to avoid compilation issues version 4: - a "config DRM_VM" in Kconfig Signed-off-by: Benjamin Gaignard Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/Kconfig | 5 +++++ drivers/gpu/drm/Makefile | 3 ++- drivers/gpu/drm/drm_legacy.h | 7 +++++++ drivers/gpu/drm/nouveau/Kconfig | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 8d9cf73..83ac815 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -121,6 +121,10 @@ config DRM_KMS_CMA_HELPER help Choose this if you need the KMS CMA helper functions +config DRM_VM + bool + depends on DRM + source "drivers/gpu/drm/i2c/Kconfig" source "drivers/gpu/drm/arm/Kconfig" @@ -246,6 +250,7 @@ source "drivers/gpu/drm/zte/Kconfig" menuconfig DRM_LEGACY bool "Enable legacy drivers (DANGEROUS)" depends on DRM + select DRM_VM help Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous APIs to user-space, which can be used to circumvent access diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index e10e935..5b73b16 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -5,7 +5,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_context.o drm_dma.o \ drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \ - drm_lock.o drm_memory.o drm_drv.o drm_vm.o \ + drm_lock.o drm_memory.o drm_drv.o \ drm_scatter.o drm_pci.o \ drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \ drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ @@ -18,6 +18,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_plane.o drm_color_mgmt.o drm_print.o \ drm_dumb_buffers.o drm_mode_config.o +drm-$(CONFIG_DRM_VM) += drm_vm.o drm-$(CONFIG_COMPAT) += drm_ioc32.o drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o drm-$(CONFIG_PCI) += ati_pcigart.o diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h index c6f422e..e4bb5ad 100644 --- a/drivers/gpu/drm/drm_legacy.h +++ b/drivers/gpu/drm/drm_legacy.h @@ -74,7 +74,14 @@ int drm_legacy_getmap_ioctl(struct drm_device *dev, void *data, int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f); int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f); +#ifdef CONFIG_DRM_VM void drm_legacy_vma_flush(struct drm_device *d); +#else +static inline void drm_legacy_vma_flush(struct drm_device *d) +{ + /* do nothing */ +} +#endif /* * AGP Support diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig index 2922a82..0f2f0af 100644 --- a/drivers/gpu/drm/nouveau/Kconfig +++ b/drivers/gpu/drm/nouveau/Kconfig @@ -16,6 +16,7 @@ config DRM_NOUVEAU select INPUT if ACPI && X86 select THERMAL if ACPI && X86 select ACPI_VIDEO if ACPI && X86 + select DRM_VM help Choose this option for open-source NVIDIA support.