Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2257946rwb; Wed, 5 Oct 2022 11:20:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sy6ruiRA1+Ee3yGEJLE3TKF3Cmc9P280HnMU8QGBXuHNbxF08U5KSJrUVu2EiwwIUqzOJ X-Received: by 2002:a17:907:2bf0:b0:78d:25de:1d5c with SMTP id gv48-20020a1709072bf000b0078d25de1d5cmr692062ejc.562.1664994005324; Wed, 05 Oct 2022 11:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664994005; cv=none; d=google.com; s=arc-20160816; b=jhB/mk0Fl45MWpEkMIB10wVLPSxwQH9J4Z/t64uZmUird/wWdddD63H45M2AC7e3xO wsB/OPLqqV718HSSdmTlVqL3j+hoT0e2IvP1F33nurCwH1S+z7WBu4MrF0kautDH1LQn Q0pU225TbLiIozovRJzcFSN9QVmMeJsYW3jDNq7YvL/0lvfiTB9ZJRICXLRg1jkS9abW yrTy7vGewYKNz7WfRzpouWtKqMsM2ybZF/DFi6W2i0g/hvbm1fxPKNIfEmotwZWN6lfn wh2J33KhjzoFKeitdj/AsL2GyQfJlRjZcpKRGQN5TwDuTtB5kiSrUjXlI0HAllxXqYo8 JB4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=u53havuJy+OJp8rUEn3jD6+bjhw8jEpiWQgmPTYsnb8=; b=wuNo6158gahWlw1HG+aA313RjPGjYSkHr61ZPO5WCSkM8zb7r2DhBQwrRnft73zauj 4/b+cdOWO4Rfac9GKpwUk8sTccvK79ZomLL/h0M1ZVCujqdKxPxlUAUbCviWKjvHtLR7 o1TZWfdxVEognJWzc4+arFVLRG18K6KWusXRoi875QRxpgn3S8TJS3jCvRUuUQgCGik6 QXklyOzzODOytBYu4afc60kM/fYkz2HvV6kPUpRL+tlkUM+p9j2h3uwHX/aMiKQ4/WaQ Q/fvS084G0BuKxEzgeS2aEONiEev+RrG/22J7GS3c3BpXRrn3lFRRLpoNMOW70FudOsn y43Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a056402520f00b00442785a4226si17163091edd.258.2022.10.05.11.19.37; Wed, 05 Oct 2022 11:20:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230438AbiJESR3 (ORCPT + 99 others); Wed, 5 Oct 2022 14:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbiJESRR (ORCPT ); Wed, 5 Oct 2022 14:17:17 -0400 Received: from relay07.th.seeweb.it (relay07.th.seeweb.it [5.144.164.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB25F474EE for ; Wed, 5 Oct 2022 11:17:16 -0700 (PDT) Received: from localhost.localdomain (94-209-172-39.cable.dynamic.v4.ziggo.nl [94.209.172.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id ADD943F64A; Wed, 5 Oct 2022 20:17:14 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org, Rob Clark , Dmitry Baryshkov , Vinod Koul Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Daniel Vetter , Abhinav Kumar , Sean Paul , Thomas Zimmermann , Javier Martinez Canillas , Alex Deucher , Douglas Anderson , Vladimir Lypak , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, David Airlie Subject: [PATCH v2 3/7] drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo Date: Wed, 5 Oct 2022 20:16:53 +0200 Message-Id: <20221005181657.784375-4-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221005181657.784375-1-marijn.suijten@somainline.org> References: <20221005181657.784375-1-marijn.suijten@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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 --- 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 + -- 2.38.0