From 663d13e0a0a91cf36035e485259411687bb8b3bc Mon Sep 17 00:00:00 2001 From: houdz1 Date: Thu, 10 Jun 2021 15:36:46 +0800 Subject: [PATCH] kernel: add supports configurable Datatype of compress pixel stream Some panel IC can not support 0x0b for compress pixel stream's DataType. For example gc7372, it will use 0x3E for compress pixel stream's DataType. Change-Id: Ie9bc90d79b11033414658d93e0b39137c6f4f8e0 Signed-off-by: houdz1 Reviewed-on: https://gerrit.mot.com/1976131 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yeqing Wang Reviewed-by: Hujun Liao Submit-Approved: Jira Key --- msm/dsi/dsi_ctrl_hw_cmn.c | 6 ++++-- msm/dsi/dsi_panel.c | 8 ++++++++ msm/msm_drv.h | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/msm/dsi/dsi_ctrl_hw_cmn.c b/msm/dsi/dsi_ctrl_hw_cmn.c index df9954da0454..50dc8a060463 100644 --- a/msm/dsi/dsi_ctrl_hw_cmn.c +++ b/msm/dsi/dsi_ctrl_hw_cmn.c @@ -332,7 +332,7 @@ void dsi_ctrl_hw_cmn_set_video_timing(struct dsi_ctrl_hw *ctrl, u32 reg = 0; u32 hs_start = 0; u32 hs_end, active_h_start, active_h_end, h_total, width = 0; - u32 bytes_per_pkt, pkt_per_line, eol_byte_num; + u32 bytes_per_pkt, pkt_per_line, eol_byte_num, datatype; u32 vs_start = 0, vs_end = 0; u32 vpos_start = 0, vpos_end, active_v_start, active_v_end, v_total; @@ -342,7 +342,9 @@ void dsi_ctrl_hw_cmn_set_video_timing(struct dsi_ctrl_hw *ctrl, &pkt_per_line, &eol_byte_num); reg = bytes_per_pkt << 16; /* data type of compressed image */ - reg |= (0x0b << 8); + datatype = mode->dsc->datatype; + if(!datatype) datatype = 0x0b; + reg |= (datatype << 8); /* * pkt_per_line: * 0 == 1 pkt diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 3adbb9636c11..d2e132e36148 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -3117,6 +3117,14 @@ static int dsi_panel_parse_dsc_params(struct dsi_display_mode *mode, } priv_info->dsc.config.bits_per_pixel = data << 4; + rc = utils->read_u32(utils->data, "qcom,mdss-dsc-datatype", + &data); + if (rc) { + DSI_ERR("failed to parse qcom,mdss-dsc-datatype\n"); + data = 0x0B; + } + priv_info->dsc.datatype = data; + rc = utils->read_u32(utils->data, "qcom,src-chroma-format", &data); if (rc) { diff --git a/msm/msm_drv.h b/msm/msm_drv.h index b69a2c7cec5a..60409a3010d1 100644 --- a/msm/msm_drv.h +++ b/msm/msm_drv.h @@ -400,6 +400,7 @@ struct msm_param_info { * @half_panel_pu True for single and dual dsc encoders if partial * update sets the roi width to half of mode width * False in all other cases + * @datatype: data type of compressed image */ struct msm_display_dsc_info { struct drm_dsc_config config; @@ -422,6 +423,7 @@ struct msm_display_dsc_info { u32 dsc_4hsmerge_padding; u32 dsc_4hsmerge_alignment; bool half_panel_pu; + int datatype; };