Loading drivers/gpu/drm/msm/dsi-staging/dsi_panel.c +4 −2 Original line number Diff line number Diff line Loading @@ -2369,11 +2369,13 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, priv_info->dsc.pic_width = mode->timing.h_active; priv_info->dsc.pic_height = mode->timing.v_active; rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-per-pkt", &data); rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-per-pkt", &data); if (rc) { pr_err("failed to parse qcom,mdss-dsc-slice-per-pkt\n"); goto error; } else if (!data || (data > 2)) { pr_err("invalid dsc slice-per-pkt:%d\n", data); goto error; } priv_info->dsc.slice_per_pkt = data; Loading drivers/gpu/drm/msm/sde/sde_encoder.c +19 −7 Original line number Diff line number Diff line Loading @@ -1141,25 +1141,37 @@ static void _sde_encoder_dsc_pclk_param_calc(struct msm_display_dsc_info *dsc, static int _sde_encoder_dsc_initial_line_calc(struct msm_display_dsc_info *dsc, int enc_ip_width) { int ssm_delay, total_pixels, soft_slice_per_enc; int ssm_delay, total_pixels, soft_slice_per_enc, fifo_size; int first_line_offset, tmp[3]; soft_slice_per_enc = enc_ip_width / dsc->slice_width; /* * minimum number of initial line pixels is a sum of: * 1. sub-stream multiplexer delay (83 groups for 8bpc, * 91 for 10 bpc) * 3 * 1. sub-stream multiplexer delay (84 groups for 8bpc, * 92 for 10 bpc) * 3 * 2. for two soft slice cases, add extra sub-stream multiplexer * 3 * 3. the initial xmit delay * 4. total pipeline delay through the "lock step" of encoder (47) * 5. 6 additional pixels as the output of the rate buffer is * 48 bits wide */ ssm_delay = ((dsc->bpc < 10) ? 84 : 92); total_pixels = ssm_delay * 3 + dsc->initial_xmit_delay + 47; if (soft_slice_per_enc > 1) total_pixels += (ssm_delay * 3); ssm_delay = 3 * ((dsc->bpc < 10) ? 84 : 92); total_pixels = (soft_slice_per_enc * ssm_delay) + dsc->initial_xmit_delay + 47; fifo_size = ((soft_slice_per_enc == 2) ? 5610 : 11610); first_line_offset = (dsc->first_line_bpg_offset * dsc->pic_width) / (3 * 8); dsc->initial_lines = DIV_ROUND_UP(total_pixels, dsc->slice_width); tmp[0] = dsc->initial_xmit_delay + first_line_offset; tmp[1] = (2 + (0.75 * soft_slice_per_enc)) * dsc->chunk_size; tmp[2] = (total_pixels % dsc->slice_width) * (dsc->bpp / 8); if ((tmp[0] + tmp[1] - tmp[2]) < fifo_size) dsc->initial_lines++; return 0; } Loading drivers/gpu/drm/msm/sde/sde_hw_dsc.c +0 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ static void sde_hw_dsc_config(struct sde_hw_dsc *hw_dsc, u32 data; int bpp, lsb; u32 initial_lines = dsc->initial_lines; bool is_cmd_mode = !(mode & BIT(2)); struct sde_hw_blk_reg_map *dsc_c = &hw_dsc->hw; SDE_REG_WRITE(dsc_c, DSC_COMMON_MODE, mode); Loading @@ -65,9 +64,6 @@ static void sde_hw_dsc_config(struct sde_hw_dsc *hw_dsc, if (ich_reset_override) data = 3 << 28; if (is_cmd_mode) initial_lines += 1; data |= (initial_lines << 20); data |= (dsc->slice_last_group_size << 18); /* bpp is 6.4 format, 4 LSBs bits are for fractional part */ Loading Loading
drivers/gpu/drm/msm/dsi-staging/dsi_panel.c +4 −2 Original line number Diff line number Diff line Loading @@ -2369,11 +2369,13 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, priv_info->dsc.pic_width = mode->timing.h_active; priv_info->dsc.pic_height = mode->timing.v_active; rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-per-pkt", &data); rc = utils->read_u32(utils->data, "qcom,mdss-dsc-slice-per-pkt", &data); if (rc) { pr_err("failed to parse qcom,mdss-dsc-slice-per-pkt\n"); goto error; } else if (!data || (data > 2)) { pr_err("invalid dsc slice-per-pkt:%d\n", data); goto error; } priv_info->dsc.slice_per_pkt = data; Loading
drivers/gpu/drm/msm/sde/sde_encoder.c +19 −7 Original line number Diff line number Diff line Loading @@ -1141,25 +1141,37 @@ static void _sde_encoder_dsc_pclk_param_calc(struct msm_display_dsc_info *dsc, static int _sde_encoder_dsc_initial_line_calc(struct msm_display_dsc_info *dsc, int enc_ip_width) { int ssm_delay, total_pixels, soft_slice_per_enc; int ssm_delay, total_pixels, soft_slice_per_enc, fifo_size; int first_line_offset, tmp[3]; soft_slice_per_enc = enc_ip_width / dsc->slice_width; /* * minimum number of initial line pixels is a sum of: * 1. sub-stream multiplexer delay (83 groups for 8bpc, * 91 for 10 bpc) * 3 * 1. sub-stream multiplexer delay (84 groups for 8bpc, * 92 for 10 bpc) * 3 * 2. for two soft slice cases, add extra sub-stream multiplexer * 3 * 3. the initial xmit delay * 4. total pipeline delay through the "lock step" of encoder (47) * 5. 6 additional pixels as the output of the rate buffer is * 48 bits wide */ ssm_delay = ((dsc->bpc < 10) ? 84 : 92); total_pixels = ssm_delay * 3 + dsc->initial_xmit_delay + 47; if (soft_slice_per_enc > 1) total_pixels += (ssm_delay * 3); ssm_delay = 3 * ((dsc->bpc < 10) ? 84 : 92); total_pixels = (soft_slice_per_enc * ssm_delay) + dsc->initial_xmit_delay + 47; fifo_size = ((soft_slice_per_enc == 2) ? 5610 : 11610); first_line_offset = (dsc->first_line_bpg_offset * dsc->pic_width) / (3 * 8); dsc->initial_lines = DIV_ROUND_UP(total_pixels, dsc->slice_width); tmp[0] = dsc->initial_xmit_delay + first_line_offset; tmp[1] = (2 + (0.75 * soft_slice_per_enc)) * dsc->chunk_size; tmp[2] = (total_pixels % dsc->slice_width) * (dsc->bpp / 8); if ((tmp[0] + tmp[1] - tmp[2]) < fifo_size) dsc->initial_lines++; return 0; } Loading
drivers/gpu/drm/msm/sde/sde_hw_dsc.c +0 −4 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ static void sde_hw_dsc_config(struct sde_hw_dsc *hw_dsc, u32 data; int bpp, lsb; u32 initial_lines = dsc->initial_lines; bool is_cmd_mode = !(mode & BIT(2)); struct sde_hw_blk_reg_map *dsc_c = &hw_dsc->hw; SDE_REG_WRITE(dsc_c, DSC_COMMON_MODE, mode); Loading @@ -65,9 +64,6 @@ static void sde_hw_dsc_config(struct sde_hw_dsc *hw_dsc, if (ich_reset_override) data = 3 << 28; if (is_cmd_mode) initial_lines += 1; data |= (initial_lines << 20); data |= (dsc->slice_last_group_size << 18); /* bpp is 6.4 format, 4 LSBs bits are for fractional part */ Loading