Lines Matching refs:vbuf
715 struct vb2_v4l2_buffer *vbuf; in vdec_frame_decoded() local
729 vbuf = &vpu_buf->m2m_buf.vb; in vdec_frame_decoded()
732 v4l2_m2m_buf_copy_metadata(src_buf, vbuf, true); in vdec_frame_decoded()
741 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_DECODED) in vdec_frame_decoded()
743 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_DECODED); in vdec_frame_decoded()
749 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_READY); in vdec_frame_decoded()
750 for (int i = 0; i < vbuf->vb2_buf.num_planes; i++) in vdec_frame_decoded()
751 vb2_set_plane_payload(&vbuf->vb2_buf, in vdec_frame_decoded()
753 vbuf->field = cur_fmt->field; in vdec_frame_decoded()
754 vbuf->sequence = vdec->sequence++; in vdec_frame_decoded()
755 dev_dbg(inst->dev, "[%d][OUTPUT TS]%32lld\n", inst->id, vbuf->vb2_buf.timestamp); in vdec_frame_decoded()
757 v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE); in vdec_frame_decoded()
786 struct vb2_v4l2_buffer *vbuf; in vdec_buf_done() local
808 vbuf = &vpu_buf->m2m_buf.vb; in vdec_buf_done()
809 if (vbuf->vb2_buf.index != frame->id) in vdec_buf_done()
811 inst->id, vbuf->vb2_buf.index, frame->id); in vdec_buf_done()
813 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_READY && vdec->params.display_delay_enable) in vdec_buf_done()
816 if (vpu_get_buffer_state(vbuf) != VPU_BUF_STATE_DECODED) in vdec_buf_done()
819 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_READY); in vdec_buf_done()
820 for (i = 0; i < vbuf->vb2_buf.num_planes; i++) in vdec_buf_done()
821 vb2_set_plane_payload(&vbuf->vb2_buf, i, vpu_get_fmt_plane_size(cur_fmt, i)); in vdec_buf_done()
822 vbuf->field = cur_fmt->field; in vdec_buf_done()
823 vbuf->sequence = vdec->sequence; in vdec_buf_done()
824 dev_dbg(inst->dev, "[%d][OUTPUT TS]%32lld\n", inst->id, vbuf->vb2_buf.timestamp); in vdec_buf_done()
826 v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE); in vdec_buf_done()
1038 static int vdec_response_frame(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf) in vdec_response_frame() argument
1054 if (!vbuf) in vdec_response_frame()
1057 if (vdec->slots[vbuf->vb2_buf.index]) { in vdec_response_frame()
1059 inst->id, vbuf->vb2_buf.index); in vdec_response_frame()
1064 inst->id, vpu_codec_state_name(inst->state), vbuf->vb2_buf.index, vdec->seq_tag); in vdec_response_frame()
1065 vpu_buf = to_vpu_vb2_buffer(vbuf); in vdec_response_frame()
1068 info.id = vbuf->vb2_buf.index; in vdec_response_frame()
1071 info.luma_addr = vpu_get_vb_phy_addr(&vbuf->vb2_buf, 0); in vdec_response_frame()
1073 if (vbuf->vb2_buf.num_planes > 1) in vdec_response_frame()
1074 info.chroma_addr = vpu_get_vb_phy_addr(&vbuf->vb2_buf, 1); in vdec_response_frame()
1087 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_INUSE); in vdec_response_frame()
1138 static void vdec_recycle_buffer(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf) in vdec_recycle_buffer() argument
1142 if (vbuf->vb2_buf.state != VB2_BUF_STATE_ACTIVE) in vdec_recycle_buffer()
1144 if (vpu_find_buf_by_idx(inst, vbuf->vb2_buf.type, vbuf->vb2_buf.index)) in vdec_recycle_buffer()
1146 v4l2_m2m_buf_queue(inst->fh.m2m_ctx, vbuf); in vdec_recycle_buffer()
1153 struct vb2_v4l2_buffer *vbuf; in vdec_clear_slots() local
1161 vbuf = &vpu_buf->m2m_buf.vb; in vdec_clear_slots()
1165 vdec_recycle_buffer(inst, vbuf); in vdec_clear_slots()
1269 struct vb2_v4l2_buffer *vbuf; in vdec_evnet_rel_fs() local
1290 vbuf = &vpu_buf->m2m_buf.vb; in vdec_evnet_rel_fs()
1291 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_DECODED) { in vdec_evnet_rel_fs()
1297 if (vpu_get_buffer_state(vbuf) != VPU_BUF_STATE_READY) in vdec_evnet_rel_fs()
1298 vdec_recycle_buffer(inst, vbuf); in vdec_evnet_rel_fs()
1300 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_IDLE); in vdec_evnet_rel_fs()
1351 struct vb2_v4l2_buffer *vbuf; in vdec_process_output() local
1356 vbuf = to_vb2_v4l2_buffer(vb); in vdec_process_output()
1358 inst->id, vbuf->sequence, vb->index, vb2_get_plane_payload(vb, 0)); in vdec_process_output()
1376 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_INUSE); in vdec_process_output()
1393 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in vdec_process_capture() local
1401 ret = vdec_response_frame(inst, vbuf); in vdec_process_capture()
1404 v4l2_m2m_dst_buf_remove_by_buf(inst->fh.m2m_ctx, vbuf); in vdec_process_capture()