From patchwork Wed Nov 30 19:34:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 85910 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp485875obb; Wed, 30 Nov 2016 11:34:55 -0800 (PST) X-Received: by 10.99.175.26 with SMTP id w26mr62274843pge.144.1480534495249; Wed, 30 Nov 2016 11:34:55 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f67si65607356pfk.78.2016.11.30.11.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 11:34:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D650D6E444; Wed, 30 Nov 2016 19:34:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73FC46E43F for ; Wed, 30 Nov 2016 19:34:36 +0000 (UTC) Received: by mail-wm0-x22e.google.com with SMTP id g23so278359114wme.1 for ; Wed, 30 Nov 2016 11:34:36 -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=ceDcYI5NjhTDMoh+d7oyPBpztTUYDvepFp+mSJKU7ys=; b=J+832qvu1yOWo6IpjieGdJ40tMrnsxRzfizJfWbWz17WweU0ExT5Ttjil5T9bOgjqc /Vqha4AVlqqDmzFHLDLJmluqLFXNug4//FiGEKwQJQhZ8qjWsj7a5A8QpXcYqki1Si5B /T6qYnyLMisj5Pwhe/xo3S3JTGEGt6ozM56z4= 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=ceDcYI5NjhTDMoh+d7oyPBpztTUYDvepFp+mSJKU7ys=; b=PNfnbYuxVfs7BK8iFB+ZHZ5tmSTS/2CPZD6qFQPQsHl8k39ttuoDc6/pH27SkES6yH EELkmQa0j88vi41SIhYCj9sFGKhX58Kz/f4zTMr0bE7bLfpaWwB321h1x2peQMJZtc3r d0emFStStwMFS/7Ommr15G1Sp38bwGvOdAYtoXyvgekCEXV9/7llbqN9IxJ07C3gx+55 7MuBQGtOWKibxWZKyJJ5p/CMgEWxGW7N13raOEMEuKyWedCBbKfTA+fkIc7yT0SvmCMn qmPEnwSBpYAEJBPP0UkhL0C+xho5QlnDQdDP0DQpl8N8kv5ZAYSVcYuekRkB/Xr3Bxbb 3kWw== X-Gm-Message-State: AKaTC02pdMIYZpV/IitGuwgXCxFqbETLGyOefxh7yirYmbZnVzkNdACpiCI5E+Ks7fJr4TL/ X-Received: by 10.28.93.202 with SMTP id r193mr31793493wmb.30.1480534474768; Wed, 30 Nov 2016 11:34:34 -0800 (PST) Received: from lmenx321.st.com. (lya72-2-88-175-155-153.fbx.proxad.net. [88.175.155.153]) by smtp.gmail.com with ESMTPSA id k11sm9429333wmb.18.2016.11.30.11.34.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Nov 2016 11:34:34 -0800 (PST) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, airlied@redhat.com, daniel@ffwll.ch, robdclark@gmail.com, laurent.pinchart@ideasonboard.com Subject: [RFC v3 2/3] drm: compile drm_vm.c only when needed Date: Wed, 30 Nov 2016 20:34:18 +0100 Message-Id: <1480534459-7239-3-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480534459-7239-1-git-send-email-benjamin.gaignard@linaro.org> References: <1480534459-7239-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" 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 Signed-off-by: Benjamin Gaignard Acked-by: Laurent Pinchart --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/Makefile | 3 ++- drivers/gpu/drm/drm_legacy.h | 7 +++++++ drivers/gpu/drm/nouveau/Kconfig | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 8d9cf73..383989c 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -246,6 +246,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.