Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3865072rwb; Sun, 9 Oct 2022 12:34:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zfRfdZLnSkdvhMwXcKnwm+eza8Jpqoa4wRtXaljnC5K5sUfVtGjVP7qWVuWL7T8hsw0Hu X-Received: by 2002:a17:906:794b:b0:787:bb35:84cd with SMTP id l11-20020a170906794b00b00787bb3584cdmr11871446ejo.428.1665344049280; Sun, 09 Oct 2022 12:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665344049; cv=none; d=google.com; s=arc-20160816; b=ftJ2fEtkqbnZHwWn7fpuS52gv3QYQOZfnkJ/xZxOtHjymLvsJKh+lYgJF6vrz+Das9 Pt2t+tFigQKMknBla4BZGZXqV9/Ba4qZDcYyOKGdEhE8J/GwycWchVSTu9hnhS4ENwFj HpMD1XCt73h9TT+IECiDNhwwXgTz+EsTOvadiGlsYoeH5qbkIAcL0D7sEaQhmWjdOp+x PEi0iHj462hHLKlfTewP8Q2YfuGJfiAUryyYScSxjOCsed9SHxJ5nq9xvPe8GDPZXQo9 f4lCQZn2qKKFRCSW32hSCPE4lBWBsqC0aJFCnZ5sBtrrIh3/Gnmf0goFX7JVUw2GZ3WG LYyw== 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=usQYrU+yNjjBOqL+5QZmCVwLYWLplkYOSm3U8YVemvQ=; b=NQCPRTm10i7N5OQsUKgS6soHu9ayrCR6jfsdkumw94OQqPezKpNq9M1XHq8hL3BYLg 9T5i5BIPAbxS6nyTAAZw/vbNYhp9ZTP+RiC3CPqxbdJ21B4BvNADONvKYPce3OwUzDyB 4gUBJKYXrk5dACyFSAHg6raXGuPkXOE/CNl1DEtxMzQhDhYKOotukSjrtOWVEJkbp4J9 Eijo2BGazhmssbeWuncmezd/QW/KOqpbIGCic51U+IDNEwVDIthMhcLvLHOEurrT60eH noQqo+I049CGeqL0JCTEfgpd3B1C6i6Wb4EFJntAPiUrM3/ZtZ7EerAikI1sDHwZ9n8O MJRQ== 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 ay23-20020a056402203700b0044e80aabceasi7183789edb.372.2022.10.09.12.33.41; Sun, 09 Oct 2022 12:34:09 -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 S230359AbiJISss (ORCPT + 99 others); Sun, 9 Oct 2022 14:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230316AbiJISsm (ORCPT ); Sun, 9 Oct 2022 14:48:42 -0400 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [IPv6:2001:4b7a:2000:18::163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8E0829377 for ; Sun, 9 Oct 2022 11:48:40 -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-r1.th.seeweb.it (Postfix) with ESMTPSA id 51FBC1F986; Sun, 9 Oct 2022 20:48:38 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Vinod Koul Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Sean Paul , David Airlie , Daniel Vetter , Douglas Anderson , Vladimir Lypak , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson Subject: [PATCH v3 02/10] drm/msm/dsi: Remove repeated calculation of slice_per_intf Date: Sun, 9 Oct 2022 20:48:16 +0200 Message-Id: <20221009184824.457416-3-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221009184824.457416-1-marijn.suijten@somainline.org> References: <20221009184824.457416-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=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") Signed-off-by: Marijn Suijten Reviewed-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Reviewed-by: Vinod Koul --- 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