From patchwork Mon Dec 2 19:32:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11269727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C971109A for ; Mon, 2 Dec 2019 19:36:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4260120659 for ; Mon, 2 Dec 2019 19:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t/GFLrqR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPj1vC8/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4260120659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=uyKjMXDCF1HI1fHDMpWPcIBbtmjYb1bhU+FQTaUj7I8=; b=t/GFLrqRkEpZxF +JCKkTD7RvOr6HYSJ8KNrngyikQAZMHiMVumMro/JxQuSQdmYdKShyJYJLMIYJGACXDIESPhilRQv FyBrF4U4+UfG8eKY+HohZbXGzzx4JFz6Nfp4LIO2J+FkXe9/PpJoy6bC2SoiYN+Gs67GkLyFLDkz3 N25WrUrqI8TEpWbO6bI12i4CFsG63aFSQxHu5cerW7jZNnIf4Cu1bpdQbkuHBeN7BMRsJNkbdhvV1 E8sPCx9BY910ImEnUHFR3yrBRfa1o1vxD6WkeEOLCEEdAW4gsKT/LF8N3Y/J5G1rRJ06yooNWAcyG 2EY8yM8YwPLQWmUeLljA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrUh-0003Bf-6o; Mon, 02 Dec 2019 19:36:27 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibrRe-0007Vu-9H; Mon, 02 Dec 2019 19:33:23 +0000 Received: by mail-lf1-x144.google.com with SMTP id r15so806989lff.2; Mon, 02 Dec 2019 11:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v+UQDVW7Nk1FnYiIy3c2tfMh21o0tA2iyRXPvzxc0iY=; b=ZPj1vC8/103b8p2Ft5WPQIyrVoTUrNFdhYjve98KoYK6jO2LprLApOyZLqG7P8KPA8 9w12aTnMrwutrpoPXmI7iWvFUsuN793QRqdAxVOojeaeL4WWzcyA6CSl42RcDZcO++Uv ucxufGhvsk5CguWNr25kfu1SdtNLwdbabe1koqC1v29zPbydNyQsY2jZEz8LCU7avzh/ lgC7bOL/4kaBaMjX9XT6buTIdd33avlEjvRJAB0iZD6BE901dsUlFa64CKAJwqtJw7ix 9AVOGtlntIM9A3rknDQJax0w36S54swLo9qzNKAwChfpuBu/g7IZCN8KeCUwFeEYWQQv CYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=v+UQDVW7Nk1FnYiIy3c2tfMh21o0tA2iyRXPvzxc0iY=; b=mvTGIm74DKq0QgO9ZUMeYUI5VvbZP1Ym5jPK+9FObccv2HFJNGQjsVF4XlgvQNZq90 Bm9q0PMA5gCoE2TAVTAnx+3l3umL7lq77uF9s6v59uyJf16mp9qKVYai3DYcwuWA8+iS SbIi2WxRd8WQn3Cs/Nq4cplEJT1ex4XPmJMFXH8R6TKu9uQojCeqw1VywTYIRmUBWXqJ xXs8VMqFYRlhWWn+VbKr0hrac/2T3aCSvbXhKOUztFBCsRD9TL8vIckkBNrmVHMQfMaS jjSK4ElVx2ETzwtdQaS4Q5OVVM/RRgIoVKcYIg7+niJJdMHULgL+LRdwgR1bn/Jf7pt2 DNhg== X-Gm-Message-State: APjAAAWb6x6PLtC59AWozac9I4YvxfR9mjYgTwWrD2L1PtAsBqzc0l8j kyZFNncynkTNrrys6XV327s= X-Google-Smtp-Source: APXvYqymcSltMOuegjJ4eCugmshySy71+q0B7Aqn6cbmrLfSCCePD/3k2tE6E6ppLwnt545Rz45WDA== X-Received: by 2002:a19:c205:: with SMTP id l5mr386926lfc.159.1575315196531; Mon, 02 Dec 2019 11:33:16 -0800 (PST) Received: from saturn.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id g13sm79482lfb.74.2019.12.02.11.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 11:33:15 -0800 (PST) From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Thierry Reding , Laurent Pinchart Subject: [PATCH v1 06/26] drm/panel: decouple connector from drm_panel Date: Mon, 2 Dec 2019 20:32:10 +0100 Message-Id: <20191202193230.21310-7-sam@ravnborg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191202193230.21310-1-sam@ravnborg.org> References: <20191202193230.21310-1-sam@ravnborg.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_113318_721665_2B03AEA7 X-CRM114-Status: GOOD ( 19.55 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sam.ravnborg[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hariprasad Kelam , =?utf-8?q?Heiko_St=C3=BCb?= =?utf-8?q?ner?= , Neil Armstrong , David Airlie , Linus Walleij , Stefan Agner , Andrzej Hajda , Laurent Pinchart , Benjamin Gaignard , Sam Ravnborg , Marek Vasut , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Fabio Estevam , Allison Randal , Krzysztof Kozlowski , Jonathan Hunter , Vasily Khoruzhick , linux-rockchip@lists.infradead.org, Chen-Yu Tsai , Tomi Valkeinen , Matthias Brugger , Jagan Teki , CK Hu , Philipp Zabel , NXP Linux Team , Rob Clark , Jitao Shi , Pengutronix Kernel Team , Jonas Karlman , Sascha Hauer , Alison Wang , Maarten Lankhorst , Brian Masney , Maxime Ripard , Inki Dae , Alexios Zavras , linux-mediatek@lists.infradead.org, Abhinav Kumar , Vincent Abriou , linux-tegra@vger.kernel.org, Thomas Gleixner , Sean Paul , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Purism Kernel Team , Kieran Bingham , Seung-Woo Kim , Sandy Huang , linux-renesas-soc@vger.kernel.org, Shayenne Moura , Kyungmin Park , Boris Brezillon , Torsten Duwe , Kukjin Kim , Daniel Vetter , Sean Paul , Icenowy Zheng , Shawn Guo Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org To facilitate that connector creation will be moved to display drivers, decouple the drm_connector from drm_panel. Add a connector argument to drm_panel_get_modes() All users of drm_panel_get_modes() already had the connector available, so updating users was trivial. With this patch drm_panel no longer keep a copy of the drm_connector. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: Laurent Pinchart Cc: Sam Ravnborg Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Jonas Karlman Cc: Jernej Skrabec Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Stefan Agner Cc: Alison Wang Cc: Philipp Zabel Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: CK Hu Cc: Matthias Brugger Cc: Marek Vasut Cc: Tomi Valkeinen Cc: Kieran Bingham Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Benjamin Gaignard Cc: Vincent Abriou Cc: Chen-Yu Tsai Cc: Jonathan Hunter Cc: Torsten Duwe Cc: Vasily Khoruzhick Cc: Icenowy Zheng Cc: Sean Paul Cc: Linus Walleij Cc: Boris Brezillon Cc: Hariprasad Kelam Cc: Alexios Zavras Cc: Brian Masney Cc: Rob Clark Cc: Thomas Gleixner Cc: Allison Randal Cc: Shayenne Moura Cc: Abhinav Kumar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: linux-tegra@vger.kernel.org Reviewed-by: Laurent Pinchart Reviewed-by: Linus Walleij --- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +- drivers/gpu/drm/bridge/panel.c | 2 +- drivers/gpu/drm/bridge/parade-ps8622.c | 2 +- drivers/gpu/drm/bridge/tc358764.c | 2 +- drivers/gpu/drm/bridge/tc358767.c | 2 +- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +- drivers/gpu/drm/drm_panel.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 2 +- drivers/gpu/drm/imx/imx-ldb.c | 2 +- drivers/gpu/drm/imx/parallel-display.c | 2 +- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 2 +- drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- drivers/gpu/drm/mxsfb/mxsfb_out.c | 2 +- drivers/gpu/drm/omapdrm/omap_connector.c | 3 ++- drivers/gpu/drm/rcar-du/rcar_lvds.c | 2 +- drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 +- drivers/gpu/drm/sti/sti_dvo.c | 2 +- drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 +- drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 +- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- drivers/gpu/drm/tegra/output.c | 2 +- include/drm/drm_panel.h | 9 +-------- 26 files changed, 31 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c index b4f3a923a52a..9917ce0d86a0 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c @@ -493,7 +493,7 @@ static int anx6345_get_modes(struct drm_connector *connector) mutex_unlock(&anx6345->lock); if (!num_modes && anx6345->panel) - num_modes += drm_panel_get_modes(anx6345->panel); + num_modes += drm_panel_get_modes(anx6345->panel, connector); return num_modes; } diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index bb411fe52ae8..6effe532f820 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1111,7 +1111,7 @@ static int analogix_dp_get_modes(struct drm_connector *connector) int ret, num_modes = 0; if (dp->plat_data->panel) { - num_modes += drm_panel_get_modes(dp->plat_data->panel); + num_modes += drm_panel_get_modes(dp->plat_data->panel, connector); } else { ret = analogix_dp_prepare_panel(dp, true, false); if (ret) { diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index c5e27b81588a..65cbd4a283fb 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -37,7 +37,7 @@ static int panel_bridge_connector_get_modes(struct drm_connector *connector) struct panel_bridge *panel_bridge = drm_connector_to_panel_bridge(connector); - return drm_panel_get_modes(panel_bridge->panel); + return drm_panel_get_modes(panel_bridge->panel, connector); } static const struct drm_connector_helper_funcs diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index b7a72dfdcac3..10c47c008b40 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -461,7 +461,7 @@ static int ps8622_get_modes(struct drm_connector *connector) ps8622 = connector_to_ps8622(connector); - return drm_panel_get_modes(ps8622->panel); + return drm_panel_get_modes(ps8622->panel, connector); } static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = { diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c index db298f550a5a..96207fcfde19 100644 --- a/drivers/gpu/drm/bridge/tc358764.c +++ b/drivers/gpu/drm/bridge/tc358764.c @@ -282,7 +282,7 @@ static int tc358764_get_modes(struct drm_connector *connector) { struct tc358764 *ctx = connector_to_tc358764(connector); - return drm_panel_get_modes(ctx->panel); + return drm_panel_get_modes(ctx->panel, connector); } static const diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8029478ffebb..3709e5ace724 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1346,7 +1346,7 @@ static int tc_connector_get_modes(struct drm_connector *connector) return 0; } - count = drm_panel_get_modes(tc->panel); + count = drm_panel_get_modes(tc->panel, connector); if (count > 0) return count; diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 43abf01ebd4c..9a2dd986afa5 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -206,7 +206,7 @@ static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) { struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); - return drm_panel_get_modes(pdata->panel); + return drm_panel_get_modes(pdata->panel, connector); } static enum drm_mode_status diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 9927e28d93e6..fd428b6d25b0 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -113,10 +113,9 @@ EXPORT_SYMBOL(drm_panel_remove); */ int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector) { - if (panel->connector) + if (panel->drm) return -EBUSY; - panel->connector = connector; panel->drm = connector->dev; return 0; @@ -135,7 +134,6 @@ EXPORT_SYMBOL(drm_panel_attach); */ void drm_panel_detach(struct drm_panel *panel) { - panel->connector = NULL; panel->drm = NULL; } EXPORT_SYMBOL(drm_panel_detach); @@ -239,6 +237,7 @@ EXPORT_SYMBOL(drm_panel_disable); /** * drm_panel_get_modes - probe the available display modes of a panel * @panel: DRM panel + * @connector: DRM connector * * The modes probed from the panel are automatically added to the connector * that the panel is attached to. @@ -246,13 +245,14 @@ EXPORT_SYMBOL(drm_panel_disable); * Return: The number of modes available from the panel on success or a * negative error code on failure. */ -int drm_panel_get_modes(struct drm_panel *panel) +int drm_panel_get_modes(struct drm_panel *panel, + struct drm_connector *connector) { if (!panel) return -EINVAL; if (panel->funcs && panel->funcs->get_modes) - return panel->funcs->get_modes(panel, panel->connector); + return panel->funcs->get_modes(panel, connector); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 5479ff71cbc6..43fa0f26c052 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -85,7 +85,7 @@ static int exynos_dpi_get_modes(struct drm_connector *connector) } if (ctx->panel) - return drm_panel_get_modes(ctx->panel); + return drm_panel_get_modes(ctx->panel, connector); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ceb370864cc4..d14d3f25d344 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1461,7 +1461,7 @@ static int exynos_dsi_get_modes(struct drm_connector *connector) struct exynos_dsi *dsi = connector_to_dsi(connector); if (dsi->panel) - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); return 0; } diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c index 82c972e9c024..9598ee3cc4d2 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c @@ -68,7 +68,7 @@ static int fsl_dcu_drm_connector_get_modes(struct drm_connector *connector) struct fsl_dcu_drm_connector *fsl_connector; fsl_connector = to_fsl_dcu_connector(connector); - return drm_panel_get_modes(fsl_connector->panel); + return drm_panel_get_modes(fsl_connector->panel, connector); } static int fsl_dcu_drm_connector_mode_valid(struct drm_connector *connector, diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 208069faf183..8cb2665b2c74 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -127,7 +127,7 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) struct imx_ldb_channel *imx_ldb_ch = con_to_imx_ldb_ch(connector); int num_modes; - num_modes = drm_panel_get_modes(imx_ldb_ch->panel); + num_modes = drm_panel_get_modes(imx_ldb_ch->panel, connector); if (num_modes > 0) return num_modes; diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c index 35518e5de356..3dca424059f7 100644 --- a/drivers/gpu/drm/imx/parallel-display.c +++ b/drivers/gpu/drm/imx/parallel-display.c @@ -50,7 +50,7 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) struct device_node *np = imxpd->dev->of_node; int num_modes; - num_modes = drm_panel_get_modes(imxpd->panel); + num_modes = drm_panel_get_modes(imxpd->panel, connector); if (num_modes > 0) return num_modes; diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index e9931bbbe846..3b5e016d16c4 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -821,7 +821,7 @@ static int mtk_dsi_connector_get_modes(struct drm_connector *connector) { struct mtk_dsi *dsi = connector_to_dsi(connector); - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); } static const struct drm_encoder_helper_funcs mtk_dsi_encoder_helper_funcs = { diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c index 31abd2352f3e..c7df71e2fafc 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c @@ -53,7 +53,7 @@ static int mdp4_lvds_connector_get_modes(struct drm_connector *connector) if (panel) { drm_panel_attach(panel, connector); - ret = drm_panel_get_modes(panel); + ret = drm_panel_get_modes(panel, connector); drm_panel_detach(panel); } diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 271aa7bbca92..0fc29f1be8cc 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -329,7 +329,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector) * attached to the drm_panel. */ drm_panel_attach(panel, connector); - num = drm_panel_get_modes(panel); + num = drm_panel_get_modes(panel, connector); if (!num) return 0; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_out.c b/drivers/gpu/drm/mxsfb/mxsfb_out.c index 4eb94744c526..9eca1605d11d 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_out.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_out.c @@ -31,7 +31,7 @@ static int mxsfb_panel_get_modes(struct drm_connector *connector) drm_connector_to_mxsfb_drm_private(connector); if (mxsfb->panel) - return drm_panel_get_modes(mxsfb->panel); + return drm_panel_get_modes(mxsfb->panel, connector); return 0; } diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index 5b8799c69f68..94cded387174 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -229,7 +229,8 @@ static int omap_connector_get_modes(struct drm_connector *connector) * operation to the panel API. */ if (omap_connector->output->panel) - return drm_panel_get_modes(omap_connector->output->panel); + return drm_panel_get_modes(omap_connector->output->panel, + connector); /* * We can't retrieve modes, which can happen for instance for a DVI or diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index 8c6c172bbf2e..2cf44b91853c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -91,7 +91,7 @@ static int rcar_lvds_connector_get_modes(struct drm_connector *connector) { struct rcar_lvds *lvds = connector_to_rcar_lvds(connector); - return drm_panel_get_modes(lvds->panel); + return drm_panel_get_modes(lvds->panel, connector); } static int rcar_lvds_connector_atomic_check(struct drm_connector *connector, diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 8a4c9af0ba73..325811d2e26e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -201,7 +201,7 @@ static int rockchip_lvds_connector_get_modes(struct drm_connector *connector) struct rockchip_lvds *lvds = connector_to_lvds(connector); struct drm_panel *panel = lvds->panel; - return drm_panel_get_modes(panel); + return drm_panel_get_modes(panel, connector); } static const diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 68289b0b063a..df2ee86cd4c1 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -339,7 +339,7 @@ static int sti_dvo_connector_get_modes(struct drm_connector *connector) struct sti_dvo *dvo = dvo_connector->dvo; if (dvo->panel) - return drm_panel_get_modes(dvo->panel); + return drm_panel_get_modes(dvo->panel, connector); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c index 25ab2ef6d545..65b7a8739666 100644 --- a/drivers/gpu/drm/sun4i/sun4i_lvds.c +++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c @@ -43,7 +43,7 @@ static int sun4i_lvds_get_modes(struct drm_connector *connector) struct sun4i_lvds *lvds = drm_connector_to_sun4i_lvds(connector); - return drm_panel_get_modes(lvds->panel); + return drm_panel_get_modes(lvds->panel, connector); } static struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = { diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c index e74b9eddca01..b27f16af50f5 100644 --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c @@ -47,7 +47,7 @@ static int sun4i_rgb_get_modes(struct drm_connector *connector) struct sun4i_rgb *rgb = drm_connector_to_sun4i_rgb(connector); - return drm_panel_get_modes(rgb->panel); + return drm_panel_get_modes(rgb->panel, connector); } /* diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index c958ca9bae63..4e8f634cc2db 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -795,7 +795,7 @@ static int sun6i_dsi_get_modes(struct drm_connector *connector) { struct sun6i_dsi *dsi = connector_to_sun6i_dsi(connector); - return drm_panel_get_modes(dsi->panel); + return drm_panel_get_modes(dsi->panel, connector); } static struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 5bdbf9ffcda1..4948373d8c75 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -23,7 +23,7 @@ int tegra_output_connector_get_modes(struct drm_connector *connector) * ignore any other means of obtaining a mode. */ if (output->panel) { - err = drm_panel_get_modes(output->panel); + err = drm_panel_get_modes(output->panel, connector); if (err > 0) return err; } diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index a5f7199807f2..4fd61cb9eb93 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -124,13 +124,6 @@ struct drm_panel { */ struct drm_device *drm; - /** - * @connector: - * - * DRM connector that the panel is attached to. - */ - struct drm_connector *connector; - /** * @dev: * @@ -187,7 +180,7 @@ int drm_panel_unprepare(struct drm_panel *panel); int drm_panel_enable(struct drm_panel *panel); int drm_panel_disable(struct drm_panel *panel); -int drm_panel_get_modes(struct drm_panel *panel); +int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector); #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np);