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

Commit df5936a4 authored by Abdulla Anam's avatar Abdulla Anam
Browse files

msm: vidc: Add state checks for start streaming



Add state checks for vdec & venc start_streaming. Also if prepare
buf hits the state check against INVALID state after in vdec &
venc layer, return an error.

Change-Id: I177ea6197710adf193d04befd4dd7115fc90a897
Signed-off-by: default avatarAbdulla Anam <abdullahanam@codeaurora.org>
parent 75a9d0fe
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -872,7 +872,7 @@ int msm_vdec_prepare_buf(struct msm_vidc_inst *inst,
		dprintk(VIDC_ERR,
			"Core %pK in bad state, ignoring prepare buf\n",
				inst->core);
		goto exit;
		return -EINVAL;
	}

	switch (b->type) {
@@ -925,7 +925,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;
}

@@ -1777,6 +1777,12 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
		dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
		return -EINVAL;
	}

	if (inst->state == MSM_VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_UNINIT)
		return -EINVAL;

	hdev = inst->core->device;
	dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %pK\n",
		q->type, inst);
+8 −2
Original line number Diff line number Diff line
@@ -1903,6 +1903,12 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
		return -EINVAL;
	}
	inst = q->drv_priv;

	if (inst->state == MSM_VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_INVALID ||
		inst->core->state == VIDC_CORE_UNINIT)
		return -EINVAL;

	dprintk(VIDC_DBG, "Streamon called on: %d capability for inst: %pK\n",
		q->type, inst);
	switch (q->type) {
@@ -4425,7 +4431,7 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,
		dprintk(VIDC_ERR,
			"Core %pK in bad state, ignoring prepare buf\n",
				inst->core);
		goto exit;
		return -EINVAL;
	}

	switch (b->type) {
@@ -4473,7 +4479,7 @@ int msm_venc_prepare_buf(struct msm_vidc_inst *inst,
			"Buffer type not recognized: %d\n", b->type);
		break;
	}
exit:

	return rc;
}