Merge "disp: msm: dsi: allow cmd-engine enable/disable HW op at all times"

This commit is contained in:
qctecmdr
2021-08-13 20:50:46 -07:00
zatwierdzone przez Gerrit - the friendly Code Review server
3 zmienionych plików z 16 dodań i 27 usunięć

Wyświetl plik

@@ -444,7 +444,7 @@ static void dsi_ctrl_post_cmd_transfer(struct dsi_ctrl *dsi_ctrl)
} }
/* Command engine disable, unmask overflow, remove vote on clocks and gdsc */ /* Command engine disable, unmask overflow, remove vote on clocks and gdsc */
rc = dsi_ctrl_set_cmd_engine_state(dsi_ctrl, DSI_CTRL_ENGINE_OFF, false); rc = dsi_ctrl_set_cmd_engine_state(dsi_ctrl, DSI_CTRL_ENGINE_OFF);
if (rc) if (rc)
DSI_CTRL_ERR(dsi_ctrl, "failed to disable command engine\n"); DSI_CTRL_ERR(dsi_ctrl, "failed to disable command engine\n");
@@ -3422,7 +3422,7 @@ int dsi_ctrl_transfer_prepare(struct dsi_ctrl *dsi_ctrl, u32 flags)
dsi_ctrl_mask_error_status_interrupts(dsi_ctrl, mask, true); dsi_ctrl_mask_error_status_interrupts(dsi_ctrl, mask, true);
rc = dsi_ctrl_set_cmd_engine_state(dsi_ctrl, DSI_CTRL_ENGINE_ON, false); rc = dsi_ctrl_set_cmd_engine_state(dsi_ctrl, DSI_CTRL_ENGINE_ON);
if (rc) { if (rc) {
DSI_CTRL_ERR(dsi_ctrl, "failed to enable command engine: %d\n", rc); DSI_CTRL_ERR(dsi_ctrl, "failed to enable command engine: %d\n", rc);
mutex_unlock(&dsi_ctrl->ctrl_lock); mutex_unlock(&dsi_ctrl->ctrl_lock);
@@ -3826,8 +3826,6 @@ error:
* dsi_ctrl_set_cmd_engine_state() - set command engine state * dsi_ctrl_set_cmd_engine_state() - set command engine state
* @dsi_ctrl: DSI Controller handle. * @dsi_ctrl: DSI Controller handle.
* @state: Engine state. * @state: Engine state.
* @skip_op: Boolean to indicate few operations can be skipped.
* Set during the cont-splash or trusted-vm enable case.
* *
* Command engine state can be modified only when DSI controller power state is * Command engine state can be modified only when DSI controller power state is
* set to DSI_CTRL_POWER_LINK_CLK_ON. * set to DSI_CTRL_POWER_LINK_CLK_ON.
@@ -3835,7 +3833,7 @@ error:
* Return: error code. * Return: error code.
*/ */
int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl, int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl,
enum dsi_engine_state state, bool skip_op) enum dsi_engine_state state)
{ {
int rc = 0; int rc = 0;
@@ -3862,24 +3860,22 @@ int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl,
goto error; goto error;
} }
if (!skip_op) { if (state == DSI_CTRL_ENGINE_ON)
if (state == DSI_CTRL_ENGINE_ON) dsi_ctrl->hw.ops.cmd_engine_en(&dsi_ctrl->hw, true);
dsi_ctrl->hw.ops.cmd_engine_en(&dsi_ctrl->hw, true); else
else dsi_ctrl->hw.ops.cmd_engine_en(&dsi_ctrl->hw, false);
dsi_ctrl->hw.ops.cmd_engine_en(&dsi_ctrl->hw, false);
}
if (state == DSI_CTRL_ENGINE_ON) if (state == DSI_CTRL_ENGINE_ON)
dsi_ctrl->cmd_engine_refcount++; dsi_ctrl->cmd_engine_refcount++;
else else
dsi_ctrl->cmd_engine_refcount = 0; dsi_ctrl->cmd_engine_refcount = 0;
SDE_EVT32(dsi_ctrl->cell_index, state, skip_op); SDE_EVT32(dsi_ctrl->cell_index, state);
dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_CMD_ENGINE, state); dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_CMD_ENGINE, state);
error: error:
DSI_CTRL_DEBUG(dsi_ctrl, "Set cmd engine state:%d, skip_op:%d, enable count: %d\n", DSI_CTRL_DEBUG(dsi_ctrl, "Set cmd engine state:%d, enable count: %d\n",
state, skip_op, dsi_ctrl->cmd_engine_refcount); state, dsi_ctrl->cmd_engine_refcount);
return rc; return rc;
} }

Wyświetl plik

@@ -646,8 +646,6 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl,
* dsi_ctrl_set_cmd_engine_state() - set command engine state * dsi_ctrl_set_cmd_engine_state() - set command engine state
* @dsi_ctrl: DSI Controller handle. * @dsi_ctrl: DSI Controller handle.
* @state: Engine state. * @state: Engine state.
* @skip_op: Boolean to indicate few operations can be skipped.
* Set during the cont-splash or trusted-vm enable case.
* *
* Command engine state can be modified only when DSI controller power state is * Command engine state can be modified only when DSI controller power state is
* set to DSI_CTRL_POWER_LINK_CLK_ON. * set to DSI_CTRL_POWER_LINK_CLK_ON.
@@ -655,7 +653,7 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl,
* Return: error code. * Return: error code.
*/ */
int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl, int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl,
enum dsi_engine_state state, bool skip_op); enum dsi_engine_state state);
/** /**
* dsi_ctrl_validate_host_state() - validate DSI ctrl host state * dsi_ctrl_validate_host_state() - validate DSI ctrl host state

Wyświetl plik

@@ -279,8 +279,7 @@ static int dsi_display_cmd_engine_enable(struct dsi_display *display)
m_ctrl = &display->ctrl[display->cmd_master_idx]; m_ctrl = &display->ctrl[display->cmd_master_idx];
mutex_lock(&m_ctrl->ctrl->ctrl_lock); mutex_lock(&m_ctrl->ctrl->ctrl_lock);
rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_ON);
DSI_CTRL_ENGINE_ON, skip_op);
if (rc) { if (rc) {
DSI_ERR("[%s] enable mcmd engine failed, skip_op:%d rc:%d\n", DSI_ERR("[%s] enable mcmd engine failed, skip_op:%d rc:%d\n",
display->name, skip_op, rc); display->name, skip_op, rc);
@@ -292,8 +291,7 @@ static int dsi_display_cmd_engine_enable(struct dsi_display *display)
if (!ctrl->ctrl || (ctrl == m_ctrl)) if (!ctrl->ctrl || (ctrl == m_ctrl))
continue; continue;
rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_ON);
DSI_CTRL_ENGINE_ON, skip_op);
if (rc) { if (rc) {
DSI_ERR( DSI_ERR(
"[%s] enable cmd engine failed, skip_op:%d rc:%d\n", "[%s] enable cmd engine failed, skip_op:%d rc:%d\n",
@@ -304,8 +302,7 @@ static int dsi_display_cmd_engine_enable(struct dsi_display *display)
goto done; goto done;
error_disable_master: error_disable_master:
(void)dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, (void)dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_OFF);
DSI_CTRL_ENGINE_OFF, skip_op);
done: done:
mutex_unlock(&m_ctrl->ctrl->ctrl_lock); mutex_unlock(&m_ctrl->ctrl->ctrl_lock);
return rc; return rc;
@@ -326,16 +323,14 @@ static int dsi_display_cmd_engine_disable(struct dsi_display *display)
if (!ctrl->ctrl || (ctrl == m_ctrl)) if (!ctrl->ctrl || (ctrl == m_ctrl))
continue; continue;
rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, rc = dsi_ctrl_set_cmd_engine_state(ctrl->ctrl, DSI_CTRL_ENGINE_OFF);
DSI_CTRL_ENGINE_OFF, skip_op);
if (rc) if (rc)
DSI_ERR( DSI_ERR(
"[%s] disable cmd engine failed, skip_op:%d rc:%d\n", "[%s] disable cmd engine failed, skip_op:%d rc:%d\n",
display->name, skip_op, rc); display->name, skip_op, rc);
} }
rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, rc = dsi_ctrl_set_cmd_engine_state(m_ctrl->ctrl, DSI_CTRL_ENGINE_OFF);
DSI_CTRL_ENGINE_OFF, skip_op);
if (rc) if (rc)
DSI_ERR("[%s] disable mcmd engine failed, skip_op:%d rc:%d\n", DSI_ERR("[%s] disable mcmd engine failed, skip_op:%d rc:%d\n",
display->name, skip_op, rc); display->name, skip_op, rc);