Commit 54bc85e8 authored by Ezequiel Garcia's avatar Ezequiel Garcia

rockchip/vpu: support requests

Change-Id: I0074d9f37560e30b5e85c0d468d6475b7fce4167
Signed-off-by: Ezequiel Garcia's avatarEzequiel Garcia <ezequiel@collabora.com>
parent 9047c326
......@@ -634,6 +634,7 @@ static void rockchip_vpu_stop_streaming(struct vb2_queue *q)
vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
if (!vbuf)
break;
v4l2_ctrl_request_complete(vbuf->vb2_buf.req_obj.req, &ctx->ctrl_handler);
v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
}
}
......
......@@ -180,6 +180,7 @@ dec_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
src_vq->lock = &ctx->dev->vpu_mutex;
src_vq->dev = ctx->dev->v4l2_dev.dev;
src_vq->supports_requests = true;
ret = vb2_queue_init(src_vq);
if (ret)
......@@ -483,6 +484,11 @@ static const struct of_device_id of_rockchip_vpu_match[] = {
};
MODULE_DEVICE_TABLE(of, of_rockchip_vpu_match);
static const struct media_device_ops rockchip_m2m_media_ops = {
.req_validate = vb2_request_validate,
.req_queue = v4l2_m2m_request_queue,
};
static int rockchip_vpu_video_device_register(struct rockchip_vpu_dev *vpu,
struct v4l2_m2m_dev *m2m_dev,
enum rockchip_vpu_type type)
......@@ -639,6 +645,7 @@ static int rockchip_vpu_probe(struct platform_device *pdev)
vpu->mdev.dev = vpu->dev;
strlcpy(vpu->mdev.model, DRIVER_NAME, sizeof(vpu->mdev.model));
media_device_init(&vpu->mdev);
vpu->mdev.ops = &rockchip_m2m_media_ops;
vpu->v4l2_dev.mdev = &vpu->mdev;
if (vpu->variant->enc_fmts) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment