Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4724865pxj; Wed, 12 May 2021 11:46:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypYD0Hni+HJAWqitXpKZ4YEbmvb4Ki6aG2ZIz9nbYL7eZfhK1eFYVlexTGwIhug+8pSeCN X-Received: by 2002:a17:906:87d3:: with SMTP id zb19mr39280137ejb.342.1620845215556; Wed, 12 May 2021 11:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620845215; cv=none; d=google.com; s=arc-20160816; b=wRv72vfT4bw0yZWwDZWZWOQC9d0LSXAItJXaEj/uLTe4NR0ut5M6ba/HvjBW9q/GlX 3A/RJMSe+0rILs2nCWYtmcQBuqcIReeMgs0kGGsNAM+NjaBYye5jW40kRnCgLdq0Dnry aDpryEUUKnnowG8+bt6X3mYPZ5nI6VnOwgoI845f/MJCGGLif9DpIO9yCWXjf4a6bqkc i4D0quFB0NeI3AlypHxGNiafiK5eNDmH5rUfgxiRPTyrE+/ppVhL0LKGzQ+TWyTzBBoh uYN5yQr/OpK03crJOI5sEBhnFS0j7UUq4nbo51TRSgQSCTaDTeKUcHCSgVv8MJgVXZOL CLFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3t0ZuB6WXkf+7Jd+Hwjv/ag9UfEIDTb/ZD/ZMIfQZRE=; b=op7pXzhzO9oDZUHzNhdYtDrt6SlVGRFMELtuL5LwvlvZSy7rzmaKKvtV2x9hwWweWM BFo6QKT5GHnexsMwXKqqh6DTbWldYTRH9cUdCqWOY9iigLz35nH6+tHhGAQ+j007jBcG vZcik50a41yBwwxmwEV5zCAa3CK8mTXswX5Ds/v2qKDaBQKe590m8iFJ8RkUGAEceTw5 MmmTLVWGbdCqgawMsYXfXEm2RqOlA3+36JUYZNEET3wO1rcHxsb52392BdoBbsJ1naMW 4Q9ETgxgBV1SUvNarMlbvPSkaddkv9nOklzsrSvXvwwrG/t4ODx2I8EafDjEy1BofvAd znXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CvMggoKd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si567616eds.14.2021.05.12.11.46.31; Wed, 12 May 2021 11:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CvMggoKd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358461AbhELSoQ (ORCPT + 99 others); Wed, 12 May 2021 14:44:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243650AbhELQlw (ORCPT ); Wed, 12 May 2021 12:41:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15C0961E4D; Wed, 12 May 2021 16:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835530; bh=PA9lWJkBxmGrRkgxfV5V0140QJp5RGpSEQCPyjFuaJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvMggoKdNAJsv5YAtTasS24gPzl6ZRy28dseHiVKBeh5loyfDnZIHwa6Z+Rt9nFg9 Y8wKtR9nKH/k813ioCG1AJqkbsn7EgFK/XyN4tEj8RDazaNBwwyWaK03Tih1rqLh7m aLC7IR7F6jwCrx4YLnBuXPCLBnlqMs/JZ/JcX65Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dafna Hirschfeld , Laurent Pinchart , Chun-Kuang Hu , Sasha Levin Subject: [PATCH 5.12 382/677] drm/mediatek: Switch the hdmi bridge ops to the atomic versions Date: Wed, 12 May 2021 16:47:08 +0200 Message-Id: <20210512144850.026887565@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dafna Hirschfeld [ Upstream commit 053d231f369ca05cd563ca9738b5a4c73908e697 ] The bridge operation '.enable' and the audio cb '.get_eld' access hdmi->conn. In the future we will want to support the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR and then we will not have direct access to the connector. The atomic version '.atomic_enable' allows accessing the current connector from the state. This patch switches the bridge to the atomic version to prepare access to the connector in later patches. Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 8ee55f9e2954..f2c810b767ef 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1357,7 +1357,8 @@ static bool mtk_hdmi_bridge_mode_fixup(struct drm_bridge *bridge, return true; } -static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge) +static void mtk_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); @@ -1371,7 +1372,8 @@ static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge) hdmi->enabled = false; } -static void mtk_hdmi_bridge_post_disable(struct drm_bridge *bridge) +static void mtk_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_state) { struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); @@ -1406,7 +1408,8 @@ static void mtk_hdmi_bridge_mode_set(struct drm_bridge *bridge, drm_mode_copy(&hdmi->mode, adjusted_mode); } -static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge) +static void mtk_hdmi_bridge_atomic_pre_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_state) { struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); @@ -1426,7 +1429,8 @@ static void mtk_hdmi_send_infoframe(struct mtk_hdmi *hdmi, mtk_hdmi_setup_vendor_specific_infoframe(hdmi, mode); } -static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge) +static void mtk_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_state) { struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge); @@ -1440,13 +1444,16 @@ static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge) } static const struct drm_bridge_funcs mtk_hdmi_bridge_funcs = { + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, .attach = mtk_hdmi_bridge_attach, .mode_fixup = mtk_hdmi_bridge_mode_fixup, - .disable = mtk_hdmi_bridge_disable, - .post_disable = mtk_hdmi_bridge_post_disable, + .atomic_disable = mtk_hdmi_bridge_atomic_disable, + .atomic_post_disable = mtk_hdmi_bridge_atomic_post_disable, .mode_set = mtk_hdmi_bridge_mode_set, - .pre_enable = mtk_hdmi_bridge_pre_enable, - .enable = mtk_hdmi_bridge_enable, + .atomic_pre_enable = mtk_hdmi_bridge_atomic_pre_enable, + .atomic_enable = mtk_hdmi_bridge_atomic_enable, }; static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, -- 2.30.2