[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02a3a834-efce-e87d-6e1d-ffe21015509e@gmail.com>
Date: Fri, 3 Feb 2017 10:49:41 -0800
From: Steve Longerbeam <slongerbeam@...il.com>
To: Russell King - ARM Linux <linux@...linux.org.uk>
Cc: mark.rutland@....com, andrew-ct.chen@...iatek.com,
minghsiu.tsai@...iatek.com, nick@...anahar.org,
songjun.wu@...rochip.com, hverkuil@...all.nl,
Steve Longerbeam <steve_longerbeam@...tor.com>,
robert.jarzmik@...e.fr, devel@...verdev.osuosl.org,
markus.heiser@...marIT.de,
laurent.pinchart+renesas@...asonboard.com, geert@...ux-m68k.org,
linux-media@...r.kernel.org, devicetree@...r.kernel.org,
kernel@...gutronix.de, arnd@...db.de, mchehab@...nel.org,
bparrot@...com, robh+dt@...nel.org, horms+renesas@...ge.net.au,
tiffany.lin@...iatek.com, linux-arm-kernel@...ts.infradead.org,
niklas.soderlund+renesas@...natech.se, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, jean-christophe.trotin@...com,
p.zabel@...gutronix.de, fabio.estevam@....com, shawnguo@...nel.org,
sudipm.mukherjee@...il.com
Subject: Re: [PATCH v3 00/24] i.MX Media Driver
On 02/02/2017 02:29 PM, Russell King - ARM Linux wrote:
> On Thu, Feb 02, 2017 at 11:12:41AM -0800, Steve Longerbeam wrote:
>> Here is the current .queue_setup() op in imx-media-capture.c:
>>
>> static int capture_queue_setup(struct vb2_queue *vq,
>> unsigned int *nbuffers,
>> unsigned int *nplanes,
>> unsigned int sizes[],
>> struct device *alloc_devs[])
>> {
>> struct capture_priv *priv = vb2_get_drv_priv(vq);
>> struct v4l2_pix_format *pix = &priv->vdev.fmt.fmt.pix;
>> unsigned int count = *nbuffers;
>>
>> if (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
>> return -EINVAL;
>>
>> if (*nplanes) {
>> if (*nplanes != 1 || sizes[0] < pix->sizeimage)
>> return -EINVAL;
>> count += vq->num_buffers;
>> }
>>
>> while (pix->sizeimage * count > VID_MEM_LIMIT)
>> count--;
> That's a weird way of writing:
>
> unsigned int max_num = VID_MEM_LIMIT / pix->sizeimage;
> count = max(count, max_num);
I think you mean min() there, but yes thanks, fixed.
Steve
Powered by blists - more mailing lists