[FP5-2466]:Curve parameter adjustment to enhance code vitality
* Root Cause
parameter.
* Solution
parameter.
* Test Steps
Sliding backlight observation phenomenon.
* Test Result
pass
Change-Id: Ia67cefdb9fc834a56c83a6a77f33d8f4c2082b0f
diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c
index 51b99aa..cd25d31 100644
--- a/msm/sde/sde_connector.c
+++ b/msm/sde/sde_connector.c
@@ -135,18 +135,49 @@
/* map UI brightness into driver backlight level with rounding */
/*Add by T2M-mingwu.zhang for FP5-129 remarks: Backlight curve mapping.[Begin]*/
+/*
+## INFO: To overwrite the previous curve mapping table,
+## please add modification information below in the following format!
+## Author:xxxxxx.xxx
+## Updatetime:xx.xx.xx
+## ......
+##
+## Modifying Record:
+##
+## Author:mingwu.zhang
+## Updatetime:2023.08.03
+## XXX:Increase the macro definition of brightness curve parameters
+## and reduce the coupling between curve parameters and code.
+## BUG:FP5-2466
+## | Curve critical point | APP Curve Scale Factor | APP Curve compensation |
+## | | | |
+## | SDE_CURVE_LIMIT1 11 | SDE_CURVE_APP_SCALE1 9.7 | SDE_CURVE_APP_COMP1 5.7 |
+## | SDE_CURVE_LIMIT2 30 | SDE_CURVE_APP_SCALE2 10.5| SDE_CURVE_APP_COMP2 14 |
+## | SDE_CURVE_LIMIT3 121 | SDE_CURVE_APP_SCALE3 11.6| SDE_CURVE_APP_COMP3 275 |
+## | SDE_CURVE_LIMIT4 633 | SDE_CURVE_APP_SCALE4 1.8 | SDE_CURVE_APP_COMP4 1528|
+## | SDE_CURVE_LIMIT5 2047| SDE_CURVE_APP_SCALE5 0.51| SDE_CURVE_APP_COMP5 2472|
+## | | SDE_CURVE_APP_SCALE6 0.28| SDE_CURVE_APP_COMP6 2948|
+##
+## Author:xxxxxx.xxx
+## Updatetime:xx.xx.xx
+## ......
+*/
#ifdef CONFIG_PROJECT_FP5
if (!strcmp(display->display_type, "primary")){
if(brightness <= 0){
bl_lvl = 0;
- } else if(brightness >= 1 && brightness <= 11){
- bl_lvl = (int)(9.7 * brightness - 5.7);
- } else if(brightness > 11 && brightness <= 30){
- bl_lvl = (int)(10.5 * brightness - 14);
- } else if(brightness > 30 && brightness <= 2047){
- bl_lvl = (int)(1.59 * brightness + 260);
+ } else if(brightness >= 1 && brightness <= SDE_CURVE_LIMIT1){
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE1 * brightness - SDE_CURVE_APP_COMP1);
+ } else if(brightness > SDE_CURVE_LIMIT1 && brightness <= SDE_CURVE_LIMIT2){
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE2 * brightness - SDE_CURVE_APP_COMP2);
+ } else if(brightness > SDE_CURVE_LIMIT2 && brightness <= SDE_CURVE_LIMIT3){
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE3 * brightness + SDE_CURVE_APP_COMP3);
+ } else if(brightness > SDE_CURVE_LIMIT3 && brightness <= SDE_CURVE_LIMIT4){
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE4 * brightness + SDE_CURVE_APP_COMP4);
+ } else if(brightness > SDE_CURVE_LIMIT4 && brightness <= SDE_CURVE_LIMIT5){
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE5 * brightness + SDE_CURVE_APP_COMP5);
} else {
- bl_lvl = (int)(0.28 * brightness + 2948);
+ bl_lvl = (int)(SDE_CURVE_APP_SCALE6 * brightness + SDE_CURVE_APP_COMP6);
}
if(bl_lvl > display->panel->bl_config.bl_max_level)
diff --git a/msm/sde/sde_connector.h b/msm/sde/sde_connector.h
index ecbbefb..1a9f665 100644
--- a/msm/sde/sde_connector.h
+++ b/msm/sde/sde_connector.h
@@ -20,6 +20,37 @@
#define SDE_CONNECTOR_DHDR_MEMPOOL_MAX_SIZE SZ_32
#define MAX_CMD_RECEIVE_SIZE 256
+/*
+##TAG:Add by T2M-mingwu.zhang [Begin]
+##BUG:FP5-2466
+##INFO:Curve parameter adjustment to enhance code vitality.
+*/
+#ifdef CONFIG_PROJECT_FP5
+/* Curve critical point */
+#define SDE_CURVE_LIMIT1 11
+#define SDE_CURVE_LIMIT2 30
+#define SDE_CURVE_LIMIT3 121
+#define SDE_CURVE_LIMIT4 633
+#define SDE_CURVE_LIMIT5 2047
+
+/* APP Curve Scale Factor */
+#define SDE_CURVE_APP_SCALE1 9.7
+#define SDE_CURVE_APP_SCALE2 10.5
+#define SDE_CURVE_APP_SCALE3 11.6
+#define SDE_CURVE_APP_SCALE4 1.8
+#define SDE_CURVE_APP_SCALE5 0.51
+#define SDE_CURVE_APP_SCALE6 0.28
+
+/* APP Curve compensation */
+#define SDE_CURVE_APP_COMP1 5.7
+#define SDE_CURVE_APP_COMP2 14
+#define SDE_CURVE_APP_COMP3 275
+#define SDE_CURVE_APP_COMP4 1528
+#define SDE_CURVE_APP_COMP5 2472
+#define SDE_CURVE_APP_COMP6 2948
+#endif
+/*Add by T2M-mingwu.zhang [End]*/
+
struct sde_connector;
struct sde_connector_state;