summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorHuang Chaofan <chaofan.huang@nxp.com>2018-06-29 16:42:43 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit6454f6a4a06075cfa117560b6135115cbbbb5567 (patch)
treec9d67ab86c8a5033cae50f777c2f1dae3a12544e /drivers/mxc
parent3d0ccbb3a01d893600536d4ded4cecdecee89aae (diff)
MLK-18717 VPU: Add judge when v4l2 function return error and print the
error value Add judge when v4l2 function return error and print the error value Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/vpu-decoder-b0/vpu_b0.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/mxc/vpu-decoder-b0/vpu_b0.c b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
index 797b6493a623..b4fd623f185f 100644
--- a/drivers/mxc/vpu-decoder-b0/vpu_b0.c
+++ b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
@@ -627,7 +627,7 @@ static int v4l2_ioctl_reqbufs(struct file *file,
}
}
} else if (reqbuf->count != 0)
- vpu_dbg(LVL_ERR, "error: %s() can't request (%d) buffer\n", __func__, reqbuf->count);
+ vpu_dbg(LVL_ERR, "error: %s() can't request (%d) buffer ret=%d\n", __func__, reqbuf->count, ret);
return ret;
}
@@ -660,7 +660,8 @@ static int v4l2_ioctl_querybuf(struct file *file,
} else
buf->m.offset |= (q_data->type << MMAP_BUF_TYPE_SHIFT);
}
- }
+ } else
+ vpu_dbg(LVL_ERR, "error: %s() return ret=%d\n", __func__, ret);
return ret;
}
@@ -685,9 +686,12 @@ static int v4l2_ioctl_qbuf(struct file *file,
return -EINVAL;
ret = vb2_qbuf(&q_data->vb2_q, buf);
- if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
- wake_up_interruptible(&ctx->buffer_wq);
- v4l2_update_stream_addr(ctx, 0);
+ if (!ret) {
+ if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ wake_up_interruptible(&ctx->buffer_wq);
+ v4l2_update_stream_addr(ctx, 0);
+ } else
+ vpu_dbg(LVL_ERR, "error: %s() return ret=%d\n", __func__, ret);
return ret;
}
@@ -712,14 +716,17 @@ static int v4l2_ioctl_dqbuf(struct file *file,
ret = vb2_dqbuf(&q_data->vb2_q, buf, file->f_flags & O_NONBLOCK);
- if (q_data->vb2_reqs[buf->index].bfield)
- buf->field = V4L2_FIELD_INTERLACED;
- else
- buf->field = V4L2_FIELD_NONE;
- v4l2_update_stream_addr(ctx, 0);
- if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
- if ((ctx->pSeqinfo->uBitDepthLuma > 8) || (ctx->pSeqinfo->uBitDepthChroma > 8))
- buf->reserved = 1;
+ if (!ret) {
+ if (q_data->vb2_reqs[buf->index].bfield)
+ buf->field = V4L2_FIELD_INTERLACED;
+ else
+ buf->field = V4L2_FIELD_NONE;
+ v4l2_update_stream_addr(ctx, 0);
+ if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ if ((ctx->pSeqinfo->uBitDepthLuma > 8) || (ctx->pSeqinfo->uBitDepthChroma > 8))
+ buf->reserved = 1;
+ } else
+ vpu_dbg(LVL_ERR, "error: %s() return ret=%d\n", __func__, ret);
return ret;
}
@@ -828,10 +835,13 @@ static int v4l2_ioctl_streamon(struct file *file,
ctx->firmware_finished = false;
ret = vb2_streamon(&q_data->vb2_q, i);
- if (i == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
- wake_up_interruptible(&ctx->buffer_wq);
+ if (!ret) {
+ if (i == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ wake_up_interruptible(&ctx->buffer_wq);
- v4l2_update_stream_addr(ctx, 0);
+ v4l2_update_stream_addr(ctx, 0);
+ } else
+ vpu_dbg(LVL_ERR, "error: %s() return ret=%d\n", __func__, ret);
return ret;
}