Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d0c2bca authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cvp: stop session queue when session closed"

parents 24999171 917cd8ad
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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) {
+24 −0
Original line number Diff line number Diff line
@@ -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)
{
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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);