.. | .. |
---|
257 | 257 | struct hva_ctx *ctx = fh_to_ctx(file->private_data); |
---|
258 | 258 | struct hva_dev *hva = ctx_to_hdev(ctx); |
---|
259 | 259 | |
---|
260 | | - strlcpy(cap->driver, HVA_NAME, sizeof(cap->driver)); |
---|
261 | | - strlcpy(cap->card, hva->vdev->name, sizeof(cap->card)); |
---|
| 260 | + strscpy(cap->driver, HVA_NAME, sizeof(cap->driver)); |
---|
| 261 | + strscpy(cap->card, hva->vdev->name, sizeof(cap->card)); |
---|
262 | 262 | snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", |
---|
263 | 263 | hva->pdev->name); |
---|
264 | 264 | |
---|
.. | .. |
---|
566 | 566 | */ |
---|
567 | 567 | struct vb2_queue *vq; |
---|
568 | 568 | struct hva_stream *stream; |
---|
| 569 | + struct vb2_buffer *vb2_buf; |
---|
569 | 570 | |
---|
570 | 571 | vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type); |
---|
571 | 572 | |
---|
.. | .. |
---|
575 | 576 | return -EINVAL; |
---|
576 | 577 | } |
---|
577 | 578 | |
---|
578 | | - stream = (struct hva_stream *)vq->bufs[buf->index]; |
---|
| 579 | + vb2_buf = vb2_get_buffer(vq, buf->index); |
---|
| 580 | + stream = to_hva_stream(to_vb2_v4l2_buffer(vb2_buf)); |
---|
579 | 581 | stream->bytesused = buf->bytesused; |
---|
580 | 582 | } |
---|
581 | 583 | |
---|
.. | .. |
---|
1085 | 1087 | |
---|
1086 | 1088 | if ((V4L2_TYPE_IS_OUTPUT(vq->type) && |
---|
1087 | 1089 | vb2_is_streaming(&ctx->fh.m2m_ctx->cap_q_ctx.q)) || |
---|
1088 | | - (!V4L2_TYPE_IS_OUTPUT(vq->type) && |
---|
| 1090 | + (V4L2_TYPE_IS_CAPTURE(vq->type) && |
---|
1089 | 1091 | vb2_is_streaming(&ctx->fh.m2m_ctx->out_q_ctx.q))) { |
---|
1090 | 1092 | dev_dbg(dev, "%s %s out=%d cap=%d\n", |
---|
1091 | 1093 | ctx->name, to_type_str(vq->type), |
---|
.. | .. |
---|
1314 | 1316 | snprintf(vdev->name, sizeof(vdev->name), "%s%lx", HVA_NAME, |
---|
1315 | 1317 | hva->ip_version); |
---|
1316 | 1318 | |
---|
1317 | | - ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); |
---|
| 1319 | + ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1); |
---|
1318 | 1320 | if (ret) { |
---|
1319 | 1321 | dev_err(dev, "%s failed to register video device\n", |
---|
1320 | 1322 | HVA_PREFIX); |
---|