From 171fe6d1270d535eae798e4b5acc9f5d25e6e17e Mon Sep 17 00:00:00 2001 From: "Lad, Prabhakar" Date: Mon, 25 May 2015 12:34:28 -0300 Subject: [PATCH] [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: Lad, Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- .../staging/media/davinci_vpfe/vpfe_mc_capture.h | 2 -- drivers/staging/media/davinci_vpfe/vpfe_video.c | 15 +++------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h index 2632a806c4a8..8ad8d743f4e0 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h +++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.h @@ -67,8 +67,6 @@ struct vpfe_device { /* CCDC IRQs used when CCDC/ISIF output to SDRAM */ unsigned int ccdc_irq0; unsigned int ccdc_irq1; - /* maximum video memory that is available*/ - unsigned int video_limit; /* media device */ struct media_device media_dev; /* ccdc subdevice */ diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index 06d48d5eb0a0..674419286a93 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -27,9 +27,6 @@ #include "vpfe.h" #include "vpfe_mc_capture.h" -/* minimum number of buffers needed in cont-mode */ -#define MIN_NUM_BUFFERS 3 - static int debug; /* 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, struct vpfe_fh *fh = vb2_get_drv_priv(vq); struct vpfe_video_device *video = fh->video; struct vpfe_device *vpfe_dev = video->vpfe_dev; - struct vpfe_pipeline *pipe = &video->pipe; unsigned long size; v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_buffer_queue_setup\n"); size = video->fmt.fmt.pix.sizeimage; - if (vpfe_dev->video_limit) { - while (size * *nbuffers > vpfe_dev->video_limit) - (*nbuffers)--; - } - if (pipe->state == VPFE_PIPELINE_STREAM_CONTINUOUS) { - if (*nbuffers < MIN_NUM_BUFFERS) - *nbuffers = MIN_NUM_BUFFERS; - } + if (vq->num_buffers + *nbuffers < 3) + *nbuffers = 3 - vq->num_buffers; + *nplanes = 1; sizes[0] = size; alloc_ctxs[0] = video->alloc_ctx;