disp: msm: sde: fix failure in perf mode clk update through debugfs

Setting perf tuning mode through debugfs during suspend can
result in underflow. Ensure that we are able to set rates,
or reset values and return to remain in normal mode.

Change-Id: Ib88de888690086d982b023b017083fee4e4d2091
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Este commit está contenido en:
Nilaan Gunabalachandran
2019-12-18 17:34:28 -05:00
cometido por Gerrit - the friendly Code Review server
padre c4f345dd75
commit 5bd891e4e2

Ver fichero

@@ -879,7 +879,7 @@ void sde_core_perf_crtc_update(struct drm_crtc *crtc,
if ((params_changed &&
(new->core_clk_rate > old->core_clk_rate)) ||
(!params_changed &&
(!params_changed && new->core_clk_rate &&
(new->core_clk_rate < old->core_clk_rate))) {
old->core_clk_rate = new->core_clk_rate;
update_clk = 1;
@@ -1037,12 +1037,17 @@ static ssize_t _sde_core_perf_mode_write(struct file *file,
ret = sde_power_clk_set_rate(perf->phandle,
perf->clk_name, perf->max_core_clk_rate);
if (ret)
if (ret) {
SDE_ERROR("failed to set %s clock rate %llu\n",
perf->clk_name,
perf->max_core_clk_rate);
else
perf->perf_tune.min_core_clk = 0;
perf->perf_tune.min_bus_vote = 0;
perf_mode = SDE_PERF_MODE_NORMAL;
} else {
DRM_INFO("minimum performance mode\n");
}
SDE_EVT32(perf->max_core_clk_rate, ret);
} else if (perf_mode == SDE_PERF_MODE_NORMAL) {
/* reset the perf tune params to 0 */