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

Commit f7047be1 authored by Sowmya Pandiri's avatar Sowmya Pandiri
Browse files

msm: vidc: Handle STREAMON failure in vidc driver



If start_streaming() fails due to some reason,
rc is getting overwritten and error is not propagated
to client resulting hang in driver.
This change fixes the issue for decoder/encoder use case.

Change-Id: Iefa045b3eae89b33717bc9a8ae5185a850a3a976
Signed-off-by: default avatarSowmya Pandiri <spandiri@codeaurora.org>
parent 31f8dcc9
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1832,8 +1832,8 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
		return -EINVAL;
	}
	hdev = inst->core->device;
	dprintk(VIDC_DBG,
		"Streamon called on: %d capability\n", q->type);
	dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %p\n",
		q->type, inst);
	switch (q->type) {
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		if (inst->bufq[CAPTURE_PORT].vb2_bufq.streaming)
@@ -1848,6 +1848,12 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
		rc = -EINVAL;
		goto stream_start_failed;
	}
	if (rc) {
		dprintk(VIDC_ERR,
			"Streamon failed on: %d capability for inst: %p\n",
			q->type, inst);
		goto stream_start_failed;
	}

	rc = msm_comm_qbuf(inst, NULL);
	if (rc) {
+8 −1
Original line number Diff line number Diff line
@@ -1561,7 +1561,8 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
		return -EINVAL;
	}
	inst = q->drv_priv;
	dprintk(VIDC_DBG, "Streamon called on: %d capability\n", q->type);
	dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %p\n",
		q->type, inst);
	switch (q->type) {
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		if (inst->bufq[CAPTURE_PORT].vb2_bufq.streaming)
@@ -1576,6 +1577,12 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
		rc = -EINVAL;
		goto stream_start_failed;
	}
	if (rc) {
		dprintk(VIDC_ERR,
			"Streamon failed on: %d capability for inst: %p\n",
			q->type, inst);
		goto stream_start_failed;
	}

	rc = msm_comm_qbuf(inst, NULL);
	if (rc) {