[PATCH v6 07/11] drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled

Alexandre Mergnat amergnat at baylibre.com
Thu Jul 20 06:05:02 PDT 2023



On 17/07/2023 16:14, AngeloGioacchino Del Regno wrote:
> If a controller (usually, eDP!) does not support audio, or audio is not
> enabled because the endpoint has no audio support, it's useless to lock
> a mutex only to unlock it right after because there's no .plugged_cb().
> 
> Check if the audio is supported and enabled before locking the mutex in
> mtk_dp_update_plugged_status(): if not, we simply return immediately.
> 
> While at it, since the update_plugged_status_lock mutex would not be
> used if the controller doesn't support audio at all, initialize it
> only if `audio_supported` is true.

Reviewed-by: Alexandre Mergnat <amergnat at baylibre.com>

-- 
Regards,
Alexandre



More information about the Linux-mediatek mailing list