summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-09-13 18:59:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-09-13 18:59:43 -0700
commit4b449078dbaa109259e0ab8fd856fb988d1ba258 (patch)
treea6ca9652aaef3bb9942fa3115384265ee154ef4c
parent1a0b5a7c618d229d280c324c863ce667cf0a962a (diff)
parenta91776ae442542400d998f1a2b631a1a26207c3d (diff)
Merge "msm: vidc: Do a proper clean-up in case of session abort"
-rw-r--r--drivers/media/platform/msm/vidc/msm_vdec.c8
-rw-r--r--drivers/media/platform/msm/vidc/msm_venc.c6
-rw-r--r--drivers/media/platform/msm/vidc/msm_vidc_common.c2
3 files changed, 15 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c
index 78cced2abd47..c80f535d95e1 100644
--- a/drivers/media/platform/msm/vidc/msm_vdec.c
+++ b/drivers/media/platform/msm/vidc/msm_vdec.c
@@ -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);
diff --git a/drivers/media/platform/msm/vidc/msm_venc.c b/drivers/media/platform/msm/vidc/msm_venc.c
index e4698e0cdcd8..947ade9c99ed 100644
--- a/drivers/media/platform/msm/vidc/msm_venc.c
+++ b/drivers/media/platform/msm/vidc/msm_venc.c
@@ -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);
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index 1d910f4b235c..4cb8f92c4e38 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -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");