disp: msm: dsi: update panel commands for panel operating mode switch
Update panel commands to support panel operating mode switch in one timing node. Change-Id: Ieb8303cebe78c699dfd5f274830418e87655ff56 Signed-off-by: Lei Chen <chenlei@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
ab3f86f918
commit
8cdb80455f
@@ -242,6 +242,8 @@ enum dsi_dyn_clk_feature_type {
|
|||||||
* enum dsi_cmd_set_type - DSI command set type
|
* enum dsi_cmd_set_type - DSI command set type
|
||||||
* @DSI_CMD_SET_PRE_ON: Panel pre on
|
* @DSI_CMD_SET_PRE_ON: Panel pre on
|
||||||
* @DSI_CMD_SET_ON: Panel on
|
* @DSI_CMD_SET_ON: Panel on
|
||||||
|
* @DSI_CMD_SET_VID_ON: Video mode panel on
|
||||||
|
* @DSI_CMD_SET_CMD_ON: Command mode panel on
|
||||||
* @DSI_CMD_SET_POST_ON: Panel post on
|
* @DSI_CMD_SET_POST_ON: Panel post on
|
||||||
* @DSI_CMD_SET_PRE_OFF: Panel pre off
|
* @DSI_CMD_SET_PRE_OFF: Panel pre off
|
||||||
* @DSI_CMD_SET_OFF: Panel off
|
* @DSI_CMD_SET_OFF: Panel off
|
||||||
@@ -249,10 +251,10 @@ enum dsi_dyn_clk_feature_type {
|
|||||||
* @DSI_CMD_SET_PRE_RES_SWITCH: Pre resolution switch
|
* @DSI_CMD_SET_PRE_RES_SWITCH: Pre resolution switch
|
||||||
* @DSI_CMD_SET_RES_SWITCH: Resolution switch
|
* @DSI_CMD_SET_RES_SWITCH: Resolution switch
|
||||||
* @DSI_CMD_SET_POST_RES_SWITCH: Post resolution switch
|
* @DSI_CMD_SET_POST_RES_SWITCH: Post resolution switch
|
||||||
* @DSI_CMD_SET_CMD_TO_VID_SWITCH: Cmd to video mode switch
|
* @DSI_CMD_SET_VID_SWITCH_IN: Video mode switch in
|
||||||
* @DSI_CMD_SET_POST_CMD_TO_VID_SWITCH: Post cmd to vid switch
|
* @DSI_CMD_SET_VID_SWITCH_OUT: Video mode switch out
|
||||||
* @DSI_CMD_SET_VID_TO_CMD_SWITCH: Video to cmd mode switch
|
* @DSI_CMD_SET_CMD_SWITCH_IN: Cmd mode switch in
|
||||||
* @DSI_CMD_SET_POST_VID_TO_CMD_SWITCH: Post vid to cmd switch
|
* @DSI_CMD_SET_CMD_SWITCH_OUT: Cmd mode switch out
|
||||||
* @DSI_CMD_SET_PANEL_STATUS: Panel status
|
* @DSI_CMD_SET_PANEL_STATUS: Panel status
|
||||||
* @DSI_CMD_SET_LP1: Low power mode 1
|
* @DSI_CMD_SET_LP1: Low power mode 1
|
||||||
* @DSI_CMD_SET_LP2: Low power mode 2
|
* @DSI_CMD_SET_LP2: Low power mode 2
|
||||||
@@ -268,6 +270,8 @@ enum dsi_dyn_clk_feature_type {
|
|||||||
enum dsi_cmd_set_type {
|
enum dsi_cmd_set_type {
|
||||||
DSI_CMD_SET_PRE_ON = 0,
|
DSI_CMD_SET_PRE_ON = 0,
|
||||||
DSI_CMD_SET_ON,
|
DSI_CMD_SET_ON,
|
||||||
|
DSI_CMD_SET_VID_ON,
|
||||||
|
DSI_CMD_SET_CMD_ON,
|
||||||
DSI_CMD_SET_POST_ON,
|
DSI_CMD_SET_POST_ON,
|
||||||
DSI_CMD_SET_PRE_OFF,
|
DSI_CMD_SET_PRE_OFF,
|
||||||
DSI_CMD_SET_OFF,
|
DSI_CMD_SET_OFF,
|
||||||
@@ -275,10 +279,10 @@ enum dsi_cmd_set_type {
|
|||||||
DSI_CMD_SET_PRE_RES_SWITCH,
|
DSI_CMD_SET_PRE_RES_SWITCH,
|
||||||
DSI_CMD_SET_RES_SWITCH,
|
DSI_CMD_SET_RES_SWITCH,
|
||||||
DSI_CMD_SET_POST_RES_SWITCH,
|
DSI_CMD_SET_POST_RES_SWITCH,
|
||||||
DSI_CMD_SET_CMD_TO_VID_SWITCH,
|
DSI_CMD_SET_VID_SWITCH_IN,
|
||||||
DSI_CMD_SET_POST_CMD_TO_VID_SWITCH,
|
DSI_CMD_SET_VID_SWITCH_OUT,
|
||||||
DSI_CMD_SET_VID_TO_CMD_SWITCH,
|
DSI_CMD_SET_CMD_SWITCH_IN,
|
||||||
DSI_CMD_SET_POST_VID_TO_CMD_SWITCH,
|
DSI_CMD_SET_CMD_SWITCH_OUT,
|
||||||
DSI_CMD_SET_PANEL_STATUS,
|
DSI_CMD_SET_PANEL_STATUS,
|
||||||
DSI_CMD_SET_LP1,
|
DSI_CMD_SET_LP1,
|
||||||
DSI_CMD_SET_LP2,
|
DSI_CMD_SET_LP2,
|
||||||
|
@@ -8209,10 +8209,10 @@ int dsi_display_post_enable(struct dsi_display *display)
|
|||||||
|
|
||||||
if (display->panel->cur_mode->dsi_mode_flags &
|
if (display->panel->cur_mode->dsi_mode_flags &
|
||||||
DSI_MODE_FLAG_POMS_TO_CMD) {
|
DSI_MODE_FLAG_POMS_TO_CMD) {
|
||||||
dsi_panel_mode_switch_to_cmd(display->panel);
|
dsi_panel_switch_cmd_mode_in(display->panel);
|
||||||
} else if (display->panel->cur_mode->dsi_mode_flags &
|
} else if (display->panel->cur_mode->dsi_mode_flags &
|
||||||
DSI_MODE_FLAG_POMS_TO_VID)
|
DSI_MODE_FLAG_POMS_TO_VID)
|
||||||
dsi_panel_mode_switch_to_vid(display->panel);
|
dsi_panel_switch_video_mode_in(display->panel);
|
||||||
else {
|
else {
|
||||||
rc = dsi_panel_post_enable(display->panel);
|
rc = dsi_panel_post_enable(display->panel);
|
||||||
if (rc)
|
if (rc)
|
||||||
@@ -8246,7 +8246,7 @@ int dsi_display_pre_disable(struct dsi_display *display)
|
|||||||
DSI_ALL_CLKS, DSI_CLK_ON);
|
DSI_ALL_CLKS, DSI_CLK_ON);
|
||||||
if (display->poms_pending) {
|
if (display->poms_pending) {
|
||||||
if (display->config.panel_mode == DSI_OP_CMD_MODE)
|
if (display->config.panel_mode == DSI_OP_CMD_MODE)
|
||||||
dsi_panel_pre_mode_switch_to_video(display->panel);
|
dsi_panel_switch_cmd_mode_out(display->panel);
|
||||||
|
|
||||||
if (display->config.panel_mode == DSI_OP_VIDEO_MODE) {
|
if (display->config.panel_mode == DSI_OP_VIDEO_MODE) {
|
||||||
/*
|
/*
|
||||||
@@ -8268,7 +8268,7 @@ int dsi_display_pre_disable(struct dsi_display *display)
|
|||||||
goto error_disable_clks;
|
goto error_disable_clks;
|
||||||
}
|
}
|
||||||
|
|
||||||
dsi_panel_pre_mode_switch_to_cmd(display->panel);
|
dsi_panel_switch_video_mode_out(display->panel);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rc = dsi_panel_pre_disable(display->panel);
|
rc = dsi_panel_pre_disable(display->panel);
|
||||||
|
@@ -442,7 +442,7 @@ static int dsi_panel_tx_cmd_set(struct dsi_panel *panel,
|
|||||||
if (cmds->last_command)
|
if (cmds->last_command)
|
||||||
cmds->msg.flags |= MIPI_DSI_MSG_LASTCOMMAND;
|
cmds->msg.flags |= MIPI_DSI_MSG_LASTCOMMAND;
|
||||||
|
|
||||||
if (type == DSI_CMD_SET_VID_TO_CMD_SWITCH)
|
if (type == DSI_CMD_SET_VID_SWITCH_OUT)
|
||||||
cmds->msg.flags |= MIPI_DSI_MSG_ASYNC_OVERRIDE;
|
cmds->msg.flags |= MIPI_DSI_MSG_ASYNC_OVERRIDE;
|
||||||
|
|
||||||
len = ops->transfer(panel->host, &cmds->msg);
|
len = ops->transfer(panel->host, &cmds->msg);
|
||||||
@@ -1704,6 +1704,8 @@ error:
|
|||||||
const char *cmd_set_prop_map[DSI_CMD_SET_MAX] = {
|
const char *cmd_set_prop_map[DSI_CMD_SET_MAX] = {
|
||||||
"qcom,mdss-dsi-pre-on-command",
|
"qcom,mdss-dsi-pre-on-command",
|
||||||
"qcom,mdss-dsi-on-command",
|
"qcom,mdss-dsi-on-command",
|
||||||
|
"qcom,vid-on-commands",
|
||||||
|
"qcom,cmd-on-commands",
|
||||||
"qcom,mdss-dsi-post-panel-on-command",
|
"qcom,mdss-dsi-post-panel-on-command",
|
||||||
"qcom,mdss-dsi-pre-off-command",
|
"qcom,mdss-dsi-pre-off-command",
|
||||||
"qcom,mdss-dsi-off-command",
|
"qcom,mdss-dsi-off-command",
|
||||||
@@ -1711,10 +1713,10 @@ const char *cmd_set_prop_map[DSI_CMD_SET_MAX] = {
|
|||||||
"qcom,mdss-dsi-pre-res-switch",
|
"qcom,mdss-dsi-pre-res-switch",
|
||||||
"qcom,mdss-dsi-res-switch",
|
"qcom,mdss-dsi-res-switch",
|
||||||
"qcom,mdss-dsi-post-res-switch",
|
"qcom,mdss-dsi-post-res-switch",
|
||||||
"qcom,cmd-to-video-mode-switch-commands",
|
"qcom,video-mode-switch-in-commands",
|
||||||
"qcom,cmd-to-video-mode-post-switch-commands",
|
"qcom,video-mode-switch-out-commands",
|
||||||
"qcom,video-to-cmd-mode-switch-commands",
|
"qcom,cmd-mode-switch-in-commands",
|
||||||
"qcom,video-to-cmd-mode-post-switch-commands",
|
"qcom,cmd-mode-switch-out-commands",
|
||||||
"qcom,mdss-dsi-panel-status-command",
|
"qcom,mdss-dsi-panel-status-command",
|
||||||
"qcom,mdss-dsi-lp1-command",
|
"qcom,mdss-dsi-lp1-command",
|
||||||
"qcom,mdss-dsi-lp2-command",
|
"qcom,mdss-dsi-lp2-command",
|
||||||
@@ -1730,6 +1732,8 @@ const char *cmd_set_prop_map[DSI_CMD_SET_MAX] = {
|
|||||||
const char *cmd_set_state_map[DSI_CMD_SET_MAX] = {
|
const char *cmd_set_state_map[DSI_CMD_SET_MAX] = {
|
||||||
"qcom,mdss-dsi-pre-on-command-state",
|
"qcom,mdss-dsi-pre-on-command-state",
|
||||||
"qcom,mdss-dsi-on-command-state",
|
"qcom,mdss-dsi-on-command-state",
|
||||||
|
"qcom,vid-on-commands-state",
|
||||||
|
"qcom,cmd-on-commands-state",
|
||||||
"qcom,mdss-dsi-post-on-command-state",
|
"qcom,mdss-dsi-post-on-command-state",
|
||||||
"qcom,mdss-dsi-pre-off-command-state",
|
"qcom,mdss-dsi-pre-off-command-state",
|
||||||
"qcom,mdss-dsi-off-command-state",
|
"qcom,mdss-dsi-off-command-state",
|
||||||
@@ -1737,10 +1741,10 @@ const char *cmd_set_state_map[DSI_CMD_SET_MAX] = {
|
|||||||
"qcom,mdss-dsi-pre-res-switch-state",
|
"qcom,mdss-dsi-pre-res-switch-state",
|
||||||
"qcom,mdss-dsi-res-switch-state",
|
"qcom,mdss-dsi-res-switch-state",
|
||||||
"qcom,mdss-dsi-post-res-switch-state",
|
"qcom,mdss-dsi-post-res-switch-state",
|
||||||
"qcom,cmd-to-video-mode-switch-commands-state",
|
"qcom,video-mode-switch-in-commands-state",
|
||||||
"qcom,cmd-to-video-mode-post-switch-commands-state",
|
"qcom,video-mode-switch-out-commands-state",
|
||||||
"qcom,video-to-cmd-mode-switch-commands-state",
|
"qcom,cmd-mode-switch-in-commands-state",
|
||||||
"qcom,video-to-cmd-mode-post-switch-commands-state",
|
"qcom,cmd-mode-switch-out-commands-state",
|
||||||
"qcom,mdss-dsi-panel-status-command-state",
|
"qcom,mdss-dsi-panel-status-command-state",
|
||||||
"qcom,mdss-dsi-lp1-command-state",
|
"qcom,mdss-dsi-lp1-command-state",
|
||||||
"qcom,mdss-dsi-lp2-command-state",
|
"qcom,mdss-dsi-lp2-command-state",
|
||||||
@@ -4479,7 +4483,7 @@ int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dsi_panel_pre_mode_switch_to_video(struct dsi_panel *panel)
|
int dsi_panel_switch_cmd_mode_out(struct dsi_panel *panel)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@@ -4490,16 +4494,16 @@ int dsi_panel_pre_mode_switch_to_video(struct dsi_panel *panel)
|
|||||||
|
|
||||||
mutex_lock(&panel->panel_lock);
|
mutex_lock(&panel->panel_lock);
|
||||||
|
|
||||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_CMD_TO_VID_SWITCH);
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_CMD_SWITCH_OUT);
|
||||||
if (rc)
|
if (rc)
|
||||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n",
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_SWITCH_OUT cmds, rc=%d\n",
|
||||||
panel->name, rc);
|
panel->name, rc);
|
||||||
|
|
||||||
mutex_unlock(&panel->panel_lock);
|
mutex_unlock(&panel->panel_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dsi_panel_pre_mode_switch_to_cmd(struct dsi_panel *panel)
|
int dsi_panel_switch_video_mode_out(struct dsi_panel *panel)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@@ -4510,16 +4514,16 @@ int dsi_panel_pre_mode_switch_to_cmd(struct dsi_panel *panel)
|
|||||||
|
|
||||||
mutex_lock(&panel->panel_lock);
|
mutex_lock(&panel->panel_lock);
|
||||||
|
|
||||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_VID_TO_CMD_SWITCH);
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_VID_SWITCH_OUT);
|
||||||
if (rc)
|
if (rc)
|
||||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n",
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_VID_SWITCH_OUT cmds, rc=%d\n",
|
||||||
panel->name, rc);
|
panel->name, rc);
|
||||||
|
|
||||||
mutex_unlock(&panel->panel_lock);
|
mutex_unlock(&panel->panel_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dsi_panel_mode_switch_to_cmd(struct dsi_panel *panel)
|
int dsi_panel_switch_video_mode_in(struct dsi_panel *panel)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@@ -4530,16 +4534,16 @@ int dsi_panel_mode_switch_to_cmd(struct dsi_panel *panel)
|
|||||||
|
|
||||||
mutex_lock(&panel->panel_lock);
|
mutex_lock(&panel->panel_lock);
|
||||||
|
|
||||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_VID_TO_CMD_SWITCH);
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_VID_SWITCH_IN);
|
||||||
if (rc)
|
if (rc)
|
||||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n",
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_VID_SWITCH_IN cmds, rc=%d\n",
|
||||||
panel->name, rc);
|
panel->name, rc);
|
||||||
|
|
||||||
mutex_unlock(&panel->panel_lock);
|
mutex_unlock(&panel->panel_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dsi_panel_mode_switch_to_vid(struct dsi_panel *panel)
|
int dsi_panel_switch_cmd_mode_in(struct dsi_panel *panel)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
@@ -4550,9 +4554,9 @@ int dsi_panel_mode_switch_to_vid(struct dsi_panel *panel)
|
|||||||
|
|
||||||
mutex_lock(&panel->panel_lock);
|
mutex_lock(&panel->panel_lock);
|
||||||
|
|
||||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_POST_CMD_TO_VID_SWITCH);
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_CMD_SWITCH_IN);
|
||||||
if (rc)
|
if (rc)
|
||||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_TO_VID_SWITCH cmds, rc=%d\n",
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_SWITCH_IN cmds, rc=%d\n",
|
||||||
panel->name, rc);
|
panel->name, rc);
|
||||||
|
|
||||||
mutex_unlock(&panel->panel_lock);
|
mutex_unlock(&panel->panel_lock);
|
||||||
@@ -4611,11 +4615,30 @@ int dsi_panel_enable(struct dsi_panel *panel)
|
|||||||
mutex_lock(&panel->panel_lock);
|
mutex_lock(&panel->panel_lock);
|
||||||
|
|
||||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_ON);
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_ON);
|
||||||
if (rc)
|
if (rc) {
|
||||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_ON cmds, rc=%d\n",
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_ON cmds, rc=%d\n",
|
||||||
panel->name, rc);
|
panel->name, rc);
|
||||||
else
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (panel->panel_mode == DSI_OP_CMD_MODE) {
|
||||||
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_CMD_ON);
|
||||||
|
if (rc) {
|
||||||
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_CMD_ON cmds, rc=%d\n",
|
||||||
|
panel->name, rc);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
} else if (panel->panel_mode == DSI_OP_VIDEO_MODE) {
|
||||||
|
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_VID_ON);
|
||||||
|
if (rc) {
|
||||||
|
DSI_ERR("[%s] failed to send DSI_CMD_SET_VID_ON cmds, rc=%d\n",
|
||||||
|
panel->name, rc);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
}
|
||||||
panel->panel_initialized = true;
|
panel->panel_initialized = true;
|
||||||
|
|
||||||
|
error:
|
||||||
mutex_unlock(&panel->panel_lock);
|
mutex_unlock(&panel->panel_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _DSI_PANEL_H_
|
#ifndef _DSI_PANEL_H_
|
||||||
@@ -361,10 +361,13 @@ int dsi_panel_send_qsync_off_dcs(struct dsi_panel *panel,
|
|||||||
int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx,
|
int dsi_panel_send_roi_dcs(struct dsi_panel *panel, int ctrl_idx,
|
||||||
struct dsi_rect *roi);
|
struct dsi_rect *roi);
|
||||||
|
|
||||||
int dsi_panel_pre_mode_switch_to_video(struct dsi_panel *panel);
|
int dsi_panel_switch_video_mode_out(struct dsi_panel *panel);
|
||||||
int dsi_panel_pre_mode_switch_to_cmd(struct dsi_panel *panel);
|
|
||||||
int dsi_panel_mode_switch_to_cmd(struct dsi_panel *panel);
|
int dsi_panel_switch_cmd_mode_out(struct dsi_panel *panel);
|
||||||
int dsi_panel_mode_switch_to_vid(struct dsi_panel *panel);
|
|
||||||
|
int dsi_panel_switch_cmd_mode_in(struct dsi_panel *panel);
|
||||||
|
|
||||||
|
int dsi_panel_switch_video_mode_in(struct dsi_panel *panel);
|
||||||
|
|
||||||
int dsi_panel_switch(struct dsi_panel *panel);
|
int dsi_panel_switch(struct dsi_panel *panel);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user