From patchwork Fri Dec 6 04:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 13896415 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 BC2FD1E2617; Fri, 6 Dec 2024 04:33:16 +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=1733459599; cv=none; b=t1FlPJA6g+h2VcASaFs6GuG2JMnFBl3CprH2TVKik73quKjXYap79VoKQROouUbC9PK4F1De/Uajg4qr/6c3cyvOfKVmguaXQgnqCZanJOwBRGzQRHWvGWRnDZwT3cFPgx8yZ5YFQKCEE3wPDcoIlBJudiwkSGWKErpaLtw0MUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733459599; c=relaxed/simple; bh=h6eQcJDrXbl3z7x5hKOervSZiaRyQX6qkjqr2wHNL1w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=f7U4fWl8RBvCCEmmhMeTi+KNoVTfdCsmReJvfzD6J+I4Uivu2WBrU4KCuSdRiStJnH6VCb0awL5XyokYCAJpVztmzuebQL/SBc+nGIdfVmbjkPQ35P42+17jWsArAeSkpJW9jpvyyNSElHirRwIp+6mJYvsCILo4UL17sopxAGc= 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=CvRZDFd2; 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="CvRZDFd2" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B5JhhuJ018614; Fri, 6 Dec 2024 04:32:43 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= yHtYPnJ8t8AjSRI/FAEKiefjhVnWpwrIbMUqzZmMjI8=; b=CvRZDFd2jLTDtvdx qwQplRXbqAGA/CujV2ysAaBZVx9PLE1OnWdFfEYbgpHxYRHWFBiM2vtf85nqcKwB HE7T0sMARy7kHpSDBO1WDvMWu3BJI5uAGvrgLNnRnNfEGmCamtPKHlm0ZvjAWSmH kDMkFg0b5BTzvnpEqcqFPbo6xA8Y5/7KAcwRFwMyz6nXu/y+eL1lKYZUbdneuB5M leHqrhC/OF+bBBg2Bha21P3CD2sQCw9Vp1/iywnxKlISwoHtQGTOR9HW2cLpe5yD R9Y3vwedXKRmoc+9zAWCdUiKYNeP+R7wx5tMv8V8FRAe/bXHDRggfqeXxNXqrbXg 8ZH5LQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43bjk8s0ua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Dec 2024 04:32:42 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4B64Wfds022151 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Dec 2024 04:32:41 GMT Received: from abhinavk-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 5 Dec 2024 20:32:41 -0800 From: Abhinav Kumar Date: Thu, 5 Dec 2024 20:32:01 -0800 Subject: [PATCH 30/45] drm/msm/dp: add dp_display_get_panel() to initialize DP panel Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-dp_mst-v1-30-f8618d42a99a@quicinc.com> References: <20241205-dp_mst-v1-0-f8618d42a99a@quicinc.com> In-Reply-To: <20241205-dp_mst-v1-0-f8618d42a99a@quicinc.com> To: Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Simona Vetter" , Stephen Boyd , "Chandan Uddaraju" , Guenter Roeck , Kuogee Hsieh , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Vara Reddy , Rob Clark , Tanmay Shah , , , , , , Jessica Zhang , Laurent Pinchart , Abhinav Kumar X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733459543; l=2253; i=quic_abhinavk@quicinc.com; s=20240509; h=from:subject:message-id; bh=h6eQcJDrXbl3z7x5hKOervSZiaRyQX6qkjqr2wHNL1w=; b=y2Jdg/2x1sBdEU4srdZaNi1eNAbwJQeK4LxPEojCS8qT0ccsxKxHJ3fWcSEF6+ajg8vycjND7 zCLwKejICpBBtV53BPAh1Etu5iywn6JX6CJ+s/kob7ZUXC5ajthgzNF X-Developer-Key: i=quic_abhinavk@quicinc.com; a=ed25519; pk=SD3D8dOKDDh6BoX3jEYjsHrTFwuIK8+o0cLPgQok9ys= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: rgegwgh7wJXOusuwXUb-E7HxlLa-8DjK X-Proofpoint-GUID: rgegwgh7wJXOusuwXUb-E7HxlLa-8DjK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 mlxlogscore=743 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412060030 Add an API dp_display_get_panel() to initialize and return a DP panel to be used by DP MST module. Since some of the fields of DP panel are private, dp_display module needs to initialize these parts and return the panel back. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 28 ++++++++++++++++++++++++++++ drivers/gpu/drm/msm/dp/dp_display.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index a67bc7c1b83a5a9996435804ff7337f72dae93a0..60316633cc6bcfdfad8ab356d803642d353add61 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -753,6 +753,34 @@ static int msm_dp_irq_hpd_handle(struct msm_dp_display_private *dp, u32 data) return 0; } +struct msm_dp_panel *msm_dp_display_get_panel(struct msm_dp *dp_display) +{ + struct msm_dp_display_private *dp; + struct msm_dp_panel *dp_panel; + + struct msm_dp_panel_in panel_in; + + dp = container_of(dp_display, struct msm_dp_display_private, msm_dp_display); + + panel_in.dev = &dp_display->pdev->dev; + panel_in.aux = dp->aux; + panel_in.catalog = dp->catalog; + panel_in.link = dp->link; + + dp_panel = msm_dp_panel_get(&panel_in); + + if (IS_ERR(dp->panel)) { + DRM_ERROR("failed to initialize panel\n"); + return NULL; + } + + memcpy(dp_panel->dpcd, dp->panel->dpcd, DP_RECEIVER_CAP_SIZE + 1); + memcpy(&dp_panel->link_info, &dp->panel->link_info, + sizeof(dp->panel->link_info)); + + return dp_panel; +} + static void msm_dp_display_deinit_sub_modules(struct msm_dp_display_private *dp) { msm_dp_audio_put(dp->audio); diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h index f1142b7b96c372b49e8e45dd0378eb507b081915..6ab14e969bce0fd07b3a550bae17e99652479232 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.h +++ b/drivers/gpu/drm/msm/dp/dp_display.h @@ -68,4 +68,6 @@ void msm_dp_display_unprepare(struct msm_dp *dp); int msm_dp_display_get_active_stream_cnt(struct msm_dp *msm_dp); +struct msm_dp_panel *msm_dp_display_get_panel(struct msm_dp *dp_display); + #endif /* _DP_DISPLAY_H_ */