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

Commit a91776ae authored by Praveen Kumar Dwivedi's avatar Praveen Kumar Dwivedi Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Do a proper clean-up in case of session abort



A ctrl-c while the venus session is on causes WARN_ON
from function __vb2_queue_cancel. This fix will ensure that
all buffers are returned to vb2 when a stream off is called.
Also there is no need to process release reference event in
the case of session stop.

Change-Id: Id7bf05a17efe237791ad17585d04b59a16bd76d8
Signed-off-by: default avatarPraveen Kumar Dwivedi <pkd@codeaurora.org>
parent 1cbd1cdf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -847,6 +847,14 @@ int msm_vdec_streamoff(struct msm_vidc_inst *inst, enum v4l2_buf_type i)
		return -EINVAL;
	}
	dprintk(VIDC_DBG, "Calling streamoff\n");

	if (!inst->in_reconfig) {
		rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE);
		if (rc)
			dprintk(VIDC_ERR,
			"Failed to move inst: %pK to res done state\n", inst);
	}

	mutex_lock(&q->lock);
	rc = vb2_streamoff(&q->vb2_bufq, i);
	mutex_unlock(&q->lock);
+6 −0
Original line number Diff line number Diff line
@@ -4620,6 +4620,12 @@ int msm_venc_streamoff(struct msm_vidc_inst *inst, enum v4l2_buf_type i)
		return -EINVAL;
	}
	dprintk(VIDC_DBG, "Calling streamoff on port: %d\n", i);

	rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE);
	if (rc)
		dprintk(VIDC_ERR,
			"Failed to move inst: %pK to res done state\n", inst);

	mutex_lock(&q->lock);
	rc = vb2_streamoff(&q->vb2_bufq, i);
	mutex_unlock(&q->lock);
+1 −1
Original line number Diff line number Diff line
@@ -1179,7 +1179,7 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
				__func__, inst, &event_notify->packet_buffer,
				&event_notify->extra_data_buffer);

		if (inst->state == MSM_VIDC_CORE_INVALID ||
		if (inst->state >= MSM_VIDC_STOP ||
				inst->core->state == VIDC_CORE_INVALID) {
			dprintk(VIDC_DBG,
					"Event release buf ref received in invalid state - discard\n");