summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUjwal Patel <ujwalp@codeaurora.org>2015-10-01 20:12:02 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:47:29 -0700
commitc08198242326c200aeff7dbadb17856d7e58873b (patch)
tree9b1ac6374a8deffb0e609ee43c2daeac82067af7
parent502daaa2602ef379dd8fb0ee56bef8ae92cc4177 (diff)
msm: mdss: dynamically configure dsc ich_reset override
ich_reset override should be used only when partial update is enabled where full frame and partial frame have different number of slices. Since it is not dependent on panel, remove its configuration from panel device tree and dynamically configure based on current frame information. Change-Id: Ia7d66e4a3e1b8bb1bab71e6a2d24eb58e00c238c Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org> [cip@codeaurora.org: Removed .dtsi updates] Signed-off-by: Clarence Ip <cip@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt7
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_panel.c14
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_ctl.c44
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h3
4 files changed, 40 insertions, 28 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
index d65f9622d177..bee2b8f3c2c6 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
@@ -444,9 +444,6 @@ Optional properites:
- qcom,mdss-dsc-bit-per-component: An integer value indicates the bits per component before compression.
- qcom,mdss-dsc-bit-per-pixel: An integer value indicates the bits per pixel after compression.
- qcom,mdss-dsc-block-prediction-enable: A boolean value to enable/disable the block prediction at decoder.
-- qcom,mdss-dsc-ich-reset-value: An integer value defines the Indexed Color History reset value.
-- qcom,mdss-dsc-ich-reset-override: An integer value defines the Indexed Color History for each line in
- slice.
- qcom,mdss-dsc-config-by-manufacture-cmd: A boolean to indicates panel use manufacture command to setup pps
instead of standard dcs type 0x0A.
- qcom,adjust-timer-wakeup-ms: An integer value to indicate the timer delay(in ms) to accommodate
@@ -674,8 +671,6 @@ Example:
qcom,mdss-dsc-bit-per-component = <8>;
qcom,mdss-dsc-bit-per-pixel = <8>;
qcom,mdss-dsc-block-prediction-enable;
- qcom,mdss-dsc-ich-reset-value = <0>;
- qcom,mdss-dsc-ich-reset-override = <0>;
qcom,mdss-dsc-config-by-manufacture-cmd;
};
@@ -687,8 +682,6 @@ Example:
qcom,mdss-dsc-bit-per-component = <8>;
qcom,mdss-dsc-bit-per-pixel = <8>;
qcom,mdss-dsc-block-prediction-enable;
- qcom,mdss-dsc-ich-reset-value = <0>;
- qcom,mdss-dsc-ich-reset-override = <0>;
qcom,mdss-dsc-config-by-manufacture-cmd;
};
diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c
index 8357428471d7..45f84232f663 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_panel.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c
@@ -1464,17 +1464,6 @@ static int mdss_dsi_parse_dsc_params(struct device_node *np,
pr_debug("%s: bpc=%d bpp=%d\n", __func__,
dsc->bpc, dsc->bpp);
- rc = of_property_read_u32(np, "qcom,mdss-dsc-ich-reset-value", &data);
- if (rc)
- goto end;
- dsc->ich_reset_value = data;
-
- rc = of_property_read_u32(np, "qcom,mdss-dsc-ich-reset-override",
- &data);
- if (rc)
- goto end;
- dsc->ich_reset_override = data;
-
dsc->block_pred_enable = of_property_read_bool(np,
"qcom,mdss-dsc-block-prediction-enable");
@@ -1487,6 +1476,9 @@ static int mdss_dsi_parse_dsc_params(struct device_node *np,
mdss_dsc_parameters_calc(&timing->dsc, timing->xres, timing->yres);
+ timing->dsc.full_frame_slices =
+ CEIL(timing->dsc.pic_width, timing->dsc.slice_width);
+
timing->compression_mode = COMPRESSION_DSC;
end:
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
index df392a9b779d..57f9ca1ee71d 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
@@ -2404,7 +2404,7 @@ static inline void mdss_mdp_ctl_dsc_disable(struct mdss_mdp_mixer *mixer)
}
static void mdss_mdp_ctl_dsc_config(struct mdss_mdp_mixer *mixer,
- struct dsc_desc *dsc, u32 mode)
+ struct dsc_desc *dsc, u32 mode, bool ich_reset_override)
{
u32 data;
int bpp, lsb;
@@ -2431,8 +2431,10 @@ static void mdss_mdp_ctl_dsc_config(struct mdss_mdp_mixer *mixer,
writel_relaxed(mode, offset + MDSS_MDP_REG_DSC_COMMON_MODE);
- data = dsc->ich_reset_override << 28;
- data |= dsc->ich_reset_value << 29;
+ data = 0;
+ if (ich_reset_override)
+ data = 3 << 28;
+
data |= (dsc->initial_lines << 20);
data |= ((dsc->slice_last_group_size - 1) << 18);
/* bpp is 6.4 format, 4 LSBs bits are for fractional part */
@@ -2448,8 +2450,8 @@ static void mdss_mdp_ctl_dsc_config(struct mdss_mdp_mixer *mixer,
data |= (dsc->convert_rgb << 1);
data |= dsc->input_10_bits;
- pr_debug("%d %d %d %d %d %d %d %d %d %d, data=%x\n",
- dsc->ich_reset_value, dsc->ich_reset_override,
+ pr_debug("%d %d %d %d %d %d %d %d %d, data=%x\n",
+ ich_reset_override,
dsc->initial_lines , dsc->slice_last_group_size,
dsc->bpp, dsc->block_pred_enable, dsc->line_buf_depth,
dsc->enable_422, dsc->convert_rgb, dsc->input_10_bits, data);
@@ -2574,6 +2576,8 @@ void mdss_mdp_ctl_dsc_setup(struct mdss_mdp_ctl *ctl,
u32 pic_width = 0, pic_height = 0;
u32 mode = 0;
bool recalc_dsc_params = false;
+ bool ich_reset_override = false;
+ bool dsc_merge = false;
if (pinfo->type == MIPI_VIDEO_PANEL)
mode = BIT(2);
@@ -2606,8 +2610,10 @@ void mdss_mdp_ctl_dsc_setup(struct mdss_mdp_ctl *ctl,
/* DSC Merge */
if ((pinfo->dsc_enc_total == 2) &&
- (mdss_mdp_is_both_lm_valid(main_ctl)))
+ (mdss_mdp_is_both_lm_valid(main_ctl))) {
mode |= BIT(1);
+ dsc_merge = true;
+ }
}
}
@@ -2627,8 +2633,29 @@ void mdss_mdp_ctl_dsc_setup(struct mdss_mdp_ctl *ctl,
if (recalc_dsc_params)
mdss_dsc_parameters_calc(dsc, pic_width, pic_height);
+ /*
+ * As per the DSC spec, ICH_RESET can be either end of the slice line
+ * or at the end of the slice. HW internally generates ich_reset at
+ * end of the slice line if DSC_MERGE is used or encoder has two
+ * soft slices. However, if encoder has only 1 soft slice and DSC_MERGE
+ * is not used then it will generate ich_reset at the end of slice.
+ *
+ * Now as per the spec, during one PPS session, position where
+ * ich_reset is generated should not change. Now if full-screen frame
+ * has more than 1 soft slice then HW will automatically generate
+ * ich_reset at the end of slice_line. But for the same panel, if
+ * partial frame is enabled and only 1 encoder is used with 1 slice,
+ * then HW will generate ich_reset at end of the slice. This is a
+ * mismatch. Prevent this by overriding HW's decision.
+ */
+ if (pinfo->partial_update_enabled && !dsc_merge &&
+ (dsc->full_frame_slices > 1) &&
+ (dsc->slice_width == dsc->pic_width))
+ ich_reset_override = true;
+
if (mixer_left->valid_roi) {
- mdss_mdp_ctl_dsc_config(mixer_left, dsc, mode);
+ mdss_mdp_ctl_dsc_config(mixer_left, dsc, mode,
+ ich_reset_override);
mdss_mdp_ctl_dsc_config_thresh(mixer_left, pinfo);
mdss_mdp_ctl_dsc_enable(mixer_left);
} else {
@@ -2637,7 +2664,8 @@ void mdss_mdp_ctl_dsc_setup(struct mdss_mdp_ctl *ctl,
if (mixer_right) {
if (mixer_right->valid_roi) {
- mdss_mdp_ctl_dsc_config(mixer_right, dsc, mode);
+ mdss_mdp_ctl_dsc_config(mixer_right, dsc, mode,
+ ich_reset_override);
mdss_mdp_ctl_dsc_config_thresh(mixer_right, pinfo);
mdss_mdp_ctl_dsc_enable(mixer_right);
} else {
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index 8c232ce89ad9..3bd233f76b32 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -427,8 +427,6 @@ enum {
};
struct dsc_desc {
- int ich_reset_value;
- int ich_reset_override;
int initial_lines;
int slice_last_group_size;
int bpp; /* target bit per pixel */
@@ -447,6 +445,7 @@ struct dsc_desc {
int slice_height;
int slice_width;
int chunk_size;
+ int full_frame_slices; /* denotes number of slice in full frame */
int pkt_per_line;
int bytes_in_slice;