Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3683023pxf; Mon, 29 Mar 2021 08:38:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsI/yQhhvveZ8ubp/L1UJV8IiJ71eKeATvS6sFBi08TolIQL7NMs97GIrwrL+7A2mmtUNS X-Received: by 2002:a05:6402:888:: with SMTP id e8mr28565292edy.51.1617032321053; Mon, 29 Mar 2021 08:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617032321; cv=none; d=google.com; s=arc-20160816; b=lIwwb29XcdYcGbpr74jMddZFld2Fdx2mfW/0pR8SVjLlvPsvXaHmKQc/0L8/noKgAv SEwX4DI1NpOD2FxbSAX8CF5JKCGiLO3y74au6cuN1XuLAFrLIJ+pfPvyWXxv99Pjvd3e axpgsQTlpFq8cCFcBbEdha2pvrJKqknpztkzynTULt+JolPjFBMFY4Fj5dXs4BUuOYpd fI6c+Z0yBWddpQTD0VwQ9Jx8JRZ3xab+w51y9/kNr+M8O5W3gzho01xzcDGlnHZt9gVL YfuJP+C9xxoLtPj3QbvuhDD2e0LfGuDeIvCNFPC/JV7fDGgd/baf6EFEkT2yKDzKELoW QmMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=zP6DpMMtrjDZip2maPCVNc0br8NxdoM0FAY8J7/QY9A=; b=w4IFmALGbRYFQvSx9WpBBf7eOFT+bfpMnNe81XV/sozpVFA0pJdZAaO+cwsx3DU8ao omh7auPV0OK9iLiPwixm8LndK8qI9uGMWaj/cdjCPqGMijU7b8Kv6rteCW2iiWzc4zrb ieMQrq+feqgKfXlbihZQGUcfyOIeSuLNOgNnq8ORhu1GFCUiYN5/+TzhGVDZ8uzL7WSa u+ppc7Hzi7GxDEvnQVG+66/7Jur18Qlp6PVgEkqXK9oA1J+sbpefIPzSK9SseI1NcbvS /sBPipceYsOHVtWSKhmqYOjXeqdly/4iLG/JjR/zLGWdUP5FNkA8QehQ2zRQYlb6YJf0 Uurg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si13001408edu.114.2021.03.29.08.38.18; Mon, 29 Mar 2021 08:38:41 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbhC2PhY (ORCPT + 99 others); Mon, 29 Mar 2021 11:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbhC2Pgz (ORCPT ); Mon, 29 Mar 2021 11:36:55 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6F2C061574 for ; Mon, 29 Mar 2021 08:36:54 -0700 (PDT) Received: from guri.fritz.box (unknown [IPv6:2a02:810a:880:f54:85ba:22ea:8b43:4375]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id CD6C31F4553F; Mon, 29 Mar 2021 16:36:52 +0100 (BST) From: Dafna Hirschfeld To: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Cc: dafna.hirschfeld@collabora.com, kernel@collabora.com, dafna3@gmail.com, chunkuang.hu@kernel.org, p.zabel@pengutronix.de, airlied@linux.ie, daniel@ffwll.ch, enric.balletbo@collabora.com, laurent.pinchart@ideasonboard.com Subject: [PATCH v2 1/3] drm/mediatek: Switch the hdmi bridge ops to the atomic versions Date: Mon, 29 Mar 2021 17:36:30 +0200 Message-Id: <20210329153632.17559-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210329153632.17559-1-dafna.hirschfeld@collabora.com> References: <20210329153632.17559-1-dafna.hirschfeld@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.17.1