Skip to content

Commit e443459

Browse files
MarijnS95lumag
authored andcommitted
drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size
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: 08802f5 ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Marijn Suijten <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/508934/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 1e81961 commit e443459

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
845845
u32 reg, reg_ctrl, reg_ctrl2;
846846
u32 slice_per_intf, total_bytes_per_intf;
847847
u32 pkt_per_line;
848-
u32 bytes_in_slice;
849848
u32 eol_byte_num;
850849

851850
/* 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
860859
if (slice_per_intf > dsc->slice_count)
861860
dsc->slice_count = 1;
862861

863-
bytes_in_slice = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8);
864-
865-
dsc->slice_chunk_size = bytes_in_slice;
866-
867-
total_bytes_per_intf = bytes_in_slice * slice_per_intf;
862+
total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
868863

869864
eol_byte_num = total_bytes_per_intf % 3;
870865
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
890885
reg_ctrl |= reg;
891886

892887
reg_ctrl2 &= ~DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH__MASK;
893-
reg_ctrl2 |= DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(bytes_in_slice);
888+
reg_ctrl2 |= DSI_COMMAND_COMPRESSION_MODE_CTRL2_STREAM0_SLICE_WIDTH(dsc->slice_chunk_size);
894889

895890
dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL, reg_ctrl);
896891
dsi_write(msm_host, REG_DSI_COMMAND_COMPRESSION_MODE_CTRL2, reg_ctrl2);

0 commit comments

Comments
 (0)