Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp72360rwb; Wed, 5 Oct 2022 14:58:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM54m7ZaVtszo07pPv58JFWChFe7XPSBWvpIZ4XfEY11h0ktnbIdrDbkcrI6c0phzHgxY0Ph X-Received: by 2002:a05:6a00:2392:b0:549:be0:cd3c with SMTP id f18-20020a056a00239200b005490be0cd3cmr1908062pfc.8.1665007091161; Wed, 05 Oct 2022 14:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665007091; cv=none; d=google.com; s=arc-20160816; b=BKNbAoisz+qexTg7L8hxJo+y01m+/StOyZsoyJQRLb8uVqmq3Wj+atZsoUSX4ghUSc e2RycDSOmwqQ+NeXSFL7y6zdG3+e5LrGxe3ZqyeYYHeFMDxoaXdMXSIwBWCZ8f+r016v 7/YUSJrCxTF2iLdJ2HGuwB/I5Rpg0J6FsfnSZfnkDv5ANDEQVF8HVypGct13JP7VJQ90 CKJSgXov4xcdKMpoGJTf31rlyKn1mFrNOy1xmwiUnJG2uOFRTLmYeG114RMKkW5QURBA E8tmaxfRCfAgeR7ebg7mY3iQVlGrHml2ADTHGykki8zUHXcnmjdT7ThSW2lMQelSZCd9 rtQQ== 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=GrrxmV0a8cb8wxj5wYID3jmmdK+wvVIqBnasA6y8kmU=; b=guta4ZHiCWXXFDUWT1hIAAnjq0MhcOEDp54Z9Gqtt0vhXaDm81i4/HMLP3KJ7tKZ8t 44yqikXYlEL6DgxLT+gpcesaJL4ljMrOqAvD0KROiFLGxcDbwDmCY216B3dptdgr0Gzg jZWfMrornW4z7K7igm9AIBKBp2p4F8XDdA/B6w+0GLfGcCdpqWmuXdiddiQkIqoLEi8G mD6vk0i0jQpwtkXY9SsEWxfq6N6D2xLrOjC0kapdxsEwry0KP7nI5LaMqcQY7cyXoMBN aOwrz9937IkZZIqcKrrkcy/pImfY6HCjAfS0o00GWINeQHN/IuwNpEpzqZ6IobWEpYII 9szA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Z0+BbJFk; 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 q14-20020a63504e000000b0042c6044840dsi17716276pgl.425.2022.10.05.14.58.00; Wed, 05 Oct 2022 14:58:11 -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=Z0+BbJFk; 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 S231255AbiJEVf3 (ORCPT + 99 others); Wed, 5 Oct 2022 17:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbiJEVf1 (ORCPT ); Wed, 5 Oct 2022 17:35:27 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E439D4F1AB; Wed, 5 Oct 2022 14:35:26 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 295LYxUu017082; Wed, 5 Oct 2022 21:34:59 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=GrrxmV0a8cb8wxj5wYID3jmmdK+wvVIqBnasA6y8kmU=; b=Z0+BbJFk5nmNfScGn3es/jZxH8wldfsYAkCslphRN8PaqI6KiWqt1JeVXPlkPZOcRLG0 n2Uf7FmbvunuHoPfjJrhdbe/cQPP085W/qKxnRx06hO7BGyjdxxfEK8R+N9NjOJkU1WJ 2rlwVhAORdU+2BCi+aTijRW8LoyDx88AQsSBViBmGdpZiSOP++H13D5+BYPFvL1qFEnO F1WBAA3czPh3wIFNUpsaomigyZz7LQFDYbMJqjX6ZYSzrCYrYYCmXp/9y1RE7a1r/9xm 8SQpZf5IvQswC/OdD6JOz26/5V7M+OdNJqvUUsjlAq7v5ohe6RLga9gvP0jhGQcU+mhI gA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3k0syqtfj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:34:59 +0000 Received: from pps.filterd (NALASPPMTA05.qualcomm.com [127.0.0.1]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 295LYwGM004175; Wed, 5 Oct 2022 21:34:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA05.qualcomm.com (PPS) with ESMTPS id 3k1e1e0ph6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:34:58 +0000 Received: from NALASPPMTA05.qualcomm.com (NALASPPMTA05.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 295LYvIh004170; Wed, 5 Oct 2022 21:34:58 GMT Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (PPS) with ESMTPS id 295LYv9G004169 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Oct 2022 21:34:57 +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:34:54 -0700 Message-ID: Date: Wed, 5 Oct 2022 14:34:53 -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 3/7] drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo 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-4-marijn.suijten@somainline.org> From: Abhinav Kumar In-Reply-To: <20221005181657.784375-4-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: iEuZDNO_JxyVvhOBNmmL1ljlCrXDgmj- X-Proofpoint-ORIG-GUID: iEuZDNO_JxyVvhOBNmmL1ljlCrXDgmj- 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 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 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: > This exact same math is used to compute bytes_in_slice above in > dsi_update_dsc_timing(), also used to fill slice_chunk_size. > > Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") > Signed-off-by: Marijn Suijten Reviewed-by: Abhinav Kumar > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index c746ed5d61f9..48c966375ffa 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -1829,9 +1829,7 @@ static int dsi_populate_dsc_params(struct drm_dsc_config *dsc) > * params are calculated > */ > groups_per_line = DIV_ROUND_UP(dsc->slice_width, 3); > - dsc->slice_chunk_size = dsc->slice_width * dsc->bits_per_pixel / 8; > - if ((dsc->slice_width * dsc->bits_per_pixel) % 8) > - dsc->slice_chunk_size++; > + dsc->slice_chunk_size = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8); > > /* rbs-min */ > min_rate_buffer_size = dsc->rc_model_size - dsc->initial_offset +