summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorHuang Chaofan <chaofan.huang@nxp.com>2018-06-13 16:44:43 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitebbf7e64c7e75293c281d4bcfbb199046a969ee3 (patch)
tree564fe3e3bcbcb2c53438ba5caab2df6af1e008c3 /drivers/mxc
parent9a23e26d24f775062a56d6fe315befe89df61be6 (diff)
MLK-18604 VPU: Add multi-planar support for vpu encoder
Add multi-planar support for vpu encoder, and add more debug logs for vpu decoder Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/vpu-decoder-b0/vpu_b0.c7
-rw-r--r--drivers/mxc/vpu-encoder-b0/vpu_encoder_b0.c16
2 files changed, 16 insertions, 7 deletions
diff --git a/drivers/mxc/vpu-decoder-b0/vpu_b0.c b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
index adf474e7ce69..9c871f18a13c 100644
--- a/drivers/mxc/vpu-decoder-b0/vpu_b0.c
+++ b/drivers/mxc/vpu-decoder-b0/vpu_b0.c
@@ -866,10 +866,10 @@ static int v4l2_ioctl_streamoff(struct file *file,
i);
if (ctx->dev->hang_mask & (1 << ctx->str_index)) {
- vpu_dbg(LVL_ERR, "%s(): failed and some instance are blocked\n", __func__);
+ vpu_dbg(LVL_ERR, "%s(): not succeed and some instance are blocked\n", __func__);
return -EINVAL;
} else if (ctx->firmware_stopped) {
- vpu_dbg(LVL_ERR, "%s(): failed and firmware is stopped\n", __func__);
+ vpu_dbg(LVL_ERR, "%s(): not succeed and firmware is stopped\n", __func__);
return -EINVAL;
}
else
@@ -1403,7 +1403,7 @@ static void report_buffer_done(struct vpu_ctx *ctx, void *frame_info)
VB2_BUF_STATE_DONE
);
else
- vpu_dbg(LVL_ERR, "error: check buffer(%d) state(%d)\n", buffer_id, p_data_req->vb2_buf->state);
+ vpu_dbg(LVL_ERR, "warning: wait_rst_done(%d) check buffer(%d) state(%d)\n", ctx->wait_rst_done, buffer_id, p_data_req->vb2_buf->state);
up(&This->drv_q_lock);
vpu_dbg(LVL_INFO, "leave %s\n", __func__);
}
@@ -1763,6 +1763,7 @@ static void vpu_api_event_handler(struct vpu_ctx *ctx, u_int32 uStrIdx, u_int32
}
break;
case VID_API_EVENT_RES_CHANGE:
+ vpu_dbg(LVL_ERR, "warning: VID_API_EVENT_RES_CHANGE is not handled\n");
#if 0
{
const struct v4l2_event ev = {
diff --git a/drivers/mxc/vpu-encoder-b0/vpu_encoder_b0.c b/drivers/mxc/vpu-encoder-b0/vpu_encoder_b0.c
index 2ba0b3d13e40..c75d07bd3bcb 100644
--- a/drivers/mxc/vpu-encoder-b0/vpu_encoder_b0.c
+++ b/drivers/mxc/vpu-encoder-b0/vpu_encoder_b0.c
@@ -833,6 +833,8 @@ static bool update_yuv_addr(struct vpu_ctx *ctx, u_int32 uStrIdx)
#endif
pphy_address = (u_int32 *)vb2_plane_cookie(p_data_req->vb2_buf, 0);
pParamYuvBuffDesc->uLumaBase = *pphy_address;
+ pphy_address = (u_int32 *)vb2_plane_cookie(p_data_req->vb2_buf, 1);
+ pParamYuvBuffDesc->uChromaBase = *pphy_address;
/* Not sure what the test should be here for a valid frame return from vb2_plane_cookie */
if (pParamYuvBuffDesc->uLumaBase != 0)
bGotAFrame = TRUE;
@@ -1278,11 +1280,17 @@ static int vpu_queue_setup(struct vb2_queue *vq,
if ((vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) ||
(vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
) {
- *plane_count = 1;
- psize[0] = This->sizeimage[0];//check alignment
- } else {
*plane_count = 1;
- psize[0] = This->sizeimage[0] + This->sizeimage[1];
+ psize[0] = This->sizeimage[0];//check alignment
+ } else {
+ if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
+ *plane_count = 2;
+ psize[0] = This->sizeimage[0];//check alignment
+ psize[1] = This->sizeimage[1];//check colocated_size
+ } else {
+ psize[0] = This->sizeimage[0] + This->sizeimage[1];
+ *plane_count = 1;
+ }
}
return 0;
}