Commit 171fe6d1 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab

[media] media: davinci_vpfe: set minimum required buffers to three

this patch sets nbuffers to three or more and drops the
unset member video_limit which just a copy paste from
earlier driver.
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 694f9963
...@@ -67,8 +67,6 @@ struct vpfe_device { ...@@ -67,8 +67,6 @@ struct vpfe_device {
/* CCDC IRQs used when CCDC/ISIF output to SDRAM */ /* CCDC IRQs used when CCDC/ISIF output to SDRAM */
unsigned int ccdc_irq0; unsigned int ccdc_irq0;
unsigned int ccdc_irq1; unsigned int ccdc_irq1;
/* maximum video memory that is available*/
unsigned int video_limit;
/* media device */ /* media device */
struct media_device media_dev; struct media_device media_dev;
/* ccdc subdevice */ /* ccdc subdevice */
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
#include "vpfe.h" #include "vpfe.h"
#include "vpfe_mc_capture.h" #include "vpfe_mc_capture.h"
/* minimum number of buffers needed in cont-mode */
#define MIN_NUM_BUFFERS 3
static int debug; static int debug;
/* get v4l2 subdev pointer to external subdev which is active */ /* get v4l2 subdev pointer to external subdev which is active */
...@@ -1088,20 +1085,14 @@ vpfe_buffer_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt, ...@@ -1088,20 +1085,14 @@ vpfe_buffer_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt,
struct vpfe_fh *fh = vb2_get_drv_priv(vq); struct vpfe_fh *fh = vb2_get_drv_priv(vq);
struct vpfe_video_device *video = fh->video; struct vpfe_video_device *video = fh->video;
struct vpfe_device *vpfe_dev = video->vpfe_dev; struct vpfe_device *vpfe_dev = video->vpfe_dev;
struct vpfe_pipeline *pipe = &video->pipe;
unsigned long size; unsigned long size;
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_buffer_queue_setup\n"); v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_buffer_queue_setup\n");
size = video->fmt.fmt.pix.sizeimage; size = video->fmt.fmt.pix.sizeimage;
if (vpfe_dev->video_limit) { if (vq->num_buffers + *nbuffers < 3)
while (size * *nbuffers > vpfe_dev->video_limit) *nbuffers = 3 - vq->num_buffers;
(*nbuffers)--;
}
if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) {
if (*nbuffers < MIN_NUM_BUFFERS)
*nbuffers = MIN_NUM_BUFFERS;
}
*nplanes = 1; *nplanes = 1;
sizes[0] = size; sizes[0] = size;
alloc_ctxs[0] = video->alloc_ctx; alloc_ctxs[0] = video->alloc_ctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment