why does aptina_pll_calculate insist on exact division?

2018-08-14 Thread Helmut Grohne
Hi, I tried using the aptina_pll_calculate for a "new" imager and ran into problems. After filling out aptina_pll_limits from the data sheet, I was having a hard time finding a valid pix_clock. Most of the ones I tried are rejected by aptina_pll_calculate for various reasons. In particular, no

Re: [PATCHv17 29/34] v4l2-mem2mem: add vb2_m2m_request_queue

2018-08-14 Thread Hans Verkuil
On 13/08/18 17:02, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:21 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> For mem2mem devices we have to make sure that v4l2_m2m_try_schedule() >> is called whenever a request is queued. >> >> We do that by creating a

Re: [PATCHv17 34/34] RFC: media-requests: add debugfs node

2018-08-14 Thread Hans Verkuil
On 13/08/18 17:15, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:26 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> Keep track of the number of requests and request objects of a media >> device. Helps to verify that all request-related memory is freed. >> >>

Re: [PATCHv17 30/34] vim2m: use workqueue

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 09:28:42 +0200 Hans Verkuil escreveu: > On 13/08/18 17:05, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:22 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> v4l2_ctrl uses mutexes, so we can't setup a ctrl_handler in > >> interrupt

Re: [PATCHv17 26/34] videobuf2-v4l2: add vb2_request_queue/validate helpers

2018-08-14 Thread Hans Verkuil
On 13/08/18 16:53, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:18 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> The generic vb2_request_validate helper function checks if >> there are buffers in the request and if so, prepares (validates) >> all objects in the

Re: [PATCHv17 34/34] RFC: media-requests: add debugfs node

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 09:33:16 +0200 Hans Verkuil escreveu: > On 13/08/18 17:15, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:26 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> Keep track of the number of requests and request objects of a media > >>

Re: [PATCHv17 01/34] Documentation: v4l: document request API

2018-08-14 Thread Hans Verkuil
On 09/08/18 19:43, Mauro Carvalho Chehab wrote: >> diff --git a/Documentation/media/uapi/v4l/vidioc-qbuf.rst >> b/Documentation/media/uapi/v4l/vidioc-qbuf.rst >> index 9e448a4aa3aa..0e415f2551b2 100644 >> --- a/Documentation/media/uapi/v4l/vidioc-qbuf.rst >> +++

Re: [PATCHv17 08/34] v4l2-dev: lock req_queue_mutex

2018-08-14 Thread Mauro Carvalho Chehab
Em Fri, 10 Aug 2018 09:39:20 +0200 Hans Verkuil escreveu: > On 08/09/2018 10:03 PM, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:00 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> We need to serialize streamon/off with queueing new requests. > >> These

Re: [PATCHv17 30/34] vim2m: use workqueue

2018-08-14 Thread Hans Verkuil
On 13/08/18 17:05, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:22 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> v4l2_ctrl uses mutexes, so we can't setup a ctrl_handler in >> interrupt context. Switch to a workqueue instead and drop the timer. >> >> Signed-off-by:

Re: why does aptina_pll_calculate insist on exact division?

2018-08-14 Thread Laurent Pinchart
Hi Helmut, (CC'ing Sakari Ailus who is our current PLL expert after spending so much time on the SMIA PLL code) On Tuesday, 14 August 2018 09:35:40 EEST Helmut Grohne wrote: > Hi, > > I tried using the aptina_pll_calculate for a "new" imager and ran into > problems. After filling out

[PATCH] cec-func-poll.rst/func-poll.rst: update EINVAL description

2018-08-14 Thread Hans Verkuil
nfds depends on RLIMIT_NOFILE, not OPEN_MAX. Update the description for cec and v4l2. Signed-off-by: Hans Verkuil --- diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst b/Documentation/media/uapi/cec/cec-func-poll.rst index d49f1ee0742d..c698c969635c 100644 ---

Re: [PATCH v2 2/7] [media] dt-bindings: tvp5150: Add input port connectors DT bindings

2018-08-14 Thread Marco Felsch
On 18-08-13 15:41, Rob Herring wrote: > On Mon, Aug 13, 2018 at 11:25:03AM +0200, Marco Felsch wrote: > > The TVP5150/1 decoders support different video input sources to their > > AIP1A/B pins. > > > > Possible configurations are as follows: > > - Analog Composite signal connected to AIP1A. > >

Re: [PATCH v2 0/2] media: i2c: ov5640: Re-work MIPI startup sequence

2018-08-14 Thread jacopo mondi
Hi Steve, On Tue, Aug 14, 2018 at 09:51:04AM -0700, Steve Longerbeam wrote: > Hi Jacopo, > > > On 08/14/2018 08:35 AM, jacopo mondi wrote: > >Hi Steve, > >sorry for resurecting this. > > > > > >>>I'm sorry I'm not sur I'm following. Does this mean that with that bug > >>>you are referring to

Re: [PATCH v2 0/2] media: i2c: ov5640: Re-work MIPI startup sequence

2018-08-14 Thread Steve Longerbeam
Hi Jacopo, On 08/14/2018 08:35 AM, jacopo mondi wrote: Hi Steve, sorry for resurecting this. I'm sorry I'm not sur I'm following. Does this mean that with that bug you are referring to up here fixed by my last patch you have capture working? No, capture still not working for me on

Re: [PATCHv18 14/35] v4l2-ctrls: add core request support

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:26 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Integrate the request support. This adds the v4l2_ctrl_request_complete > and v4l2_ctrl_request_setup functions to complete a request and (as a > helper function) to apply a request to the hardware. > > It

Re: [PATCHv18 00/35] Request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:12 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Hi all, > > This is version 18 of the Request API series. The intention is that > this will become a topic branch in preparation of merging this for > 4.20 together with the cedrus staging driver. > > I

Re: [PATCHv18 00/35] Request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 17:01:07 -0300 Mauro Carvalho Chehab escreveu: > > > > Besides all the review comments I also fixed a bug. See: > > https://www.mail-archive.com/linux-media@vger.kernel.org/msg134311.html > > I'll look on it right now. Sorry, I meant to say that I'm looking into this

Re: [PATCHv18 03/35] media-request: implement media requests

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:15 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Add initial media request support: > > 1) Add MEDIA_IOC_REQUEST_ALLOC ioctl support to media-device.c > 2) Add struct media_request to store request objects. > 3) Add struct media_request_object to represent a

Re: [PATCHv18 15/35] v4l2-ctrls: support g/s_ext_ctrls for requests

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:27 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > The v4l2_g/s_ext_ctrls functions now support control handlers that > represent requests. > > The v4l2_ctrls_find_req_obj() function is responsible for finding the > request from the fd. > > Signed-off-by: Hans

Re: [PATCHv18 21/35] vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:33 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > The PREPARED state becomes a problem with the request API: a buffer > could be PREPARED but dequeued, or PREPARED and in state IN_REQUEST. > > PREPARED is really not a state as such, but more a property of the

Re: [PATCHv18 02/35] uapi/linux/media.h: add request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:14 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Define the public request API. > > This adds the new MEDIA_IOC_REQUEST_ALLOC ioctl to allocate a request > and two ioctls that operate on a request in order to queue the > contents of the request to the driver

Re: [PATCHv18 19/35] vb2: store userspace data in vb2_v4l2_buffer

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:31 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > The userspace-provided plane data needs to be stored in > vb2_v4l2_buffer. Currently this information is applied by > __fill_vb2_buffer() which is called by the core prepare_buf > and qbuf functions, but when

Re: [PATCHv18 24/35] videobuf2-core: embed media_request_object

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:36 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Make vb2_buffer a request object. > > Signed-off-by: Hans Verkuil I had already sent a reviewed-by to this. Anyway: Reviewed-by: Mauro Carvalho Chehab > --- > include/media/videobuf2-core.h | 4 > 1

Re: [PATCHv18 28/35] videobuf2-v4l2: add vb2_request_queue/validate helpers

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:40 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > The generic vb2_request_validate helper function checks if > there are buffers in the request and if so, prepares (validates) > all objects in the request. > > The generic vb2_request_queue helper function

Re: [PATCH 1/3] dt-bindings: media: Add i.MX Pixel Pipeline binding

2018-08-14 Thread Rob Herring
On Fri, 10 Aug 2018 17:18:20 +0200, Philipp Zabel wrote: > Add DT binding documentation for the Pixel Pipeline (PXP) found on > various NXP i.MX SoCs. > > Signed-off-by: Philipp Zabel > --- > .../devicetree/bindings/media/fsl-pxp.txt | 26 +++ > 1 file changed, 26

Re: [PATCHv18 01/35] Documentation: v4l: document request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:13 +0200 Hans Verkuil escreveu: > From: Alexandre Courbot > > Document the request API for V4L2 devices, and amend the documentation > of system calls influenced by it. Looks ok to me. Just a minor nitpick (see below). Mental note: we'll need to push the

Re: [PATCHv18 16/35] v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:28 +0200 Hans Verkuil escreveu: > If a driver needs to find/inspect the controls set in a request then > it can use these functions. > > E.g. to check if a required control is set in a request use this in the > req_validate() implementation: > > int res =

Re: [PATCHv18 08/35] v4l2-dev: lock req_queue_mutex

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:20 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > We need to serialize streamon/off with queueing new requests. > These ioctls may trigger the cancellation of a streaming > operation, and that should not be mixed with queuing a new > request at the same time. >

Re: [PATCHv18 17/35] videobuf2-v4l2: move __fill_v4l2_buffer() function

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:29 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > Move the __fill_v4l2_buffer() to before the vb2_queue_or_prepare_buf() > function to prepare for the next two patches. > > No other changes. > > Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab

Re: [PATCHv18 31/35] v4l2-mem2mem: add vb2_m2m_request_queue

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 16:20:43 +0200 Hans Verkuil escreveu: > From: Hans Verkuil > > For mem2mem devices we have to make sure that v4l2_m2m_try_schedule() > is called whenever a request is queued. > > We do that by creating a vb2_m2m_request_queue() helper that should > be used instead of the

Re: why does aptina_pll_calculate insist on exact division?

2018-08-14 Thread Sakari Ailus
Hi, On Tue, Aug 14, 2018 at 10:30:14AM +0300, Laurent Pinchart wrote: > Hi Helmut, > > (CC'ing Sakari Ailus who is our current PLL expert after spending so much > time > on the SMIA PLL code) > > On Tuesday, 14 August 2018 09:35:40 EEST Helmut Grohne wrote: > > Hi, > > > > I tried using the

Re: [PATCHv17 16/34] v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 10:45:57 +0200 Hans Verkuil escreveu: > On 13/08/18 13:07, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:08 +0200 > > Hans Verkuil escreveu: > > > >> If a driver needs to find/inspect the controls set in a request then > >> it can use these functions. > >> >

Re: [PATCHv17 01/34] Documentation: v4l: document request API

2018-08-14 Thread Hans Verkuil
On 14/08/18 10:48, Mauro Carvalho Chehab wrote: > Em Tue, 14 Aug 2018 09:57:27 +0200 > Hans Verkuil escreveu: > >> On 09/08/18 19:43, Mauro Carvalho Chehab wrote: diff --git a/Documentation/media/uapi/v4l/vidioc-qbuf.rst b/Documentation/media/uapi/v4l/vidioc-qbuf.rst index

Re: [PATCHv17 01/34] Documentation: v4l: document request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Fri, 10 Aug 2018 09:20:48 +0200 Hans Verkuil escreveu: > On 08/09/2018 07:43 PM, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:44:53 +0200 > > Hans Verkuil escreveu: > > > >> From: Alexandre Courbot > >> > >> Document the request API for V4L2 devices, and amend the

Re: [PATCHv17 19/34] vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 10:58:59 +0200 Hans Verkuil escreveu: > On 13/08/18 13:30, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:11 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> The PREPARED state becomes a problem with the request API: a buffer > >> could

Re: [BUG, RFC] media: Wrong module gets acquired

2018-08-14 Thread Petr Cvek
Dne 14.8.2018 v 10:35 Sakari Ailus napsal(a): > Hi Pert, > Hello, thanks for answering > On Mon, Aug 13, 2018 at 06:33:12PM +0200, petrcve...@gmail.com wrote: >> From: Petr Cvek >> >> When transferring a media sensor driver from the soc_camera I've found >> the controller module can get

Re: [PATCHv17 16/34] v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

2018-08-14 Thread Hans Verkuil
On 13/08/18 13:07, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:08 +0200 > Hans Verkuil escreveu: > >> If a driver needs to find/inspect the controls set in a request then >> it can use these functions. >> >> E.g. to check if a required control is set in a request use this in the >>

Re: [PATCHv17 02/34] uapi/linux/media.h: add request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Fri, 10 Aug 2018 09:21:59 +0200 Hans Verkuil escreveu: > On 08/09/2018 07:53 PM, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:44:54 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> Define the public request API. > >> > >> This adds the new

Re: [PATCHv17 05/34] media-request: add media_request_get_by_fd

2018-08-14 Thread Mauro Carvalho Chehab
Em Fri, 10 Aug 2018 09:32:53 +0200 Hans Verkuil escreveu: > On 08/09/2018 09:55 PM, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:44:57 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> Add media_request_get_by_fd() to find a request based on the file > >>

Re: [PATCHv17 14/34] v4l2-ctrls: add core request support

2018-08-14 Thread Hans Verkuil
On 13/08/18 12:55, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:06 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> Integrate the request support. This adds the v4l2_ctrl_request_complete >> and v4l2_ctrl_request_setup functions to complete a request and (as a >> helper

Re: [BUG, RFC] media: Wrong module gets acquired

2018-08-14 Thread Sakari Ailus
Hi Pert, On Mon, Aug 13, 2018 at 06:33:12PM +0200, petrcve...@gmail.com wrote: > From: Petr Cvek > > When transferring a media sensor driver from the soc_camera I've found > the controller module can get removed (which will cause a stack dump > because the sensor driver depends on resources

Re: [PATCHv17 01/34] Documentation: v4l: document request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 09:57:27 +0200 Hans Verkuil escreveu: > On 09/08/18 19:43, Mauro Carvalho Chehab wrote: > >> diff --git a/Documentation/media/uapi/v4l/vidioc-qbuf.rst > >> b/Documentation/media/uapi/v4l/vidioc-qbuf.rst > >> index 9e448a4aa3aa..0e415f2551b2 100644 > >> ---

Re: [PATCHv17 02/34] uapi/linux/media.h: add request API

2018-08-14 Thread Hans Verkuil
On 14/08/18 10:46, Mauro Carvalho Chehab wrote: > Em Fri, 10 Aug 2018 09:21:59 +0200 > Hans Verkuil escreveu: > >> On 08/09/2018 07:53 PM, Mauro Carvalho Chehab wrote: >>> Em Sat, 4 Aug 2018 14:44:54 +0200 >>> Hans Verkuil escreveu: >>> From: Hans Verkuil Define the public

Re: why does aptina_pll_calculate insist on exact division?

2018-08-14 Thread Helmut Grohne
Hi, Thank you for the quick and helpful answer. On Tue, Aug 14, 2018 at 09:30:14AM +0200, Laurent Pinchart wrote: > How do you mean ? The only place where pix_clock_max is used is in the > following code: > > if (pll->pix_clock == 0 || pll->pix_clock > limits->pix_clock_max) { >

Re: [PATCHv17 14/34] v4l2-ctrls: add core request support

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 10:34:47 +0200 Hans Verkuil escreveu: > >> +void v4l2_ctrl_request_setup(struct media_request *req, > >> + struct v4l2_ctrl_handler *main_hdl) > >> +{ > >> + struct media_request_object *obj; > >> + struct v4l2_ctrl_handler *hdl; > >> + struct

Re: [PATCHv17 19/34] vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

2018-08-14 Thread Hans Verkuil
On 13/08/18 13:30, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:11 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> The PREPARED state becomes a problem with the request API: a buffer >> could be PREPARED but dequeued, or PREPARED and in state IN_REQUEST. >> >> PREPARED

Re: Using big platform driver as foundation to implement TV driver framework in Linux

2018-08-14 Thread Mauro Carvalho Chehab
Hi Jesse, Em Mon, 13 Aug 2018 01:32:45 + Jesse Huang (黃建興) escreveu: > Hi Mchehab, > Hi Linux-Media, > > MTK/MStar try to move TV SOC proprietary driver framework to Linux TV driver. > > But, we also need to share/re-use driver code to non-OS which is a size > limitation low cost system.

Re: [PATCHv17 16/34] v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

2018-08-14 Thread Hans Verkuil
On 14/08/18 10:55, Mauro Carvalho Chehab wrote: > Em Tue, 14 Aug 2018 10:45:57 +0200 > Hans Verkuil escreveu: > >> On 13/08/18 13:07, Mauro Carvalho Chehab wrote: >>> Em Sat, 4 Aug 2018 14:45:08 +0200 >>> Hans Verkuil escreveu: >>> If a driver needs to find/inspect the controls set in

Re: [PATCH v2 0/2] media: i2c: ov5640: Re-work MIPI startup sequence

2018-08-14 Thread Steve Longerbeam
On 08/14/2018 10:38 AM, jacopo mondi wrote: Hi Steve, On Tue, Aug 14, 2018 at 09:51:04AM -0700, Steve Longerbeam wrote: Hi Jacopo, On 08/14/2018 08:35 AM, jacopo mondi wrote: Hi Steve, sorry for resurecting this. I'm sorry I'm not sur I'm following. Does this mean that with that

RE: Using big platform driver as foundation to implement TV driver framework in Linux

2018-08-14 Thread 黃建興
Hi Mchehab, We are very appreciating for your reply. For GPL, We are agree to follow GPL license to open source code which is in Linux kernel. For "but we don't accept any other OS-dependent code", we can follow this rule to remove relative OS-dependent code. For " If otherwise all you want is

cron job: media_tree daily build: WARNINGS

2018-08-14 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Wed Aug 15 05:00:16 CEST 2018 media-tree git hash:da2048b7348a0be92f706ac019e022139e29495e media_build

Re: [PATCH 01/14] staging: media: tegra-vde: Support BSEV clock and reset

2018-08-14 Thread Dmitry Osipenko
On Tuesday, 14 August 2018 17:21:24 MSK Thierry Reding wrote: > On Mon, Aug 13, 2018 at 06:09:46PM +0300, Dmitry Osipenko wrote: > > On Monday, 13 August 2018 17:50:14 MSK Thierry Reding wrote: > > > From: Thierry Reding > > > > > > The BSEV clock has a separate gate bit and can not be assumed

Re: [PATCH 01/14] staging: media: tegra-vde: Support BSEV clock and reset

2018-08-14 Thread Dmitry Osipenko
On Tuesday, 14 August 2018 18:05:51 MSK Dmitry Osipenko wrote: > On Tuesday, 14 August 2018 17:21:24 MSK Thierry Reding wrote: > > On Mon, Aug 13, 2018 at 06:09:46PM +0300, Dmitry Osipenko wrote: > > > On Monday, 13 August 2018 17:50:14 MSK Thierry Reding wrote: > > > > From: Thierry Reding > > >

Re: [PATCHv17 02/34] uapi/linux/media.h: add request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 11:57:48 +0200 Hans Verkuil escreveu: > On 14/08/18 10:46, Mauro Carvalho Chehab wrote: > > Em Fri, 10 Aug 2018 09:21:59 +0200 > > Hans Verkuil escreveu: > > > >> On 08/09/2018 07:53 PM, Mauro Carvalho Chehab wrote: > >>> Em Sat, 4 Aug 2018 14:44:54 +0200 > >>> Hans

[PATCHv18 05/35] media-request: add media_request_get_by_fd

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add media_request_get_by_fd() to find a request based on the file descriptor. The caller has to call media_request_put() for the returned request since this function increments the refcount. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Mauro Carvalho

[PATCHv18 34/35] vivid: add mc

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add support for the media_device to vivid. This is a prerequisite for request support. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/platform/vivid/vivid-core.c | 61 +++ drivers/media/platform/vivid/vivid-core.h | 8

[PATCHv18 29/35] videobuf2-core: add uses_requests/qbuf flags

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Set the first time a buffer from a request is queued to vb2 (uses_requests) or directly queued (uses_qbuf). Cleared when the queue is canceled. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/common/videobuf2/videobuf2-core.c | 13

[PATCHv18 35/35] vivid: add request support

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add support for requests to vivid. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/platform/vivid/vivid-core.c| 8 drivers/media/platform/vivid/vivid-kthread-cap.c | 12

[PATCHv18 24/35] videobuf2-core: embed media_request_object

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Make vb2_buffer a request object. Signed-off-by: Hans Verkuil --- include/media/videobuf2-core.h | 4 1 file changed, 4 insertions(+) diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 2eb24961183e..413b8b2dc485 100644 ---

[PATCHv18 22/35] videodev2.h: Add request_fd field to v4l2_buffer

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil When queuing buffers allow for passing the request that should be associated with this buffer. If V4L2_BUF_FLAG_REQUEST_FD is set, then request_fd is used as the file descriptor. If a buffer is stored in a request, but not yet queued to the driver, then

[PATCHv18 01/35] Documentation: v4l: document request API

2018-08-14 Thread Hans Verkuil
From: Alexandre Courbot Document the request API for V4L2 devices, and amend the documentation of system calls influenced by it. Signed-off-by: Alexandre Courbot Signed-off-by: Hans Verkuil --- .../media/uapi/mediactl/media-controller.rst | 1 + .../media/uapi/mediactl/media-funcs.rst

[PATCHv18 19/35] vb2: store userspace data in vb2_v4l2_buffer

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil The userspace-provided plane data needs to be stored in vb2_v4l2_buffer. Currently this information is applied by __fill_vb2_buffer() which is called by the core prepare_buf and qbuf functions, but when using requests these functions aren't called yet since the buffer won't be

[PATCHv18 03/35] media-request: implement media requests

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add initial media request support: 1) Add MEDIA_IOC_REQUEST_ALLOC ioctl support to media-device.c 2) Add struct media_request to store request objects. 3) Add struct media_request_object to represent a request object. 4) Add MEDIA_REQUEST_IOC_QUEUE/REINIT ioctl support.

[PATCHv18 02/35] uapi/linux/media.h: add request API

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Define the public request API. This adds the new MEDIA_IOC_REQUEST_ALLOC ioctl to allocate a request and two ioctls that operate on a request in order to queue the contents of the request to the driver and to re-initialize the request. Signed-off-by: Hans Verkuil Acked-by:

[PATCHv18 26/35] videobuf2-v4l2: integrate with media requests

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil This implements the V4L2 part of the request support. The main change is that vb2_qbuf and vb2_prepare_buf now have a new media_device pointer. This required changes to several drivers that did not use the vb2_ioctl_qbuf/prepare_buf helper functions. Signed-off-by: Hans

[PATCHv18 00/35] Request API

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Hi all, This is version 18 of the Request API series. The intention is that this will become a topic branch in preparation of merging this for 4.20 together with the cedrus staging driver. I incorporated Mauro's review comments and a review comment from Ezequiel in v18. The

[PATCHv18 11/35] v4l2-ctrls: prepare internal structs for request API

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Embed and initialize a media_request_object in struct v4l2_ctrl_handler. Add a p_req field to struct v4l2_ctrl_ref that will store the request value. Signed-off-by: Hans Verkuil Signed-off-by: Alexandre Courbot Reviewed-by: Mauro Carvalho Chehab ---

[PATCHv18 28/35] videobuf2-v4l2: add vb2_request_queue/validate helpers

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil The generic vb2_request_validate helper function checks if there are buffers in the request and if so, prepares (validates) all objects in the request. The generic vb2_request_queue helper function queues all buffer objects in the validated request. Signed-off-by: Hans

Re: [PATCH 01/14] staging: media: tegra-vde: Support BSEV clock and reset

2018-08-14 Thread Thierry Reding
On Mon, Aug 13, 2018 at 06:09:46PM +0300, Dmitry Osipenko wrote: > On Monday, 13 August 2018 17:50:14 MSK Thierry Reding wrote: > > From: Thierry Reding > > > > The BSEV clock has a separate gate bit and can not be assumed to be > > always enabled. Add explicit handling for the BSEV clock and

[PATCHv18 12/35] v4l2-ctrls: alloc memory for p_req

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil To store request data the handler_new_ref() allocates memory for it if needed. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-ctrls.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git

[PATCHv18 23/35] vb2: add init_buffer buffer op

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil We need to initialize the request_fd field in struct vb2_v4l2_buffer to -1 instead of the default of 0. So we need to add a new op that is called when struct vb2_v4l2_buffer is allocated. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab ---

[PATCHv18 32/35] vim2m: use workqueue

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil v4l2_ctrl uses mutexes, so we can't setup a ctrl_handler in interrupt context. Switch to a workqueue instead and drop the timer. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/platform/vim2m.c | 25 ++--- 1 file

[PATCHv18 16/35] v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

2018-08-14 Thread Hans Verkuil
If a driver needs to find/inspect the controls set in a request then it can use these functions. E.g. to check if a required control is set in a request use this in the req_validate() implementation: int res = -EINVAL; hdl = v4l2_ctrl_request_hdl_find(req, parent_hdl);

[PATCHv18 21/35] vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil The PREPARED state becomes a problem with the request API: a buffer could be PREPARED but dequeued, or PREPARED and in state IN_REQUEST. PREPARED is really not a state as such, but more a property of the buffer. So make new 'prepared' and 'synced' bools instead to remember

[PATCHv18 18/35] videobuf2-v4l2: replace if by switch in __fill_vb2_buffer()

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Replace 'if' statements by a switch in __fill_vb2_buffer() in preparation of the next patch. No other changes. Signed-off-by: Hans Verkuil --- .../media/common/videobuf2/videobuf2-v4l2.c | 21 --- 1 file changed, 14 insertions(+), 7 deletions(-) diff

[PATCHv18 09/35] videodev2.h: add request_fd field to v4l2_ext_controls

2018-08-14 Thread Hans Verkuil
From: Alexandre Courbot If 'which' is V4L2_CTRL_WHICH_REQUEST_VAL, then the 'request_fd' field can be used to specify a request for the G/S/TRY_EXT_CTRLS ioctls. Signed-off-by: Alexandre Courbot Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab ---

[PATCHv18 13/35] v4l2-ctrls: use ref in helper instead of ctrl

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil The next patch needs the reference to a control instead of the control itself, so change struct v4l2_ctrl_helper accordingly. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/v4l2-ctrls.c | 18 +- 1 file changed, 9

[PATCHv18 15/35] v4l2-ctrls: support g/s_ext_ctrls for requests

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil The v4l2_g/s_ext_ctrls functions now support control handlers that represent requests. The v4l2_ctrls_find_req_obj() function is responsible for finding the request from the fd. Signed-off-by: Hans Verkuil --- drivers/media/platform/omap3isp/ispvideo.c | 2 +-

[PATCHv18 17/35] videobuf2-v4l2: move __fill_v4l2_buffer() function

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Move the __fill_v4l2_buffer() to before the vb2_queue_or_prepare_buf() function to prepare for the next two patches. No other changes. Signed-off-by: Hans Verkuil --- .../media/common/videobuf2/videobuf2-v4l2.c | 264 +- 1 file changed, 132 insertions(+),

[PATCHv18 04/35] media: doc: Add media-request.h header to documentation build

2018-08-14 Thread Hans Verkuil
From: Sakari Ailus media-request.h has been recently added; add it to the documentation build as well. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- Documentation/media/kapi/mc-core.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCHv18 27/35] videobuf2-core: add request helper functions

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add a new helper function to tell if a request object is a buffer. Add a new helper function that returns true if a media_request contains at least one buffer. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- .../media/common/videobuf2/videobuf2-core.c

[PATCHv18 14/35] v4l2-ctrls: add core request support

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Integrate the request support. This adds the v4l2_ctrl_request_complete and v4l2_ctrl_request_setup functions to complete a request and (as a helper function) to apply a request to the hardware. It takes care of queuing requests and correctly chaining control values in the

[PATCHv18 31/35] v4l2-mem2mem: add vb2_m2m_request_queue

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil For mem2mem devices we have to make sure that v4l2_m2m_try_schedule() is called whenever a request is queued. We do that by creating a vb2_m2m_request_queue() helper that should be used instead of the 'normal' vb2_request_queue() helper. The m2m helper function will call

[PATCHv18 30/35] videobuf2-v4l2: refuse qbuf if queue uses requests or vv.

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Check if the vb2 queue uses requests, and if so refuse to add buffers that are not part of a request. Also check for the reverse: a vb2 queue did not use requests, and an attempt was made to queue a buffer to a request. We might relax this in the future, but for now just

[PATCHv18 08/35] v4l2-dev: lock req_queue_mutex

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil We need to serialize streamon/off with queueing new requests. These ioctls may trigger the cancellation of a streaming operation, and that should not be mixed with queuing a new request at the same time. Finally close() needs this lock since that too can trigger the

[PATCHv18 33/35] vim2m: support requests

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add support for requests to vim2m. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- drivers/media/platform/vim2m.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/media/platform/vim2m.c

[PATCHv18 10/35] v4l2-ctrls: v4l2_ctrl_add_handler: add from_other_dev

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add a 'bool from_other_dev' argument: set to true if the two handlers refer to different devices (e.g. it is true when inheriting controls from a subdev into a main v4l2 bridge driver). This will be used later when implementing support for the request API since we need to

[PATCHv18 07/35] v4l2-device.h: add v4l2_device_supports_requests() helper

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add a simple helper function that tests if the driver supports the request API. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- include/media/v4l2-device.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/media/v4l2-device.h

[PATCHv18 20/35] davinci_vpfe: remove bogus vb2->state check

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil There is no need to check the vb2 state in the buf_prepare callback: it can never be wrong. Since VB2_BUF_STATE_PREPARED will be removed in the next patch we'll remove this unnecessary check (and use of that state) first. Signed-off-by: Hans Verkuil Reviewed-by: Mauro

[PATCHv18 25/35] videobuf2-core: integrate with media requests

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Buffers can now be prepared or queued for a request. A buffer is unbound from the request at vb2_buffer_done time or when the queue is cancelled. Signed-off-by: Hans Verkuil Reviewed-by: Mauro Carvalho Chehab --- .../media/common/videobuf2/videobuf2-core.c | 133

[PATCHv18 06/35] media-request: add media_request_object_find

2018-08-14 Thread Hans Verkuil
From: Hans Verkuil Add media_request_object_find to find a request object inside a request based on ops and priv values. Objects of the same type (vb2 buffer, control handler) will have the same ops value. And objects that refer to the same 'parent' object (e.g. the v4l2_ctrl_handler that has

Re: qcom: update firmware file for Venus on SDM845

2018-08-14 Thread Josh Boyer
On Fri, Aug 10, 2018 at 5:44 AM Vikash Garodia wrote: > > hi, > > This pull request updates firmware files for Venus h/w codec found on the > Qualcomm SDM845 chipset. > > The following changes since commit 7b5835fd37630d18ac0c755329172f6a17c1af29: > > linux-firmware: add firmware for mt76x2u

Re: [PATCHv17 03/34] media-request: implement media requests

2018-08-14 Thread Hans Verkuil
On 04/08/18 14:44, Hans Verkuil wrote: > From: Hans Verkuil > > Add initial media request support: > > 1) Add MEDIA_IOC_REQUEST_ALLOC ioctl support to media-device.c > 2) Add struct media_request to store request objects. > 3) Add struct media_request_object to represent a request object. > 4)

Re: [PATCHv17 25/34] videobuf2-core: add request helper functions

2018-08-14 Thread Hans Verkuil
On 13/08/18 16:50, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:17 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> Add a new helper function to tell if a request object is a buffer. >> >> Add a new helper function that returns true if a media_request >> contains at

Re: [PATCHv17 26/34] videobuf2-v4l2: add vb2_request_queue/validate helpers

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 09:19:08 +0200 Hans Verkuil escreveu: > On 13/08/18 16:53, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:18 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> The generic vb2_request_validate helper function checks if > >> there are

Re: [PATCHv17 01/34] Documentation: v4l: document request API

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 11:51:30 +0200 Hans Verkuil escreveu: > On 14/08/18 10:48, Mauro Carvalho Chehab wrote: > > Em Tue, 14 Aug 2018 09:57:27 +0200 > > Hans Verkuil escreveu: > > > >> On 09/08/18 19:43, Mauro Carvalho Chehab wrote: > diff --git

Re: [BUG, RFC] media: Wrong module gets acquired

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 11:35:01 +0300 Sakari Ailus escreveu: > Hi Pert, > > On Mon, Aug 13, 2018 at 06:33:12PM +0200, petrcve...@gmail.com wrote: > > From: Petr Cvek > > > > When transferring a media sensor driver from the soc_camera I've found > > the controller module can get removed (which

Re: [PATCHv17 08/34] v4l2-dev: lock req_queue_mutex

2018-08-14 Thread Mauro Carvalho Chehab
Em Tue, 14 Aug 2018 14:00:16 +0200 Hans Verkuil escreveu: > On 09/08/18 22:03, Mauro Carvalho Chehab wrote: > > Em Sat, 4 Aug 2018 14:45:00 +0200 > > Hans Verkuil escreveu: > > > >> From: Hans Verkuil > >> > >> We need to serialize streamon/off with queueing new requests. > >> These ioctls

Re: [PATCHv17 08/34] v4l2-dev: lock req_queue_mutex

2018-08-14 Thread Hans Verkuil
On 09/08/18 22:03, Mauro Carvalho Chehab wrote: > Em Sat, 4 Aug 2018 14:45:00 +0200 > Hans Verkuil escreveu: > >> From: Hans Verkuil >> >> We need to serialize streamon/off with queueing new requests. >> These ioctls may trigger the cancellation of a streaming >> operation, and that should not

Re: [PATCH v2 0/2] media: i2c: ov5640: Re-work MIPI startup sequence

2018-08-14 Thread jacopo mondi
Hi Steve, sorry for resurecting this. On Mon, Jul 16, 2018 at 09:26:13AM -0700, Steve Longerbeam wrote: > > > On 07/16/2018 01:29 AM, jacopo mondi wrote: > >Hi Steve, > >thanks for keep testing it > > > >On Sat, Jul 14, 2018 at 01:02:32PM -0700, Steve Longerbeam wrote: > >> > >>On

  1   2   >