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: 9800175 X-Patchwork-Delegate: agross@codeaurora.org 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 BD28B6038C for ; Tue, 20 Jun 2017 20:18:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18D5206AC for ; Tue, 20 Jun 2017 20:18:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6071283AF; Tue, 20 Jun 2017 20:18:26 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3344126861 for ; Tue, 20 Jun 2017 20:18:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbdFTUSZ (ORCPT ); Tue, 20 Jun 2017 16:18:25 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:63148 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbdFTUSY (ORCPT ); Tue, 20 Jun 2017 16:18:24 -0400 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 Cc: Jordan Crouse , Bjorn Andersson , Arnd Bergmann , David Airlie , Srinivas Kandagatla , Daniel Vetter , Archit Taneja , Eric Anholt , Sushmita Susheelendra , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org 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:E0NHW0Z3GE4=:Hl8DJmXfY38lclx6ERw8CH 0ydkflFltZndKuaTjfVML9cpfGftn9m2Ni6JbkPL5C1iTx0glQ+DmwgdfXajsdXuseAaLGnYp m3Ky+LDvetCyza0Y3BKS+/YJQKYlkBBlxX6rdPgbJbTBmfMEjvbty2semEkszJ65pGxpoLjKx CVd857hMFfP6GxEZHrkYnwX0dPVY4JVzOsH+HBZfbT6GwFwJwBmdrv1id1GW2zznkMe4NKqP4 kiAT8JJTQa0U+a00D43ePIzdFG/NI+lxk16r/tYHbaTeUFwmv3hZGj1Rarf92Yy5lUF88FifE gjsObCEgfN8o6PRqfmjtNL70e2BeHwK612cf+bTqk1+CHMDWW6DOuH3waHXOPShsUpVdshi2j xhetxr8Jy2lTlIDPIIKsDO2WsC7DXTvEhXxhJuuwjDg0JWZY2TG8WyXdS/ECSs9nbgvLJMWB9 wJexV0KEumdtF1KdI8i/qo2vuZajPOhgcMVU7juEP3srIYOzs2lHRXiieYnG4la7gRE4bnEiZ 4cGsQ9Ypse/FWbal4Pq4ZL8sMVBgKlM8I9eFSaF86JifhfA6QsQbRAbD6l4qtF3G3DOwypUaa NlkGt6libP+2IvUjvqqic2upFOf4zylQp59mQzQ7SkzJUF5nc/bhWbqDgqUNQiqUiK92SZyuC /87Swk/EZb5H89eD2//AQNSYVBpX5Wv8+DpDv2TorPA4tPmETOBcaAzbNrOySGyGtUvI= Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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)