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

Commit 059fd2cf 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: Update VB2 buffer state during stream_on failure"

parents fdc3087c 8ff60ca8
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1767,6 +1767,7 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
	struct msm_vidc_inst *inst;
	int rc = 0;
	struct hfi_device *hdev;
	struct vb2_buffer *vb;
	struct vb2_buf_entry *temp, *next;
	if (!q || !q->drv_priv) {
		dprintk(VIDC_ERR, "Invalid input, q = %pK\n", q);
@@ -1791,8 +1792,7 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
		break;
	default:
		dprintk(VIDC_ERR, "Queue type is not supported: %d\n", q->type);
		rc = -EINVAL;
		goto stream_start_failed;
		return -EINVAL;
	}
	if (rc) {
		dprintk(VIDC_ERR,
@@ -1811,12 +1811,15 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)

stream_start_failed:
	if (rc) {
		list_for_each_entry(vb, &q->queued_list, queued_entry) {
			if (vb->type == q->type &&
					vb->state == VB2_BUF_STATE_ACTIVE)
				vb2_buffer_done(vb, VB2_BUF_STATE_QUEUED);
		}
		mutex_lock(&inst->pendingq.lock);
		list_for_each_entry_safe(temp, next, &inst->pendingq.list,
			list) {
		list_for_each_entry_safe(temp, next,
				&inst->pendingq.list, list) {
			if (temp->vb->type == q->type) {
				vb2_buffer_done(temp->vb,
					VB2_BUF_STATE_QUEUED);
				list_del(&temp->list);
				kfree(temp);
			}
+10 −6
Original line number Diff line number Diff line
@@ -1897,7 +1897,9 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
{
	struct msm_vidc_inst *inst;
	int rc = 0;
	struct vb2_buffer *vb;
	struct vb2_buf_entry *temp, *next;

	if (!q || !q->drv_priv) {
		dprintk(VIDC_ERR, "Invalid input, q = %pK\n", q);
		return -EINVAL;
@@ -1916,8 +1918,7 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)
		break;
	default:
		dprintk(VIDC_ERR, "Queue type is not supported: %d\n", q->type);
		rc = -EINVAL;
		goto stream_start_failed;
		return  -EINVAL;
	}
	if (rc) {
		dprintk(VIDC_ERR,
@@ -1936,12 +1937,15 @@ static int msm_venc_start_streaming(struct vb2_queue *q, unsigned int count)

stream_start_failed:
	if (rc) {
		list_for_each_entry(vb, &q->queued_list, queued_entry) {
			if (vb->type == q->type &&
					vb->state == VB2_BUF_STATE_ACTIVE)
				vb2_buffer_done(vb, VB2_BUF_STATE_QUEUED);
		}
		mutex_lock(&inst->pendingq.lock);
		list_for_each_entry_safe(temp, next, &inst->pendingq.list,
			list) {
		list_for_each_entry_safe(temp, next,
				&inst->pendingq.list, list) {
			if (temp->vb->type == q->type) {
				vb2_buffer_done(temp->vb,
					VB2_BUF_STATE_QUEUED);
				list_del(&temp->list);
				kfree(temp);
			}