Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1734998rwb; Thu, 8 Dec 2022 14:44:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uOGBccbfSgznW/5hu353/vaUHd4wRc617+ZUxKS5fQCMkBm9WFI2CEmN9J/CLwoO61fnN X-Received: by 2002:a17:906:2249:b0:7c0:e23d:12c4 with SMTP id 9-20020a170906224900b007c0e23d12c4mr3112241ejr.63.1670539456709; Thu, 08 Dec 2022 14:44:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670539456; cv=none; d=google.com; s=arc-20160816; b=xZcTLSqv0S/ekbdq5uj46X7iCQ4qMmGnkuc5y4zVrS+kI0jTptj25Nc4p94lbkXDRO gp0GvGaEuSfWFnoDmdifcpVvnskV6krMRP8+OR0Qgwh+/ww8kr9xxVLWuoCj3tn8TXzn 0Pgp3MNerZ7MfE25MTpUq9e+qdy7dU08aDTLMCCN8JYF4Tk/LUfPqGYaqCA1eP+D+6JS hcpJbJ3BzPRPzh+Qprj4l98gcYvJLARSQmH9fic0tD84zK9jvlhhi5wTEetWw+RY9kYj m6y3lq81rCS2L6vPW3BBhzBDcIwbgXZ1d0EGIiC0aHo7FLjyGoNbKpdQEdq8zQbpHHxB PJiQ== 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=J99VpopIpBMY//qrJoAhecmuCU/yUWrKumpFiACeVoXTFfkvrwbxUMkKQCKveCjWxb EXCLO/13/2f7g8VsdDMBPK1NNYqcr3I+YF1dn6ptUSZ2qz2hQAKHE5VZF7HugBNz23+8 cvxtEtU26TV+YYi8o4PGiU+39dD8EeWiDnZISG4ZM4ZzchaiTEuFzqFyJBxZ6YJrhhRn F73WgZcPdC4cn+k7Z0leZoSTHIR3kMboowrhqWGjvibSEhv+MF1r75YyY293tc4ziH3m nKFt+ytl4qc5Nb4LQ86oO98d/cyKS1F/ZJq5aBD/oQJIOAAxKlV/29sZypgmRQwQyuNF uWHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="XN8L/exg"; 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 ga17-20020a1709070c1100b007c07d0dbe85si20976945ejc.463.2022.12.08.14.43.58; Thu, 08 Dec 2022 14:44:16 -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="XN8L/exg"; 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 S229876AbiLHWhz (ORCPT + 75 others); Thu, 8 Dec 2022 17:37:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbiLHWhp (ORCPT ); Thu, 8 Dec 2022 17:37:45 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 176562AD6; Thu, 8 Dec 2022 14:37:43 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8LbviF025478; Thu, 8 Dec 2022 22:37:35 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=XN8L/exgAogu93T60L/PUf5+fAP/X9DhuiAgXGuB8ysn3vmz5kpboaZSKO/pooPaRZjZ Ydx1oQV8lQI+PzerJ9io23Q0CgpYgrsH9O5v90sNoB7/273ZnlhD9VgwflSijDNRWpea +nj7YjuEm+/2zYZySWw2+LuSxCvTdza/WmybMyGgTnGEnn6cjqMjAKxYPR44QBoVWzdl TM0s534IIxUwnHKKcNwAZvbZEAV/gKCgBYSnwlMHFsodY7dYUY/Z9YJnWLr2VhaU3Vkx Fxtq4knUv/4VqD63trTVP5rgl38i4yLX3AO8spZKVChuFjTzCy8K1TvOx8IGXXut5geL pQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mbr0sr39s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Dec 2022 22:37:34 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B8MbYEN015216 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Dec 2022 22:37:34 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; Thu, 8 Dec 2022 14:37:33 -0800 From: Kuogee Hsieh To: , , , , , , , , , , , , , , , CC: Kuogee Hsieh , , , , , Subject: [PATCH v11 3/5] drm/msm/dp: parser data-lanes as property of dp_out endpoint Date: Thu, 8 Dec 2022 14:36:53 -0800 Message-ID: <1670539015-11808-4-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1670539015-11808-1-git-send-email-quic_khsieh@quicinc.com> References: <1670539015-11808-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: elJbr9D0kmdKECl_aZZxtXxR43PGi2gC X-Proofpoint-ORIG-GUID: elJbr9D0kmdKECl_aZZxtXxR43PGi2gC 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-08_12,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212080186 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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