diff options
author | Benjamin Gaignard <benjamin.gaignard@collabora.com> | 2023-11-09 19:34:54 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-11-23 14:35:37 +0300 |
commit | ff2560f0263ab30e8ed4bec13495dce050e5d8cc (patch) | |
tree | 306efe107481e207ee6b1fdea2ce164e396123a1 /drivers/media/platform/ti/davinci/vpif_display.c | |
parent | 36e3faf99f825fd9d975ae0bf96d93e4da1d732f (diff) | |
download | linux-ff2560f0263ab30e8ed4bec13495dce050e5d8cc.tar.xz |
media: ti: 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: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Reviewed-by: Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/ti/davinci/vpif_display.c')
-rw-r--r-- | drivers/media/platform/ti/davinci/vpif_display.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/ti/davinci/vpif_display.c b/drivers/media/platform/ti/davinci/vpif_display.c index f8ec2991c667..9dbab1003c1d 100644 --- a/drivers/media/platform/ti/davinci/vpif_display.c +++ b/drivers/media/platform/ti/davinci/vpif_display.c @@ -115,6 +115,7 @@ static int vpif_buffer_queue_setup(struct vb2_queue *vq, struct channel_obj *ch = vb2_get_drv_priv(vq); struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; unsigned size = common->fmt.fmt.pix.sizeimage; + unsigned int q_num_bufs = vb2_get_num_buffers(vq); if (*nplanes) { if (sizes[0] < size) @@ -122,8 +123,8 @@ static int vpif_buffer_queue_setup(struct vb2_queue *vq, size = sizes[0]; } - if (vq->num_buffers + *nbuffers < 3) - *nbuffers = 3 - vq->num_buffers; + if (q_num_bufs + *nbuffers < 3) + *nbuffers = 3 - q_num_bufs; *nplanes = 1; sizes[0] = size; |