mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "msm: cvp: stop session queue when session closed"
This commit is contained in:
commit
9d0c2bcade
4 changed files with 35 additions and 1 deletions
|
|
@ -4174,7 +4174,7 @@ static void power_off_iris2(struct iris_hfi_device *device)
|
|||
static inline int __resume(struct iris_hfi_device *device)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 flags = 0;
|
||||
u32 flags = 0, reg_gdsc, reg_cbcr;
|
||||
|
||||
if (!device) {
|
||||
dprintk(CVP_ERR, "Invalid params: %pK\n", device);
|
||||
|
|
@ -4193,6 +4193,14 @@ static inline int __resume(struct iris_hfi_device *device)
|
|||
goto err_iris_power_on;
|
||||
}
|
||||
|
||||
|
||||
|
||||
reg_gdsc = __read_register(device, CVP_CC_MVS1C_GDSCR);
|
||||
reg_cbcr = __read_register(device, CVP_CC_MVS1C_CBCR);
|
||||
if (!(reg_gdsc & 0x80000000) || (reg_cbcr & 0x80000000))
|
||||
dprintk(CVP_ERR, "CVP power on failed gdsc %x cbcr %x\n",
|
||||
reg_gdsc, reg_cbcr);
|
||||
|
||||
/* Reboot the firmware */
|
||||
rc = __tzbsp_set_cvp_state(TZ_SUBSYS_STATE_RESUME);
|
||||
if (rc) {
|
||||
|
|
|
|||
|
|
@ -1019,6 +1019,30 @@ static int msm_cvp_session_stop(struct msm_cvp_inst *inst,
|
|||
return cvp_fence_thread_stop(inst);
|
||||
}
|
||||
|
||||
int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst)
|
||||
{
|
||||
struct cvp_session_queue *sq;
|
||||
|
||||
sq = &inst->session_queue;
|
||||
|
||||
spin_lock(&sq->lock);
|
||||
|
||||
if (sq->state == QUEUE_STOP) {
|
||||
spin_unlock(&sq->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sq->state = QUEUE_STOP;
|
||||
|
||||
dprintk(CVP_SESS, "Stop session queue: %pK session_id = %d\n",
|
||||
inst, hash32_ptr(inst->session));
|
||||
spin_unlock(&sq->lock);
|
||||
|
||||
wake_up_all(&inst->session_queue.wq);
|
||||
|
||||
return cvp_fence_thread_stop(inst);
|
||||
}
|
||||
|
||||
static int msm_cvp_session_ctrl(struct msm_cvp_inst *inst,
|
||||
struct cvp_kmd_arg *arg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,4 +32,5 @@ static inline bool is_buf_param_valid(u32 buf_num, u32 offset)
|
|||
int msm_cvp_handle_syscall(struct msm_cvp_inst *inst, struct cvp_kmd_arg *arg);
|
||||
int msm_cvp_session_init(struct msm_cvp_inst *inst);
|
||||
int msm_cvp_session_deinit(struct msm_cvp_inst *inst);
|
||||
int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ static void msm_cvp_cleanup_instance(struct msm_cvp_inst *inst)
|
|||
sq = &inst->session_queue;
|
||||
|
||||
max_retries = inst->core->resources.msm_cvp_hw_rsp_timeout >> 1;
|
||||
msm_cvp_session_queue_stop(inst);
|
||||
|
||||
wait:
|
||||
mutex_lock(&inst->frames.lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue