Skip to content

Commit 155fa3a

Browse files
Jessica Zhanglumag
authored andcommitted
drm/msm/dsi: Remove incorrect references to slice_count
Currently, slice_count is being used to calculate word count and pkt_per_line. Instead, these values should be calculated using slice per packet, which is not the same as slice_count. Slice count represents the number of slices per interface, and its value will not always match that of slice per packet. For example, it is possible to have cases where there are multiple slices per interface but the panel specifies only one slice per packet. Thus, use the default value of one slice per packet and remove slice_count from the aforementioned calculations. Fixes: 08802f5 ("drm/msm/dsi: Add support for DSC configuration") Fixes: bc6b6ff ("drm/msm/dsi: Use DSC slice(s) packet size to compute word count") Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/541965/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-5-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 1642b58 commit 155fa3a

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -863,18 +863,17 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
863863
*/
864864
slice_per_intf = msm_dsc_get_slices_per_intf(dsc, hdisplay);
865865

866-
/*
867-
* If slice_count is greater than slice_per_intf
868-
* then default to 1. This can happen during partial
869-
* update.
870-
*/
871-
if (dsc->slice_count > slice_per_intf)
872-
dsc->slice_count = 1;
873-
874866
total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
875867

876868
eol_byte_num = total_bytes_per_intf % 3;
877-
pkt_per_line = slice_per_intf / dsc->slice_count;
869+
870+
/*
871+
* Typically, pkt_per_line = slice_per_intf * slice_per_pkt.
872+
*
873+
* Since the current driver only supports slice_per_pkt = 1,
874+
* pkt_per_line will be equal to slice per intf for now.
875+
*/
876+
pkt_per_line = slice_per_intf;
878877

879878
if (is_cmd_mode) /* packet data type */
880879
reg = DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE(MIPI_DSI_DCS_LONG_WRITE);
@@ -998,7 +997,14 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
998997
if (!msm_host->dsc)
999998
wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1;
1000999
else
1001-
wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count + 1;
1000+
/*
1001+
* When DSC is enabled, WC = slice_chunk_size * slice_per_pkt + 1.
1002+
* Currently, the driver only supports default value of slice_per_pkt = 1
1003+
*
1004+
* TODO: Expand mipi_dsi_device struct to hold slice_per_pkt info
1005+
* and adjust DSC math to account for slice_per_pkt.
1006+
*/
1007+
wc = msm_host->dsc->slice_chunk_size + 1;
10021008

10031009
dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL,
10041010
DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |

0 commit comments

Comments
 (0)