[PATCH v2 0/3] DVB: represent frequencies at tuner/frontend .info in Hz

2018-07-05 Thread Mauro Carvalho Chehab
Currently, the DVB drivers internally represent frequencies on their ops.info structures in Hz, for Terrestrial and Cable, or in kHz for Satellite. This is very confusing, as from time to time developers end by filling the data in a wrong way. Also, this is a long standing issue that affect newer

[PATCH v2 3/3] dvb_frontend: ensure that the step is ok for both FE and tuner

2018-07-05 Thread Mauro Carvalho Chehab
The frequency step should take into account the tuner step, as, if tuner step is bigger than frontend step, the zigzag algorithm won't be doing the right thing, as it will be tuning multiple times at the same frequency. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvb_frontend

[PATCH v2 2/3] media: dvb: represent min/max/step/tolerance freqs in Hz

2018-07-05 Thread Mauro Carvalho Chehab
Right now, satellite frontend drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal frontends capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing

[PATCH v2 1/3] media: dvb: convert tuner_info frequencies to Hz

2018-07-05 Thread Mauro Carvalho Chehab
Right now, satellite tuner drivers specify frequencies in kHz, while terrestrial/cable ones specify in Hz. That's confusing for developers. However, the main problem is that universal tuners capable of handling both satellite and non-satelite delivery systems are appearing. We end by needing to ha

Re: [PATCH 16/16] media: imx: add mem2mem device

2018-07-05 Thread Steve Longerbeam
Hi Philipp, On 06/22/2018 08:52 AM, Philipp Zabel wrote: Add a single imx-media mem2mem video device that uses the IPU IC PP (image converter post processing) task for scaling and colorspace conversion. On i.MX6Q/DL SoCs with two IPUs currently only the first IPU is used. The hardware only sup

Re: [PATCH 00/16] i.MX media mem2mem scaler

2018-07-05 Thread Steve Longerbeam
Hi Philipp, Thanks for this great patchset! Finally we have improved seams with tiled conversions, and relaxed width alignment requirements. Unfortunately this patchset isn't working correctly yet. It breaks tiled conversions with rotation. Trying the following conversion: input: 720x480, UYVY

Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz

2018-07-05 Thread Mauro Carvalho Chehab
Em Thu, 5 Jul 2018 21:16:06 +0200 Michael Büsch escreveu: > On Wed, 4 Jul 2018 23:46:56 -0300 > Mauro Carvalho Chehab wrote: > > > diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c > > index 145407dee3db..a983899c6b0b 100644 > > --- a/drivers/media/tuners/fc0011.c > >

Re: [PATCH v7 1/2] media: ov2680: dt: Add bindings for OV2680

2018-07-05 Thread Rob Herring
On Wed, Jul 4, 2018 at 9:52 AM Rui Miguel Silva wrote: > > Hi Jacopo, > Hope your fine. > Thanks for the review. > > On Wed 04 Jul 2018 at 09:58, jacopo mondi wrote: > > Hi Rui, > >sorry, I'm a bit late, you're already at v7 and I don't want > >to > > slow down inclusion with a few minor c

Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz

2018-07-05 Thread Michael Büsch
On Wed, 4 Jul 2018 23:46:56 -0300 Mauro Carvalho Chehab wrote: > diff --git a/drivers/media/tuners/fc0011.c b/drivers/media/tuners/fc0011.c > index 145407dee3db..a983899c6b0b 100644 > --- a/drivers/media/tuners/fc0011.c > +++ b/drivers/media/tuners/fc0011.c > @@ -472,10 +472,10 @@ static int fc0

Re: Video capturing

2018-07-05 Thread Oleh Kravchenko
05.07.18 16:52, Nicolas Dufresne пише: > Le jeudi 05 juillet 2018 à 16:35 +0300, Oleh Kravchenko a écrit : > > And do you get the same with GStreamer ? > gst-launch-1.0 v4l2src device=/dev/video1 norm=PAL ! videoconvert ! > autovideosink Doesn't work: $ v4l2-ctl -d /dev/video2 --all Driver Info

[PATCH 1/3] media: Add JPEG_RAW format

2018-07-05 Thread Ezequiel Garcia
From: Shunqian Zheng Add V4L2_PIX_FMT_JPEG_RAW format that does not contain JPEG header in the output frame. Signed-off-by: Shunqian Zheng --- Documentation/media/uapi/v4l/pixfmt-compressed.rst | 5 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h

[PATCH 0/3] Add Rockchip VPU JPEG encoder

2018-07-05 Thread Ezequiel Garcia
This series adds support for JPEG encoding via the VPU block present in Rockchip platforms. Currently, support for RK3288 and RK3399 is included. The hardware produces a Raw JPEG format (i.e. works as a JPEG accelerator), and requires quantization tables provided by the application. Therefore, th

[PATCH 2/3] media: Add controls for jpeg quantization tables

2018-07-05 Thread Ezequiel Garcia
From: Shunqian Zheng Add V4L2_CID_JPEG_LUMA/CHROMA_QUANTIZATION controls to allow userspace configure the JPEG quantization tables. Signed-off-by: Shunqian Zheng --- drivers/media/v4l2-core/v4l2-ctrls.c | 4 include/uapi/linux/v4l2-controls.h | 3 +++ 2 files changed, 7 insertions(+) d

[PATCH 3/3] media: add Rockchip VPU driver

2018-07-05 Thread Ezequiel Garcia
Add a mem2mem driver for the VPU available on Rockchip SoCs. Currently only JPEG encoding is supported, for RK3399 and RK3288 platforms. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/Kconfig| 12 + drivers/media/platform/Makefile | 1 + drivers/media/

[PATCHv16 01/34] Documentation: v4l: document request API

2018-07-05 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

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

2018-07-05 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: S

[PATCHv16 12/34] v4l2-ctrls: alloc memory for p_req

2018-07-05 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 --- drivers/media/v4l2-core/v4l2-ctrls.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c

[PATCHv16 08/34] v4l2-dev: lock req_queue_mutex

2018-07-05 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 cancellati

[PATCHv16 07/34] v4l2-device.h: add v4l2_device_supports_requests() helper

2018-07-05 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 --- include/media/v4l2-device.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index b330e4

[PATCHv16 16/34] vb2: store userspace data in vb2_v4l2_buffer

2018-07-05 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

[PATCHv16 32/34] vivid: add mc

2018-07-05 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 --- drivers/media/platform/vivid/vivid-core.c | 61 +++ drivers/media/platform/vivid/vivid-core.h | 8 +++ 2 files changed, 69 insertions(+

[PATCHv16 00/34] Request API

2018-07-05 Thread Hans Verkuil
From: Hans Verkuil Hi all, This is version 16 of the Request API series. The main changes compared to v15 are: - Moved the documentation patch to the front of the series. - Many documentation updates based on Mauro's review. - Lock in vb2_request_has_buffers() to ensure nobody else is messin

[PATCHv16 05/34] media-request: add media_request_get_by_fd

2018-07-05 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 --- drivers/media/media-request

[PATCHv16 23/34] videobuf2-v4l2: integrate with media requests

2018-07-05 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 Verkui

[PATCHv16 31/34] vim2m: support requests

2018-07-05 Thread Hans Verkuil
From: Hans Verkuil Add support for requests to vim2m. Signed-off-by: Hans Verkuil --- drivers/media/platform/vim2m.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index 6f87ef025ff1..3b8df2c9d24a

[PATCHv16 29/34] v4l2-mem2mem: add vb2_m2m_request_queue

2018-07-05 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 v4l2_

[PATCHv16 19/34] videodev2.h: Add request_fd field to v4l2_buffer

2018-07-05 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 V4L2_BUF_FLAG_IN_REQUE

[PATCHv16 13/34] v4l2-ctrls: use ref in helper instead of ctrl

2018-07-05 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 --- drivers/media/v4l2-core/v4l2-ctrls.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff -

[PATCHv16 22/34] videobuf2-core: integrate with media requests

2018-07-05 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 --- .../media/common/videobuf2/videobuf2-core.c | 133 +- .../media/common/videobu

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

2018-07-05 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 --- Documentation/media/kapi/mc-core.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/media/kapi/mc-core.rst b

[PATCHv16 25/34] videobuf2-v4l2: add vb2_request_queue/validate helpers

2018-07-05 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 Verkui

[PATCHv16 27/34] videobuf2-v4l2: refuse qbuf if queue uses requests or vv.

2018-07-05 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 retur

[PATCHv16 09/34] videodev2.h: add request_fd field to v4l2_ext_controls

2018-07-05 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 --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 5 - drivers/m

[PATCHv16 03/34] media-request: implement media requests

2018-07-05 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. Basic

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

2018-07-05 Thread Hans Verkuil
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. Signed-off-by: Hans Verkuil --- drivers/media/media-device.c | 41 +++ drivers/media/media-devnode.c | 17 ++

[PATCHv16 11/34] v4l2-ctrls: prepare internal structs for request API

2018-07-05 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 --- drivers/media/v4l2-core/v4l2-ctrls.c | 1 + include/media

[PATCHv16 15/34] v4l2-ctrls: support g/s_ext_ctrls for requests

2018-07-05 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 +- drivers/med

[PATCHv16 33/34] vivid: add request support

2018-07-05 Thread Hans Verkuil
From: Hans Verkuil Add support for requests to vivid. Signed-off-by: Hans Verkuil --- drivers/media/platform/vivid/vivid-core.c| 8 drivers/media/platform/vivid/vivid-kthread-cap.c | 12 drivers/media/platform/vivid/vivid-kthread-out.c | 12 drivers/

[PATCHv16 24/34] videobuf2-core: add request helper functions

2018-07-05 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 --- .../media/common/videobuf2/videobuf2-core.c | 24 +++ include/me

[PATCHv16 26/34] videobuf2-core: add uses_requests/qbuf flags

2018-07-05 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 --- drivers/media/common/videobuf2/videobuf2-core.c | 13 + include/media/videobuf2-core.h

[PATCHv16 17/34] davinci_vpfe: remove bogus vb2->state check

2018-07-05 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 --- drivers/staging/medi

[PATCHv16 30/34] vim2m: use workqueue

2018-07-05 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 --- drivers/media/platform/vim2m.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-)

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

2018-07-05 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 req

[PATCHv16 18/34] vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

2018-07-05 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 whe

[PATCHv16 28/34] v4l2-mem2mem: Simplify exiting the function in v4l2_m2m_try_schedule

2018-07-05 Thread Hans Verkuil
From: Sakari Ailus The v4l2_m2m_try_schedule function acquires and releases multiple spinlocks; simplify unlocking the job lock by adding a label to unlock the job lock and exit the function. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-mem2mem.c | 22 -- 1

[PATCHv16 10/34] v4l2-ctrls: v4l2_ctrl_add_handler: add from_other_dev

2018-07-05 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 skip

[PATCHv16 20/34] vb2: add init_buffer buffer op

2018-07-05 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 --- drivers/media/common/videobuf2/videobuf2-core.c | 2 ++

[PATCHv16 21/34] videobuf2-core: embed media_request_object

2018-07-05 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 cbda3968d018..df92dcdeabb3 100644 --- a/include/medi

[PATCHv16 06/34] media-request: add media_request_object_find

2018-07-05 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 th

Re: Video capturing

2018-07-05 Thread Nicolas Dufresne
Le jeudi 05 juillet 2018 à 16:35 +0300, Oleh Kravchenko a écrit : > Hello Nicolas, > > On 05.07.18 15:57, Nicolas Dufresne wrote: > > > > > > Le jeu. 5 juil. 2018 05:28, Oleh Kravchenko > > a écrit : > > > > Hello! > > > > Yesterday I tried to capture video fro

Re: Video capturing

2018-07-05 Thread Oleh Kravchenko
Hello Nicolas, On 05.07.18 15:57, Nicolas Dufresne wrote: > > > Le jeu. 5 juil. 2018 05:28, Oleh Kravchenko > a écrit : > > Hello! > > Yesterday I tried to capture video from old game console (PAL) and > got an image like this > https://www.kaa.org.ua/image

Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz

2018-07-05 Thread Mauro Carvalho Chehab
Em Thu, 5 Jul 2018 08:35:24 -0400 Michael Ira Krufky escreveu: > On Wed, Jul 4, 2018 at 10:47 PM Mauro Carvalho Chehab > wrote: > > > > Right now, satellite tuner drivers specify frequencies in kHz, > > while terrestrial/cable ones specify in Hz. That's confusing > > for developers. > > > > Howe

[PATCH v5 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx

2018-07-05 Thread Stanimir Varbanov
This adds suspend (power collapse) functionality by reusing the suspend function for Venus 3xx and also enables idle indicator property for Venus 4xx (where it is disabled by default). Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/hfi_venus.c |

Re: [PATCH 1/2] media: dvb: convert tuner_info frequencies to Hz

2018-07-05 Thread Michael Ira Krufky
On Wed, Jul 4, 2018 at 10:47 PM Mauro Carvalho Chehab wrote: > > Right now, satellite tuner drivers specify frequencies in kHz, > while terrestrial/cable ones specify in Hz. That's confusing > for developers. > > However, the main problem is that universal tuners capable > of handling both satelli

Re: [PATCH] media: dvb: fix noderef.cocci warnings

2018-07-05 Thread Michael Ira Krufky
On Thu, Jul 5, 2018 at 1:50 AM kbuild test robot wrote: > > From: kbuild test robot > > drivers/media/dvb-core/dvb_frontend.c:2396:18-24: ERROR: application of > sizeof to pointer > > sizeof when applied to a pointer typed expression gives the size of > the pointer > > Generated by: scripts/co

[PATCH] media: v4l2-ctrls.h: fix v4l2_ctrl field description typos

2018-07-05 Thread Baruch Siach
Signed-off-by: Baruch Siach --- include/media/v4l2-ctrls.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 5b445b5654f7..f615ba1b29dd 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -

Video capturing

2018-07-05 Thread Oleh Kravchenko
Hello! Yesterday I tried to capture video from old game console (PAL) and got an image like this https://www.kaa.org.ua/images/EvromediaUSBFullHybridFullHD/mplayer_nes.png I tried different TV norms, but no success. At the same time that video console works fine with my TV! My TV tuners works fin

[PATCH] videobuf2-core: check for q->error in vb2_core_qbuf()

2018-07-05 Thread Hans Verkuil
The vb2_core_qbuf() function didn't check if q->error was set. It is checked in __buf_prepare(), but that function isn't called if the buffer was already prepared before with VIDIOC_PREPARE_BUF. So check it at the start of vb2_core_qbuf() as well. Signed-off-by: Hans Verkuil --- diff --git a/dri

Re: [PATCH] media: dvb_ca_en50221: off by one in dvb_ca_en50221_io_do_ioctl()

2018-07-05 Thread Jasmin J.
Hello Dan! I checked this and this is in since ages. Good catch! I did a quick look to the other places where this is checked also and they seem all ok. Acked-by: Jasmin Jessich BR, Jasmin