Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp1018220rdb; Fri, 1 Sep 2023 10:13:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAdFUpwWxz0bLYScA7O7Y1FhzS7nTpofkNXmZL+AwYhqbSMYnxv3T66kPY54kN6ed61JXm X-Received: by 2002:a05:6a20:3d85:b0:148:82d6:aa16 with SMTP id s5-20020a056a203d8500b0014882d6aa16mr3779425pzi.25.1693588386941; Fri, 01 Sep 2023 10:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693588386; cv=none; d=google.com; s=arc-20160816; b=Kj7J5311ZRRhRiLxak1P9b+hdKHIPI8rst/ki/zHQXudcOe+l453/Ch+rf9M7YyoQV Pu6HiFxozw+pgQ8LpJ8zL1BkdhNCj7TlXEWEtW658IhDXhx/RBIakBpL4QMryR5/ntqp 7olnlZ+2SxexXW1qTiMmmLegDpK2EtkjoGu6vkXobQOnCBpdJLOdo8fbVssoH0r6vems c8e7/lzDK6QHc/rKr+NxlNrhMwGGx89A14Dqk22NBZjRjHgaoIzDWOJKw+zfUILRjKsn jR5dUYgNZ7l5o8JzrYffszJEwj+rPRoKqRePhFZOGSHngjb5sZ8CPGpmDi5sTpW9hbL2 Czng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ys49PkpoeoqodHudvYndP+UifUpkStkIb4kswc6vt8o=; fh=N1TNoAFeKthmzJd757OiW3gvi5/HPfEUSVb+6ywwkc4=; b=dqeiqN/kEn3/TsJi+uMo+5C67rMRfVJVh52X1mhBnse5OFAx0Ga0Pze8XbVczjD/xh x2236J9eIwAm8soBmRo7s7Dlj4eu5GGzK63vsA6kTdudjvJOIT9axMCHssEAjky3Vdnn QMQq58uHOz9SUNPKW1/ijdLmpoVHnTpWO1Th5feUH4OI6nph9MkH6ckEwjKqFvTjyWNx hOgEbtx9VPBTOD0KJy/FRy41PcKyKqr2OJpeYzKQ5n1NvIuNZrb2pzMRC64MF8PdGL6i ukJrJS9N6UC+A1tLubb6hJx9SHOHv0ZkMc7qSEz9ZlTK8ApDenPObJB5TyVCP6c3PU+X /oNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="UgI5h/gA"; 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 fo14-20020a056a00600e00b0068bed8e35d8si3148513pfb.318.2023.09.01.10.12.50; Fri, 01 Sep 2023 10:13:06 -0700 (PDT) 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="UgI5h/gA"; 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 S238211AbjHaU2q (ORCPT + 99 others); Thu, 31 Aug 2023 16:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347371AbjHaU2a (ORCPT ); Thu, 31 Aug 2023 16:28:30 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED755E6F for ; Thu, 31 Aug 2023 13:28:25 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37VJ9UXp002278; Thu, 31 Aug 2023 20:28:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=Ys49PkpoeoqodHudvYndP+UifUpkStkIb4kswc6vt8o=; b=UgI5h/gA74+P2lfo8q2DmmBrFRwUq3VJQHL8Znqa2iawIfE/V/0YhOvf1VUnQ1z/6Xfx 6D2J3oVEaN1qFGBCN8GffBBmTgX1E1e8ufUStlK0KQl8fm+fKCiI69WlrTs+iC5RZ0RQ qVXQAbb6QXXNWpNICBRKH3Rwy5om00bDDNVYvnnQIw+1WHbzRL2RkBPhLKIyanP21SbP nwKpZ1GSHhyyTXXou/DlvhWpxDZvm/ioNqJPTtfDDMoIOIwZqX2bwvTv5m8gU+fvTk3Y v9Q4wbb549hMF4GV3JZT3fDvK3OYS8roX0UrdN2dS+b7rTC7maUuVKGJQs4DGgwX/QHM Vg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3stpy9a1ca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Aug 2023 20:28:04 +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 37VKS32L005676 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Aug 2023 20:28:04 GMT Received: from [10.71.108.94] (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.1118.36; Thu, 31 Aug 2023 13:28:03 -0700 Message-ID: Date: Thu, 31 Aug 2023 13:28:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 3/7] drm/msm/dp: Remove dead code related to downstream cap info Content-Language: en-US To: Stephen Boyd , Rob Clark , Abhinav Kumar , Dmitry Baryshkov CC: , , Sean Paul , , , Vinod Polimera References: <20230829184735.2841739-1-swboyd@chromium.org> <20230829184735.2841739-4-swboyd@chromium.org> From: Kuogee Hsieh In-Reply-To: <20230829184735.2841739-4-swboyd@chromium.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: aUdBQO0m3CrEMi7Zn8Q9N56YePkxgoZS X-Proofpoint-GUID: aUdBQO0m3CrEMi7Zn8Q9N56YePkxgoZS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-31_18,2023-08-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 impostorscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308310183 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 On 8/29/2023 11:47 AM, Stephen Boyd wrote: > We read the downstream port count and capability info but never use it > anywhere. Remove 'ds_port_cnt' and 'ds_cap_info' and any associated code > from this driver. Fold the check for 'dfp_present' into a call to > drm_dp_is_branch() at the one place it is used to get rid of any member > storage related to downstream ports. > > Cc: Vinod Polimera > Cc: Kuogee Hsieh > Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh > --- > drivers/gpu/drm/msm/dp/dp_panel.c | 25 +++---------------------- > drivers/gpu/drm/msm/dp/dp_panel.h | 6 ------ > 2 files changed, 3 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c > index a0523b18b9e9..9fb4e963fefb 100644 > --- a/drivers/gpu/drm/msm/dp/dp_panel.c > +++ b/drivers/gpu/drm/msm/dp/dp_panel.c > @@ -43,9 +43,7 @@ static void dp_panel_read_psr_cap(struct dp_panel_private *panel) > > static int dp_panel_read_dpcd(struct dp_panel *dp_panel) > { > - int rc = 0; > - size_t len; > - ssize_t rlen; > + int rc; > struct dp_panel_private *panel; > struct dp_link_info *link_info; > u8 *dpcd, major, minor; > @@ -79,25 +77,8 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel) > if (drm_dp_enhanced_frame_cap(dpcd)) > link_info->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING; > > - dp_panel->dfp_present = dpcd[DP_DOWNSTREAMPORT_PRESENT]; > - dp_panel->dfp_present &= DP_DWN_STRM_PORT_PRESENT; > - > - if (dp_panel->dfp_present && (dpcd[DP_DPCD_REV] > 0x10)) { > - dp_panel->ds_port_cnt = dpcd[DP_DOWN_STREAM_PORT_COUNT]; > - dp_panel->ds_port_cnt &= DP_PORT_COUNT_MASK; > - len = DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE; > - > - rlen = drm_dp_dpcd_read(panel->aux, > - DP_DOWNSTREAM_PORT_0, dp_panel->ds_cap_info, len); > - if (rlen < len) { > - DRM_ERROR("ds port status failed, rlen=%zd\n", rlen); > - rc = -EINVAL; > - goto end; > - } > - } > - > dp_panel_read_psr_cap(panel); > -end: > + > return rc; > } > > @@ -173,7 +154,7 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel, > return -EINVAL; > } > > - if (dp_panel->dfp_present) { > + if (drm_dp_is_branch(dp_panel->dpcd)) { > count = drm_dp_read_sink_count(panel->aux); > if (!count) { > DRM_ERROR("no downstream ports connected\n"); > diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h > index 6d733480a62d..3cb1f8dcfd3b 100644 > --- a/drivers/gpu/drm/msm/dp/dp_panel.h > +++ b/drivers/gpu/drm/msm/dp/dp_panel.h > @@ -13,9 +13,6 @@ > > struct edid; > > -#define DP_DOWNSTREAM_PORTS 4 > -#define DP_DOWNSTREAM_CAP_SIZE 4 > - > struct dp_display_mode { > struct drm_display_mode drm_mode; > u32 capabilities; > @@ -39,9 +36,6 @@ struct dp_panel_psr { > struct dp_panel { > /* dpcd raw data */ > u8 dpcd[DP_RECEIVER_CAP_SIZE]; > - u8 ds_cap_info[DP_DOWNSTREAM_PORTS * DP_DOWNSTREAM_CAP_SIZE]; > - u32 ds_port_cnt; > - u32 dfp_present; > > struct dp_link_info link_info; > struct drm_dp_desc desc;