summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhaval Patel <pdhaval@codeaurora.org>2016-03-30 17:40:53 -0700
committerDhaval Patel <pdhaval@codeaurora.org>2016-03-31 12:12:19 -0700
commita5fb4daf3e4ea5e9d17875ef079b18919da44c19 (patch)
tree86c78d36f97c6b72f949d7eae85a46428faaa486
parent2503ec5f7fc157e538ae8cbc300d94b52508cafc (diff)
display: add support for SCR rev for DSC 1.1
Add support for SCR rev for DSC 1.1. Change-Id: I6a0e6c61e120a90d8e106b16f9b55782c02f69ac
-rwxr-xr-xdev/gcdb/display/include/panel.h3
-rwxr-xr-xdev/gcdb/display/panel_display.c3
-rw-r--r--platform/msm_shared/include/msm_panel.h3
-rw-r--r--platform/msm_shared/mipi_dsc.c25
4 files changed, 26 insertions, 8 deletions
diff --git a/dev/gcdb/display/include/panel.h b/dev/gcdb/display/include/panel.h
index 11f471cd..3a83bcec 100755
--- a/dev/gcdb/display/include/panel.h
+++ b/dev/gcdb/display/include/panel.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -217,6 +217,7 @@ struct dsc_parameters {
uint32_t bpc; /* target bpc, byte per component */
uint32_t slice_per_pkt;
uint32_t block_prediction;
+ uint32_t scr_rev;
};
struct topology_config {
diff --git a/dev/gcdb/display/panel_display.c b/dev/gcdb/display/panel_display.c
index 6ae60ae5..77046950 100755
--- a/dev/gcdb/display/panel_display.c
+++ b/dev/gcdb/display/panel_display.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -267,6 +267,7 @@ int dsi_panel_init(struct msm_panel_info *pinfo,
dsc->major = dsc_params->major;
dsc->minor = dsc_params->minor;
+ dsc->scr_rev = dsc_params->scr_rev;
dsc->pps_id = dsc_params->pps_id;
dsc->slice_height = dsc_params->slice_height;
dsc->slice_width = dsc_params->slice_width;
diff --git a/platform/msm_shared/include/msm_panel.h b/platform/msm_shared/include/msm_panel.h
index 625beac2..7780f21a 100644
--- a/platform/msm_shared/include/msm_panel.h
+++ b/platform/msm_shared/include/msm_panel.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -148,6 +148,7 @@ struct dsc_desc {
int major;
int minor;
+ int scr_rev;
int pps_id;
int pic_height;
diff --git a/platform/msm_shared/mipi_dsc.c b/platform/msm_shared/mipi_dsc.c
index 4a575cb8..c581855e 100644
--- a/platform/msm_shared/mipi_dsc.c
+++ b/platform/msm_shared/mipi_dsc.c
@@ -41,10 +41,14 @@
*/
static char dsc_rc_buf_thresh[] = {0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54,
0x62, 0x69, 0x70, 0x77, 0x79, 0x7b, 0x7d, 0x7e};
-static char dsc_rc_range_min_qp[] = {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5,
+static char dsc_rc_range_min_qp_1_1[] = {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5,
5, 5, 7, 13};
-static char dsc_rc_range_max_qp[] = {4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 11,
+static char dsc_rc_range_min_qp_1_1_scr1[] = {0, 0, 1, 1, 3, 3, 3, 3, 3, 3, 5,
+ 5, 5, 9, 12};
+static char dsc_rc_range_max_qp_1_1[] = {4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 11,
12, 13, 13, 15};
+static char dsc_rc_range_max_qp_1_1_scr1[] = {4, 4, 5, 6, 7, 7, 7, 8, 9, 10, 10,
+ 11, 11, 12, 13};
static char dsc_rc_range_bpg_offset[] = {2, 0, 0, -2, -4, -6, -8, -8,
-8, -10, -10, -12, -12, -12, -12};
@@ -190,10 +194,16 @@ void mdss_dsc_parameters_calc(struct msm_panel_info *pinfo)
int data;
int final_value, final_scale;
int slice_per_line, bytes_in_slice, total_bytes;
+ int version;
dsc = &pinfo->dsc;
+ version = (((dsc->major & 0xf) << 4) | (dsc->minor & 0xf));
+
dsc->rc_model_size = 8192; /* rate_buffer_size */
- dsc->first_line_bpg_offset = 12;
+ if (version == 0x11 && dsc->scr_rev == 0x1)
+ dsc->first_line_bpg_offset = 15;
+ else
+ dsc->first_line_bpg_offset = 12;
dsc->min_qp_flatness = 3;
dsc->max_qp_flatness = 12;
dsc->line_buf_depth = 9;
@@ -205,8 +215,13 @@ void mdss_dsc_parameters_calc(struct msm_panel_info *pinfo)
dsc->tgt_offset_lo = 3;
dsc->buf_thresh = dsc_rc_buf_thresh;
- dsc->range_min_qp = dsc_rc_range_min_qp;
- dsc->range_max_qp = dsc_rc_range_max_qp;
+ if (version == 0x11 && dsc->scr_rev == 0x1) {
+ dsc->range_min_qp = dsc_rc_range_min_qp_1_1_scr1;
+ dsc->range_max_qp = dsc_rc_range_max_qp_1_1_scr1;
+ } else {
+ dsc->range_min_qp = dsc_rc_range_min_qp_1_1;
+ dsc->range_max_qp = dsc_rc_range_max_qp_1_1;
+ }
dsc->range_bpg_offset = dsc_rc_range_bpg_offset;
dsc->pic_width = pinfo->xres;