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 1FE7B25F997; Mon, 9 Jun 2025 12:24:33 +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=1749471875; cv=none; b=ifmXg9pNsS9eeLVPlzAU0Rdo99Z3U1dL64dnehy9cUH1+1YODpbGWPhd+vh2esRCMGoOVdrrWxuoXrXWUmcktg8boFohLnvl/ZB9Ch6+v2rC//f5su3LyIg9/DTjwJuxvCpYH/XG7Z3Q7wuF91bqg2WtxdG4N655ax3ilL+jNRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749471875; c=relaxed/simple; bh=c4XGEa/rr+YudLiqtPexA7QNkp5VUvEZZBRpNcWl46I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=JUxd6klF3G+0LbWlsHY01vPMI6KqCahoqWj/MxhO069JKt2YL5UVP3JydNfoqD4dsplpIxO3jCZYyROSfW3QkcDWcgiUDODgqPTmw7+Gdt0yPJJUxr2hvCH/zEHnf4C7WBOJwYbxLedBRINnt2Hqr9dgRt8P5vv3V/5cDokwq4Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=IGKKxkrG; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="IGKKxkrG" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55996Y0Y025339; Mon, 9 Jun 2025 12:24:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JJF7gMUlfNUaJzWdqOPLPAprlnc/8ry5DRBtUgFzc0U=; b=IGKKxkrG9DSv+iNe vOq8QML1ENDV/gfkYl1jnDLGKeRVvHf1PlXhTuTfoxeCFCDuWscHAcMDzuTGuAyZ l9v/Gp8tHfpqyaU/NPOyTOxbpzonRxIwk4tN6oLPH8xKRgsmhCuwv2c7Z1rf2myr nUw8kycQ+WyQcl+PNCuqRMFcZEiOXTNDOOUFOC3pYdfA0WN1k4NkqHObMBMmj0Ti /d4ao4DgSX0sQEzABilc+2r9s4N6r1sAWMC7QY5KOfSlzooU/KuR1G/ZvWp80zPf bib5ecGP1gG2j5SAytwJLWYMDuYsTNAObRjNzYSB1uyRxMvGR8aKzitfpc8fSlWd SSaFUw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 474dgxpahc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Jun 2025 12:24:25 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 559COOxi005531 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 9 Jun 2025 12:24:24 GMT Received: from cse-cd01-lnx.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 9 Jun 2025 05:24:20 -0700 From: Yongxing Mou Date: Mon, 9 Jun 2025 20:21:44 +0800 Subject: [PATCH v2 25/38] drm/msm/dp: add an API to initialize MST on sink side Precedence: bulk X-Mailing-List: linux-arm-msm@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: <20250609-msm-dp-mst-v2-25-a54d8902a23d@quicinc.com> References: <20250609-msm-dp-mst-v2-0-a54d8902a23d@quicinc.com> In-Reply-To: <20250609-msm-dp-mst-v2-0-a54d8902a23d@quicinc.com> To: Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , "Simona Vetter" CC: , , , , "Yongxing Mou" , Abhinav Kumar X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1749471759; l=2503; i=quic_yongmou@quicinc.com; s=20241121; h=from:subject:message-id; bh=E3bJr6xEPrE0CmibFGOVvfXhR9WqSobb9xT6B/UEMLQ=; b=jkWBYZE4+TRi0pF+irNGvcaLu6LijOGLmqWJqGW4zVRQHRsQ+ovBMW0tv066bhfi/XS9WZPT9 A01UP0jVCurCQ3J0djveSD+H515MwxzE4ka4DJ/whdjweIqODrBK2U9 X-Developer-Key: i=quic_yongmou@quicinc.com; a=ed25519; pk=zeCnFRUqtOQMeFvdwex2M5o0Yf67UHYfwCyBRQ3kFbU= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: CP8MKADvadXHrckiKFT0-33pt2vDs3py X-Authority-Analysis: v=2.4 cv=HMbDFptv c=1 sm=1 tr=0 ts=6846d279 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=LAHIc_0XiO2Pp9i8BzQA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: CP8MKADvadXHrckiKFT0-33pt2vDs3py X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA5MDA5MyBTYWx0ZWRfX7Nh6yhPb53n/ liHJuoI4zjrnoKxC9ZrMbc5Ha0uA0S+VhQ52yN3qBsOR4FAScVwseWVIvLcOnOd1cvugz8xBWyc pgj39KxscJm2LBEx3OLMC+XlVIKZVUpDRPIJgCwvMBeiQG1DYncSKPQ1H6irMXpjkiLI+dnxa+0 DqeC8mU/c6e72aQwk4NsfjvCTig8j9qqApkqlKV13K7SWDzKxTjmZHeIyfdkDJ3MNXdBKENXX+T f+e30CyXeyPDUBy11uxSJM9kR4n107l6sZXPmzilFghPBQAo7N7AJf8zxDRgt6yfJX93kJALhZe aroK2UU3gk8JeoIEwDXjRyRLGnGAATINfYBXi/cSDOb1RqWPQezgOTMkm22dnov3rW5fWpj6X+B uMuxXzDIoO+janeS4z7w3jRXQAjsUnNTb/5ptI2qtGLLDUVBy7/1JUX81FaWZIsodIwl9c/1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-09_05,2025-06-05_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506090093 From: Abhinav Kumar If the DP controller is capable of supporting multiple streams then initialize the DP sink in MST mode by programming the DP_MSTM_CTRL DPCD register to enable MST mode. Signed-off-by: Abhinav Kumar Signed-off-by: Yongxing Mou --- drivers/gpu/drm/msm/dp/dp_display.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 5c8b38babc778f3575ab26ae4238b5f9fdb65b51..88cae0ca66015377e59bee757462edeae5ae91bf 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "msm_drv.h" @@ -390,6 +391,35 @@ static int msm_dp_display_lttpr_init(struct msm_dp_display_private *dp, u8 *dpcd return lttpr_count; } +static void msm_dp_display_mst_init(struct msm_dp_display_private *dp) +{ + const unsigned long clear_mstm_ctrl_timeout_us = 100000; + u8 old_mstm_ctrl; + struct msm_dp *msm_dp = &dp->msm_dp_display; + int ret; + + /* clear sink mst state */ + drm_dp_dpcd_readb(dp->aux, DP_MSTM_CTRL, &old_mstm_ctrl); + drm_dp_dpcd_writeb(dp->aux, DP_MSTM_CTRL, 0); + + /* add extra delay if MST old state is on*/ + if (old_mstm_ctrl) { + drm_dbg_dp(dp->drm_dev, "wait %luus to set DP_MSTM_CTRL set 0\n", + clear_mstm_ctrl_timeout_us); + usleep_range(clear_mstm_ctrl_timeout_us, + clear_mstm_ctrl_timeout_us + 1000); + } + + ret = drm_dp_dpcd_writeb(dp->aux, DP_MSTM_CTRL, + DP_MST_EN | DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC); + if (ret < 0) { + DRM_ERROR("sink mst enablement failed\n"); + return; + } + + msm_dp->mst_active = true; +} + static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp) { struct drm_connector *connector = dp->msm_dp_display.connector; @@ -431,6 +461,9 @@ static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp) */ msm_dp_link_psm_config(dp->link, &dp->panel->link_info, false); + if (dp->mst_supported && drm_dp_read_mst_cap(dp->aux, dp->panel->dpcd)) + msm_dp_display_mst_init(dp); + msm_dp_link_reset_phy_params_vx_px(dp->link); rc = msm_dp_ctrl_on_link(dp->ctrl, dp_display->mst_active); if (rc) { -- 2.34.1