From patchwork Mon Jul 9 16:05:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10515159 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 5B5376032A for ; Mon, 9 Jul 2018 16:06:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4712E28C17 for ; Mon, 9 Jul 2018 16:06:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 394AB28C1C; Mon, 9 Jul 2018 16:06:57 +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=ham 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 C802E28C17 for ; Mon, 9 Jul 2018 16:06:56 +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=1BmM1DBovZvsTyvd3MWFVRrLXqklfz09VIybQjgMgwQ=; b=g/W FoHOUpaXNaP+1TDzA0EatuAmRxzZEMR22x2KmXves0Ns9nk1lY8Z6+0UVkKT3VnBzYgpoFZafY3+x 08ju4itgtbIejJLUUZt751KVtlVGBW9czvb1tKcgmSrmJp8gq/q34kE/SR+x/x8a5gUxuok7wkDIV RPULIZ6lIbOIY7SU4FE+qr0vQ0X+ckqaa9Ts0xP8fRaIaBh7llBXwTKvi72lvSrZsUTAXC2ypSUd5 yszScKlrSAmVJjaJ/b8vj0hAkqPZ0S1sdDTiAajMe0ZVBaN36VLlfZfkFy2miUtyAeucOovYjCZol jrX2I/lRRhS2afiE58VdTtuYHfj4rRA==; 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 1fcYge-0005Y0-Ed; Mon, 09 Jul 2018 16:06:52 +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 1fcYga-0005Ik-S8 for linux-arm-kernel@lists.infradead.org; Mon, 09 Jul 2018 16:06:51 +0000 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mboqj-1fLqbm1pMj-00Iyub; Mon, 09 Jul 2018 18:06:19 +0200 From: Arnd Bergmann To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH] [v2] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Date: Mon, 9 Jul 2018 18:05:55 +0200 Message-Id: <20180709160615.2686055-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:yfMQHlSrnKBRQ1W1oWue4dMcRmiJaOain4IMJcV3MVRbduh5nGg dE/45cd9ACGkChuav2BqcLp/AYu1ny4M6l8k/ibLV+8YTKBzHTwk1SET3A2j1mhmR0Xny7q eOg+xJoDGeOAhSyfIGYYhYd0/1sQWoa2gsJnqNj8ZxaJuyEGjYac/3/rmKML0lNZ/Xb7v1h asfeyo5aGUAJCx6Y5gHPg== X-UI-Out-Filterresults: notjunk:1; V01:K0:G2oTdP56VaM=:NO43VNKIEuhaxY6mZxdQ+2 X9LU7SWrVRKPk9GRk0vfgSsApGFDw3yElsETthZxRPJF2Bxep/RAEiuE4DWwRu7UE5FEYGem5 x4uSmN/2gcVfnH2uoBryE+mIHw8WZ7r6pSMhBA6F+A1N04N+pewbuwDGoM8qkn5sHg40Geico xjuOeTyRUTYjd0ImrM1EeupC8bC+a+31bRGNLYAUs7wk7P3VuLNYrNiaYqpUVxtILgrwlIu2a E6mF0phipqXst9qqsFV2O5IOA+LBHh1UsS/OIEWGfNT829LMJAaEm3Qpj99Eo4gJOYmOV/nu3 pHhSh1dHKBetYb+9HviuwuGlr4CvKV8JbDc7tDRbgtfTrp0FQ194Lg2u66TD/5XSTkbRjc1HC rM/mlDTGM0naKa0ecYcY+tiojH0LZtYmi5zgjbtYMwLjUdbRByxJUzha1JuEOG2Z6CLpQnypR cdH8SAjNeh+Cdt9qkcwOYNTBefueydM6ov63Jvsuc2F8/QFuBi2GX/K9hDCWa415aGoo9ql/v 8XQScTd/nwM1o2CuCCKQEKMOd5U+Epq85j7yZaYXBWiw/S22n4oACEPd4z05a6N77Z/EgYqVs 395IdJPQpy+IMwp1pY10Po/1mA6YKsVEOtd/Qq9UF1vgxkZI+mq8+ACWFP9ist1XYwbVx4TKE icNaXUkwvRPIrtT2LlrfiSOWIpZld9B4RuFnsQ+JG29rMcL3YH3vN9JZnpta0MnSxdMs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_090649_250587_F04DAA80 X-CRM114-Status: GOOD ( 15.08 ) 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: Jernej Skrabec , Arnd Bergmann , Greg Kroah-Hartman , Jonathan Liu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hans Verkuil , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Philippe Ombredanne , linux-arm-kernel@lists.infradead.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 --- 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 6ddf4eaccb40..495d0fc41297 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 3459b9ec56c9..3704d95874c2 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,