Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp58999rwb; Tue, 13 Dec 2022 14:04:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5W6e7UN3T1C1S9k5x35dcnv4fgcRQTr13oWS5Ey8pJZXaXPExM1iGKo/9AunsGbS9I/ePd X-Received: by 2002:a05:6a21:1084:b0:a5:c5ed:6469 with SMTP id nl4-20020a056a21108400b000a5c5ed6469mr22399630pzb.31.1670969095761; Tue, 13 Dec 2022 14:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670969095; cv=none; d=google.com; s=arc-20160816; b=qCzkwgYWT7RzW9vyo4ieDpkQb2+G29+yuW0QiDFcpPd1DaZf17PFvEAaMjxg+uY6yx RjHIaHmxrJqHR79e4Ai9PVjrINWUb9i+NAQiIN1w/QNbAlj6OvHAZsLSx4VMWVEWaY2z 4Cil39dCGCzgkW8wiDWgG2VceJW2FB5qt/cOJtxgHjGxF3yrGwGwkfi7/46JxKAffbbL q9Fq2bFJUQyZDzaaxaX+QyeOLcFrN3En6WH3sHEBt0z1GuJ8UnlLjay8SCoxSafdDAZG Sraqocn5dQNCtyskNXSs0bPoikN7/L0THQhD9bMtW+g8tzXonQNsjEWMiXEGGuv2dij/ Tz4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=D0G4TADsne4GknsV3/DiDjdVyQbWExXugyPC5lUp4U0=; b=h6IkxjJk8g2qgT8KhvOFLIJnhL8WvQiokNvJ6UwXXCWI9mqAZ+PheYdp1Qo0L48CTt 3qx+0QT1R7hnR2U8/uQ2eG9EyE3g/2BpnoFJdE7t3xbEXFeQcoiHjPzKP6yfGKO4heSp krIvvYHZCOjaF5Ws8wLly6zrEgkYEpgFeij8AI+h3eyZDIuPSYdf/qTK9ES8dcf+9T5e 75++EpfNuwKl0PrrHX9OFWxul/3B0vex6/Y9Kx2NCIjRf8fsGqnMUT5FJwJfwTWskNJS GEBObt7472SmiG8b7swfyDn5e1ldHJlu2VJExsWVECqq4AHVe0v3V6ZnISjn6fFZImXc 6jbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IwKsU1e8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a635445000000b004705b0ca9f1si13921256pgm.545.2022.12.13.14.04.45; Tue, 13 Dec 2022 14:04:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IwKsU1e8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236671AbiLMVor (ORCPT + 72 others); Tue, 13 Dec 2022 16:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236664AbiLMVog (ORCPT ); Tue, 13 Dec 2022 16:44:36 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F051824F36; Tue, 13 Dec 2022 13:44:34 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BDJn1t2008651; Tue, 13 Dec 2022 21:44:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=D0G4TADsne4GknsV3/DiDjdVyQbWExXugyPC5lUp4U0=; b=IwKsU1e8aHf6AVPD4vK7i9wvITp7iakHeoi+4e9j7oHj06APcunvDbGv+I0h1t5ExlXE XHFRSB8jjy8oGFTt5GVwewl3z6ETrfMK8gQgIpeqsvmOnbz7xhFQBnkklL6L0+U3AfSQ zqIKfFiK1vbBfmxq0+JO0KdacQ77hXhJd2wjvExOLzaamDz6YTTGyLVHb+BGms4JTkt7 UGrotgtoOROuWiySEq7vY6SWUWCefxdAfXLEoz9sPaejzl3FvB8yPicazjT86WGjnn+B jK3hKfU540gO6RSTX0WVktb4/TVl3p1IKHE62CpDN3ygUioPCc8fiQLg3i5RWEOvoKrd CA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3meyfkgd6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 21:44:27 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BDLiQ5C029522 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 21:44:26 GMT Received: from khsieh-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.986.36; Tue, 13 Dec 2022 13:44:26 -0800 From: Kuogee Hsieh To: , , , , , , , , , , , , , , CC: Kuogee Hsieh , , , , , Subject: [PATCH v12 3/5] drm/msm/dp: parser data-lanes as property of dp_out endpoint Date: Tue, 13 Dec 2022 13:44:06 -0800 Message-ID: <1670967848-31475-4-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1670967848-31475-1-git-send-email-quic_khsieh@quicinc.com> References: <1670967848-31475-1-git-send-email-quic_khsieh@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] 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-GUID: t6vgiDUClsPtyXKHN5_Rp7ObO-am6r8H X-Proofpoint-ORIG-GUID: t6vgiDUClsPtyXKHN5_Rp7ObO-am6r8H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-13_03,2022-12-13_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 spamscore=0 clxscore=1015 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212130188 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add capability to parser data-lanes as property of dp_out endpoint. Also retain the original capability to parser data-lanes as property of mdss_dp node to handle legacy case. Changes in v6: -- first patch after split parser patch into two Changes in v7: -- check "data-lanes" from endpoint first Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_parser.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c index dd73221..b5f7e70 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.c +++ b/drivers/gpu/drm/msm/dp/dp_parser.c @@ -94,16 +94,25 @@ static int dp_parser_ctrl_res(struct dp_parser *parser) static int dp_parser_misc(struct dp_parser *parser) { struct device_node *of_node = parser->pdev->dev.of_node; - int len; - - len = drm_of_get_data_lanes_count(of_node, 1, DP_MAX_NUM_DP_LANES); - if (len < 0) { - DRM_WARN("Invalid property \"data-lanes\", default max DP lanes = %d\n", - DP_MAX_NUM_DP_LANES); - len = DP_MAX_NUM_DP_LANES; + int cnt; + + /* + * data-lanes is the property of dp_out endpoint + */ + cnt = drm_of_get_data_lanes_count_ep(of_node, 1, 0, 1, DP_MAX_NUM_DP_LANES); + if (cnt > 0) + parser->max_dp_lanes = cnt; + else { + /* + * legacy code, data-lanes is the property of mdss_dp node + */ + cnt = drm_of_get_data_lanes_count(of_node, 1, DP_MAX_NUM_DP_LANES); + if (cnt > 0) + parser->max_dp_lanes = cnt; + else + parser->max_dp_lanes = DP_MAX_NUM_DP_LANES; /* 4 lanes */ } - parser->max_dp_lanes = len; return 0; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project