Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp72157rwb; Wed, 5 Oct 2022 14:57:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5npSgjhHRaiuZ7YWrMiStY5llz28Wbv/lgZrDbNjRyQlzJS65KY1rV73JKPNatoseINsZq X-Received: by 2002:a17:902:70c4:b0:17c:f9fe:3200 with SMTP id l4-20020a17090270c400b0017cf9fe3200mr1527245plt.1.1665007075669; Wed, 05 Oct 2022 14:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665007075; cv=none; d=google.com; s=arc-20160816; b=LO2e9dD+rN65D9CDGfynOfFMlf2O2kM9U9fyA7CYNzR2/k47LArZogUfgFUc7K2mXX 0mMXWID8HZOAMnMnIqrGeiV6GM3CoEEN/EasDhzdi2xz+ocS8pZPzT2oQJvJUH6XQg1j pEeahNnFjqxEB2ULY19CZhjNE13NT6RaBcpyezN+/VkSYKLUmyBNphHjO3pmfjV5ZcTL Y/w5Pkey4bIzzM85+einnGXDMqb9ILfyLzd/EG2mFxdOPwia72yjgcaAnHDaiA1hkIZX gk56jPyS0vpXMdQzxEn0jqHtOuHY4aUyAQYofj71RODsrWmLzMBbMJs9x+6hBRnkxWSn +PUQ== 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=9prHnzD6OwG3iwoLmDhhOtBkKcdiOjUUhhhFWk/oQro=; b=B5Xmv2WBko6aUx5StefrFDNi2Z5qU+sWPdEd+2iH25usSRrPdte5jUzxuNZI6JOpMu HLKwGoFN5Hx7XR8eOKtEwgNucMBgXhbUmggNCyjK6LhEA4YoWHZSlq4Vgtf+66xZqucZ fxMdXCw3KqozoJ1iI9qBCrRVxbQX1NLAs0BN2Hm7GLQGZRD7laIOQvGJ0x1IsVhKExuI 8uZ6bxzjfWu1wQ3n1OVoUpE8I2Umt2wDe/EdypceRVx+jpNKVdNFC6HORKQPCXEh8LIZ uqUdtwP45yn3CfU8hB/LA7HhVVb8zPOapmDTruSMJeJ/k9rOn58NkHtOTk+HZEKTWjzS +0SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=TFiGD53k; 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 j191-20020a638bc8000000b004428327e6easi10590218pge.619.2022.10.05.14.57.42; Wed, 05 Oct 2022 14:57:55 -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=TFiGD53k; 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 S231274AbiJEViH (ORCPT + 99 others); Wed, 5 Oct 2022 17:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbiJEViF (ORCPT ); Wed, 5 Oct 2022 17:38:05 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71475804A7; Wed, 5 Oct 2022 14:38:04 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 295JKLqI025641; Wed, 5 Oct 2022 21:37:49 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=9prHnzD6OwG3iwoLmDhhOtBkKcdiOjUUhhhFWk/oQro=; b=TFiGD53k1eetuLVG/ISslSP84bFPsX/hWLP3b2G4AJp8pm+fxARiCGdcM6cDu2nM9Gvq O3o3EvHIwU++vqKcH2WZgB1owGY2dUaPavt695F3/7jBC772DhwIfCQc1TIjmpY7245x FiT3e1zQF8eQR75f2yqhKZAwPVIPdgckUPDR3RprsR66ujTl37NCvvrubZOUPRj3kGPe srDFkTuaq64bT1N477sm/S9K/56cqg2tB+aNbCflVICnOrZ7S2dqEDm6/4aetq3qdSh+ sUC4QQ+igHJFB0slxWEbKT46slhgCqt0yen1Zh3Dw7f5t7SZUVYrjmCSvvUZkCtSqkL6 kA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3k0m88kus0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:37:49 +0000 Received: from pps.filterd (NALASPPMTA04.qualcomm.com [127.0.0.1]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 295LbmYo018156; Wed, 5 Oct 2022 21:37:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTPS id 3k1e0drq1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:37:48 +0000 Received: from NALASPPMTA04.qualcomm.com (NALASPPMTA04.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 295LblAc018150; Wed, 5 Oct 2022 21:37:48 GMT Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (PPS) with ESMTPS id 295Lbll4018148 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:37:47 +0000 Received: from [10.38.244.136] (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.29; Wed, 5 Oct 2022 14:37:44 -0700 Message-ID: Date: Wed, 5 Oct 2022 14:37:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v2 4/7] drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size Content-Language: en-US To: Marijn Suijten , , Rob Clark , Dmitry Baryshkov , Vinod Koul CC: <~postmarketos/upstreaming@lists.sr.ht>, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Daniel Vetter , Sean Paul , Thomas Zimmermann , Javier Martinez Canillas , Alex Deucher , Douglas Anderson , Vladimir Lypak , , , , , David Airlie References: <20221005181657.784375-1-marijn.suijten@somainline.org> <20221005181657.784375-5-marijn.suijten@somainline.org> From: Abhinav Kumar In-Reply-To: <20221005181657.784375-5-marijn.suijten@somainline.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: _Po1bYHf1ZhSRD1rP3H2jTs2PPmxtsqi X-Proofpoint-ORIG-GUID: _Po1bYHf1ZhSRD1rP3H2jTs2PPmxtsqi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-05_05,2022-10-05_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210050132 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 10/5/2022 11:16 AM, Marijn Suijten wrote: > dsi_populate_dsc_params() is called prior to dsi_update_dsc_timing() and > already computes a value for slice_chunk_size, whose value doesn't need > to be recomputed and re-set here. > > Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") > Signed-off-by: Marijn Suijten Reviewed-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index 48c966375ffa..f42794cdd4c1 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -845,7 +845,6 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod > u32 reg, reg_ctrl, reg_ctrl2; > u32 slice_per_intf, total_bytes_per_intf; > u32 pkt_per_line; > - u32 bytes_in_slice; > u32 eol_byte_num; > > /* first calculate dsc parameters and then program > @@ -860,11 +859,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod > if (slice_per_intf > dsc->slice_count) > dsc->slice_count = 1; > > - bytes_in_slice = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8); > - > - dsc->slice_chunk_size = bytes_in_slice; > - > - total_bytes_per_intf = bytes_in_slice * slice_per_intf; > + total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; > > eol_byte_num = total_bytes_per_intf % 3; > pkt_per_line = slice_per_intf / dsc->slice_count; > @@ -890,7 +885,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod > reg_ctrl |= reg; > > reg_ctrl2 &= ~DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__MASK; > - reg_ctrl2 |= DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(bytes_in_slice); > + reg_ctrl2 |= DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(dsc->slice_chunk_size); > > dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL, reg_ctrl); > dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL2, reg_ctrl2);