mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
drm/msm/dsi-staging: skip DCS command tx during recovery
When ESD recovery is underway, then DSI host might be in a bad state and can not transmit DCS commands. So this change avoids sending any DCS commands when recovery is pending. Change-Id: I85272b6debcca8a2e40a97e1c39d9d8aeb8e31b4 Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
This commit is contained in:
parent
84797bfc7e
commit
b1e56027b1
@ -733,7 +733,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display,
|
||||
}
|
||||
|
||||
/* Prevent another ESD check,when ESD recovery is underway */
|
||||
if (panel->esd_recovery_pending) {
|
||||
if (atomic_read(&panel->esd_recovery_pending)) {
|
||||
dsi_panel_release_panel_lock(panel);
|
||||
return rc;
|
||||
}
|
||||
@ -769,7 +769,7 @@ int dsi_display_check_status(struct drm_connector *connector, void *display,
|
||||
false);
|
||||
} else {
|
||||
/* Handle Panel failures during display disable sequence */
|
||||
panel->esd_recovery_pending = true;
|
||||
atomic_set(&panel->esd_recovery_pending, 1);
|
||||
}
|
||||
|
||||
dsi_display_clk_ctrl(dsi_display->dsi_clk_handle,
|
||||
@ -2563,7 +2563,7 @@ static int dsi_host_detach(struct mipi_dsi_host *host,
|
||||
static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
const struct mipi_dsi_msg *msg)
|
||||
{
|
||||
struct dsi_display *display = to_dsi_display(host);
|
||||
struct dsi_display *display;
|
||||
int rc = 0, ret = 0;
|
||||
|
||||
if (!host || !msg) {
|
||||
@ -2571,6 +2571,14 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
return 0;
|
||||
}
|
||||
|
||||
display = to_dsi_display(host);
|
||||
|
||||
/* Avoid sending DCS commands when ESD recovery is pending */
|
||||
if (atomic_read(&display->panel->esd_recovery_pending)) {
|
||||
pr_debug("ESD recovery pending\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = dsi_display_clk_ctrl(display->dsi_clk_handle,
|
||||
DSI_ALL_CLKS, DSI_CLK_ON);
|
||||
if (rc) {
|
||||
|
@ -156,7 +156,7 @@ static void dsi_bridge_pre_enable(struct drm_bridge *bridge)
|
||||
return;
|
||||
}
|
||||
|
||||
c_bridge->display->panel->esd_recovery_pending = false;
|
||||
atomic_set(&c_bridge->display->panel->esd_recovery_pending, 0);
|
||||
|
||||
/* By this point mode should have been validated through mode_fixup */
|
||||
rc = dsi_display_set_mode(c_bridge->display,
|
||||
|
@ -3717,8 +3717,8 @@ int dsi_panel_disable(struct dsi_panel *panel)
|
||||
|
||||
mutex_lock(&panel->panel_lock);
|
||||
|
||||
/* Avoid sending panel off commands when ESD recovery is underway */
|
||||
if (!panel->esd_recovery_pending) {
|
||||
/* Avoid sending panel off commands when ESD recovery is underway */
|
||||
if (!atomic_read(&panel->esd_recovery_pending)) {
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_OFF);
|
||||
if (rc) {
|
||||
pr_err("[%s] failed to send DSI_CMD_SET_OFF cmds, rc=%d\n",
|
||||
|
@ -176,7 +176,7 @@ struct dsi_panel {
|
||||
bool ulps_enabled;
|
||||
bool ulps_suspend_enabled;
|
||||
bool allow_phy_power_off;
|
||||
bool esd_recovery_pending;
|
||||
atomic_t esd_recovery_pending;
|
||||
|
||||
bool panel_initialized;
|
||||
bool te_using_watchdog_timer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user