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 89AF83B47D9 for ; Fri, 10 Apr 2026 09:34:15 +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=1775813657; cv=none; b=Tp/DjKTPF4fqbcmd6FuymQHzzEZCtdFB/8D8hSxfBHJEvOkX6FRcHB7UJyJ8CUrdZBu6vDxzTjKd49MfvGqAKd53II/77FgKoIS4L94R/aixtLN0Kwi2Fdg/fWGO4+9QEo5UF90ErQErOYd9QkvuugLbMSq6NCzBcfl8+m3FsAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775813657; c=relaxed/simple; bh=9wzpmcOHoBOq6BiCkmrHwhLf/OqV48UkD8j7/jTLUvs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FbnoRQI5oGWNwFXAFWdlCpanJwjQllT6F6vxvWZJInR/4GGAPNbR4DWMBAZS3ISE18MPDoGW9VqvIb+frKyRX2weYn1TRvvzwO8Zf6IVW3L2IgTPQK+gABbPwzFI361xBIOd/jAE5t03OJoGBv3g5BbE35uwMCsqeFlRQ03r2UE= 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=bS25G3ml; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=CHZ+Z/M2; 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="bS25G3ml"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CHZ+Z/M2" 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 63A7EJaB2626845 for ; Fri, 10 Apr 2026 09:34:14 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= c2cqSDHqNgVvUpQ2UDVNucOxrHSj4G+nvJMZ5j+4sYo=; b=bS25G3ml963D+4sM rIYshNcvxf34m20u5h2a3JAnaoKmjZvCJqNg4St8GECKzSod1RnQf8CqyI9usCDm 8OffamoR43yl2Xb6b0thW9WoKftG0+b6fKicOSnb2iMnjJ7jwjrI5HabRnUO9IDZ dOg662rLTytDOX2cFhcvzBaNYN9GYYq4AaSuh3pmjzRXs6X88t2bZjBgmnUBJzlK QbgEzzx3TgXuR9Ilwy9HsnzC+0y85RozdzUGDc89Bwhq2wPzGxQgwAnqxoCNsVFJ N+HqNcDUQhzPJGTPTwd126NExF3lKIllpiIVWGiQx8jcy99z3liAmBroFNUAeLJh p1UWEw== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4decmu3m10-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 10 Apr 2026 09:34:14 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8abd6e281c0so43047576d6.1 for ; Fri, 10 Apr 2026 02:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775813654; x=1776418454; 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=c2cqSDHqNgVvUpQ2UDVNucOxrHSj4G+nvJMZ5j+4sYo=; b=CHZ+Z/M2IFJfR8wDVtaQN4YaBtnR6x/12CL7A1w+rh10Odfq7xht93RvPgz6t5kif5 0KjG4lLynVumGcI1iAf+O96vveSntChcY+8PVU+Lzx+sa7Qf6XRCEXmm7qwOD1PFgLU1 vorf3YEmCQenMbR7wgkhC/kPpHndoV3H8+we2RIYn5pyjK3M9/Kn4+YeGRNWbekTmEAF 5AxmRVvOlyw62onaLlqL0TJy8gMe7xyP99hvEn3Ewwft1stiHNooabiTx0HEgDOeQdk+ pn/n3detPrs8fGzVkGQoJKhAZdn4sYS5+mDfsUuLAJAaAKyn/RH/SaLrpt9x5fId80nb KKgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775813654; x=1776418454; 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=c2cqSDHqNgVvUpQ2UDVNucOxrHSj4G+nvJMZ5j+4sYo=; b=FH7+P4KaVESyCuVVqAAHsVaRnDn6KVMcqVQ6YwuoOn2bDDfCAOWVLDFBDfz0vfl20J w1MSSbjw+StBR0NxXS2ht7hLSU6Nsn9gYW909j5FdMt7K9zNnued+SanJDj0Y6c7/3mG Z6mVrxmFwfYuQ+H5mUfm8msQVL4/7b6Ne3o3hPm611ZGBT2h4CWMucR1K3fvxHoABoMa qa5CoxqAGOs/651hVGfj8CSsMGs5CFUi5PWd7IgphjVIfbV61ZZxYTx8bYaOVUoGh/AI MI1Jxhhcp5NcSrL2kuMuuq01DquNcvT0Duo+7i2G+o7VVT7zBgob40BBIOaumqrM5lYM zCCQ== X-Forwarded-Encrypted: i=1; AJvYcCVzVZwMZG2U2x2IiufVb3nYkMMc4Ldbw+z7/xRiqfAH+NjcrhAubD6KUnadIcweOAPe9KWkLgg8+hWT0qg=@vger.kernel.org X-Gm-Message-State: AOJu0YzHBMktq4RITcxdBpRrBRMirpWymvTlmYHg09ZPvR+JC1VVIeK9 UX7aWN+l649Z/dYtX31Wy1vaTPnkYh5hXEKCFlYJI2T695jVsTz9RKdeEPgsD0kw3nxtQA9W0Be HztwvckGqUJ7MDS2z+e/HdSVs+nPD3CzF7EOpg80lgDNzlUMlK0g1EOX5b8OqhaKRx5g= X-Gm-Gg: AeBDievAtf308+xvF255hBdLq3zY2zXhjHqX9d+f61/djJJfYg/atfus63diArM1hXu JrKF8dh2HJ/+pumJ/WVa3i1gm+VE5xFpgQA0QnGcSjB0KkYw+mzq02a9KZQB7uSWv0wKGzxVrrk 0bc1giBAmFil/zZLod0/K7jkEn/M+Hxk5FJtq0htCJueBlc9rubxITnokNvJHTAEizjIRpz3stv h1lNTSHAzE55NgVzDfpzSHptMYZwhTXX73TQ8AY2QuKD6oZ65rDmX7FXeUXSvmftTjyvz8E8vbW WgKOaspvS7CB5NicycvHDJHbH6nted6WmgDdbijuLKyBVOBTzO28WyxufIhdDoT/885pNHkyK0z ib4nxtSSlsm5VnIwMIv+wU/JokXfvr/ap3uRKZO82i2dUGPi5wR+KCK1yW9SZxl0GdMgzMGGaTq al9uHh1CU= X-Received: by 2002:ad4:5949:0:b0:89c:c75a:e83b with SMTP id 6a1803df08f44-8ac86319c15mr31742766d6.54.1775813653695; Fri, 10 Apr 2026 02:34:13 -0700 (PDT) X-Received: by 2002:ad4:5949:0:b0:89c:c75a:e83b with SMTP id 6a1803df08f44-8ac86319c15mr31742456d6.54.1775813653299; Fri, 10 Apr 2026 02:34:13 -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 6a1803df08f44-8ac84cb135fsm19223386d6.38.2026.04.10.02.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 02:34:13 -0700 (PDT) From: Yongxing Mou Date: Fri, 10 Apr 2026 17:33:39 +0800 Subject: [PATCH v4 04/39] 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: <20260410-msm-dp-mst-v4-4-b20518dea8de@oss.qualcomm.com> References: <20260410-msm-dp-mst-v4-0-b20518dea8de@oss.qualcomm.com> In-Reply-To: <20260410-msm-dp-mst-v4-0-b20518dea8de@oss.qualcomm.com> To: Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Jessica Zhang 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=1775813628; l=3890; i=yongxing.mou@oss.qualcomm.com; s=20250910; h=from:subject:message-id; bh=jXQCAxCiXUJRF5Hy5TGXsy0zyup8wBHq7tf5RYhaBiU=; b=WGsTo1NHR/4bJtLAXFiYRnBHZTj9PqjbvGytlM2rfB5uHc5KVWe4B1JU8TM6JJaCmRKf6Haro NY/UjH39L99BndgMunlcShYVvNU/wAP5i0xUmW2OYB6CqGXjQY6e4I0 X-Developer-Key: i=yongxing.mou@oss.qualcomm.com; a=ed25519; pk=rAy5J1eP+V7OXqH5FJ7ngMCtUrnHhut30ZTldOj52UM= X-Proofpoint-GUID: 6P0cqjBke3QifABlEd5RFZEMVwBj66P8 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDEwMDA4OCBTYWx0ZWRfXxsYtx6JOo/sh 4OOjqwvJiWeK6oF4h1d9OZabQZqfYI0X9cn0/FREuLJ42iSsTDEt9hxXGoUF+yPLZ02qAxNm5V2 HBXZZBysn2MkuPStVCl/IEx2iKRjE8cEFSvHXcUjKk6y4RhUC+aOZr5VDB/xQcmZnW4VWDXE24c jDKgRD5/jumOmbzYtyPTTLv1zjnufU0PBwm8tlNG6jimqHpoCjR95lr0KtGNkKQKF0UaB5Wy33/ yWweE75wlN7RE32en1672HayfmUz7mmj3PpxD+VwdCT07+m+JUaQ2rq/YBREDcZVxMZ5vdX626u tDRwZzncqYA7JVA66cqThZTD70hu5dD3Zf94tCyvj6pG1zCj8AODkEwyXNPqITKSvwRgA8LDJG6 g2FfRnJ+iCygN4tUZ8/lyn97JOIAUtyLVkTi/ftKRw2kUu1Uks15ymhmg9i2tao8oojpn52JVa9 QUjeVzAZ32mcuCoZk7A== X-Proofpoint-ORIG-GUID: 6P0cqjBke3QifABlEd5RFZEMVwBj66P8 X-Authority-Analysis: v=2.4 cv=DslmPm/+ c=1 sm=1 tr=0 ts=69d8c416 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=C3Dk8TwHQYyIj7nOf9RCJw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=We74lq4XQ-Qw3Vo_XYoA:9 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-10_03,2026-04-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604100088 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 0fd4a7b6d931..476346e3ac19 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -2576,7 +2576,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; @@ -2584,23 +2584,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 5ecbc83c3838..58c46d5ab4d8 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -719,12 +719,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