Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2269531rwb; Wed, 5 Oct 2022 11:31:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77zL1+d5bMVkegBwQUetA80n74xk421s+fmyWLYiWueenXR3cZJp9oEXOulckrsaK/He+j X-Received: by 2002:a05:6402:1853:b0:459:4e34:2ea5 with SMTP id v19-20020a056402185300b004594e342ea5mr1034513edy.191.1664994718639; Wed, 05 Oct 2022 11:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664994718; cv=none; d=google.com; s=arc-20160816; b=IqfI0c2zD8bGLut4XIl+u8tiFHFzkGElszu3bEYUl6ag4wW1zkiJfPIf3hQOTZIDJ4 ot4TSxZXyCYsxkYuID1AwAxj0W9QpwgLIe8s+htwlCJAsa7RckVZmpvqg11cX/BwWJBd SXW5esfsprCT22BhNayyYdLaSe9JSYA47e1kQsyqiJtJSCuTTdbT4ibbBN8yZkI47NMw bjHNhTWH0XLIRcTtz25eR123BUqrYbqED3iqYrMgw4xlPzKzRIzY+KabLdVPVY4wTv8Q izsKDlPHsJw7BKEszIU+mWt1fCeRdvrlGpWyyZV0kS7zqT05m9AiD0DDu0JXCGUaL9UV Iy4g== 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=zjE3s/97HZXrMDR/0k6D/ntyDbUpaXmmOOPaLRG8RDY=; b=LGE4WPLNtxcjcnQp/Q9j0smURaWM0Lao30XbwCY7rbvP9h6Rn0ldE9eB+ivkiPvVpC DbImpQ7nJLrF8/qgfOnZTVuSiqoh0zPXqLE8B7ym3zDv2k49915AX/QLjHGgWK//NeeE Y4KIvMR2C/pzO4iEmDWXty5WrIbablggqGTnUe4ofcUkUR5REzit4dOj5S9Km97+upVB BTDfloIrRhcbriZh9EH5OSG7UmLobV27rrY3lI6gx4Lyn4zfoFMNCplBxLPfKEao9a+G vnD8bq9O7huhFu8L5m8MsVbVKrpa2zUdmOCrGwPTTsdTDrmsvO29O4Iy4mUZ89JAYuga F1/A== 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 gs7-20020a1709072d0700b0076f591c4692si13990294ejc.330.2022.10.05.11.31.27; Wed, 05 Oct 2022 11:31:58 -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 S230246AbiJESRZ (ORCPT + 99 others); Wed, 5 Oct 2022 14:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbiJESRQ (ORCPT ); Wed, 5 Oct 2022 14:17:16 -0400 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [5.144.164.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72DF04F3AB for ; Wed, 5 Oct 2022 11:17:15 -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 BBE6A3F5B6; Wed, 5 Oct 2022 20:17:12 +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, Bjorn Andersson , David Airlie Subject: [PATCH v2 2/7] drm/msm/dsi: Remove repeated calculation of slice_per_intf Date: Wed, 5 Oct 2022 20:16:52 +0200 Message-Id: <20221005181657.784375-3-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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 slice_per_intf is already computed for intf_width, which holds the same value as hdisplay. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Reviewed-by: Vinod Koul Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_host.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 70077d1f0f21..c746ed5d61f9 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -842,7 +842,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable, static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mode, u32 hdisplay) { struct drm_dsc_config *dsc = msm_host->dsc; - u32 reg, intf_width, reg_ctrl, reg_ctrl2; + u32 reg, reg_ctrl, reg_ctrl2; u32 slice_per_intf, total_bytes_per_intf; u32 pkt_per_line; u32 bytes_in_slice; @@ -851,8 +851,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod /* first calculate dsc parameters and then program * compress mode registers */ - intf_width = hdisplay; - slice_per_intf = DIV_ROUND_UP(intf_width, dsc->slice_width); + slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width); /* If slice_per_pkt is greater than slice_per_intf * then default to 1. This can happen during partial @@ -861,7 +860,6 @@ 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; - slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width); bytes_in_slice = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8); dsc->slice_chunk_size = bytes_in_slice; -- 2.38.0