diff options
| author | Kuogee Hsieh <khsieh@codeaurora.org> | 2015-05-12 08:35:44 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:42:22 -0700 |
| commit | 1ca4a4b015ca94acc4991bdb8fbad47dfd54c38e (patch) | |
| tree | daf16a03093a3e0936f8a2be970e8d61f04ec66c /drivers/video/fbdev | |
| parent | 848551b3627b7dee1415b790b523de5b63e57147 (diff) | |
msm: mdss: dsi: add support for DSC command mode panel
Add required register programming in the DSI host driver to support
command mode panels that use Display Stream Compression (DSC) modes.
Change-Id: I316086e929f2424d56097e2f9d63a01de2d3fe8d
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 25 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_host.c | 11 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi_panel.c | 16 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_panel.h | 1 |
4 files changed, 31 insertions, 22 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index 0012c00a9067..a349b09906d7 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -1818,9 +1818,10 @@ static int mdss_dsi_ctl_partial_roi(struct mdss_panel_data *pdata) static int mdss_dsi_set_stream_size(struct mdss_panel_data *pdata) { - u32 data, idle; + u32 stream_ctrl, stream_total, idle; struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL; struct mdss_panel_info *pinfo; + struct dsc_desc *dsc = NULL; struct mdss_rect *roi; struct panel_horizontal_idle *pidle; int i; @@ -1838,18 +1839,28 @@ static int mdss_dsi_set_stream_size(struct mdss_panel_data *pdata) if (!pinfo->partial_update_supported) return -EINVAL; + if (pinfo->compression_mode == COMPRESSION_DSC) + dsc = &pinfo->dsc; + roi = &pinfo->roi; /* DSI_COMMAND_MODE_MDP_STREAM_CTRL */ - data = (((roi->w * 3) + 1) << 16) | + if (dsc) { + stream_ctrl = ((dsc->bytes_in_slice + 1) << 16) | + (pdata->panel_info.mipi.vc << 8) | DTYPE_DCS_LWRITE; + stream_total = roi->h << 16 | dsc->pclk_per_line; + } else { + + stream_ctrl = (((roi->w * 3) + 1) << 16) | (pdata->panel_info.mipi.vc << 8) | DTYPE_DCS_LWRITE; - MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x60, data); - MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x58, data); + stream_total = roi->h << 16 | roi->w; + } + MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x60, stream_ctrl); + MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x58, stream_ctrl); /* DSI_COMMAND_MODE_MDP_STREAM_TOTAL */ - data = roi->h << 16 | roi->w; - MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x64, data); - MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x5C, data); + MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x64, stream_total); + MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x5C, stream_total); /* set idle control -- dsi clk cycle */ idle = 0; diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index 1f2257064866..2ed624ec2203 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -1043,9 +1043,9 @@ static void mdss_dsi_dsc_config(struct mdss_dsi_ctrl_pdata *ctrl, MIPI_OUTP((ctrl->ctrl_base) + MDSS_DSI_COMMAND_COMPRESSION_MODE_CTRL2, - dsc->bytes_per_pkt); + dsc->bytes_in_slice); - data = 0x0b << 8; + data = DTYPE_DCS_LWRITE << 8; data |= (dsc->pkt_per_line - 1) << 6; data |= dsc->eol_byte_num << 4; data |= 1; /* enable */ @@ -1135,7 +1135,12 @@ static void mdss_dsi_mode_setup(struct mdss_panel_data *pdata) ystride = width * bpp + 1; - if (pinfo->partial_update_enabled && + if (dsc) { + stream_ctrl = ((dsc->bytes_in_slice + 1) << 16) | + (mipi->vc << 8) | DTYPE_DCS_LWRITE; + stream_total = dsc->pic_height << 16 | + dsc->pclk_per_line; + } else if (pinfo->partial_update_enabled && mdss_dsi_is_panel_on(pdata) && pinfo->roi.w && pinfo->roi.h) { stream_ctrl = (((pinfo->roi.w * bpp) + 1) << 16) | diff --git a/drivers/video/fbdev/msm/mdss_dsi_panel.c b/drivers/video/fbdev/msm/mdss_dsi_panel.c index d6ad191cdf67..3847d62ff887 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_panel.c +++ b/drivers/video/fbdev/msm/mdss_dsi_panel.c @@ -1036,8 +1036,6 @@ void mdss_dsc_parameters_calc(struct mdss_panel_info *pinfo) dsc->max_qp_flatness = 12; dsc->min_qp_flatness = 3; - dsc->pkt_per_line = 1; - dsc->edge_factor = 6; dsc->quant_incr_limit0 = 11; dsc->quant_incr_limit1 = 11; @@ -1071,20 +1069,14 @@ void mdss_dsc_parameters_calc(struct mdss_panel_info *pinfo) slice_per_line = dsc->pic_width / dsc->slice_width; bytes_in_slice = CEIL(dsc->pic_width, slice_per_line); - data = 0; - bytes_in_slice *= dsc->bpp; /* compressed */ - if (bytes_in_slice % 8) - data++; + bytes_in_slice *= dsc->bpp; /* bites per compressed pixel */ + bytes_in_slice = CEIL(bytes_in_slice, 8); - bytes_in_slice /= 8; - if (data) - bytes_in_slice++; + dsc->bytes_in_slice = bytes_in_slice; total_bytes = bytes_in_slice * slice_per_line; dsc->eol_byte_num = total_bytes % 3; - dsc->pclk_per_line = total_bytes / 3; - if (dsc->eol_byte_num) - dsc->pclk_per_line++; + dsc->pclk_per_line = CEIL(total_bytes, 3); dsc->slice_last_group_size = 3 - dsc->eol_byte_num; diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h index cc2ecd6e82ce..314e01de3fb7 100644 --- a/drivers/video/fbdev/msm/mdss_panel.h +++ b/drivers/video/fbdev/msm/mdss_panel.h @@ -401,6 +401,7 @@ struct dsc_desc { int chunk_size; int pkt_per_line; + int bytes_in_slice; int bytes_per_pkt; int eol_byte_num; int pclk_per_line; /* width */ |
