Lines Matching refs:vbuf

713 	struct vb2_v4l2_buffer *vbuf;  in vdec_frame_decoded()  local
727 vbuf = &vpu_buf->m2m_buf.vb; in vdec_frame_decoded()
730 v4l2_m2m_buf_copy_metadata(src_buf, vbuf, true); in vdec_frame_decoded()
739 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_DECODED) in vdec_frame_decoded()
741 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_DECODED); in vdec_frame_decoded()
747 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_READY); in vdec_frame_decoded()
748 for (int i = 0; i < vbuf->vb2_buf.num_planes; i++) in vdec_frame_decoded()
749 vb2_set_plane_payload(&vbuf->vb2_buf, in vdec_frame_decoded()
751 vbuf->field = cur_fmt->field; in vdec_frame_decoded()
752 vbuf->sequence = vdec->sequence++; in vdec_frame_decoded()
753 dev_dbg(inst->dev, "[%d][OUTPUT TS]%32lld\n", inst->id, vbuf->vb2_buf.timestamp); in vdec_frame_decoded()
755 v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE); in vdec_frame_decoded()
784 struct vb2_v4l2_buffer *vbuf; in vdec_buf_done() local
806 vbuf = &vpu_buf->m2m_buf.vb; in vdec_buf_done()
807 if (vbuf->vb2_buf.index != frame->id) in vdec_buf_done()
809 inst->id, vbuf->vb2_buf.index, frame->id); in vdec_buf_done()
811 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_READY && vdec->params.display_delay_enable) in vdec_buf_done()
814 if (vpu_get_buffer_state(vbuf) != VPU_BUF_STATE_DECODED) in vdec_buf_done()
817 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_READY); in vdec_buf_done()
818 for (i = 0; i < vbuf->vb2_buf.num_planes; i++) in vdec_buf_done()
819 vb2_set_plane_payload(&vbuf->vb2_buf, i, vpu_get_fmt_plane_size(cur_fmt, i)); in vdec_buf_done()
820 vbuf->field = cur_fmt->field; in vdec_buf_done()
821 vbuf->sequence = vdec->sequence; in vdec_buf_done()
822 dev_dbg(inst->dev, "[%d][OUTPUT TS]%32lld\n", inst->id, vbuf->vb2_buf.timestamp); in vdec_buf_done()
824 v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_DONE); in vdec_buf_done()
1036 static int vdec_response_frame(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf) in vdec_response_frame() argument
1052 if (!vbuf) in vdec_response_frame()
1055 if (vdec->slots[vbuf->vb2_buf.index]) { in vdec_response_frame()
1057 inst->id, vbuf->vb2_buf.index); in vdec_response_frame()
1062 inst->id, vpu_codec_state_name(inst->state), vbuf->vb2_buf.index, vdec->seq_tag); in vdec_response_frame()
1063 vpu_buf = to_vpu_vb2_buffer(vbuf); in vdec_response_frame()
1066 info.id = vbuf->vb2_buf.index; in vdec_response_frame()
1069 info.luma_addr = vpu_get_vb_phy_addr(&vbuf->vb2_buf, 0); in vdec_response_frame()
1071 if (vbuf->vb2_buf.num_planes > 1) in vdec_response_frame()
1072 info.chroma_addr = vpu_get_vb_phy_addr(&vbuf->vb2_buf, 1); in vdec_response_frame()
1085 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_INUSE); in vdec_response_frame()
1136 static void vdec_recycle_buffer(struct vpu_inst *inst, struct vb2_v4l2_buffer *vbuf) in vdec_recycle_buffer() argument
1140 if (vbuf->vb2_buf.state != VB2_BUF_STATE_ACTIVE) in vdec_recycle_buffer()
1142 if (vpu_find_buf_by_idx(inst, vbuf->vb2_buf.type, vbuf->vb2_buf.index)) in vdec_recycle_buffer()
1144 v4l2_m2m_buf_queue(inst->fh.m2m_ctx, vbuf); in vdec_recycle_buffer()
1151 struct vb2_v4l2_buffer *vbuf; in vdec_clear_slots() local
1159 vbuf = &vpu_buf->m2m_buf.vb; in vdec_clear_slots()
1163 vdec_recycle_buffer(inst, vbuf); in vdec_clear_slots()
1267 struct vb2_v4l2_buffer *vbuf; in vdec_evnet_rel_fs() local
1288 vbuf = &vpu_buf->m2m_buf.vb; in vdec_evnet_rel_fs()
1289 if (vpu_get_buffer_state(vbuf) == VPU_BUF_STATE_DECODED) { in vdec_evnet_rel_fs()
1295 if (vpu_get_buffer_state(vbuf) != VPU_BUF_STATE_READY) in vdec_evnet_rel_fs()
1296 vdec_recycle_buffer(inst, vbuf); in vdec_evnet_rel_fs()
1298 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_IDLE); in vdec_evnet_rel_fs()
1349 struct vb2_v4l2_buffer *vbuf; in vdec_process_output() local
1354 vbuf = to_vb2_v4l2_buffer(vb); in vdec_process_output()
1356 inst->id, vbuf->sequence, vb->index, vb2_get_plane_payload(vb, 0)); in vdec_process_output()
1374 vpu_set_buffer_state(vbuf, VPU_BUF_STATE_INUSE); in vdec_process_output()
1391 struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); in vdec_process_capture() local
1399 ret = vdec_response_frame(inst, vbuf); in vdec_process_capture()
1402 v4l2_m2m_dst_buf_remove_by_buf(inst->fh.m2m_ctx, vbuf); in vdec_process_capture()