From patchwork Wed Jul 11 14:43:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10520059 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 C2F7F601D4 for ; Wed, 11 Jul 2018 14:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF91829032 for ; Wed, 11 Jul 2018 14:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A339229029; Wed, 11 Jul 2018 14:47:12 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 364D029029 for ; Wed, 11 Jul 2018 14:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=BvFpcDmEotZEeUKFnckZ6VWp8i0JdDClCA2QhxsGlPg=; b=SXL iQINz9+UXy4pCXDqZXOm3Ez7Yw6qJ33weqqAlR3Hx+DJe2jSbl0JCII51AGxrxp3osbmwkQA/OWZW /Csci0UDCH9LXOLtoABTLZTb12QQokXu7RKmK793tDoDUJoB6I2OosJSGV49qZ6DJwoB3WsgB3z9y LOkUCCD7Ok9EJjKIwzWl7ZghrmDiqs71NDZuIsZnCKhnmfv+W2Ngq7hZYlx4CQo5UxgyYr7dF27O1 GPSyw7YOjCZTeByr4PEd3B0lLAT8ueBOu4v9tLxym3tDrAFc+SKil7+81ciAhsUq0O5s4rB00CV1i SLfy2hWDbSzNIFV6uPMdT7ZSm6iE9rA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdGOV-00016q-5c; Wed, 11 Jul 2018 14:47:03 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdGM2-0006xo-Vl for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 14:45:51 +0000 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lapqe-1gNdi42jSy-00kRkN; Wed, 11 Jul 2018 16:44:08 +0200 From: Arnd Bergmann To: Maxime Ripard , Chen-Yu Tsai Subject: [PATCH] [v3] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Date: Wed, 11 Jul 2018 16:43:10 +0200 Message-Id: <20180711144403.1022829-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:Xn9lFVgmsfGt6qSqwJlwu4AzJiaAn9rdd249O1SmDwH4pj/luPm e1ciFlK6WXcmnD1ZBjC0wK0udmlKvNOvM9NtIjMvcikohimvll0yG/0N6sfHwA6NWd3WvK7 iI5AvnraJC3nxes31ZUdokumggAweKlQcoFdcdeH1R1VlZpXswGa9aUWs91BUbTqhXBbGLk MHLSuvy3gQsQovKxvP/MQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ykw5blQwfDA=:3lyWPAVyaoPt+9ABtQ+Nqm 8ZPJFAjhMgocQQqjaawKIS4XWBkFZJFV2TmO964bJzu/ZQZSQ+BM9ftwZLRK11lJxbFyv6Rjw 7DgLuLSMVfHjfqHQasJPec7ffBE7dnQQWszZffYdKVmTB25ffbLYM8iPDRyZfKu5f+SkROLz9 Mq3hdnr1VnNvDK2iYhwGCi+ymc1GehnwdWpOtaElj0raXCxw7MBlFBjO9SVmtvM1Ggo2H2tAO Bmj07ogdkRTXhrNPOvgVIGud7dtxgnRDODr11yk+BOXddbUi9DxLnCz7MsBhnYhCiUd7aPr9D H85OVGhJ1Clp9vBHppOImUHUP3NZ+oW0+ThWsbONMlSagY78VY3Ae6Wf4ia9dAwmF4tTi4UDz UjLvVM2pRdPe23/Mx8ePOdl8LikA/mVcOZl0t6qRKHPE18APJWuIRppjMJcGcgptC1IPzMtpH NNwnsy339m4H3ljg1t+fOhafrcenBt2yYD4FbRK+GKB9Dz9wz0QX5e7pBxS52IZ3HQ+4NvRXa CGcs/R5bZ6wk7meKkUe6F+1WK+tPDPzegYDA1D50sJNhFsjLhMBS1OiqHpZX9B+E4DJrs+GV4 2IC+YN9hxrZpnzSobkIMQGYQ7O8JitkHgonhGBp83RobIc8UNPn5puuu3XZBahjKFpZ500v29 IwKplAHd2soBS7Y3/itDgXP/KDQxOyFTclamUrr0zn2NzJvxZfvwN9Iy4BDnXQN3z1Po= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_074432_403937_046813E8 X-CRM114-Status: GOOD ( 14.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module: ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined! ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined! This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules. Fixes: 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs") Fixes: ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP") Signed-off-by: Arnd Bergmann --- v2: link the tcon top module separately instead of into the mixer v3: rebased on top of the latest git://anongit.freedesktop.org/drm/drm-misc for-linux-next --- drivers/gpu/drm/sun4i/Kconfig | 7 +++++++ drivers/gpu/drm/sun4i/Makefile | 3 ++- drivers/gpu/drm/sun4i/sun4i_drv.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig index 156a865c3e6d..c2c042287c19 100644 --- a/drivers/gpu/drm/sun4i/Kconfig +++ b/drivers/gpu/drm/sun4i/Kconfig @@ -68,4 +68,11 @@ config DRM_SUN8I_MIXER graphics mixture and feed graphics to TCON, If M is selected the module will be called sun8i-mixer. +config DRM_SUN8I_TCON_TOP + tristate + default DRM_SUN4I if DRM_SUN8I_MIXER!=n + help + TCON TOP is responsible for configuring display pipeline for + HTMI, TVE and LCD. + endif diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile index cd27d02c94e2..0eb38ac8e86e 100644 --- a/drivers/gpu/drm/sun4i/Makefile +++ b/drivers/gpu/drm/sun4i/Makefile @@ -39,4 +39,5 @@ endif obj-$(CONFIG_DRM_SUN4I_HDMI) += sun4i-drm-hdmi.o obj-$(CONFIG_DRM_SUN6I_DSI) += sun6i-dsi.o obj-$(CONFIG_DRM_SUN8I_DW_HDMI) += sun8i-drm-hdmi.o -obj-$(CONFIG_DRM_SUN8I_MIXER) += sun8i-mixer.o sun8i_tcon_top.o +obj-$(CONFIG_DRM_SUN8I_MIXER) += sun8i-mixer.o +obj-$(CONFIG_DRM_SUN8I_TCON_TOP) += sun8i_tcon_top.o diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index a15feb807393..03ffbcc98dd0 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -216,7 +216,8 @@ static bool sun4i_drv_node_is_tcon_with_ch0(struct device_node *node) static bool sun4i_drv_node_is_tcon_top(struct device_node *node) { - return !!of_match_node(sun8i_tcon_top_of_table, node); + return IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) && + !!of_match_node(sun8i_tcon_top_of_table, node); } static int compare_of(struct device *dev, void *data) diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index 21dc9ebad0b4..e184cb17690b 100644 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c @@ -44,7 +44,8 @@ sun8i_dw_hdmi_mode_valid(struct drm_connector *connector, static bool sun8i_dw_hdmi_node_is_tcon_top(struct device_node *node) { - return !!of_match_node(sun8i_tcon_top_of_table, node); + return IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) && + !!of_match_node(sun8i_tcon_top_of_table, node); } static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,