Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1735838rwb; Thu, 8 Dec 2022 14:45:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4lzayqzL1com7ZWGt7yK3niarRA+VNbfvpsFm5yQ8Yz1Sq0CREC54HhE6OrxHnt2maBXb9 X-Received: by 2002:a05:6402:1948:b0:45c:835c:ea97 with SMTP id f8-20020a056402194800b0045c835cea97mr3153108edz.5.1670539505066; Thu, 08 Dec 2022 14:45:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670539505; cv=none; d=google.com; s=arc-20160816; b=KKAC3uSlzvPOM0tsRQlkRfc2D0BzLei+RBX1j7wrB22tJ0MI3EY0pz4gmTNunE1cjK 5mmqhbxvX5IOjacnh0v+4DKHP5nxryV+xGJq/oJO9+NsCx6mP63UVdr/7o61ASvNg9Nh Dh0cO94nnhL2NpvVgAa4XkM6DvRSVFtSO6Dsf6g0GYNcjU2ivSwFFJfDwkziTCEibp2U VXXF1ka33ZBv5mU3/quv1BVL78WPlycmwxmfeX6Mqf/JQUiAFu8TFRcEB2NzpybTUFua 51xxbOV0sKSW1g64E9U5tyT5fuKZnddHf83v0ydh1guWX8JZpRIRfuzORdsr4LIsO4WY koew== 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=HIhtSWlTSNGiCll3cr07ynxNzkRjJzJljGUF5zCpQAQ=; b=p/AQcR5K8R04xt/Q4zlJOP5MVqrvx6uPs3AoOLnmRAN9zSmM0BtelSSh0qaINFXmww tuk79R6ym1ePkX5uTsw4Sn9O8JExQzqqooCiKlp5hv2Vxh3/e90Fd5cDsj39yOmZ1nms K82p7BdEOUD2FO2lKemV5O5IMwIdG8LqPS6qvodgo2Xr5HvR5LrRWUNmQkxnPuruebpn T9J7CUwEGgydOof9wCcI2PbJSsflO7hnk3IWiJIn6IvajgbRAuyhwigWjrkpF9TQKoeH fszJt56ZBDH2kbafLjvSgONLpDuukuoD6T1I8q7j3Q6p4j4tu/kgFDteXDfwv3TpskQl kT5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bVURHE+e; 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 wu14-20020a170906eece00b00783ac0b4d32si19226008ejb.941.2022.12.08.14.44.46; Thu, 08 Dec 2022 14:45:05 -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=bVURHE+e; 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 S229628AbiLHWiG (ORCPT + 75 others); Thu, 8 Dec 2022 17:38:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbiLHWhx (ORCPT ); Thu, 8 Dec 2022 17:37:53 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2477D2FBD7; Thu, 8 Dec 2022 14:37:48 -0800 (PST) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MX3d8026924; Thu, 8 Dec 2022 22:37:40 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=HIhtSWlTSNGiCll3cr07ynxNzkRjJzJljGUF5zCpQAQ=; b=bVURHE+eZ3EqEtYllwzQjUIsSVZd15AU9w7+jVTSTz6NFmqMHev6WaNrGzYfJamc4sQO qAm9OFzmP5AMnlCRWI6z0bmdmpQhKzGUdcSC/183PK5MOHn7gKIgx5Dto7j8cr6sIw6C InrTIVwENBYH8r1fyPEcOWtTOLZ5qZ2laTsb60CTjFRUN0U+/+pgAyeeNBGV77dP51gA zi+GowXct2EdELlBPPwg/PP65V6jI1TBjVtnS1o+/gAu7PMrvu42FLx1fsrSsgswbqfc ukCj6m0vJ6KVwHrIpd6Tpwr1FowqaGL8WYjIigm+56xpQtel3+mU0/1uSGIP0XUK2MN5 jQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mbr2v82eu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Dec 2022 22:37:40 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B8Mbdbo003960 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Dec 2022 22:37:39 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:38 -0800 From: Kuogee Hsieh To: , , , , , , , , , , , , , , , CC: Kuogee Hsieh , , , , , Subject: [PATCH v11 5/5] drm/msm/dp: add support of max dp link rate Date: Thu, 8 Dec 2022 14:36:55 -0800 Message-ID: <1670539015-11808-6-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-ORIG-GUID: Z-RfY1FlHYBT75hlW7b1uLLyeN69uWKo X-Proofpoint-GUID: Z-RfY1FlHYBT75hlW7b1uLLyeN69uWKo 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 bulkscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 clxscore=1015 mlxscore=0 spamscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212080186 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 By default, HBR2 (5.4G) is the max link link be supported. This patch uses the actual limit specified by DT and removes the artificial limitation to 5.4 Gbps. Supporting HBR3 is a consequence of that. Changes in v2: -- add max link rate from dtsi Changes in v3: -- parser max_data_lanes and max_dp_link_rate from dp_out endpoint Changes in v4: -- delete unnecessary pr_err Changes in v5: -- split parser function into different patch Changes in v9: -- revised commit test Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++++ drivers/gpu/drm/msm/dp/dp_panel.c | 7 ++++--- drivers/gpu/drm/msm/dp/dp_panel.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index bfd0aef..edee550 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -390,6 +390,10 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp) struct edid *edid; dp->panel->max_dp_lanes = dp->parser->max_dp_lanes; + dp->panel->max_dp_link_rate = dp->parser->max_dp_link_rate; + + drm_dbg_dp(dp->drm_dev, "max_lanes=%d max_link_rate=%d\n", + dp->panel->max_dp_lanes, dp->panel->max_dp_link_rate); rc = dp_panel_read_sink_caps(dp->panel, dp->dp_display.connector); if (rc) diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index 5149ceb..933fa9c 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -75,12 +75,13 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) link_info->rate = drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]); link_info->num_lanes = dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK; + /* Limit data lanes from data-lanes of endpoint properity of dtsi */ if (link_info->num_lanes > dp_panel->max_dp_lanes) link_info->num_lanes = dp_panel->max_dp_lanes; - /* Limit support upto HBR2 until HBR3 support is added */ - if (link_info->rate >= (drm_dp_bw_code_to_link_rate(DP_LINK_BW_5_4))) - link_info->rate = drm_dp_bw_code_to_link_rate(DP_LINK_BW_5_4); + /* Limit link rate from link-frequencies of endpoint properity of dtsi */ + if (link_info->rate > dp_panel->max_dp_link_rate) + link_info->rate = dp_panel->max_dp_link_rate; drm_dbg_dp(panel->drm_dev, "version: %d.%d\n", major, minor); drm_dbg_dp(panel->drm_dev, "link_rate=%d\n", link_info->rate); diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h index d861197a..f04d021 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.h +++ b/drivers/gpu/drm/msm/dp/dp_panel.h @@ -50,6 +50,7 @@ struct dp_panel { u32 vic; u32 max_dp_lanes; + u32 max_dp_link_rate; u32 max_bw_code; }; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project