disp: msm: trigger same BW vote if rsc state updates
SDE RSC and core perf avoids BW vote trigger if current and previous AB/IB BW votes are same. This may cause issue if target enters in idle power collapse state with stale AMC vote. This invalidates the sleep vote and does not remove disp_drv vote. This change triggers BW vote on all rsc state updates. Change-Id: Id738206ade0feeb067dfda3d06cc0c7e19d66df1 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
@@ -974,8 +974,7 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
|
|||||||
if (kms->perf.bw_vote_mode == DISP_RSC_MODE &&
|
if (kms->perf.bw_vote_mode == DISP_RSC_MODE &&
|
||||||
((get_sde_rsc_current_state(SDE_RSC_INDEX) != SDE_RSC_CLK_STATE
|
((get_sde_rsc_current_state(SDE_RSC_INDEX) != SDE_RSC_CLK_STATE
|
||||||
&& params_changed) ||
|
&& params_changed) ||
|
||||||
(get_sde_rsc_current_state(SDE_RSC_INDEX) == SDE_RSC_CLK_STATE
|
(get_sde_rsc_current_state(SDE_RSC_INDEX) == SDE_RSC_CLK_STATE)))
|
||||||
&& update_bus)))
|
|
||||||
sde_rsc_client_trigger_vote(sde_cstate->rsc_client,
|
sde_rsc_client_trigger_vote(sde_cstate->rsc_client,
|
||||||
update_bus ? true : false);
|
update_bus ? true : false);
|
||||||
|
|
||||||
|
@@ -994,6 +994,7 @@ int sde_rsc_client_state_update(struct sde_rsc_client *caller_client,
|
|||||||
pr_debug("state switch successfully complete: %d\n", state);
|
pr_debug("state switch successfully complete: %d\n", state);
|
||||||
SDE_ATRACE_INT("rsc_state", state);
|
SDE_ATRACE_INT("rsc_state", state);
|
||||||
rsc->current_state = state;
|
rsc->current_state = state;
|
||||||
|
rsc->update_tcs_content = true;
|
||||||
SDE_EVT32(caller_client->id, caller_client->current_state,
|
SDE_EVT32(caller_client->id, caller_client->current_state,
|
||||||
state, rsc->current_state, SDE_EVTLOG_FUNC_EXIT);
|
state, rsc->current_state, SDE_EVTLOG_FUNC_EXIT);
|
||||||
|
|
||||||
@@ -1067,6 +1068,11 @@ int sde_rsc_client_trigger_vote(struct sde_rsc_client *caller_client,
|
|||||||
|
|
||||||
mutex_lock(&rsc->client_lock);
|
mutex_lock(&rsc->client_lock);
|
||||||
|
|
||||||
|
if (!delta_vote && !rsc->update_tcs_content &&
|
||||||
|
((rsc->current_state == SDE_RSC_CMD_STATE) ||
|
||||||
|
(rsc->current_state == SDE_RSC_VID_STATE)))
|
||||||
|
goto end;
|
||||||
|
|
||||||
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX && delta_vote; i++) {
|
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX && delta_vote; i++) {
|
||||||
if (rsc->bw_config.new_ab_vote[i] > rsc->bw_config.ab_vote[i] ||
|
if (rsc->bw_config.new_ab_vote[i] > rsc->bw_config.ab_vote[i] ||
|
||||||
rsc->bw_config.new_ib_vote[i] > rsc->bw_config.ib_vote[i])
|
rsc->bw_config.new_ib_vote[i] > rsc->bw_config.ib_vote[i])
|
||||||
@@ -1078,7 +1084,7 @@ int sde_rsc_client_trigger_vote(struct sde_rsc_client *caller_client,
|
|||||||
|
|
||||||
rc = sde_rsc_resource_enable(rsc);
|
rc = sde_rsc_resource_enable(rsc);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto clk_enable_fail;
|
goto end;
|
||||||
|
|
||||||
if (delta_vote) {
|
if (delta_vote) {
|
||||||
if (rsc->hw_ops.tcs_wait) {
|
if (rsc->hw_ops.tcs_wait) {
|
||||||
@@ -1087,7 +1093,7 @@ int sde_rsc_client_trigger_vote(struct sde_rsc_client *caller_client,
|
|||||||
pr_err("tcs is still busy; can't send command\n");
|
pr_err("tcs is still busy; can't send command\n");
|
||||||
if (rsc->hw_ops.tcs_use_ok)
|
if (rsc->hw_ops.tcs_use_ok)
|
||||||
rsc->hw_ops.tcs_use_ok(rsc);
|
rsc->hw_ops.tcs_use_ok(rsc);
|
||||||
goto end;
|
goto tcs_wait_failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1106,9 +1112,11 @@ int sde_rsc_client_trigger_vote(struct sde_rsc_client *caller_client,
|
|||||||
else if (rsc->hw_ops.tcs_use_ok)
|
else if (rsc->hw_ops.tcs_use_ok)
|
||||||
rsc->hw_ops.tcs_use_ok(rsc);
|
rsc->hw_ops.tcs_use_ok(rsc);
|
||||||
|
|
||||||
end:
|
rsc->update_tcs_content = false;
|
||||||
|
|
||||||
|
tcs_wait_failed:
|
||||||
sde_rsc_resource_disable(rsc);
|
sde_rsc_resource_disable(rsc);
|
||||||
clk_enable_fail:
|
end:
|
||||||
mutex_unlock(&rsc->client_lock);
|
mutex_unlock(&rsc->client_lock);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -168,6 +168,8 @@ struct sde_rsc_bw_config {
|
|||||||
* current_state: current rsc state (video/command), solver
|
* current_state: current rsc state (video/command), solver
|
||||||
* override/enabled.
|
* override/enabled.
|
||||||
* vsync_source: Interface index to provide the vsync ticks
|
* vsync_source: Interface index to provide the vsync ticks
|
||||||
|
* update_tcs_content: WAKE & SLEEP / AMC TCS content needs update with same BW
|
||||||
|
* vote if RSC state updates.
|
||||||
* debug_mode: enables the logging for each register read/write
|
* debug_mode: enables the logging for each register read/write
|
||||||
* debugfs_root: debugfs file system root node
|
* debugfs_root: debugfs file system root node
|
||||||
*
|
*
|
||||||
@@ -210,8 +212,9 @@ struct sde_rsc_priv {
|
|||||||
|
|
||||||
struct sde_rsc_timer_config timer_config;
|
struct sde_rsc_timer_config timer_config;
|
||||||
struct sde_rsc_cmd_config cmd_config;
|
struct sde_rsc_cmd_config cmd_config;
|
||||||
u32 current_state;
|
u32 current_state;
|
||||||
u32 vsync_source;
|
u32 vsync_source;
|
||||||
|
bool update_tcs_content;
|
||||||
|
|
||||||
u32 debug_mode;
|
u32 debug_mode;
|
||||||
struct dentry *debugfs_root;
|
struct dentry *debugfs_root;
|
||||||
|
Reference in New Issue
Block a user