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

Commit 8933cba5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Fix session error handling"

parents bcb72f65 a65bf165
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -767,6 +767,14 @@ int msm_vdec_prepare_buf(struct msm_vidc_inst *inst,
	}
	hdev = inst->core->device;

	if (inst->state == MSM_VIDC_CORE_INVALID ||
			inst->core->state == VIDC_CORE_INVALID) {
		dprintk(VIDC_ERR,
			"Core %p in bad state, ignoring prepare buf\n",
				inst->core);
		goto exit;
	}

	switch (b->type) {
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		break;
@@ -817,6 +825,7 @@ int msm_vdec_prepare_buf(struct msm_vidc_inst *inst,
		dprintk(VIDC_ERR, "Buffer type not recognized: %d\n", b->type);
		break;
	}
exit:
	return rc;
}

+9 −0
Original line number Diff line number Diff line
@@ -3378,6 +3378,14 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,

	hdev = inst->core->device;

	if (inst->state == MSM_VIDC_CORE_INVALID ||
			inst->core->state == VIDC_CORE_INVALID) {
		dprintk(VIDC_ERR,
			"Core %p in bad state, ignoring prepare buf\n",
				inst->core);
		goto exit;
	}

	switch (b->type) {
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		break;
@@ -3423,6 +3431,7 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,
			"Buffer type not recognized: %d\n", b->type);
		break;
	}
exit:
	return rc;
}

+3 −12
Original line number Diff line number Diff line
@@ -1001,7 +1001,6 @@ exit:
static void handle_session_error(enum command_response cmd, void *data)
{
	struct msm_vidc_cb_cmd_done *response = data;
	int rc;
	struct hfi_device *hdev = NULL;
	struct msm_vidc_inst *inst = NULL;

@@ -1024,15 +1023,6 @@ static void handle_session_error(enum command_response cmd, void *data)
	dprintk(VIDC_WARN, "Session error received for session %p\n", inst);
	change_inst_state(inst, MSM_VIDC_CORE_INVALID);

	mutex_lock(&inst->lock);
	dprintk(VIDC_DBG, "cleaning up inst: %p\n", inst);
	rc = call_hfi_op(hdev, session_clean, inst->session);
	if (rc)
		dprintk(VIDC_ERR, "Session (%p) clean failed: %d\n", inst, rc);

	inst->session = NULL;
	mutex_unlock(&inst->lock);

	if (response->status == VIDC_ERR_MAX_CLIENTS) {
		dprintk(VIDC_WARN,
			"send max clients reached error to client: %p\n",
@@ -4235,8 +4225,9 @@ int msm_comm_kill_session(struct msm_vidc_inst *inst)
	 * the session send session_abort to firmware to clean up and release
	 * the session, else just kill the session inside the driver.
	 */
	if (inst->state >= MSM_VIDC_OPEN_DONE &&
			inst->state < MSM_VIDC_CLOSE_DONE) {
	if ((inst->state >= MSM_VIDC_OPEN_DONE &&
			inst->state < MSM_VIDC_CLOSE_DONE) ||
			inst->state == MSM_VIDC_CORE_INVALID) {
		rc = msm_comm_session_abort(inst);
		if (rc == -EBUSY) {
			msm_comm_generate_sys_error(inst);