From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B23A3BC685 for ; Thu, 28 May 2026 10:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779964883; cv=none; b=NhC19oMCzHfZuWZPQfBnDqISMRcID6uzHoxkb7Z0PspH77Cn2+Qa81p3ey8eYiGMlkMuNEIC89O98iJbPrIxmr6Gbv7CoKPGfpVR1P/KU3uEGdYbTFL0BgtwmpO0hxVKCgoOkV6rG/UOPCmOEqSJ86UJ7XPHf1erS5nwVTD8UVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779964883; c=relaxed/simple; bh=kqMysOhRIN6JiSma34nTkzWoYUmxkKT0/ASFE6VqJ64=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hCD61LFCXtN2xL2AsewXuiSSF51j4rBPn6IvAFraJNPrIBwPeK11b92V8PribyAM9hRy7kTu75Tdp+fcGPpMA5/N95vua1+l+NcUzTgKX5/UihfaR0vSxUL8gL/4fxNBalqYb5cd9XTks/gETyCN6zII9BUb0KW4dBdY7FHASsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=VzSF8HuN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ggB4A7lB; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="VzSF8HuN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ggB4A7lB" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64S8vlwx298274 for ; Thu, 28 May 2026 10:41:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= toiQ8+ElWmOZI++E+BWr1iSCUEgENnEGEvNlwdrGuBY=; b=VzSF8HuN32O5gLPg bvn75tUrx+BeVRFuR+eOgBmhStHy3CHaruxwyOEHXD+03JLOXCz2AJDz8npLHWO+ AzRgQ/FWm9ksou8NLhMM9YfL2o3upUCVk6pyeoKYCc7nuIo+VQcuh2A7NPOrv40S AFSSGQ1YtO8AEz9bElhctWZzkkb2QHJLM5NEAHW713o9k78WlKDtwnMEmA0CMi1B zKesx678rmFzTfyCFVK1QnTTPB9ZdJE796sn2cUxkHtiNe7nNetPiQuQMC0kfsKA X/xpT6GoSS0hM9SciwbAm3jQ2m5okkC6pK/HeGi0WqZepOA/KDjI5AoGGm6ASEW1 UY4fpQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ee7yajd4k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 28 May 2026 10:41:20 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-90fd6eeed3cso2761946585a.3 for ; Thu, 28 May 2026 03:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779964880; x=1780569680; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=toiQ8+ElWmOZI++E+BWr1iSCUEgENnEGEvNlwdrGuBY=; b=ggB4A7lBRa3v3jh69lm6JhnoNFfRsoWmbGUqtxobhAB/wzjsDrjUKeow8NRMRbuq/g aum1wkKZ7TU7K7/UQtxDweiYfo+qNyap5JnIIxQ+WhvvYconbye91kjwVrg0LKKvjaMW pu1jACb/0vrxuuSeEFEAmGJYscJphpRPLl5eoe+Esja5ui7WhruKYv0KSX433mj90IWS YVQM008rMUwJ38EDORZEJQmy2Eb7DVioOviJJxruialZh9kdoZE7Zldk1J72Eu64Pe+R P+0/ZyooGKEhcRfqLhWHy1jx+RPY+eiv2hDTFAsbuSbyqt7/+foN3eLKsyVT9/au+4hS PDcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779964880; x=1780569680; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=toiQ8+ElWmOZI++E+BWr1iSCUEgENnEGEvNlwdrGuBY=; b=e9iqAEQjck4glyRgWcZRHvhGNHfLiQTq4cn0VOgoGS7u10rEJJoLkudT8EJqPKexxr EbjTCfABk+DUhExIlbSUQrEy/3GZZnQw1+IYCC8rhdoqYLeUv+MW5UoxG7wSixVu0pCf wx8bOszFpespfU74XHrVDjVeOsM9UCMj0MnA1yyXSRCONyebGtcnNYq+L0wth6iYPeic WKHSLDZw5q5rD1Q25crDY3iRyiR5Fs34puJS2DJgemVyGDB8edjtfCI7DmyOfofkwbtw gHyh1h1BE0MNmmDAinpZ5vSvMP/GIERZhEPCm97xfCqafwdv1M9Y03McdqloUCctdKYs 5lSg== X-Forwarded-Encrypted: i=1; AFNElJ9pNlQIo3TMAnh7LKFiXoZ9kqR0umMsQrDvxpREDxY5TeS0ivZls0TNSTuc+i+yuE/+oxRnRwQfNJTAOl8=@vger.kernel.org X-Gm-Message-State: AOJu0YyZjSLA8tM1KLDNT20jKZ4FQYrmSDb0DtNGloGgOGOz/NJQZRhQ 7kFq1lQIN53h2gPvzgGCwHg5WXN69XZGCS09SJQc38SoyW6cHSt7Nvh2977Pc7bapUM1iByTtfp J/ccGlpR5+q9oin73iplovEOkB8R1oeK0GyRUtUvRX8ErJiwW0mYcXypJhXswWZrph+7aS5L48d h+6w== X-Gm-Gg: Acq92OFkm7SSWpbbcKXPeEYW1D79uIu094VgR2s+uFTgLHFSkXRzfDHYRbLJErMY9LB ZAeMiXDe3gtxUCw6Cx1odH4zI6OLRJ5cCAp8zpEMxNcD30UxzC3IwhGWUO35iWCnGnsYly6j804 N1xCzA0ihQyLnWELRfsBT7ZPMelOemo5ZmgzwGVgQcXdJniILEqWGi98YThHHV8AQJ5sIkMcaLe CKl5pJaYmTSQLQ1fDZQ+ots+Tk/F85NCDN9jGG+2pmffa4d5UGJABKUncR/HquVGXXB57rQTddu MjyIE/1Z4EELjOeFC2h+ZnHemFcdX5gEsEZ2rINuYefRZpV9tAcBzxCE+JQZ0v+BuX9ULjmP9ZP 5FT6fcR00NGV+WeyR+BXPrepDmqVBcfYW3uYX3crXNrfrXZE//d+AcN6W0S9nhxT5ny7m2/l5A7 rnEkDmBFqoqh+DeotLdQ== X-Received: by 2002:a05:620a:40c6:b0:914:e3ff:e89a with SMTP id af79cd13be357-914e3ffec5emr2014203685a.44.1779964879802; Thu, 28 May 2026 03:41:19 -0700 (PDT) X-Received: by 2002:a05:620a:40c6:b0:914:e3ff:e89a with SMTP id af79cd13be357-914e3ffec5emr2014200685a.44.1779964879329; Thu, 28 May 2026 03:41:19 -0700 (PDT) Received: from yongmou2.ap.qualcomm.com (Global_NAT1_IAD_FW.qualcomm.com. [129.46.232.65]) by smtp.gmail.com with ESMTPSA id af79cd13be357-914f86fffddsm755148485a.12.2026.05.28.03.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 03:41:19 -0700 (PDT) From: Yongxing Mou Date: Thu, 28 May 2026 18:40:30 +0800 Subject: [PATCH v5 09/15] drm/msm/dp: re-arrange dp_display_disable() into functional parts Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260528-dp_mstclean-v5-9-a9221c1f1f3b@oss.qualcomm.com> References: <20260528-dp_mstclean-v5-0-a9221c1f1f3b@oss.qualcomm.com> In-Reply-To: <20260528-dp_mstclean-v5-0-a9221c1f1f3b@oss.qualcomm.com> To: Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yongxing Mou , Abhinav Kumar , Dmitry Baryshkov X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779964831; l=3890; i=yongxing.mou@oss.qualcomm.com; s=20250910; h=from:subject:message-id; bh=Gg4tv21+td583ahpOswrb0tuTDaAio5HpF6DslP1vNA=; b=sx9y/gqDawpFRVhXuuTJ/PCPoqxJ9NvxKy22y7ghmDb6hM7tJFuIopZfqoq8Ktkk4XNad3s3C QKubjTq3H1JDrVvOXWm9gaJO0XEnWKdgU+mpv43JolLNXIEXzCqpkuy X-Developer-Key: i=yongxing.mou@oss.qualcomm.com; a=ed25519; pk=rAy5J1eP+V7OXqH5FJ7ngMCtUrnHhut30ZTldOj52UM= X-Proofpoint-GUID: SoASD976Ryt85z0MKjbke4j3EOsiqSgn X-Proofpoint-ORIG-GUID: SoASD976Ryt85z0MKjbke4j3EOsiqSgn X-Authority-Analysis: v=2.4 cv=CaE4Irrl c=1 sm=1 tr=0 ts=6a181bd0 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=C3Dk8TwHQYyIj7nOf9RCJw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=7LH33tsxRIP6uNRhSrAA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTI4MDEwOCBTYWx0ZWRfX73AxJ5WI1tN8 7sThQHZ6OOjcWR+2pGVq0+YT+6612ZKTd/ZpOaiPSQSB5LKf1wzqPGGkelNwISgrncAsAdoTMHk 8G4xvVVTj3dEa4679gA3+zMN1VMohCrfSVEuWZqCeQeOUFHlVcGeAZ02TaPfczcF1K8vYjx0wX1 H53Li35PwgZ2GpHeonT3c3hRQZ+1Ro3D3r/xyl4iM6HXn0RmN7WmNIx5tXuM9SA0iHCzeZlIQez 6SsNS25tbA9Ja8OvDCPrzlnEvRwAGKpoBzD4oH5t75qfnKng+CVtn/MOW0+ug0cH79tUsd9zJRE pxWZz5MbCiWebtod4OBNEB4Hadh9/jxOsUlE5NfzHG+8s6uGMeUw0Yhk8XwoiJwzyNwm7EuGgvC 0rLQEJ1815IDjDGWpb9hhIFtB75xe2b9RXZ4iXlZeCls99YOcr8UX8uVPiWxeOKEfmjgy/MeI39 7IxQBpBK94ImocDxylQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-05-28_03,2026-05-26_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 impostorscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2605280108 From: Abhinav Kumar dp_display_disable() handles special case of when monitor is disconnected from the dongle while the dongle stays connected thereby needing a separate function dp_ctrl_off_link_stream() for this. However with a slight rework this can still be handled by keeping common paths same for regular and special case. Signed-off-by: Abhinav Kumar Signed-off-by: Yongxing Mou Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_ctrl.c | 19 +------------------ drivers/gpu/drm/msm/dp/dp_ctrl.h | 2 +- drivers/gpu/drm/msm/dp/dp_display.c | 10 +++++++++- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index d8297ebf7d56..fcce67df4660 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -2600,7 +2600,7 @@ int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl) return ret; } -void msm_dp_ctrl_off_link_stream(struct msm_dp_ctrl *msm_dp_ctrl) +void msm_dp_ctrl_reinit_phy(struct msm_dp_ctrl *msm_dp_ctrl) { struct msm_dp_ctrl_private *ctrl; struct phy *phy; @@ -2608,23 +2608,6 @@ void msm_dp_ctrl_off_link_stream(struct msm_dp_ctrl *msm_dp_ctrl) ctrl = container_of(msm_dp_ctrl, struct msm_dp_ctrl_private, msm_dp_ctrl); phy = ctrl->phy; - msm_dp_panel_disable_vsc_sdp(ctrl->panel); - - /* set dongle to D3 (power off) mode */ - msm_dp_link_psm_config(ctrl->link, &ctrl->panel->link_info, true); - - msm_dp_ctrl_mainlink_disable(ctrl); - - if (ctrl->stream_clks_on) { - clk_disable_unprepare(ctrl->pixel_clk); - ctrl->stream_clks_on = false; - } - - dev_pm_opp_set_rate(ctrl->dev, 0); - msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl); - - phy_power_off(phy); - /* aux channel down, reinit phy */ phy_exit(phy); phy_init(phy); diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.h b/drivers/gpu/drm/msm/dp/dp_ctrl.h index 1497f1a8fc2f..5d615f50d13b 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.h +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.h @@ -19,7 +19,6 @@ struct phy; int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_dp_ctrl); int msm_dp_ctrl_on_stream(struct msm_dp_ctrl *msm_dp_ctrl); int msm_dp_ctrl_prepare_stream_on(struct msm_dp_ctrl *msm_dp_ctrl, bool force_link_train); -void msm_dp_ctrl_off_link_stream(struct msm_dp_ctrl *msm_dp_ctrl); void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl); void msm_dp_ctrl_push_idle(struct msm_dp_ctrl *msm_dp_ctrl); irqreturn_t msm_dp_ctrl_isr(struct msm_dp_ctrl *msm_dp_ctrl); @@ -46,4 +45,5 @@ void msm_dp_ctrl_core_clk_disable(struct msm_dp_ctrl *msm_dp_ctrl); void msm_dp_ctrl_enable_irq(struct msm_dp_ctrl *msm_dp_ctrl); void msm_dp_ctrl_disable_irq(struct msm_dp_ctrl *msm_dp_ctrl); +void msm_dp_ctrl_reinit_phy(struct msm_dp_ctrl *msm_dp_ctrl); #endif /* _DP_CTRL_H_ */ diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index cf859f880943..b8dab3f8a7c2 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -714,12 +714,20 @@ static int msm_dp_display_disable(struct msm_dp_display_private *dp) if (!msm_dp_display->power_on) return 0; + msm_dp_panel_disable_vsc_sdp(dp->panel); + + /* dongle is still connected but sinks are disconnected */ if (dp->link->sink_count == 0) { /* * irq_hpd with sink_count = 0 * hdmi unplugged out of dongle */ - msm_dp_ctrl_off_link_stream(dp->ctrl); + + /* set dongle to D3 (power off) mode */ + msm_dp_link_psm_config(dp->link, &dp->panel->link_info, true); + msm_dp_ctrl_off(dp->ctrl); + /* re-init the PHY so that we can listen to Dongle disconnect */ + msm_dp_ctrl_reinit_phy(dp->ctrl); } else { /* * unplugged interrupt -- 2.43.0