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: 141761 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp375787ljj; Wed, 11 Jul 2018 07:44:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebCdh1x0/ENDZRVnNKw17RAKfCZOExKwSsr5iVnszjLGykhhpYjvHgHDKKMAfTIfi+hM7W X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr7166395pll.185.1531320293132; Wed, 11 Jul 2018 07:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531320293; cv=none; d=google.com; s=arc-20160816; b=AfZ/2p0q3OqHKnv5nm3n5UUKNtKKQlsJBLqL4SraB4fPeNGnovTLb2rVbBmWntfkeu lrPhL/IiTaSLvSzRt7tH4tKhIwMMI1lBhiUTRpXcNMmX0VQrRt7ECsqXhXuhDwaBDJHo fsmJ2Sh1GspTzNQjTNLLLV4qfAi/W8Tnvl6e2CAPVJvo2dYiKMzdmIqRdFQUxQchOU6L AC8uIkZy3rU6pZ0PaZVhh8XfTadLSgNJfLuUdoCDOd69yYsziomF7GF6KcfOc0R7J9Fm AgP0JT7zjq9jNX1ar8ApIh1fN1u6BO57W6zJJK7x63fzh9QJCGJWu6ZaomN1+G07qNzH AVqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=9oaR3KP2oWk/Da6Tl2qNjJL2Rxm6JNbHrEBFq08KoZY=; b=kAuCf8XdA0k2f5kBGKc9qB/G+RKE1FwziAgxubt0P3Ingq4DKKEZqAdCll+gYSDwTf qdcrdVR0uCWpbC/ngArG9ScNr+tP+BlHiEFZ33dccWJ+Exly0nQtHb097PpYb1Avo/4d TET3wNhd7oyRBc5vC8JxMtJWqDYwN+wFPOF/u5OV72QRZnCYKLpHULji+YOztjOYotsq wdZ52ZEzm/Jx1ipt5+3Vzsd3VK2wCzQO6slJtoZqzSFk26sABj5ZdULwHaQdnrgl83jR ZgB1Zb7mlJpXkWAbBu+dbFtqcnMNG29+bJ4njt+WA30XyxfbQBMU2Vzl1N2Fv/w2O00P xXXA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id m3-v6si20676733pfm.0.2018.07.11.07.44.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 07:44:53 -0700 (PDT) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07CA66E62D; Wed, 11 Jul 2018 14:44:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50D946E62D for ; Wed, 11 Jul 2018 14:44:18 +0000 (UTC) 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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,