Skip to content

Commit 170ffca

Browse files
MarijnS95lumag
authored andcommitted
drm/msm/dsi: Remove repeated calculation of slice_per_intf
slice_per_intf is already computed for intf_width, which holds the same value as hdisplay. Fixes: 08802f5 ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Vinod Koul <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Marijn Suijten <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/508933/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 01a9079 commit 170ffca

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/msm/dsi/dsi_host.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable,
842842
static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mode, u32 hdisplay)
843843
{
844844
struct drm_dsc_config *dsc = msm_host->dsc;
845-
u32 reg, intf_width, reg_ctrl, reg_ctrl2;
845+
u32 reg, reg_ctrl, reg_ctrl2;
846846
u32 slice_per_intf, total_bytes_per_intf;
847847
u32 pkt_per_line;
848848
u32 bytes_in_slice;
@@ -851,8 +851,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
851851
/* first calculate dsc parameters and then program
852852
* compress mode registers
853853
*/
854-
intf_width = hdisplay;
855-
slice_per_intf = DIV_ROUND_UP(intf_width, dsc->slice_width);
854+
slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width);
856855

857856
/* If slice_per_pkt is greater than slice_per_intf
858857
* 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
861860
if (slice_per_intf > dsc->slice_count)
862861
dsc->slice_count = 1;
863862

864-
slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width);
865863
bytes_in_slice = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8);
866864

867865
dsc->slice_chunk_size = bytes_in_slice;

0 commit comments

Comments
 (0)