mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	"kishon@ti.com" <kishon@ti.com>,
	"Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	"granquet@baylibre.com" <granquet@baylibre.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"krzysztof.kozlowski+dt@linaro.org"
	<krzysztof.kozlowski+dt@linaro.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Mac Shen (沈俊)" <Mac.Shen@mediatek.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"krzysztof.kozlowski@linaro.org" <krzysztof.kozlowski@linaro.org>,
	"Stuart Lee (李翰)" <Stuart.Lee@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH v4 5/8] drm/mediatek: hdmi: add v2 support
Date: Tue, 13 Jun 2023 08:24:21 +0000	[thread overview]
Message-ID: <0e789f2741346be40263bcec038dc66624e4aef6.camel@mediatek.com> (raw)
In-Reply-To: <20220919-v4-5-687f09a06dd9@baylibre.com>

Hi, Guillaume:

On Mon, 2023-05-29 at 16:31 +0200, Guillaume Ranquet wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  Adds hdmi and hdmi-ddc support for v2 IP.
> 
> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
> ---

[snip]

> +
> +static void mtk_hdmi_bridge_disable(struct drm_bridge *bridge,
> +    struct drm_bridge_state *old_bridge_state)
> +{
> +struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
> +
> +if (!hdmi->enabled)
> +return;
> +
> +mtk_hdmi_hw_send_av_mute(hdmi);
> +usleep_range(50000, 50050);
> +mtk_hdmi_hw_vid_black(hdmi, true);
> +mtk_hdmi_disable_hdcp_encrypt(hdmi);
> +usleep_range(50000, 50050);
> +
> +phy_power_off(hdmi->phy);
> +
> +hdmi->enabled = false;
> +}
> +
> +static void mtk_hdmi_bridge_post_disable(struct drm_bridge *bridge,
> + struct drm_bridge_state *old_state)
> +{
> +struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
> +
> +if (!hdmi->powered)
> +return;
> +
> +phy_power_off(hdmi->phy);
> +
> +hdmi->powered = false;
> +}
> +
> +static void mtk_hdmi_bridge_pre_enable(struct drm_bridge *bridge,
> +       struct drm_bridge_state *old_state)
> +{
> +struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
> +struct drm_atomic_state *state = old_state->base.state;
> +union phy_configure_opts opts = {
> +.dp = { .link_rate = hdmi->mode.clock * KILO}
> +};
> +
> +/* Retrieve the connector through the atomic state. */
> +hdmi->curr_conn = drm_atomic_get_new_connector_for_encoder(state,
> +   bridge->encoder);
> +
> +mtk_hdmi_output_set_display_mode(hdmi, &hdmi->mode);
> +/* configuring phy clock link with appropriate rate */
> +phy_configure(hdmi->phy, &opts);
> +phy_power_on(hdmi->phy);
> +hdmi->powered = true;
> +}

In mt8173 hdmi driver, only bridge_enable stage, no bridge_pre_enable
stage, why mt8195 need to separate it?

Regards,
CK

> +
> +static void mtk_hdmi_bridge_enable(struct drm_bridge *bridge,
> +   struct drm_bridge_state *old_state)
> +{
> +struct mtk_hdmi *hdmi = hdmi_ctx_from_bridge(bridge);
> +u8 buffer_spd[HDMI_INFOFRAME_SIZE(SPD)];
> +u8 buffer_avi[HDMI_INFOFRAME_SIZE(AVI)];
> +
> +phy_power_on(hdmi->phy);
> +mtk_hdmi_send_infoframe(hdmi, buffer_spd, sizeof(buffer_spd),
> +buffer_avi, sizeof(buffer_avi), &hdmi->mode);
> +mtk_hdmi_hw_spd_infoframe(hdmi, buffer_spd, sizeof(buffer_spd));
> +mtk_hdmi_hw_avi_infoframe(hdmi, buffer_avi, sizeof(buffer_avi));
> +
> +mtk_hdmi_hw_vid_black(hdmi, false);
> +
> +hdmi->enabled = true;
> +}
> +
> 

  parent reply	other threads:[~2023-06-13  8:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 14:30 [PATCH v4 0/8] Add MT8195 HDMI support Guillaume Ranquet
2023-05-29 14:30 ` [PATCH v4 1/8] dt-bindings: display: mediatek: add MT8195 hdmi bindings Guillaume Ranquet
2023-06-08 21:05   ` Rob Herring
2023-06-09 15:49     ` Guillaume Ranquet
2023-06-10  4:16       ` Chun-Kuang Hu
2023-05-29 14:30 ` [PATCH v4 2/8] drm/mediatek: hdmi: use a regmap instead of iomem Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 3/8] drm/mediatek: extract common functions from the mtk hdmi driver Guillaume Ranquet
2023-06-13  2:37   ` CK Hu (胡俊光)
2023-05-29 14:31 ` [PATCH v4 4/8] drm/mediatek: hdmi: make the cec dev optional Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 5/8] drm/mediatek: hdmi: add v2 support Guillaume Ranquet
2023-06-13  1:52   ` CK Hu (胡俊光)
2023-06-13  2:19   ` CK Hu (胡俊光)
2023-06-13  2:52   ` CK Hu (胡俊光)
2023-06-13  5:35   ` CK Hu (胡俊光)
2023-06-13  8:24   ` CK Hu (胡俊光) [this message]
2023-06-14  3:41   ` CK Hu (胡俊光)
2023-05-29 14:31 ` [PATCH v4 6/8] drm/mediatek: hdmi: v2: add audio support Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 7/8] dt-bindings: display: mediatek: dpi: Add compatible for MediaTek MT8195 Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 8/8] drm/mediatek: dpi: Add mt8195 hdmi to DPI driver Guillaume Ranquet
2023-06-14  6:14   ` CK Hu (胡俊光)
2024-01-15 11:06 ` [PATCH v4 0/8] Add MT8195 HDMI support AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e789f2741346be40263bcec038dc66624e4aef6.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=Chunfeng.Yun@mediatek.com \
    --cc=Mac.Shen@mediatek.com \
    --cc=Stuart.Lee@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=granquet@baylibre.com \
    --cc=jitao.shi@mediatek.com \
    --cc=kishon@ti.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®