media: amphion: Stop direct calls to queue num_buffers field
Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> CC: Ming Qian <ming.qian@nxp.com> CC: Zhou Peng <eagle.zhou@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
e03bcb2898
commit
1be718477f
@ -87,7 +87,7 @@ static int vpu_dbg_instance(struct seq_file *s, void *data)
|
||||
num = scnprintf(str, sizeof(str),
|
||||
"output (%2d, %2d): fmt = %c%c%c%c %d x %d, %d;",
|
||||
vb2_is_streaming(vq),
|
||||
vq->num_buffers,
|
||||
vb2_get_num_buffers(vq),
|
||||
inst->out_format.pixfmt,
|
||||
inst->out_format.pixfmt >> 8,
|
||||
inst->out_format.pixfmt >> 16,
|
||||
@ -111,7 +111,7 @@ static int vpu_dbg_instance(struct seq_file *s, void *data)
|
||||
num = scnprintf(str, sizeof(str),
|
||||
"capture(%2d, %2d): fmt = %c%c%c%c %d x %d, %d;",
|
||||
vb2_is_streaming(vq),
|
||||
vq->num_buffers,
|
||||
vb2_get_num_buffers(vq),
|
||||
inst->cap_format.pixfmt,
|
||||
inst->cap_format.pixfmt >> 8,
|
||||
inst->cap_format.pixfmt >> 16,
|
||||
@ -139,7 +139,7 @@ static int vpu_dbg_instance(struct seq_file *s, void *data)
|
||||
return 0;
|
||||
|
||||
vq = v4l2_m2m_get_src_vq(inst->fh.m2m_ctx);
|
||||
for (i = 0; i < vq->num_buffers; i++) {
|
||||
for (i = 0; i < vb2_get_num_buffers(vq); i++) {
|
||||
struct vb2_buffer *vb;
|
||||
struct vb2_v4l2_buffer *vbuf;
|
||||
|
||||
@ -161,7 +161,7 @@ static int vpu_dbg_instance(struct seq_file *s, void *data)
|
||||
}
|
||||
|
||||
vq = v4l2_m2m_get_dst_vq(inst->fh.m2m_ctx);
|
||||
for (i = 0; i < vq->num_buffers; i++) {
|
||||
for (i = 0; i < vb2_get_num_buffers(vq); i++) {
|
||||
struct vb2_buffer *vb;
|
||||
struct vb2_v4l2_buffer *vbuf;
|
||||
|
||||
|
@ -439,7 +439,7 @@ int vpu_get_num_buffers(struct vpu_inst *inst, u32 type)
|
||||
else
|
||||
q = v4l2_m2m_get_dst_vq(inst->fh.m2m_ctx);
|
||||
|
||||
return q->num_buffers;
|
||||
return vb2_get_num_buffers(q);
|
||||
}
|
||||
|
||||
static void vpu_m2m_device_run(void *priv)
|
||||
@ -587,7 +587,7 @@ static int vpu_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
fmt->sizeimage[0], fmt->bytesperline[0],
|
||||
fmt->sizeimage[1], fmt->bytesperline[1],
|
||||
fmt->sizeimage[2], fmt->bytesperline[2],
|
||||
q->num_buffers);
|
||||
vb2_get_num_buffers(q));
|
||||
vb2_clear_last_buffer_dequeued(q);
|
||||
ret = call_vop(inst, start, q->type);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user