Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] drm/exynos: hdmi_get_modes() calls cec_notifier_set_phys_addr() when 
no EDID
--

commit 66acd3ff42feaf8689b6b9eff4b13a5139f4e6bb
Author: Hans Verkuil <[email protected]>

gpu: drm: exynos: call cec_notifier_phys_addr_invalidate if no EDID

This commit updates hdmi_detect() in the Exynos HDMI driver to call
cec_notifier_phys_addr_invalidate() instead of cec_notifier_set_phys_addr()
with CEC_PHYS_ADDR_INVALID when the connector is disconnected.

> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
> b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 055dc04f9b3e5..d03f4e531e05e 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -857,7 +857,7 @@ static enum drm_connector_status hdmi_detect(struct 
> drm_connector *connector,
>       if (gpiod_get_value(hdata->hpd_gpio))
>               return connector_status_connected;
>  
> -     cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
> +     cec_notifier_phys_addr_invalidate(hdata->notifier);

[Severity: Medium]
The commit message notes that if an EDID is present, the driver should call
cec_notifier_set_phys_addr(), and if not, it should call
cec_notifier_phys_addr_invalidate().

However, this patch only updates the HPD disconnect path in hdmi_detect().
When HPD is asserted (or probing is forced) and
drm_helper_probe_single_connector_modes() calls hdmi_get_modes(), if reading
the EDID via drm_edid_read_ddc() returns NULL, drm_edid_connector_update()
sets info->source_physical_address to CEC_PHYS_ADDR_INVALID and
hdmi_get_modes() still calls cec_notifier_set_phys_addr() before checking
drm_edid:

drivers/gpu/drm/exynos/exynos_hdmi.c:hdmi_get_modes() {
        ...
        drm_edid = drm_edid_read_ddc(connector, hdata->ddc_adpt);

        ret = drm_edid_connector_update(connector, drm_edid);
        if (ret)
                return 0;

        cec_notifier_set_phys_addr(hdata->notifier, 
info->source_physical_address);

        if (!drm_edid)
                goto no_edid;
        ...
no_edid:
        return drm_add_modes_noedid(connector, 640, 480);
}

Should hdmi_get_modes() also be updated so that cec_notifier_set_phys_addr()
is only called when drm_edid is non-NULL, and
cec_notifier_phys_addr_invalidate() is called in the no_edid path when no
EDID could be read?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to