diff mbox series

drm/msm/dp: only signal audio when disconnected detected at dp_pm_resume

Message ID 1632845472-29276-1-git-send-email-khsieh@codeaurora.org (mailing list archive)
State Superseded
Headers show
Series drm/msm/dp: only signal audio when disconnected detected at dp_pm_resume | expand

Commit Message

Kuogee Hsieh Sept. 28, 2021, 4:11 p.m. UTC
Only signal audio when disconnected detected at dp_pm_resume since
connected status will be signaled to audio at next plugin handler.

Fixes: 078867ce04ed ("drm/msm/dp: signal audio plugged change at dp_pm_resume")
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Stephen Boyd Sept. 28, 2021, 8:42 p.m. UTC | #1
Quoting Kuogee Hsieh (2021-09-28 09:11:12)
> Only signal audio when disconnected detected at dp_pm_resume since
> connected status will be signaled to audio at next plugin handler.

Please add more details. This says what the patch does but it would be
better if it included why it is important. Does it fix something?
There's a fixes tag so it must fix something. Is it bad to signal audio
plug change on resume when it hasn't actually changed from last time?
Why is that bad? What if the cable is unplugged and then plugged in
before resume? Does audio still get signalled in that case?

>
> Fixes: 078867ce04ed ("drm/msm/dp: signal audio plugged change at dp_pm_resume")
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 0e543a03..6f13008 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1356,14 +1356,14 @@ static int dp_pm_resume(struct device *dev)
>          * can not declared display is connected unless
>          * HDMI cable is plugged in and sink_count of
>          * dongle become 1
> +        * also only signal audio when disconnected
>          */
> -       if (dp->link->sink_count)
> +       if (dp->link->sink_count) {
>                 dp->dp_display.is_connected = true;
> -       else
> +       } else {
>                 dp->dp_display.is_connected = false;
> -
> -       dp_display_handle_plugged_change(g_dp_display,
> -                               dp->dp_display.is_connected);
> +               dp_display_handle_plugged_change(g_dp_display, false);
> +       }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 0e543a03..6f13008 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1356,14 +1356,14 @@  static int dp_pm_resume(struct device *dev)
 	 * can not declared display is connected unless
 	 * HDMI cable is plugged in and sink_count of
 	 * dongle become 1
+	 * also only signal audio when disconnected
 	 */
-	if (dp->link->sink_count)
+	if (dp->link->sink_count) {
 		dp->dp_display.is_connected = true;
-	else
+	} else {
 		dp->dp_display.is_connected = false;
-
-	dp_display_handle_plugged_change(g_dp_display,
-				dp->dp_display.is_connected);
+		dp_display_handle_plugged_change(g_dp_display, false);
+	}
 
 	DRM_DEBUG_DP("After, sink_count=%d is_connected=%d core_inited=%d power_on=%d\n",
 			dp->link->sink_count, dp->dp_display.is_connected,