Commit 848bc59
drm/mediatek: dp: Avoid mutex locks if audio is not supported/enabled
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.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230725073234.55892-8-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>1 parent 779b8d2 commit 848bc59
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1948 | 1948 | | |
1949 | 1949 | | |
1950 | 1950 | | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
1951 | 1954 | | |
1952 | 1955 | | |
1953 | 1956 | | |
| |||
2520 | 2523 | | |
2521 | 2524 | | |
2522 | 2525 | | |
2523 | | - | |
2524 | | - | |
2525 | 2526 | | |
2526 | 2527 | | |
2527 | 2528 | | |
| 2529 | + | |
| 2530 | + | |
2528 | 2531 | | |
2529 | 2532 | | |
2530 | 2533 | | |
| |||
0 commit comments