From patchwork Tue Jun 20 20:16:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9800185 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 ED2FC6038C for ; Tue, 20 Jun 2017 20:23:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBE581FF12 for ; Tue, 20 Jun 2017 20:23:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD73B22AFC; Tue, 20 Jun 2017 20:23:48 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 BD29B1FF12 for ; Tue, 20 Jun 2017 20:23:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFCED6E3E1; Tue, 20 Jun 2017 20:23:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 328 seconds by postgrey-1.35 at gabe; Tue, 20 Jun 2017 20:23:44 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBD8F6E3A8; Tue, 20 Jun 2017 20:23:44 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MRD6F-1dDtzE21Ql-00UZjg; Tue, 20 Jun 2017 22:17:59 +0200 From: Arnd Bergmann To: Rob Clark Subject: [PATCH 2/2] drm/msm: gpu: call qcom_mdt interfaces only for ARCH_QCOM Date: Tue, 20 Jun 2017 22:16:51 +0200 Message-Id: <20170620201720.225593-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170620201720.225593-1-arnd@arndb.de> References: <20170620201720.225593-1-arnd@arndb.de> X-Provags-ID: V03:K0:uhxBazX4VSdSataU5/CEIHYTJ0Dlj9ylJAGoTsvcxRmrXyTY5Be Jbur4K6KR/Wp7P+xMLN17yBwwi9yMZErdcKSy9cM2fP3aejjb//Qxl2BSvj+aowqtj0zNrh xbH0eBKlpXeIkQ/2psQzhQajXgGV0GSKCMJJQA+S+o/ano7mSxPYz76RwcMC+mCKXILHSba TvauoE6kFEcxlwVobEDXg== X-UI-Out-Filterresults: notjunk:1; V01:K0:78up2TPMEQ4=:oNjeZUhFwWS9LsMVnUuwHW QM9YKw8SBdcZ6W6/YdD5RrjjyXl8Eqv3aVOyLPBMk0HOp/ie2KFpzsgchNBdRopp4Tp/CR3zy 1xlXHppujYrmkfnZjnQHQcis2Nz6Byz2kqFoINClZ0PT7BMp86Ed+fXQ2f+DA8uWnC7tXJs7K iT+JSB7mPTzx786PUdwsYnl8UyKJr5UfmDdW3V0DHgSKOo35MwcWOccL8RInEwQsfbMAk0avP BxlZv8xcyDGSPqpavqv2v6+EkbYtb7MbX2gYGGpYnHt4Y75S8XspNYqHrvCziAAE07q8ZVqSo wlbpQr94ogZplLdAqOGyaRkT/b4P1OkA+HhyJoCj1c1Xdvi/avaLHi/SLDbSI8YfB1V73rOn/ qkCKK9SvaCT+8Ye5gYBbhto3ocLCJsD95QTIZaxiRSXdpC7x9f+BQsyRsrBzk3LRnIbwxO0T4 YcjuZY9IGePg4dH9GC6MkhVP7btiSydW39oYAS2Jrq2JKETZSK8tzXYXp+hy9OKtTmyppmG3R FrZ12D0O/pT+2Ef4nKCe3EFIjYwC5QmTxC0M2+x1K31evbKC7xoxIxiDkn4uTZU7hlTa+kk0K RgoLF0R+9+ezKRqPWU94tu2zQ1z3d78RQh5Obl/+zQLslqEDLFDhDT4OMuigeK1UZf88i5Ueb bWdnqlKVRr2O6xI0aK0TEUsuvdvlE76q8ENpsZYVyF0MnUViglgE5J/Be66J25ArnrKk= Cc: Arnd Bergmann , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , Sushmita Susheelendra , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org 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 When compile-testing for something other than ARCH_QCOM, we run into a link error: drivers/gpu/drm/msm/adreno/a5xx_gpu.o: In function `a5xx_hw_init': a5xx_gpu.c:(.text.a5xx_hw_init+0x600): undefined reference to `qcom_mdt_get_size' a5xx_gpu.c:(.text.a5xx_hw_init+0x93c): undefined reference to `qcom_mdt_load' There is already an #ifdef that tries to check for CONFIG_QCOM_MDT_LOADER, but that symbol is only meaningful when building for ARCH_QCOM. This adds a compile-time check for ARCH_QCOM, and clarifies the Kconfig select statement so we don't even try it for other targets. The check for CONFIG_QCOM_MDT_LOADER can then go away, which also improves compile-time coverage and makes the code a little nicer to read. Fixes: 7c65817e6d38 ("drm/msm: gpu: Enable zap shader for A5XX") Signed-off-by: Arnd Bergmann Acked-by: Jordan Crouse Acked-by: Bjorn Andersson --- drivers/gpu/drm/msm/Kconfig | 2 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/Kconfig b/drivers/gpu/drm/msm/Kconfig index b638d192ce5e..99d39b2aefa6 100644 --- a/drivers/gpu/drm/msm/Kconfig +++ b/drivers/gpu/drm/msm/Kconfig @@ -5,7 +5,7 @@ config DRM_MSM depends on ARCH_QCOM || (ARM && COMPILE_TEST) depends on OF && COMMON_CLK depends on MMU - select QCOM_MDT_LOADER + select QCOM_MDT_LOADER if ARCH_QCOM select REGULATOR select DRM_KMS_HELPER select DRM_PANEL diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index eee9ac81aaa1..b719a5b5b88a 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -26,8 +26,6 @@ static void a5xx_dump(struct msm_gpu *gpu); #define GPU_PAS_ID 13 -#if IS_ENABLED(CONFIG_QCOM_MDT_LOADER) - static int zap_shader_load_mdt(struct device *dev, const char *fwname) { const struct firmware *fw; @@ -36,6 +34,9 @@ static int zap_shader_load_mdt(struct device *dev, const char *fwname) void *mem_region = NULL; int ret; + if (!IS_ENABLED(CONFIG_ARCH_QCOM)) + return -EINVAL; + /* Request the MDT file for the firmware */ ret = request_firmware(&fw, fwname, dev); if (ret) { @@ -75,12 +76,6 @@ static int zap_shader_load_mdt(struct device *dev, const char *fwname) return ret; } -#else -static int zap_shader_load_mdt(struct device *dev, const char *fwname) -{ - return -ENODEV; -} -#endif static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, struct msm_file_private *ctx)