mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
drm/msm: Support Moto Panel param for dual panels
PROPAGATED from (CR) Panel is black when HBM trigger. The reason is CLI HBM commond set send to Primary Display. Fix MOT`s panel param so it can support dual panels Change-Id: Iaa4a0c974740571347a810d2517adcb830cb7795 Reviewed-on: https://gerrit.mot.com/1782933 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Reviewed-by: Shanshan Dai <daiss1@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
1fd102ea73
commit
07b3e66569
3 changed files with 45 additions and 7 deletions
|
|
@ -4724,6 +4724,7 @@ static int dsi_display_res_init(struct dsi_display *display)
|
|||
int rc = 0;
|
||||
int i;
|
||||
struct dsi_display_ctrl *ctrl;
|
||||
u32 panel_idx = 0;
|
||||
|
||||
display_for_each_ctrl(i, display) {
|
||||
ctrl = &display->ctrl[i];
|
||||
|
|
@ -4745,12 +4746,21 @@ static int dsi_display_res_init(struct dsi_display *display)
|
|||
}
|
||||
}
|
||||
|
||||
if (!strcmp(display->display_type, "primary"))
|
||||
panel_idx = 0;
|
||||
else if (!strcmp(display->display_type, "secondary"))
|
||||
panel_idx = 1;
|
||||
else {
|
||||
DSI_WARN("Unalbe to find the display type");
|
||||
panel_idx = 0;
|
||||
}
|
||||
display->panel = dsi_panel_get(&display->pdev->dev,
|
||||
display->panel_node,
|
||||
display->parser_node,
|
||||
display->display_type,
|
||||
display->cmdline_topology,
|
||||
display->trusted_vm_env);
|
||||
display->trusted_vm_env,
|
||||
panel_idx);
|
||||
if (IS_ERR_OR_NULL(display->panel)) {
|
||||
rc = PTR_ERR(display->panel);
|
||||
DSI_ERR("failed to get panel, rc=%d\n", rc);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,24 @@ static struct panel_param_val_map cabc_map[CABC_STATE_NUM] = {
|
|||
{CABC_DIS_STATE, DSI_CMD_SET_CABC_DIS, NULL},
|
||||
};
|
||||
|
||||
static struct panel_param_val_map hbm_map_s[HBM_STATE_NUM] = {
|
||||
{HBM_OFF_STATE, DSI_CMD_SET_HBM_OFF, NULL},
|
||||
{HBM_ON_STATE, DSI_CMD_SET_HBM_ON, NULL},
|
||||
{HBM_FOD_ON_STATE, DSI_CMD_SET_HBM_FOD_ON, NULL},
|
||||
};
|
||||
|
||||
static struct panel_param_val_map acl_map_s[ACL_STATE_NUM] = {
|
||||
{ACL_OFF_STATE, DSI_CMD_SET_ACL_OFF, NULL},
|
||||
{ACL_ON_STATE, DSI_CMD_SET_ACL_ON, NULL},
|
||||
};
|
||||
|
||||
|
||||
static struct panel_param_val_map cabc_map_s[CABC_STATE_NUM] = {
|
||||
{CABC_UI_STATE, DSI_CMD_SET_CABC_UI, NULL},
|
||||
{CABC_MV_STATE, DSI_CMD_SET_CABC_MV, NULL},
|
||||
{CABC_DIS_STATE, DSI_CMD_SET_CABC_DIS, NULL},
|
||||
};
|
||||
|
||||
static struct panel_param dsi_panel_param[PANEL_IDX_MAX][PARAM_ID_NUM] = {
|
||||
{
|
||||
{"HBM", hbm_map, HBM_STATE_NUM, HBM_OFF_STATE,
|
||||
|
|
@ -83,6 +101,14 @@ static struct panel_param dsi_panel_param[PANEL_IDX_MAX][PARAM_ID_NUM] = {
|
|||
{"ACL", acl_map, ACL_STATE_NUM, ACL_OFF_STATE,
|
||||
ACL_OFF_STATE, false}
|
||||
},
|
||||
{
|
||||
{"HBM", hbm_map_s, HBM_STATE_NUM, HBM_OFF_STATE,
|
||||
HBM_OFF_STATE, false},
|
||||
{"ACL", acl_map_s, ACL_STATE_NUM, ACL_OFF_STATE,
|
||||
ACL_OFF_STATE, false},
|
||||
{"CABC", cabc_map_s, CABC_STATE_NUM, CABC_UI_STATE,
|
||||
CABC_UI_STATE, false},
|
||||
}
|
||||
};
|
||||
|
||||
static void dsi_dce_prepare_pps_header(char *buf, u32 pps_delay_ms)
|
||||
|
|
@ -4065,13 +4091,13 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
|
|||
struct device_node *parser_node,
|
||||
const char *type,
|
||||
int topology_override,
|
||||
bool trusted_vm_env)
|
||||
bool trusted_vm_env,
|
||||
u32 panel_idx)
|
||||
{
|
||||
struct dsi_panel *panel;
|
||||
struct dsi_parser_utils *utils;
|
||||
const char *panel_physical_type;
|
||||
int rc = 0;
|
||||
u32 panel_idx = 0; /* Since only panel support for now */
|
||||
const char *pname;
|
||||
|
||||
panel = kzalloc(sizeof(*panel), GFP_KERNEL);
|
||||
|
|
@ -4114,7 +4140,7 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
|
|||
DSI_DEBUG("failed to parse mot_panel_config, rc = %d\n", rc);
|
||||
|
||||
panel->param_cmds = dsi_panel_param[panel_idx];
|
||||
rc = dsi_panel_parse_param_prop(panel, of_node, panel_idx );
|
||||
rc = dsi_panel_parse_param_prop(panel, of_node, panel_idx);
|
||||
if (rc)
|
||||
pr_debug("failed to parse panel param prop, rc =%d\n", rc);
|
||||
|
||||
|
|
|
|||
|
|
@ -219,8 +219,9 @@ struct dsi_panel_spr_info {
|
|||
};
|
||||
|
||||
enum panel_idx {
|
||||
MAIN_IDX = 0,
|
||||
PANEL_IDX_MAX,
|
||||
MAIN_IDX = 0,
|
||||
SEC_INX,
|
||||
PANEL_IDX_MAX,
|
||||
};
|
||||
|
||||
enum acl_state {
|
||||
|
|
@ -404,7 +405,8 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
|
|||
struct device_node *parser_node,
|
||||
const char *type,
|
||||
int topology_override,
|
||||
bool trusted_vm_env);
|
||||
bool trusted_vm_env,
|
||||
u32 panel_idx);
|
||||
|
||||
int dsi_panel_trigger_esd_attack(struct dsi_panel *panel, bool trusted_vm_env);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue