Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2258172rwb; Wed, 5 Oct 2022 11:20:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QU8Qnbv14ELqRHqbkjy+8gkLigx51MrEsrrPVR5Fej86zsyOAd0kanMz8IAVdxvlZ2pnf X-Received: by 2002:a17:907:a47:b0:780:6883:2a37 with SMTP id be7-20020a1709070a4700b0078068832a37mr697443ejc.219.1664994017715; Wed, 05 Oct 2022 11:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664994017; cv=none; d=google.com; s=arc-20160816; b=e6Rz+bzzxTCyb995/6la+gAx04AMGs39aPVql7i4RUaVP/njLQCr5WfaUrjQ9YCr5+ nNlJfU18dOA64j+7tNUU7HkBEWM3W8NuXRlAOlB8DupSk3gTLKaIrhqQl8bVyqukkIxY VbP23By5YqY74tP4EFYFXBfxA24JBcrsXKQ88N7w3fISJVifGRoRnF0IQv3p7jgLlO+g h0dWMECNWkTX6SZxjHPAPk90IuEuY+S1piNGz21s5jl3ufMAl4K/ATgKp09WcCEF9vbT v24T28Jk0aSKcXKi/rF5l8zFUwyoT2j2hIRgOEjzEl4FkVh0dxAi2Cnx3YfpI3Q7Smtn czyg== 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=QMx8mthukTUw0Va1oy4G3MoEVW15/qm5RWX9Jy9yNhE=; b=GYmk5c2BzFbcF8u90gfSwwfK38UHPyFJNv7mo3nOzXCAKgTBnd8G86rtYVZZlDSAFQ r3Q86NVOmU8Gv+oTi93WiROR2stLXKbS7iyr+YkwoLNSa7kh9fzReB9ww9PlVemYSlMO dOQ7f1a7zprII/2NjkU5p836gijrHo/K8A7m+m1MoKwlNESM2+ha4HifghWmO469yXEH hTscLhtTYCtCCmhzVpKd2f3rcEqyEfkmZcmBDpdg15P6OWh8LJpih1ifiwyN1mcAsq/b Yn7y1hNPtzcGG09vOee4ETjXxgPjzVmxV9sUwpFG+W3LtAIV4EikeM/BwCsPImBBrcXy 6+1g== 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 q19-20020a056402519300b00459cf2ca2bfsi134599edd.23.2022.10.05.11.19.48; Wed, 05 Oct 2022 11:20:17 -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 S230318AbiJESRh (ORCPT + 99 others); Wed, 5 Oct 2022 14:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230424AbiJESRW (ORCPT ); Wed, 5 Oct 2022 14:17:22 -0400 Received: from relay05.th.seeweb.it (relay05.th.seeweb.it [IPv6:2001:4b7a:2000:18::166]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0BC150190; Wed, 5 Oct 2022 11:17:18 -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 A68123F5F8; Wed, 5 Oct 2022 20:17:16 +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 4/7] drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size Date: Wed, 5 Oct 2022 20:16:54 +0200 Message-Id: <20221005181657.784375-5-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,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 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 --- 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); -- 2.38.0