RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Hans, > This patch is all messed up and doesn't apply. > > Check your mailer settings: it clearly replaced hard tabs by a space. > > Can you repost? I tried to find out if I can change the mailer settings. Seems, that is the problem. I tried using mutt, but, seems the configuration is missing. If you have a simple method, on using mutt, I will send it from there, as, mutt is respecting the TAB spaces. I didn't spend much time with it for time being. Regards, Divneil -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Why dont you use git send-email ? On Mon, Jul 21, 2014 at 8:03 AM, Divneil Wadhawan wrote: > > Hi Hans, > >> This patch is all messed up and doesn't apply. >> >> Check your mailer settings: it clearly replaced hard tabs by a space. >> >> Can you repost? > > I tried to find out if I can change the mailer settings. Seems, that is the > problem. > > > I tried using mutt, but, seems the configuration is missing. > > If you have a simple method, on using mutt, I will send it from there, as, > mutt is respecting the TAB spaces. > > I didn't spend much time with it for time being. > > > Regards, > > Divneil -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Ricardo Ribalda -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Divneil, On 05/07/14 11:37, Divneil Wadhawan wrote: > Hi, > > > I have a driver which is MUXING out data taking in multiple inputs. > > It has been found in certain cases, at the minimum 40 buffers are > required to be queued before it could MUX out anything. > > Currently, VIDEO_MAX_FRAME is restricting the max size to 32. This > can be over-ridden in driver queue_setup, but, it is making it > mandatory to use always a particular count. So, it takes the > independence from application to allocate any count> 32. > > So, is it okay to revise this limit or introduce a new queue->depth > variable which could be used in conjuction with VIDEO_MAX_FRAME to > determine the num_buffers. Hmm, I always wondered when this would happen. The right approach would be to add a VB2_MAX_FRAME define to videobuf2-core.h and use that in any v4l2 driver that uses videobuf2. VIDEO_MAX_FRAME really shouldn't be in a public API, but I don't think we can remove it since it's been there for ages. The maximum number of frames is really a property of vb2 (and the older videobuf, but I don't want to tamper with that) and as such it would be no problem increasing it to 64. In theory we could make the number of maximum frames driver specific, but it would be more trouble than it's worth at the moment IMHO. If we ever get drivers that need more than 64 buffers, then we can always reconsider. Which driver are you using? Is it something that you or someone else is likely to upstream to the linux kernel? Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Hans > Hmm, I always wondered when this would happen. :) > In theory we could make the number of maximum frames driver specific, but > it would be more trouble than it's worth at the moment IMHO. You mean to say adding a new field in struct vb2_queue. Hmm, I will nod yes, because, the requirement for me is no more than 64. > Which driver are you using? Is it something that you or someone else is > likely to upstream to the linux kernel? It's again TSMUXER. There are new data types defined, and some other stuff. I cannot commit on this, however, I am currently seeing this driver. Regards, Divneil -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
On 05/07/14 13:26, Divneil Wadhawan wrote: > Hi Hans > >> Hmm, I always wondered when this would happen. > > :) > > >> In theory we could make the number of maximum frames driver specific, but >> it would be more trouble than it's worth at the moment IMHO. > > You mean to say adding a new field in struct vb2_queue. No, just add a VB2_MAX_FRAME define and use that everywhere in vb2 and any driver depending on vb2 instead of VIDEO_MAX_FRAME. The VIDEO_MAX_FRAME define is used for vb2 internal array sizes, and those need to be increased. So replacing VIDEO_MAX_FRAME by VB2_MAX_FRAME is the easiest approach. Regards, Hans > Hmm, I will nod yes, because, the requirement for me is no more than 64. > > >> Which driver are you using? Is it something that you or someone else is >> likely to upstream to the linux kernel? > It's again TSMUXER. There are new data types defined, and some other stuff. > > I cannot commit on this, however, I am currently seeing this driver. > > > Regards, > > Divneil > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Hans, Can you please give some update on this. Is it okay or not? Regards, Divneil > From: divn...@outlook.com > To: hverk...@xs4all.nl; linux-media@vger.kernel.org > Subject: RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME > Date: Mon, 12 May 2014 17:30:41 +0530 > > Hi Hans, > > Please find below the patch. I hope its okay and the way of sending too. > I have only touched filed which were vb2 based in my understanding. > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
On 05/12/2014 01:38 PM, Divneil Wadhawan wrote: > Hi Hans, > > Please find attached the patch. I hope its okay. > I have only touched filed which were vb2 based in my understanding. > > Yeah! I was referring to the define as it's the easier way and also > fulfilling my use case. > However, I am looking forward for queue->depth kind of approach where driver > can specify its own choice for max buffers. > > Regards, > Divneil > PS: I was on travel, hence the delay. Sorry for the delay, I missed your patch. It looks good, but you need to update a few more files: include/media/davinci/vpfe_capture.h drivers/media/platform/vivi-core.c drivers/media/pci/saa7134/* Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Hans, > include/media/davinci/vpfe_capture.h It uses videobuf-dma-contig.h, so, I left it out. > drivers/media/platform/vivi-core.c Cannot find this one. Checked with find, in case it changed location, but couldn't. > drivers/media/pci/saa7134/* Updated. Please find below the patch. I am hoping it's good to go. Regards, Divneil >From 1792d75dc0f893a181d991a0b238bbd0ead945c1 Mon Sep 17 00:00:00 2001 From: Divneil Wadhawan Date: Mon, 7 Jul 2014 12:38:06 +0530 Subject: [PATCH] v4l2: vb2: replace VIDEO_MAX_FRAME with VB2_MAX_FRAME - vb2 drivers to rely on VB2_MAX_FRAME. - VB2_MAX_FRAME bumps the value to 64 from current 32 Change-Id: I3d7998898df43553486166c44b54524aac449deb Signed-off-by: Divneil Wadhawan --- drivers/media/pci/saa7134/saa7134-ts.c|4 ++-- drivers/media/pci/saa7134/saa7134-vbi.c |4 ++-- drivers/media/pci/saa7134/saa7134-video.c |2 +- drivers/media/platform/mem2mem_testdev.c |2 +- drivers/media/platform/ti-vpe/vpe.c |2 +- drivers/media/v4l2-core/videobuf2-core.c |8 include/media/videobuf2-core.h|4 +++- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/media/pci/saa7134/saa7134-ts.c b/drivers/media/pci/saa7134/saa7134-ts.c index bd25323..0d04995 100644 --- a/drivers/media/pci/saa7134/saa7134-ts.c +++ b/drivers/media/pci/saa7134/saa7134-ts.c @@ -227,8 +227,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) /* sanitycheck insmod options */ if (tsbufs < 2) tsbufs = 2; - if (tsbufs> VIDEO_MAX_FRAME) - tsbufs = VIDEO_MAX_FRAME; + if (tsbufs> VB2_MAX_FRAME) + tsbufs = VB2_MAX_FRAME; if (ts_nr_packets < 4) ts_nr_packets = 4; if (ts_nr_packets> 312) diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c b/drivers/media/pci/saa7134/saa7134-vbi.c index c06dbe1..15b5860 100644 --- a/drivers/media/pci/saa7134/saa7134-vbi.c +++ b/drivers/media/pci/saa7134/saa7134-vbi.c @@ -203,8 +203,8 @@ int saa7134_vbi_init1(struct saa7134_dev *dev) if (vbibufs < 2) vbibufs = 2; - if (vbibufs> VIDEO_MAX_FRAME) - vbibufs = VIDEO_MAX_FRAME; + if (vbibufs> VB2_MAX_FRAME) + vbibufs = VB2_MAX_FRAME; return 0; } diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index d375999..47dda6c 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -2032,7 +2032,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) int ret; /* sanitycheck insmod options */ - if (gbuffers < 2 || gbuffers> VIDEO_MAX_FRAME) + if (gbuffers < 2 || gbuffers> VB2_MAX_FRAME) gbuffers = 2; if (gbufsize> gbufsize_max) gbufsize = gbufsize_max; diff --git a/drivers/media/platform/mem2mem_testdev.c b/drivers/media/platform/mem2mem_testdev.c index 0714070..fe3235d 100644 --- a/drivers/media/platform/mem2mem_testdev.c +++ b/drivers/media/platform/mem2mem_testdev.c @@ -55,7 +55,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); #define MEM2MEM_NAME "m2m-testdev" /* Per queue */ -#define MEM2MEM_DEF_NUM_BUFS VIDEO_MAX_FRAME +#define MEM2MEM_DEF_NUM_BUFS VB2_MAX_FRAME /* In bytes, per queue */ #define MEM2MEM_VID_MEM_LIMIT (16 * 1024 * 1024) diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index 972f43f..6b370ed 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c @@ -1970,7 +1970,7 @@ static const struct v4l2_ctrl_config vpe_bufs_per_job = { .type = V4L2_CTRL_TYPE_INTEGER, .def = VPE_DEF_BUFS_PER_JOB, .min = 1, - .max = VIDEO_MAX_FRAME, + .max = VB2_MAX_FRAME, .step = 1, }; diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 7c4489c..09bc9bb 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -904,7 +904,7 @@ static int __reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) /* * Make sure the requested values and current defaults are sane. */ - num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME); + num_buffers = min_t(unsigned int, req->count, VB2_MAX_FRAME); num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); memset(q->plane_sizes, 0, sizeof(q->plane_sizes)); memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); @@ -1005,7 +1005,7 @@ static int __create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create unsigned int num_planes = 0, num_buffers, allocated_buffers; int ret; - if (q->num_buffers == VIDEO_MAX_FRAME) { + if (q->num_buffers == VB2_MAX_FRAME) { dprintk(1, "maximum number of buffers already allocated\n"); return -ENOBUFS; } @@ -1016,7 +1016,7 @@ static int __create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create q->memory = create->memory; } - num_buffers = min(create->count, VIDEO_MAX_FRAME - q->num_buffers); + num_buffers = min(create->count, VB2_MAX_FRAME - q->num_buffers); /* * Ask the driver, whether
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
On 07/07/2014 09:27 AM, Divneil Wadhawan wrote: > Hi Hans, > > >> include/media/davinci/vpfe_capture.h > > It uses videobuf-dma-contig.h, so, I left it out. Ah, you are right. I thought that one was converted to vb2, but it isn't. > > >> drivers/media/platform/vivi-core.c > > Cannot find this one. Checked with find, in case it changed location, but > couldn't. Sorry, my mistake. I'm working on the vivi driver and I'm actually the one who introduced VIDEO_MAX_FRAME there. But since that isn't committed yet you can't find it either :-) > > >> drivers/media/pci/saa7134/* > > Updated. > > > Please find below the patch. I am hoping it's good to go. I'll take a look at it. Regards, Hans > > > Regards, > > Divneil > > > From 1792d75dc0f893a181d991a0b238bbd0ead945c1 Mon Sep 17 00:00:00 2001 > From: Divneil Wadhawan > Date: Mon, 7 Jul 2014 12:38:06 +0530 > Subject: [PATCH] v4l2: vb2: replace VIDEO_MAX_FRAME with VB2_MAX_FRAME > > - vb2 drivers to rely on VB2_MAX_FRAME. > > - VB2_MAX_FRAME bumps the value to 64 from current 32 > > Change-Id: I3d7998898df43553486166c44b54524aac449deb > Signed-off-by: Divneil Wadhawan > --- > drivers/media/pci/saa7134/saa7134-ts.c|4 ++-- > drivers/media/pci/saa7134/saa7134-vbi.c |4 ++-- > drivers/media/pci/saa7134/saa7134-video.c |2 +- > drivers/media/platform/mem2mem_testdev.c |2 +- > drivers/media/platform/ti-vpe/vpe.c |2 +- > drivers/media/v4l2-core/videobuf2-core.c |8 > include/media/videobuf2-core.h|4 +++- > 7 files changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/pci/saa7134/saa7134-ts.c > b/drivers/media/pci/saa7134/saa7134-ts.c > index bd25323..0d04995 100644 > --- a/drivers/media/pci/saa7134/saa7134-ts.c > +++ b/drivers/media/pci/saa7134/saa7134-ts.c > @@ -227,8 +227,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) > /* sanitycheck insmod options */ > if (tsbufs < 2) >tsbufs = 2; > - if (tsbufs> VIDEO_MAX_FRAME) > - tsbufs = VIDEO_MAX_FRAME; > + if (tsbufs> VB2_MAX_FRAME) > + tsbufs = VB2_MAX_FRAME; > if (ts_nr_packets < 4) >ts_nr_packets = 4; > if (ts_nr_packets> 312) > diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c > b/drivers/media/pci/saa7134/saa7134-vbi.c > index c06dbe1..15b5860 100644 > --- a/drivers/media/pci/saa7134/saa7134-vbi.c > +++ b/drivers/media/pci/saa7134/saa7134-vbi.c > @@ -203,8 +203,8 @@ int saa7134_vbi_init1(struct saa7134_dev *dev) > > if (vbibufs < 2) >vbibufs = 2; > - if (vbibufs> VIDEO_MAX_FRAME) > - vbibufs = VIDEO_MAX_FRAME; > + if (vbibufs> VB2_MAX_FRAME) > + vbibufs = VB2_MAX_FRAME; > return 0; > } > > diff --git a/drivers/media/pci/saa7134/saa7134-video.c > b/drivers/media/pci/saa7134/saa7134-video.c > index d375999..47dda6c 100644 > --- a/drivers/media/pci/saa7134/saa7134-video.c > +++ b/drivers/media/pci/saa7134/saa7134-video.c > @@ -2032,7 +2032,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) > int ret; > > /* sanitycheck insmod options */ > - if (gbuffers < 2 || gbuffers> VIDEO_MAX_FRAME) > + if (gbuffers < 2 || gbuffers> VB2_MAX_FRAME) >gbuffers = 2; > if (gbufsize> gbufsize_max) >gbufsize = gbufsize_max; > diff --git a/drivers/media/platform/mem2mem_testdev.c > b/drivers/media/platform/mem2mem_testdev.c > index 0714070..fe3235d 100644 > --- a/drivers/media/platform/mem2mem_testdev.c > +++ b/drivers/media/platform/mem2mem_testdev.c > @@ -55,7 +55,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); > #define MEM2MEM_NAME "m2m-testdev" > > /* Per queue */ > -#define MEM2MEM_DEF_NUM_BUFS VIDEO_MAX_FRAME > +#define MEM2MEM_DEF_NUM_BUFS VB2_MAX_FRAME > /* In bytes, per queue */ > #define MEM2MEM_VID_MEM_LIMIT (16 * 1024 * 1024) > > diff --git a/drivers/media/platform/ti-vpe/vpe.c > b/drivers/media/platform/ti-vpe/vpe.c > index 972f43f..6b370ed 100644 > --- a/drivers/media/platform/ti-vpe/vpe.c > +++ b/drivers/media/platform/ti-vpe/vpe.c > @@ -1970,7 +1970,7 @@ static const struct v4l2_ctrl_config vpe_bufs_per_job = > { > .type = V4L2_CTRL_TYPE_INTEGER, > .def = VPE_DEF_BUFS_PER_JOB, > .min = 1, > - .max = VIDEO_MAX_FRAME, > + .max = VB2_MAX_FRAME, > .step = 1, > }; > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c > b/drivers/media/v4l2-core/videobuf2-core.c > index 7c4489c..09bc9bb 100644 > --- a/drivers/media/v4l2-core/videobuf2-core.c > +++ b/drivers/media/v4l2-core/videobuf2-core.c > @@ -904,7 +904,7 @@ static int __reqbufs(struct vb2_queue *q, struct > v4l2_requestbuffers *req) > /* >* Make sure the requested values and current defaults are sane. >*/ > - num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME); > + num_buffers = min_t(unsigned int, req->count, VB2_MAX_FRAME); > num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); > memset(q->plane_sizes, 0, sizeof(q->plane_sizes)); > memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); > @@ -1005,7 +1005,7 @@ static int __crea
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
On 07/07/2014 09:27 AM, Divneil Wadhawan wrote: > Hi Hans, > > >> include/media/davinci/vpfe_capture.h > > It uses videobuf-dma-contig.h, so, I left it out. > > >> drivers/media/platform/vivi-core.c > > Cannot find this one. Checked with find, in case it changed location, but > couldn't. > > >> drivers/media/pci/saa7134/* > > Updated. > > > Please find below the patch. I am hoping it's good to go. Acked-by: Hans Verkuil Pawel, Kamil, can you take a look as well? To my knowledge there drivers/media/platform/s5p-mfc is the only one that uses the buffer index as a bit index (1 << v4l2_buf.index), but that driver has its own maximum buffer limit of 32 so it should not be affected by this patch. Regards, Hans > > > Regards, > > Divneil > > > From 1792d75dc0f893a181d991a0b238bbd0ead945c1 Mon Sep 17 00:00:00 2001 > From: Divneil Wadhawan > Date: Mon, 7 Jul 2014 12:38:06 +0530 > Subject: [PATCH] v4l2: vb2: replace VIDEO_MAX_FRAME with VB2_MAX_FRAME > > - vb2 drivers to rely on VB2_MAX_FRAME. > > - VB2_MAX_FRAME bumps the value to 64 from current 32 > > Change-Id: I3d7998898df43553486166c44b54524aac449deb > Signed-off-by: Divneil Wadhawan > --- > drivers/media/pci/saa7134/saa7134-ts.c|4 ++-- > drivers/media/pci/saa7134/saa7134-vbi.c |4 ++-- > drivers/media/pci/saa7134/saa7134-video.c |2 +- > drivers/media/platform/mem2mem_testdev.c |2 +- > drivers/media/platform/ti-vpe/vpe.c |2 +- > drivers/media/v4l2-core/videobuf2-core.c |8 > include/media/videobuf2-core.h|4 +++- > 7 files changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/pci/saa7134/saa7134-ts.c > b/drivers/media/pci/saa7134/saa7134-ts.c > index bd25323..0d04995 100644 > --- a/drivers/media/pci/saa7134/saa7134-ts.c > +++ b/drivers/media/pci/saa7134/saa7134-ts.c > @@ -227,8 +227,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) > /* sanitycheck insmod options */ > if (tsbufs < 2) >tsbufs = 2; > - if (tsbufs> VIDEO_MAX_FRAME) > - tsbufs = VIDEO_MAX_FRAME; > + if (tsbufs> VB2_MAX_FRAME) > + tsbufs = VB2_MAX_FRAME; > if (ts_nr_packets < 4) >ts_nr_packets = 4; > if (ts_nr_packets> 312) > diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c > b/drivers/media/pci/saa7134/saa7134-vbi.c > index c06dbe1..15b5860 100644 > --- a/drivers/media/pci/saa7134/saa7134-vbi.c > +++ b/drivers/media/pci/saa7134/saa7134-vbi.c > @@ -203,8 +203,8 @@ int saa7134_vbi_init1(struct saa7134_dev *dev) > > if (vbibufs < 2) >vbibufs = 2; > - if (vbibufs> VIDEO_MAX_FRAME) > - vbibufs = VIDEO_MAX_FRAME; > + if (vbibufs> VB2_MAX_FRAME) > + vbibufs = VB2_MAX_FRAME; > return 0; > } > > diff --git a/drivers/media/pci/saa7134/saa7134-video.c > b/drivers/media/pci/saa7134/saa7134-video.c > index d375999..47dda6c 100644 > --- a/drivers/media/pci/saa7134/saa7134-video.c > +++ b/drivers/media/pci/saa7134/saa7134-video.c > @@ -2032,7 +2032,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) > int ret; > > /* sanitycheck insmod options */ > - if (gbuffers < 2 || gbuffers> VIDEO_MAX_FRAME) > + if (gbuffers < 2 || gbuffers> VB2_MAX_FRAME) >gbuffers = 2; > if (gbufsize> gbufsize_max) >gbufsize = gbufsize_max; > diff --git a/drivers/media/platform/mem2mem_testdev.c > b/drivers/media/platform/mem2mem_testdev.c > index 0714070..fe3235d 100644 > --- a/drivers/media/platform/mem2mem_testdev.c > +++ b/drivers/media/platform/mem2mem_testdev.c > @@ -55,7 +55,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); > #define MEM2MEM_NAME "m2m-testdev" > > /* Per queue */ > -#define MEM2MEM_DEF_NUM_BUFS VIDEO_MAX_FRAME > +#define MEM2MEM_DEF_NUM_BUFS VB2_MAX_FRAME > /* In bytes, per queue */ > #define MEM2MEM_VID_MEM_LIMIT (16 * 1024 * 1024) > > diff --git a/drivers/media/platform/ti-vpe/vpe.c > b/drivers/media/platform/ti-vpe/vpe.c > index 972f43f..6b370ed 100644 > --- a/drivers/media/platform/ti-vpe/vpe.c > +++ b/drivers/media/platform/ti-vpe/vpe.c > @@ -1970,7 +1970,7 @@ static const struct v4l2_ctrl_config vpe_bufs_per_job = > { > .type = V4L2_CTRL_TYPE_INTEGER, > .def = VPE_DEF_BUFS_PER_JOB, > .min = 1, > - .max = VIDEO_MAX_FRAME, > + .max = VB2_MAX_FRAME, > .step = 1, > }; > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c > b/drivers/media/v4l2-core/videobuf2-core.c > index 7c4489c..09bc9bb 100644 > --- a/drivers/media/v4l2-core/videobuf2-core.c > +++ b/drivers/media/v4l2-core/videobuf2-core.c > @@ -904,7 +904,7 @@ static int __reqbufs(struct vb2_queue *q, struct > v4l2_requestbuffers *req) > /* >* Make sure the requested values and current defaults are sane. >*/ > - num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME); > + num_buffers = min_t(unsigned int, req->count, VB2_MAX_FRAME); > num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); > memset(q->plane_sizes, 0, sizeof(q->plane_sizes)); > memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); > @@ -1005,7 +1005
RE: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Hans, > From: Hans Verkuil [mailto:hverk...@xs4all.nl] > Sent: Tuesday, July 08, 2014 9:52 AM > To: Divneil Wadhawan; linux-media@vger.kernel.org; Kamil Debski; > pa...@osciak.com > Subject: Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME > > On 07/07/2014 09:27 AM, Divneil Wadhawan wrote: > > Hi Hans, > > > > > >> include/media/davinci/vpfe_capture.h > > > > It uses videobuf-dma-contig.h, so, I left it out. > > > > > >> drivers/media/platform/vivi-core.c > > > > Cannot find this one. Checked with find, in case it changed location, > but couldn't. > > > > > >> drivers/media/pci/saa7134/* > > > > Updated. > > > > > > Please find below the patch. I am hoping it's good to go. > > Acked-by: Hans Verkuil > > Pawel, Kamil, can you take a look as well? > > To my knowledge there drivers/media/platform/s5p-mfc is the only one > that uses > the buffer index as a bit index (1 << v4l2_buf.index), but that driver > has > its own maximum buffer limit of 32 so it should not be affected by this > patch. Yes, MFC has a hardware limit of 32 buffers. It will not be affected by this patch as it uses internal #define MFC_MAX_BUFFERS 32. Best wishes, -- Kamil Debski Samsung R&D Institute Poland > Regards, > > Hans > > > > > > > Regards, > > > > Divneil > > > > > > From 1792d75dc0f893a181d991a0b238bbd0ead945c1 Mon Sep 17 00:00:00 > 2001 > > From: Divneil Wadhawan > > Date: Mon, 7 Jul 2014 12:38:06 +0530 > > Subject: [PATCH] v4l2: vb2: replace VIDEO_MAX_FRAME with > VB2_MAX_FRAME > > > > - vb2 drivers to rely on VB2_MAX_FRAME. > > > > - VB2_MAX_FRAME bumps the value to 64 from current 32 > > > > Change-Id: I3d7998898df43553486166c44b54524aac449deb > > Signed-off-by: Divneil Wadhawan > > --- > > drivers/media/pci/saa7134/saa7134-ts.c|4 ++-- > > drivers/media/pci/saa7134/saa7134-vbi.c |4 ++-- > > drivers/media/pci/saa7134/saa7134-video.c |2 +- > > drivers/media/platform/mem2mem_testdev.c |2 +- > > drivers/media/platform/ti-vpe/vpe.c |2 +- > > drivers/media/v4l2-core/videobuf2-core.c |8 > > include/media/videobuf2-core.h|4 +++- > > 7 files changed, 14 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/media/pci/saa7134/saa7134-ts.c > b/drivers/media/pci/saa7134/saa7134-ts.c > > index bd25323..0d04995 100644 > > --- a/drivers/media/pci/saa7134/saa7134-ts.c > > +++ b/drivers/media/pci/saa7134/saa7134-ts.c > > @@ -227,8 +227,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) > > /* sanitycheck insmod options */ > > if (tsbufs < 2) > >tsbufs = 2; > > - if (tsbufs> VIDEO_MAX_FRAME) > > - tsbufs = VIDEO_MAX_FRAME; > > + if (tsbufs> VB2_MAX_FRAME) > > + tsbufs = VB2_MAX_FRAME; > > if (ts_nr_packets < 4) > >ts_nr_packets = 4; > > if (ts_nr_packets> 312) > > diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c > b/drivers/media/pci/saa7134/saa7134-vbi.c > > index c06dbe1..15b5860 100644 > > --- a/drivers/media/pci/saa7134/saa7134-vbi.c > > +++ b/drivers/media/pci/saa7134/saa7134-vbi.c > > @@ -203,8 +203,8 @@ int saa7134_vbi_init1(struct saa7134_dev *dev) > > > > if (vbibufs < 2) > >vbibufs = 2; > > - if (vbibufs> VIDEO_MAX_FRAME) > > - vbibufs = VIDEO_MAX_FRAME; > > + if (vbibufs> VB2_MAX_FRAME) > > + vbibufs = VB2_MAX_FRAME; > > return 0; > > } > > > > diff --git a/drivers/media/pci/saa7134/saa7134-video.c > b/drivers/media/pci/saa7134/saa7134-video.c > > index d375999..47dda6c 100644 > > --- a/drivers/media/pci/saa7134/saa7134-video.c > > +++ b/drivers/media/pci/saa7134/saa7134-video.c > > @@ -2032,7 +2032,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) > > int ret; > > > > /* sanitycheck insmod options */ > > - if (gbuffers < 2 || gbuffers> VIDEO_MAX_FRAME) > > + if (gbuffers < 2 || gbuffers> VB2_MAX_FRAME) > >gbuffers = 2; > > if (gbufsize> gbufsize_max) > >gbufsize = gbufsize_max; > > diff --git a/drivers/media/platform/mem2mem_testdev.c > b/drivers/media/platform/mem2mem_testdev.c > > index 0714070..fe3235d 100644 > > --- a/drivers/media/platform/mem2mem_testdev.c > > +++ b/drivers/media/platform/mem2mem_testdev.c > > @@ -55,7 +55,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); > > #define MEM2MEM_NAME "m2m-testdev" > > &
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
Hi Divneil, This patch is all messed up and doesn't apply. Check your mailer settings: it clearly replaced hard tabs by a space. Can you repost? Regards, Hans On 07/07/2014 09:27 AM, Divneil Wadhawan wrote: > Hi Hans, > > >> include/media/davinci/vpfe_capture.h > > It uses videobuf-dma-contig.h, so, I left it out. > > >> drivers/media/platform/vivi-core.c > > Cannot find this one. Checked with find, in case it changed location, but > couldn't. > > >> drivers/media/pci/saa7134/* > > Updated. > > > Please find below the patch. I am hoping it's good to go. > > > Regards, > > Divneil > > > From 1792d75dc0f893a181d991a0b238bbd0ead945c1 Mon Sep 17 00:00:00 2001 > From: Divneil Wadhawan > Date: Mon, 7 Jul 2014 12:38:06 +0530 > Subject: [PATCH] v4l2: vb2: replace VIDEO_MAX_FRAME with VB2_MAX_FRAME > > - vb2 drivers to rely on VB2_MAX_FRAME. > > - VB2_MAX_FRAME bumps the value to 64 from current 32 > > Change-Id: I3d7998898df43553486166c44b54524aac449deb > Signed-off-by: Divneil Wadhawan > --- > drivers/media/pci/saa7134/saa7134-ts.c|4 ++-- > drivers/media/pci/saa7134/saa7134-vbi.c |4 ++-- > drivers/media/pci/saa7134/saa7134-video.c |2 +- > drivers/media/platform/mem2mem_testdev.c |2 +- > drivers/media/platform/ti-vpe/vpe.c |2 +- > drivers/media/v4l2-core/videobuf2-core.c |8 > include/media/videobuf2-core.h|4 +++- > 7 files changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/pci/saa7134/saa7134-ts.c > b/drivers/media/pci/saa7134/saa7134-ts.c > index bd25323..0d04995 100644 > --- a/drivers/media/pci/saa7134/saa7134-ts.c > +++ b/drivers/media/pci/saa7134/saa7134-ts.c > @@ -227,8 +227,8 @@ int saa7134_ts_init1(struct saa7134_dev *dev) > /* sanitycheck insmod options */ > if (tsbufs < 2) >tsbufs = 2; > - if (tsbufs> VIDEO_MAX_FRAME) > - tsbufs = VIDEO_MAX_FRAME; > + if (tsbufs> VB2_MAX_FRAME) > + tsbufs = VB2_MAX_FRAME; > if (ts_nr_packets < 4) >ts_nr_packets = 4; > if (ts_nr_packets> 312) > diff --git a/drivers/media/pci/saa7134/saa7134-vbi.c > b/drivers/media/pci/saa7134/saa7134-vbi.c > index c06dbe1..15b5860 100644 > --- a/drivers/media/pci/saa7134/saa7134-vbi.c > +++ b/drivers/media/pci/saa7134/saa7134-vbi.c > @@ -203,8 +203,8 @@ int saa7134_vbi_init1(struct saa7134_dev *dev) > > if (vbibufs < 2) >vbibufs = 2; > - if (vbibufs> VIDEO_MAX_FRAME) > - vbibufs = VIDEO_MAX_FRAME; > + if (vbibufs> VB2_MAX_FRAME) > + vbibufs = VB2_MAX_FRAME; > return 0; > } > > diff --git a/drivers/media/pci/saa7134/saa7134-video.c > b/drivers/media/pci/saa7134/saa7134-video.c > index d375999..47dda6c 100644 > --- a/drivers/media/pci/saa7134/saa7134-video.c > +++ b/drivers/media/pci/saa7134/saa7134-video.c > @@ -2032,7 +2032,7 @@ int saa7134_video_init1(struct saa7134_dev *dev) > int ret; > > /* sanitycheck insmod options */ > - if (gbuffers < 2 || gbuffers> VIDEO_MAX_FRAME) > + if (gbuffers < 2 || gbuffers> VB2_MAX_FRAME) >gbuffers = 2; > if (gbufsize> gbufsize_max) >gbufsize = gbufsize_max; > diff --git a/drivers/media/platform/mem2mem_testdev.c > b/drivers/media/platform/mem2mem_testdev.c > index 0714070..fe3235d 100644 > --- a/drivers/media/platform/mem2mem_testdev.c > +++ b/drivers/media/platform/mem2mem_testdev.c > @@ -55,7 +55,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); > #define MEM2MEM_NAME "m2m-testdev" > > /* Per queue */ > -#define MEM2MEM_DEF_NUM_BUFS VIDEO_MAX_FRAME > +#define MEM2MEM_DEF_NUM_BUFS VB2_MAX_FRAME > /* In bytes, per queue */ > #define MEM2MEM_VID_MEM_LIMIT (16 * 1024 * 1024) > > diff --git a/drivers/media/platform/ti-vpe/vpe.c > b/drivers/media/platform/ti-vpe/vpe.c > index 972f43f..6b370ed 100644 > --- a/drivers/media/platform/ti-vpe/vpe.c > +++ b/drivers/media/platform/ti-vpe/vpe.c > @@ -1970,7 +1970,7 @@ static const struct v4l2_ctrl_config vpe_bufs_per_job = > { > .type = V4L2_CTRL_TYPE_INTEGER, > .def = VPE_DEF_BUFS_PER_JOB, > .min = 1, > - .max = VIDEO_MAX_FRAME, > + .max = VB2_MAX_FRAME, > .step = 1, > }; > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c > b/drivers/media/v4l2-core/videobuf2-core.c > index 7c4489c..09bc9bb 100644 > --- a/drivers/media/v4l2-core/videobuf2-core.c > +++ b/drivers/media/v4l2-core/videobuf2-core.c > @@ -904,7 +904,7 @@ static int __reqbufs(struct vb2_queue *q, struct > v4l2_requestbuffers *req) > /* >* Make sure the requested values and current defaults are sane. >*/ > - num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME); > + num_buffers = min_t(unsigned int, req->count, VB2_MAX_FRAME); > num_buffers = max_t(unsigned int, num_buffers, q->min_buffers_needed); > memset(q->plane_sizes, 0, sizeof(q->plane_sizes)); > memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx)); > @@ -1005,7 +1005,7 @@ static int __create_bufs(struct vb2_queue *q, struct > v4l2_create_buffers *create > unsigned int num_planes = 0, num_buffers, allocated_buffers;
Re: vb2_reqbufs() is not allowing more than VIDEO_MAX_FRAME
On 07/21/2014 08:03 AM, Divneil Wadhawan wrote: > > Hi Hans, > >> This patch is all messed up and doesn't apply. >> >> Check your mailer settings: it clearly replaced hard tabs by a space. >> >> Can you repost? > > I tried to find out if I can change the mailer settings. Seems, that is the > problem. > > > I tried using mutt, but, seems the configuration is missing. > > If you have a simple method, on using mutt, I will send it from there, as, > mutt is respecting the TAB spaces. > > I didn't spend much time with it for time being. Ping? If you really can't get your mailer to behave, then mail it as an attachment. Regards, Hans > > > Regards, > > Divneil -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html