Re: [PATCH v2 15/15] drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188

AngeloGioacchino Del Regno
2024-12-10T08:33:25Z

Il 10/12/24 04:28, CK Hu (胡俊光) ha scritto:
> Hi, Angelo:
>
> On Thu, 2024-12-05 at 12:45 +0100, AngeloGioacchino Del Regno wrote:
>> External email : Please do not click links or open attachments until you have verified the sender or the content.
>>
>>
>> Add support for the newer HDMI-TX (Encoder) v2 and DDC v2 IPs
>> found in MediaTek's MT8195, MT8188 SoC and their variants, and
>> including support for display modes up to 4k60 and for HDMI
>> Audio, as per the HDMI 2.0 spec.
>>
>> HDCP and CEC functionalities are also supported by this hardware,
>> but are not included in this commit and that also poses a slight
>> difference between the V2 and V1 controllers in how they handle
>> Hotplug Detection (HPD).
>>
>> While the v1 controller was using the CEC controller to check
>> HDMI cable connection and disconnection, in this driver the v2
>> one does not.
>>
>> This is due to the fact that on parts with v2 designs, like the
>> MT8195 SoC, there is one CEC controller shared between the HDMI
>> Transmitter (HDMI-TX) and Receiver (HDMI-RX): before eventually
>> adding support to use the CEC HW to wake up the HDMI controllers
>> it is necessary to have support for one TX, one RX *and* for both
>> at the same time.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>
> [snip]
>
>> +static void mtk_hdmi_v2_bridge_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;
>> + int ret;
>> +
>> + ret = drm_atomic_helper_connector_hdmi_update_infoframes(hdmi->curr_conn, state);
>> + if (ret)
>> + dev_err(hdmi->dev, "Could not update infoframes: %d\n", ret);
>> +
>> + mtk_hdmi_v2_hw_vid_mute(hdmi, false);
>> + mtk_hdmi_v2_hw_aud_mute(hdmi, false);
>
> In v1, it does not unmute when bridge enable.
> I would like v1 and v2 has the same behavior.
> If possible, remove these code.
> If remove thee code would result in some problem,
> add comment to describe why need these code.
>

I think you even said that in the first review...

Thanks for repeating, and sorry for missing that in v2, will be done
for v3

Cheers,
Angelo

> Regards,
> CK
>
>> +
>> + /* signal the connect event to audio codec */
>> + mtk_hdmi_v2_handle_plugged_change(hdmi, true);
>> +
>> + hdmi->enabled = true;
>> +}
>> +
>