video: driver: set PM_SUSPEND in power collapsed state

Set substate PM_SUSPEND even if
video core was already power collapsed.

Change-Id: I15740d8e44fe89c6b34c0412dca1064539cdac35
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
This commit is contained in:
Ankush Mitra
2023-02-16 19:42:47 +05:30
والد 6b5255c60d
کامیت e96ab4ac79
3فایلهای تغییر یافته به همراه15 افزوده شده و 9 حذف شده

مشاهده پرونده

@@ -499,7 +499,7 @@ bool msm_vidc_allow_streamon(struct msm_vidc_inst *inst, u32 type);
enum msm_vidc_allow msm_vidc_allow_input_psc(struct msm_vidc_inst *inst);
bool msm_vidc_allow_drain_last_flag(struct msm_vidc_inst *inst);
bool msm_vidc_allow_psc_last_flag(struct msm_vidc_inst *inst);
bool msm_vidc_allow_pm_suspend(struct msm_vidc_core *core);
enum msm_vidc_allow msm_vidc_allow_pm_suspend(struct msm_vidc_core *core);
int msm_vidc_state_change_streamon(struct msm_vidc_inst *inst, u32 type);
int msm_vidc_state_change_streamoff(struct msm_vidc_inst *inst, u32 type);
int msm_vidc_state_change_input_psc(struct msm_vidc_inst *inst);

مشاهده پرونده

@@ -1285,27 +1285,27 @@ bool msm_vidc_allow_psc_last_flag(struct msm_vidc_inst *inst)
return false;
}
bool msm_vidc_allow_pm_suspend(struct msm_vidc_core *core)
enum msm_vidc_allow msm_vidc_allow_pm_suspend(struct msm_vidc_core *core)
{
if (!core) {
d_vpr_e("%s: invalid param\n", __func__);
return false;
return MSM_VIDC_DISALLOW;
}
/* core must be in valid state to do pm_suspend */
if (!core_in_valid_state(core)) {
d_vpr_e("%s: invalid core state %s\n",
__func__, core_state_name(core->state));
return false;
return MSM_VIDC_DISALLOW;
}
/* check if power is enabled */
if (!is_core_sub_state(core, CORE_SUBSTATE_POWER_ENABLE)) {
d_vpr_e("%s: Power already disabled\n", __func__);
return false;
return MSM_VIDC_IGNORE;
}
return true;
return MSM_VIDC_ALLOW;
}
bool is_hevc_10bit_decode_session(struct msm_vidc_inst *inst)

مشاهده پرونده

@@ -863,7 +863,7 @@ static int msm_vidc_pm_suspend(struct device *dev)
{
int rc = 0;
struct msm_vidc_core *core;
bool allow = false;
enum msm_vidc_allow allow = MSM_VIDC_DISALLOW;
/*
* Bail out if
@@ -882,8 +882,14 @@ static int msm_vidc_pm_suspend(struct device *dev)
core_lock(core, __func__);
allow = msm_vidc_allow_pm_suspend(core);
if (!allow) {
d_vpr_e("%s: pm suspend not allowed\n", __func__);
if (allow == MSM_VIDC_IGNORE) {
d_vpr_h("%s: pm already suspended\n", __func__);
msm_vidc_change_core_sub_state(core, 0, CORE_SUBSTATE_PM_SUSPEND, __func__);
rc = 0;
goto unlock;
} else if (allow != MSM_VIDC_ALLOW) {
d_vpr_h("%s: pm suspend not allowed\n", __func__);
rc = 0;
goto unlock;
}