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: 141463 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2839785ljj; Mon, 9 Jul 2018 09:07:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpef93wtbeO1JBaOl+TP7eoeKm4YEUF99Iwfi8KNVXiW8VE8WFl33MDzU+nri0lcijsG1g52 X-Received: by 2002:a17:902:4d:: with SMTP id 71-v6mr21189140pla.317.1531152429162; Mon, 09 Jul 2018 09:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531152429; cv=none; d=google.com; s=arc-20160816; b=U6lXkKtWzfS9tVOmb96qJnL/kJRjS7+02PfaEjDqKrpnoh1dJG4Yukuad0F0Sxhx00 /lFLRPTUDTN7L2J1wO2qRR98iqYSnVjA4Ni8tz9VwsVzQS1q1W3oLh4Q3o7nOM6gs/3h ywnpALwdKMABDl5VrMkdk6AgF6lgDRAWDFrr480eJ7FM4Ky4/w03tblN4f6TnhXGU4nn fl5QMbzPnFKs4pH+E68MBpc1WB8ktWcQ5MMzxS7lWjNA5GSsWE6p71UaJzgxhJ7vBs6u 4fIYVNwqamfqsl7nR+JqUmItIMIfqMPeP3THl1NzUEI0eL54/52Li9afABewrJtoPXRf T7RA== 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=PnBbnP+QaCb5/cQCRGxrJ/MdtkPBTV/eaZnBDXjmw7E=; b=IJkPud1cDQWNPBHkKDeYH5BbYHD9izSkPMaWN+wyQDld8VPZVVQgdbGhk4Wu0799x6 +2dVmHHo+BdD++kSqdRI9jldYDdgF5McPd0ZNIYmGA4EH25jIvLoN+iCTQEHTSzNPZdZ dZvKyCfWOZgzbh7bUmRzmohio92xcX8r3GW7CL63RASyIl2k6QFo5lidye+OJYS6ppOV 7kKXnlKB+koVE3pYG6Bbc+F8DCxf+IeyK8wyoTrjAzn5BQhVb+n4ArLyhhQEWtfEhvGX VCw37M3cQu/40RIS0VMAih5YpVGbP2XB83Sagqxo/3IH5V62td0wwEE0ejqmWag+2VZQ cdGA== 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 f21-v6si13911803pgl.235.2018.07.09.09.07.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 09:07:09 -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 BEC686E0D2; Mon, 9 Jul 2018 16:06:37 +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 578986E0D2 for ; Mon, 9 Jul 2018 16:06:36 +0000 (UTC) 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-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: Jernej Skrabec , Arnd Bergmann , Greg Kroah-Hartman , Jonathan Liu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hans Verkuil , Philippe Ombredanne , linux-arm-kernel@lists.infradead.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 --- 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,