Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp102760rwd; Mon, 12 Jun 2023 10:38:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+EeNwRyLu68xF6FVnFdGd+wmJiS6H8QkDd+G8N9+aSKA/HCfjP1ZdiBjvo82Ok93TPyQQ X-Received: by 2002:a17:902:b904:b0:1a6:d15f:3ce1 with SMTP id bf4-20020a170902b90400b001a6d15f3ce1mr7221791plb.34.1686591510340; Mon, 12 Jun 2023 10:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686591510; cv=none; d=google.com; s=arc-20160816; b=lmM5aKu0sEfYF8Ol+9+wxpBXjcRsyvwm0gDyarS5oIk+Draw7fqcyMtdGGzP2IfAMl sq+5GdgvBR6owSiXobrQY1iiL7iV8zPX9gvB6L2vylkFTCmzaKByGnte6Y7tEdN5ydm2 V0HQuCVC+sWfwk22MDj9gled0sst6rTGCXuh7gQIBbeZ+kkM3qtZO1KY1hsMvPbfwqw2 mxIeYnc0omfImOyo4AfJrQsT8UoaQX72DqM4qtDaEsaqrmwmm9i2JByEx9vboOROpo+2 i0tvbgdgwn/BOXHdKvXFGjKDx8QqsSSuyI6RAzxKsV2EA0rWt/L+BiuQKlJ1D9hiSoFS ls1w== 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=OHfuioKkw0sSpQtX9200zS3CjcWSpGjjyhgTtDXGPmM=; b=HsIt0I+AUPJhseQlfmieOjTHdQTUxbogQ/nPiQjmde3lfR6dgNlrz1XmBMV9uHuEbd B4CvR35j70Ol73UKAB60Xcrxs0RsoQO61XjoUHZ3b/8rLgonb1/d+/bTD2lpiCvNTdow amB2aZY6f72YrhcqxhFGVOXHSrwOj4LAn+U90QujVAs08RFfKMpRuZ6pkkIb8VtnAS6E +09rbFOGafwf4RLYBwfsgvER0CKuAd3KNqICz6CcE6tabjSfL5MwHdZT4r2LvGxl8zUs 2XWN0wQ+BQ/jfLLk8xPEqPf5y1ESDMG8JpEXLF9NPiZKML8fqD9K4/pFC0idf4n441QZ /9Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iproMTii; 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 h124-20020a636c82000000b0053592069d66si7339606pgc.467.2023.06.12.10.38.17; Mon, 12 Jun 2023 10:38:30 -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=iproMTii; 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 S236928AbjFLR1T (ORCPT + 99 others); Mon, 12 Jun 2023 13:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236866AbjFLR06 (ORCPT ); Mon, 12 Jun 2023 13:26:58 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0824E12C; Mon, 12 Jun 2023 10:26:51 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35CGtBGW019445; Mon, 12 Jun 2023 17:26:45 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=OHfuioKkw0sSpQtX9200zS3CjcWSpGjjyhgTtDXGPmM=; b=iproMTiiq2fmZRyz4/qPhZhdMDQHP6+3hw21rySefMHqodZjQzkZ4ythgEKN3z7EjZB5 /aDvsUE5h05zCj4CJbkCrVNIFrMNAxLROlNp8RZB0hLUTF4tZblYaxx5F3hWLfbREdcq QsoxaaT4AM4JsFG5kAqAtlc7r/cbqKY77J6bvNQiThwwZd0rt02a8kStkU8BntMkWNlZ M0C+95mewJKzG0bnPEtD9qYRTf9xl78GVwhvEcH9418Ur1Be3wfHcaMDTpYVQbm8/tkX xdUV/FL0YWjOk1sQINwbFMRP6zkmuu0y11NkKfSwNFmu1smH6B/Wp5XCQOwdIOc6mr4J Bw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r4ehtv4w3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jun 2023 17:26:44 +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 35CHQhBJ030448 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jun 2023 17:26:43 GMT Received: from [10.134.70.142] (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.42; Mon, 12 Jun 2023 10:26:41 -0700 Message-ID: Date: Mon, 12 Jun 2023 10:26:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [Freedreno] [PATCH v6 6/6] drm/msm/dsi: Document DSC related pclk_rate and hdisplay calculations Content-Language: en-US To: Marijn Suijten , Jessica Zhang CC: , Sean Paul , , , "Konrad Dybcio" , Rob Clark , "Daniel Vetter" , , Dmitry Baryshkov , David Airlie References: <20230405-add-dsc-support-v6-0-95eab864d1b6@quicinc.com> <20230405-add-dsc-support-v6-6-95eab864d1b6@quicinc.com> <6uiyqgggt2a3gkcihtyzr4rvq5igbe3ojpeiqnji22663bhh2l@3jifgk7bw4u5> From: Abhinav Kumar In-Reply-To: <6uiyqgggt2a3gkcihtyzr4rvq5igbe3ojpeiqnji22663bhh2l@3jifgk7bw4u5> 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-GUID: e_XxNZDwJDINU3TH43jITT2yedyJgZ8k X-Proofpoint-ORIG-GUID: e_XxNZDwJDINU3TH43jITT2yedyJgZ8k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-12_12,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306120150 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6/11/2023 3:03 PM, Marijn Suijten wrote: > On 2023-06-09 15:57:18, Jessica Zhang wrote: >> Add documentation comments explaining the pclk_rate and hdisplay math >> related to DSC. >> >> Signed-off-by: Jessica Zhang >> --- >> drivers/gpu/drm/msm/dsi/dsi_host.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c >> index fb1d3a25765f..aeaadc18bc7b 100644 >> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c >> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c >> @@ -564,6 +564,13 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host) >> static unsigned long dsi_adjust_pclk_for_compression(const struct drm_display_mode *mode, >> const struct drm_dsc_config *dsc) >> { >> + /* >> + * Adjust the pclk rate by calculating a new hdisplay proportional to >> + * the compression ratio such that: >> + * new_hdisplay = old_hdisplay * target_bpp / source_bpp >> + * >> + * Porches need not be adjusted during compression. >> + */ >> int new_hdisplay = DIV_ROUND_UP(mode->hdisplay * drm_dsc_get_bpp_int(dsc), >> dsc->bits_per_component * 3); > > I won't reiterate my original troubles with this logic and the comment > as that has well been described in v5 replies. > > Just want to ask why this comment couldn't be added in patch 5/6 > immediately when the logic is introduced? Now readers won't have a clue > what is going on until they skip one patch ahead. > Both myself and Dmitry discussed that in this particular case, we will add the documentation as a follow-up patch and merge it together. Not usually the process, but in this case, just decided to do it this way. The series will still be merged as one. > Furthermore it is lacking any explanation that this is a workaround for > cmd-mode, and that porches are currently used to represent "transfer > time" until those calculations are implemented. At that point there is > no concept of "not adjusting porches for compressed signals" anymore. > This is a much bigger topic and goes out of scope of this patch and series and I dont want to explain all that in this documentation patch. If we explain that this is specific to command mode, what would the panel drivers fill out for porches . Obviously they cannot fill out a 0. Coming to transfer time. Even if current panel drivers use 0 porches, the clock you get should still be sufficient for 60fps or a transfer time of 16.66ms. Transfer time was a concept introduced for some specific command mode panels where we needed to finish transferring the frame even faster than 16.66ms like 12ms or 13ms. Yes, without that, upstream and downstream math doesnt match. But that doesnt mean its going to break the panels or that upstream math is wrong. If you think command mode porches should be 0, then this will give you the clk for 60fps. If you add some random porches, it will just give a faster clock. Porches can be used instead of transfer time till we add that math but again, thats only needed for panels which need a faster transfer time than 16.66ms. So we dont need to call this a workaround in my opinion at all (and hack as you called in v5 is totally out of proportion). One could even argue that if the panel needs a transfer time faster than 16.66ms, then the mode->clock should also be bumped up. Panels dont do that today either. Hence, I am going to consider transfer time as an enhancement and not going to take that up in this series so I am not for adding that comment here. And as I have explained, this patch is not a workaround either. Its just calculating the clock based on what we have today in the panel drivers. >> >> @@ -961,6 +968,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) >> >> /* Divide the display by 3 but keep back/font porch and >> * pulse width same >> + * >> + * hdisplay will be divided by 3 here to account for the fact >> + * that DPU sends 3 bytes per pclk cycle to DSI. >> */ >> h_total -= hdisplay; >> hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc), 3); > > Still very glad to have this, thank you for adding it. Note that it > only further undermines the pclk adjustments, as I just explained in v5 > review. > > - Marijn > >> >> -- >> 2.40.1 >>