Re: [Intel-gfx] [PATCH 9/9] drm/rockchip: convert to using has_audio from display_info

Heiko Stübner
2022-09-05T10:48:59Z

Am Donnerstag, 1. September 2022, 14:47:11 CEST schrieb Jani Nikula:
> Prefer the parsed results for has_audio in display info over calling
> drm_detect_monitor_audio().
>
> Cc: Sandy Huang <hjc@rock-chips.com>
> Cc: Heiko Stübner <heiko@sntech.de>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
> drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++--
> drivers/gpu/drm/rockchip/inno_hdmi.c | 3 ++-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index f77bdf5f5168..50af9861553b 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -272,10 +272,10 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector)
> DRM_DEV_DEBUG_KMS(dp->dev, "got edid: width[%d] x height[%d]\n",
> edid->width_cm, edid->height_cm);
>
> - dp->sink_has_audio = drm_detect_monitor_audio(edid);
> -
> drm_connector_update_edid_property(connector, edid);
> ret = drm_add_edid_modes(connector, edid);
> +
> + dp->sink_has_audio = connector->display_info.has_audio;
> }
> mutex_unlock(&dp->lock);
>
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 87b2243ea23e..fadaa795fb3d 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -564,10 +564,11 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector)
>
> edid = drm_get_edid(connector, hdmi->ddc);
> if (edid) {
> - hdmi->hdmi_data.sink_has_audio = drm_detect_monitor_audio(edid);
> drm_connector_update_edid_property(connector, edid);
> ret = drm_add_edid_modes(connector, edid);
> kfree(edid);
> +
> + hdmi->hdmi_data.sink_has_audio = connector->display_info.has_audio;
> }
>
> return ret;
>