[PATCH v4 10/17] mx_emmaprp: Implement wait_prepare and wait_finish

2018-06-15 Thread Ezequiel Garcia
eases the queue lock while blocking, which improves latency by allowing for example streamoff or qbuf operations while waiting in dqbuf. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/mx2_emmaprp.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/mx2_emmaprp

[PATCH v4 12/17] stk1160: Set the vb2_queue lock before calling vb2_queue_init

2018-06-15 Thread Ezequiel Garcia
The vb2_queue will soon be mandatory. The videobuf2 core will throw a verbose warning if it's not set. The stk1160 driver is setting the queue lock, but after the vb2_queue_init call. Avoid the warning by setting the lock before the queue initialization. Signed-off-by: Ezequiel G

[PATCH v4 16/17] v4l2-ioctl.c: assume queue->lock is always set

2018-06-15 Thread Ezequiel Garcia
From: Hans Verkuil vb2_queue now expects a valid lock pointer, so drop the checks for that in v4l2-ioctl.c. Signed-off-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-ioctl.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/dr

[PATCH v4 17/17] media: Remove wait_{prepare, finish}

2018-06-15 Thread Ezequiel Garcia
Now that all drivers provide a proper vb2_queue lock, and that wait_{prepare, finish} are no longer in use, get rid of them. Signed-off-by: Ezequiel Garcia --- Documentation/media/kapi/v4l2-dev.rst | 7 +++ drivers/input/rmi4/rmi_f54.c | 2 -- drivers/input

[PATCH v4 13/17] dvb-core: Provide lock for vb2_queue

2018-06-15 Thread Ezequiel Garcia
Use the vb2 context mutex to protect the vb2_queue. This allows to replace the ad-hoc wait_{prepare, finish} with vb2_ops_wait_{prepare, finish}. Signed-off-by: Ezequiel Garcia --- drivers/media/dvb-core/dvb_vb2.c | 22 +++--- 1 file changed, 3 insertions(+), 19 deletions

[PATCH v4 14/17] videobuf2-core: require q->lock

2018-06-15 Thread Ezequiel Garcia
From: Hans Verkuil Refuse to initialize a vb2 queue if there is no lock specified. Signed-off-by: Hans Verkuil --- drivers/media/common/videobuf2/videobuf2-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobu

[PATCH v4 15/17] videobuf2: assume q->lock is always set

2018-06-15 Thread Ezequiel Garcia
From: Hans Verkuil Drop checks for q->lock. Drop calls to wait_finish/prepare, just lock/unlock q->lock. Signed-off-by: Hans Verkuil --- .../media/common/videobuf2/videobuf2-core.c | 21 ++- .../media/common/videobuf2/videobuf2-v4l2.c | 27 +-- include/media/vid

Re: [PATCH 2/3] mem2mem: Make .job_abort optional

2018-06-15 Thread Ezequiel Garcia
On Fri, 2018-06-15 at 10:43 +0200, Hans Verkuil wrote: > On 14/06/18 17:34, Ezequiel Garcia wrote: > > Implementing job_abort() does not make sense on some drivers. > > This is not a problem, as the abort is not required to > > wait for the job to finish. Quite the oppo

Re: [RFC 2/2] vim2m: add media device

2018-06-15 Thread Ezequiel Garcia
On Tue, 2018-06-12 at 20:44 +0100, emil.veli...@collabora.com wrote: > Hi Ezequiel, > > On Tue, Jun 12, 2018 at 07:48:27AM -0300, Ezequiel Garcia wrote: > > > @@ -1013,10 +1016,10 @@ static int vim2m_probe(struct > > platform_device *pdev) > > vfd->lo

Re: [RFC 0/2] Memory-to-memory media controller topology

2018-06-15 Thread Ezequiel Garcia
On Tue, 2018-06-12 at 10:42 -0400, Nicolas Dufresne wrote: > Le mardi 12 juin 2018 à 07:48 -0300, Ezequiel Garcia a écrit : > > As discussed on IRC, memory-to-memory need to be modeled > > properly in order to be supported by the media controller > > framework, and thus to su

[PATCH v2 1/3] rcar_jpu: Remove unrequired wait in .job_abort

2018-06-17 Thread Ezequiel Garcia
As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Cc: Mikhail Ulyanov Signed-off-by: Ezequiel Garcia --- drivers/media/platform

[PATCH v2 3/3] mem2mem: Make .job_abort optional

2018-06-17 Thread Ezequiel Garcia
implementations. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 - drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c| 5 - drivers/media/platform/rcar_jpu.c | 5 - drivers/media/platform/rockchip/rga/rga.c | 6 -- drivers/media

[PATCH v2 2/3] s5p-g2d: Remove unrequired wait in .job_abort

2018-06-17 Thread Ezequiel Garcia
As per the documentation, job_abort is not required to wait until the current job finishes. It is redundant to do so, as the core will perform the wait operation. Remove the wait infrastructure completely. Cc: Kyungmin Park Cc: Kamil Debski Cc: Andrzej Hajda Signed-off-by: Ezequiel Garcia

[PATCH v2 0/3] mem2mem: Cleanup .job_abort

2018-06-17 Thread Ezequiel Garcia
drivers is not needed, and actually suboptimal. Ezequiel Garcia (3): rcar_jpu: Remove unrequired wait in .job_abort s5p-g2d: Remove unrequired wait in .job_abort mem2mem: Make .job_abort optional drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 - drivers/media/platform/mtk-mdp/mtk

[PATCH v5 04/17] omap3isp: Add vb2_queue lock

2018-06-20 Thread Ezequiel Garcia
vb2_queue locks is now mandatory. Add it, remove driver ad-hoc locks, and implement wait_{prepare, finish}. Also, remove stream_lock mutex. Sicen the ioctls operations are protected by the queue mutex, the stream_lock mutex is not needed. Signed-off-by: Ezequiel Garcia --- drivers/media

Re: [RFC 0/2] Memory-to-memory media controller topology

2018-06-20 Thread Ezequiel Garcia
On Sat, 2018-06-16 at 20:31 -0400, Nicolas Dufresne wrote: > Le vendredi 15 juin 2018 à 17:05 -0300, Ezequiel Garcia a écrit : > > > Will the end result have "device node name /dev/..." on both > > > entity > > > 1 > > > and 6 ? > > > >

[PATCH 0/2] Memory-to-memory media controller topology

2018-06-20 Thread Ezequiel Garcia
hem. The second commit uses this API to support the vim2m driver. Ezequiel Garcia (1): media: add helpers for memory-to-memory media controller Hans Verkuil (1): vim2m: add media device drivers/media/platform/vim2m.c | 41 +- drivers/media/v4l2-core/v4l2-dev.c |

[PATCH 2/2] vim2m: add media device

2018-06-20 Thread Ezequiel Garcia
From: Hans Verkuil Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vim2m.c | 41 ++ 1 file changed, 37 insertions(+), 4

[PATCH 1/2] media: add helpers for memory-to-memory media controller

2018-06-20 Thread Ezequiel Garcia
[ENABLED,IMMUTABLE] Suggested-by: Laurent Pinchart Suggested-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-dev.c | 13 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 176 + include/media/v4l2-mem2mem.h | 5 + include/uapi/lin

Re: [PATCH 0/2] Memory-to-memory media controller topology

2018-06-21 Thread Ezequiel Garcia
On Thu, 2018-06-21 at 14:07 +0200, Hans Verkuil wrote: > On 06/20/18 21:44, Ezequiel Garcia wrote: > > As discussed on IRC, memory-to-memory need to be modeled > > properly in order to be supported by the media controller > > framework, and thus to support the Request API.

[PATCH v2 2/2] vim2m: add media device

2018-06-21 Thread Ezequiel Garcia
From: Hans Verkuil Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vim2m.c | 41 ++ 1 file changed, 37 insertions(+), 4

[PATCH v2 1/2] media: add helpers for memory-to-memory media controller

2018-06-21 Thread Ezequiel Garcia
[ENABLED,IMMUTABLE] Suggested-by: Laurent Pinchart Suggested-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-dev.c | 13 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 174 + include/media/v4l2-mem2mem.h | 19 +++ include/uapi/lin

[PATCH v2 0/2] Memory-to-memory media controller topology

2018-06-21 Thread Ezequiel Garcia
rror when MEDIA_CONTROLLER was not enabled. * Fix the 'proc' entity link, which was wrongly connecting source to source and sink to sink :-P Ezequiel Garcia (1): media: add helpers for memory-to-memory media controller Hans Verkuil (1): vim2m: add media device drivers/media/plat

Re: [PATCH v5 04/17] omap3isp: Add vb2_queue lock

2018-06-21 Thread Ezequiel Garcia
On Thu, 2018-06-21 at 10:18 +0200, Hans Verkuil wrote: > On 06/20/18 19:42, Ezequiel Garcia wrote: > > vb2_queue locks is now mandatory. Add it, remove driver ad-hoc > > locks, > > and implement wait_{prepare, finish}. > > > > Also, remove stream_lock mutex. Sicen

[PATCH v6 04/17] omap3isp: Add vb2_queue lock

2018-06-21 Thread Ezequiel Garcia
vb2_queue locks is now mandatory. Add it, remove driver ad-hoc locks, and implement wait_{prepare, finish}. Also, remove stream_lock mutex. Since the ioctls operations are now protected by the queue mutex, the stream_lock mutex is not needed. Signed-off-by: Ezequiel Garcia --- drivers/media

Re: [PATCH v2 1/2] media: add helpers for memory-to-memory media controller

2018-06-22 Thread Ezequiel Garcia
On Fri, 2018-06-22 at 08:58 +0200, Hans Verkuil wrote: > On 06/21/2018 10:38 PM, Ezequiel Garcia wrote: > > A memory-to-memory pipeline device consists in three > > entities: two DMA engine and one video processing entities. > > The DMA engine entities are linked to a V4L int

[PATCH v3 0/2] Memory-to-memory media controller topology

2018-06-27 Thread Ezequiel Garcia
ODER_CMD: OK (Not Supported) Buffer ioctls: info: test buftype Video Capture info: test buftype Video Output test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK Total: 51, Succeeded: 51, Failed: 0, Warnings: 0 v3: * Remove extra empty l

[PATCH v3 1/2] media: add helpers for memory-to-memory media controller

2018-06-27 Thread Ezequiel Garcia
[ENABLED,IMMUTABLE] Suggested-by: Laurent Pinchart Suggested-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-dev.c | 13 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 172 + include/media/v4l2-mem2mem.h | 19 +++ 3 files chan

[PATCH v3 2/2] vim2m: add media device

2018-06-27 Thread Ezequiel Garcia
From: Hans Verkuil Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vim2m.c | 41 ++ 1 file changed, 37 insertions(+), 4

[PATCH 2/2] v4l-helpers: Fix EXPBUF queue type

2018-06-28 Thread Ezequiel Garcia
s.cpp(544): q_.export_bufs(node) test VIDIOC_EXPBUF: FAIL Fix this by using the queue type instead. Signed-off-by: Ezequiel Garcia --- utils/common/v4l-helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/common/v4l-helpers.h b/utils/common/v4l-helpers.h

[PATCH 1/2] v4l-helpers: Don't close the fd in {}_s_fd

2018-06-28 Thread Ezequiel Garcia
.media_open v4l_media_open v4l_media_s_fd Similar call paths apply for other device types. Fix this by removing the close in xxx_s_fd. Signed-off-by: Ezequiel Garcia --- utils/common/v4l-helpers.h | 9 - 1 file changed, 9 deletions(-) diff --git a/utils/common/v4l-helpers.h b

Re: [PATCH v3 0/2] Memory-to-memory media controller topology

2018-06-28 Thread Ezequiel Garcia
Hi Hans, On Thu, 2018-06-28 at 11:19 +0200, Hans Verkuil wrote: > On 06/27/18 22:35, Ezequiel Garcia wrote: > > As discussed on IRC, memory-to-memory need to be modeled > > properly in order to be supported by the media controller > > framework, and thus to support the Reques

[PATCH] tw686x: Fix oops on buffer alloc failure

2018-06-28 Thread Ezequiel Garcia
From: Krzysztof Hałasa The error path currently calls tw686x_video_free() which requires vc->dev to be initialized, causing a NULL dereference on uninitizalized channels. Fix this by setting the vc->dev fields for all the channels first. Fixes: f8afaa8dbc0d ("[media] tw686x: Introduce an interf

Re: [PATCHv5 05/12] media: rename MEDIA_ENT_F_DTV_DECODER to MEDIA_ENT_F_DV_DECODER

2018-06-29 Thread Ezequiel Garcia
On 29 June 2018 at 08:43, Hans Verkuil wrote: > From: Hans Verkuil > > The use of 'DTV' is very confusing since it normally refers to Digital > TV e.g. DVB etc. > > Instead use 'DV' (Digital Video), which nicely corresponds to the > DV Timings API used to configure such receivers and transmitters

Re: [PATCH 1/2] v4l-helpers: Don't close the fd in {}_s_fd

2018-06-29 Thread Ezequiel Garcia
On Fri, 2018-06-29 at 09:03 +0200, Hans Verkuil wrote: > On 06/28/2018 09:25 PM, Ezequiel Garcia wrote: > > When creating a second node via copy or assignment: > > > > node2 = node > > > > The node being assigned to, i.e. node2, obtains the fd. >

Re: [PATCH 1/2] v4l-helpers: Don't close the fd in {}_s_fd

2018-06-29 Thread Ezequiel Garcia
Hey Hans, On Fri, 2018-06-29 at 09:03 +0200, Hans Verkuil wrote: > On 06/28/2018 09:25 PM, Ezequiel Garcia wrote: > > When creating a second node via copy or assignment: > > > > node2 = node > > > > The node being assigned to, i.e. node2, obtains the fd

Re: [PATCH v4 00/17] v4l2 core: push ioctl lock down to ioctl handler

2018-06-29 Thread Ezequiel Garcia
On Fri, 2018-06-15 at 16:07 -0300, Ezequiel Garcia wrote: > Fourth spin of the series posted by Hans: > > https://www.mail-archive.com/linux-media@vger.kernel.org/msg131363.ht > ml > > There aren't any changes from v3, aside from rebasing > and re-ordering the pa

[PATCH v4 2/2] vim2m: add media device

2018-06-29 Thread Ezequiel Garcia
From: Hans Verkuil Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vim2m.c | 41 ++ 1 file changed, 37 insertions(+), 4

[PATCH v4 1/2] media: add helpers for memory-to-memory media controller

2018-06-29 Thread Ezequiel Garcia
D,IMMUTABLE] Suggested-by: Laurent Pinchart Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-dev.c | 13 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 186 + include/media/v4l2-mem2mem.h | 19 +++ 3 files chan

[PATCH v4 0/2] Memory-to-memory media controller topology

2018-06-29 Thread Ezequiel Garcia
pported) test Cropping: OK (Not Supported) test Composing: OK (Not Supported) test Scaling: OK Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls:

[PATCH v5 2/2] vim2m: add media device

2018-07-02 Thread Ezequiel Garcia
From: Hans Verkuil Request API requires a media node. Add one to the vim2m driver so we can use requests with it. Signed-off-by: Hans Verkuil Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vim2m.c | 41 ++ 1 file changed, 37 insertions(+), 4

[PATCH v5 0/2] Memory-to-memory media controller topology

2018-07-02 Thread Ezequiel Garcia
_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported) test Composing: OK (Not Supported) test Scaling: OK Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DE

[PATCH v5 1/2] media: add helpers for memory-to-memory media controller

2018-07-02 Thread Ezequiel Garcia
D,IMMUTABLE] Suggested-by: Laurent Pinchart Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-dev.c | 13 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 188 + include/media/v4l2-mem2mem.h | 19 +++ 3 files chan

[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
) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK Total: 43, Succeeded: 43, Failed: 0, Warnings: 0 Ezequiel Garcia (1): media: add Rockchip VPU driver Shunqian Zheng (2): media: Add

[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

Re: [PATCH v2 2/3] s5p-g2d: Remove unrequired wait in .job_abort

2018-07-06 Thread Ezequiel Garcia
On Fri, 2018-07-06 at 13:09 +0200, Sylwester Nawrocki wrote: > Hi, > > On 07/04/2018 10:04 AM, Hans Verkuil wrote: > > On 18/06/18 06:38, Ezequiel Garcia wrote: > > > As per the documentation, job_abort is not required > > > to wait until the current job finishe

Re: [PATCH v6 04/17] omap3isp: Add vb2_queue lock

2018-07-06 Thread Ezequiel Garcia
On Mon, 2018-07-02 at 19:49 +0300, Laurent Pinchart wrote: > Hi Ezequiel, > > (CC'ing Sakari) > > Thank you for the patch. > > On Friday, 22 June 2018 06:53:58 EEST Ezequiel Garcia wrote: > > vb2_queue locks is now mandatory. Add it, remove driver ad-hoc &g

Re: [PATCH v4 03/17] omap4iss: Add vb2_queue lock

2018-07-06 Thread Ezequiel Garcia
On Mon, 2018-07-02 at 10:28 +0200, Hans Verkuil wrote: > On 15/06/18 21:07, Ezequiel Garcia wrote: > > vb2_queue lock is now mandatory. Add it, remove driver ad-hoc > > locks, and implement wait_{prepare, finish}. > > I don't see any wait_prepare/finish implementation?!

[PATCH] libv4l: fixup lfs mismatch in preload libraries

2018-07-11 Thread Ezequiel Garcia
: Assembler messages: /tmp/ccc3gdJg.s:67: Error: symbol `open64' is already defined /tmp/ccc3gdJg.s:130: Error: symbol `mmap64' is already defined Signed-off-by: Peter Korsgaard Signed-off-by: Ezequiel Garcia --- lib/libv4l1/v4l1compat.c | 3 +++ lib/libv4l2/v4l2convert.c | 3 +++ 2 files

Re: [PATCH] libv4l: fixup lfs mismatch in preload libraries

2018-07-11 Thread Ezequiel Garcia
On Wed, 2018-07-11 at 22:38 +0300, Baruch Siach wrote: > Hi Mauro, > > Added Peter's updated address to Cc. > > Mauro Carvalho Chehab writes: > > Em Wed, 11 Jul 2018 10:22:51 -0300 > > Ezequiel Garcia escreveu: > > > > > From: Peter Korsgaard &g

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

2018-07-11 Thread Ezequiel Garcia
Hi Hans, Sakari: On Thu, 2018-07-05 at 18:03 +0200, Hans Verkuil wrote: > 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. > > Why not just go

[PATCH 0/2] Make sure .device_run is always called in non-atomic context

2018-07-12 Thread Ezequiel Garcia
ify exiting the function in v4l2_m2m_try_schedule" be3d3b78573b "media: mem2mem: Remove excessive try_run call" Ezequiel Garcia (2): v4l2-core: Simplify v4l2_m2m_try_{schedule,run} v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish drivers/media

[PATCH 1/2] v4l2-core: Simplify v4l2_m2m_try_{schedule,run}

2018-07-12 Thread Ezequiel Garcia
v4l2_m2m_try_run() has only one caller and so it's possible to move its contents. Although this de-modularization change could reduce clarity, in this case it allows to remove a spinlock lock/unlock pair and an unneeded sanity check. Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2

[PATCH 2/2] v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish

2018-07-12 Thread Ezequiel Garcia
gets scheduled by v4l2_m2m_job_finish(). The worker calls v4l2_m2m_try_schedule(), which makes sure a single job is running at the same time, so it's safe to call it from different executions context. Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-mem2mem.c | 14 +

Re: [PATCH 0/4] WIP: rockchip mpp for v4l2 video decoder

2019-01-31 Thread Ezequiel Garcia
Hey Ayaka! On Thu, 2019-01-31 at 11:13 +0800, ayaka wrote: > From: Randy 'ayaka' Li > > Hello > Those patches are based on the previous vendor driver I post before, > but it can apply without the previous one. > I really want to make it work before FOSDEM and I didn't. And upcoming > the lun

[PATCH 03/10] rockchip/vpu: Use v4l2_m2m_buf_copy_data

2019-02-05 Thread Ezequiel Garcia
Use the recently introduced v4l2_m2m_buf_copy_data helper and get rid of some code. Signed-off-by: Ezequiel Garcia --- drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/media/rockchip/vpu

[PATCH 02/10] rockchip/vpu: Use pixel format helpers

2019-02-05 Thread Ezequiel Garcia
Now that we've introduced the pixel format helpers, use them in vpu driver, and get rid of the internal helpers. Signed-off-by: Ezequiel Garcia --- .../media/rockchip/vpu/rockchip_vpu_enc.c | 91 +-- 1 file changed, 2 insertions(+), 89 deletions(-) diff --git a/dr

[PATCH 04/10] rockchip/vpu: Cleanup macroblock alignment

2019-02-05 Thread Ezequiel Garcia
We need to make the macrobock alignment generic, in order to support multiple codecs. Signed-off-by: Ezequiel Garcia --- .../media/rockchip/vpu/rockchip_vpu_enc.c | 20 --- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/rockchip/vpu

[PATCH 01/10] media: Introduce helpers to fill pixel format structs

2019-02-05 Thread Ezequiel Garcia
Add two new API helpers, v4l2_fill_pixfmt and v4l2_fill_pixfmt_mp, to be used by drivers to calculate plane sizes and bytes per lines. Note that driver-specific paddig and alignment are not taken into account, and must be done by drivers using this API. Signed-off-by: Ezequiel Garcia

[PATCH 06/10] rockchip/vpu: Open-code media controller register

2019-02-05 Thread Ezequiel Garcia
In preparation to support decoders, using a single memory-to-memory device, we need to roll our own media controller entities registration. Signed-off-by: Ezequiel Garcia --- .../staging/media/rockchip/vpu/rockchip_vpu.h | 35 .../media/rockchip/vpu/rockchip_vpu_drv.c | 177

[PATCH v1 00/10] Add MPEG-2 decoding to Rockchip VPU

2019-02-05 Thread Ezequiel Garcia
fmpeg to work using the Request API. This driver can be tested using mpv+ffmpeg for the video decoding side, and the Panfrost mesa driver for rendering. I should be posting instructions to set all of this up, and also will be submitting the support for H264, VP8 and VP9, hopefully very soon. Ezeq

[PATCH 05/10] rockchip/vpu: Cleanup JPEG bounce buffer management

2019-02-05 Thread Ezequiel Garcia
In order to make the code more generic, introduce a pair of start/stop codec operations, and use them to allocate and release the JPEG bounce buffer. Signed-off-by: Ezequiel Garcia --- .../media/rockchip/vpu/rk3288_vpu_hw.c| 2 ++ .../rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c | 4

[PATCH 07/10] rockchip/vpu: Support the Request API

2019-02-05 Thread Ezequiel Garcia
Introduce support for the Request API. Although the JPEG encoder does not mandate using the Request API, it's perfectly possible to use it, if the application wants to. In addition, add helpers that will be used by video decoders. Signed-off-by: Ezequiel Garcia --- .../rockchi

[PATCH 08/10] rockchip/vpu: Add decoder boilerplate

2019-02-05 Thread Ezequiel Garcia
This commit adds the needed boilerplate code to support the VPU in decoding operation. Two v4l2 interfaces are exposed, one for encoding and one for decoding, but a single m2m device is shared by them, so jobs are properly serialized. Signed-off-by: Ezequiel Garcia --- drivers/staging/media

[PATCH 09/10] rockchip/vpu: Add support for non-standard controls

2019-02-05 Thread Ezequiel Garcia
Rework the way controls are registered by the driver, so it can support non-standard controls, such as those used by stateless codecs. Signed-off-by: Ezequiel Garcia --- .../media/rockchip/vpu/rk3288_vpu_hw.c| 2 +- .../media/rockchip/vpu/rk3399_vpu_hw.c| 2 +- .../staging

[PATCH 10/10] rockchip/vpu: Add support for MPEG-2 decoding

2019-02-05 Thread Ezequiel Garcia
From: Jonas Karlman Add MPEG-2 decoding, only on RK3399. Other SoCs and support for other codecs will be added in the future. Signed-off-by: Jonas Karlman Signed-off-by: Ezequiel Garcia --- drivers/staging/media/rockchip/vpu/Makefile | 4 +- .../media/rockchip/vpu/rk3399_vpu_hw.c

[PATCH] media: vb2: Fix buf_out_validate documentation

2019-02-05 Thread Ezequiel Garcia
The .buf_out_validate callback is mandatory for OUTPUT queues. Mark it as such in the callback's doc. Fixes: 28d77c21cb ("media: vb2: add buf_out_validate callback") Signed-off-by: Ezequiel Garcia --- include/media/videobuf2-core.h | 3 ++- 1 file changed, 2 insertions(+), 1 de

[PATCH] media: v4l2-mem2mem: Rename v4l2_m2m_buf_copy_data to v4l2_m2m_buf_copy_metadata

2019-02-05 Thread Ezequiel Garcia
The v4l2_m2m_buf_copy_data helper is used to copy the buffer metadata, such as its timestamp and its flags. Therefore, the v4l2_m2m_buf_copy_metadata name is more clear and avoids confusion with a payload data copy. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/vicodec/vicodec

Re: [PATCH 01/10] media: Introduce helpers to fill pixel format structs

2019-02-06 Thread Ezequiel Garcia
On Wed, 2019-02-06 at 11:43 +0100, Hans Verkuil wrote: > Hi Ezequiel, > > A quick review below. This looks really useful, BTW. > > On 2/5/19 9:24 PM, Ezequiel Garcia wrote: > > Add two new API helpers, v4l2_fill_pixfmt and v4l2_fill_pixfmt_mp, > > to be used by drive

Re: [PATCH] media: Drop superfluous PCM preallocation error checks

2019-02-06 Thread Ezequiel Garcia
/www.spinics.net/lists/alsa-devel/msg87223.html > > Media people, please give ACK if this is OK. Then I'll merge it together > with other relevant patches. Thanks! > > drivers/media/pci/solo6x10/solo6x10-g723.c | 4 +--- > drivers/media/pci/tw686x/tw686x-audio.c| 3

[PATCH v2 2/2] media: Introduce helpers to fill pixel format structs

2019-02-06 Thread Ezequiel Garcia
Add two new API helpers, v4l2_fill_pixfmt and v4l2_fill_pixfmt_mp, to be used by drivers to calculate plane sizes and bytes per lines. Note that driver-specific padding and alignment are not taken into account, and must be done by drivers using this API. Signed-off-by: Ezequiel Garcia --- This

[PATCH 1/2] rockchip/vpu: Rename pixel format helpers

2019-02-06 Thread Ezequiel Garcia
go away. Signed-off-by: Ezequiel Garcia --- .../staging/media/rockchip/vpu/rockchip_vpu_enc.c| 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c index

Re: [PATCH v2 3/5] media: sunxi: Add A10 CSI driver

2019-02-06 Thread Ezequiel Garcia
On Mon, 28 Jan 2019 at 11:53, Maxime Ripard wrote: > > The older CSI drivers have camera capture interface different from the one > in the newer ones. > > This IP is pretty simple. Some variants (one controller out of two > instances on some SoCs) have an ISP embedded, but there's no code that mak

[PATCH 00/10] Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
if driver maintainers can take review the changes. Thanks! Ezequiel Garcia (10): mtk-jpeg: Correct return type for mem2mem buffer helpers mtk-mdp: Correct return type for mem2mem buffer helpers mtk-vcodec: Correct return type for mem2mem buffer helpers mx2_emmaprp: Correct return type for mem2

[PATCH 04/10] mx2_emmaprp: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/mx2_emmaprp.c | 6 +++--- 1 file changed

[PATCH 10/10] media: v4l2-mem2mem: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
which currently return void pointer. In every case, the actual return type is a struct vb2_v4l2_buffer pointer. Change the return type of the listed functions, so type checking can be properly used. Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-mem2mem.c | 6 +++--- include

[PATCH 01/10] mtk-jpeg: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 40

[PATCH 09/10] rockchip/vpu: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/staging/media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c | 6

[PATCH 05/10] rockchip/rga: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/rockchip/rga/rga.c | 6 +++--- 1 file

[PATCH 07/10] s5p-jpeg: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 38

[PATCH 03/10] mtk-vcodec: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 62

[PATCH 02/10] mtk-mdp: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 20

[PATCH 08/10] sh_veu: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/sh_veu.c | 4 ++-- 1 file changed, 2

[PATCH 06/10] s5p-g2d: Correct return type for mem2mem buffer helpers

2019-02-08 Thread Ezequiel Garcia
vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/s5p-g2d/g2d.c | 6 +++--- 1 file changed

Re: [PATCH v3 1/2] media: uapi: Add H264 low-level decoder API compound controls.

2019-02-11 Thread Ezequiel Garcia
On Mon, 2019-02-11 at 15:39 +0100, Maxime Ripard wrote: > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index d6eed479c3a6..6fc955926bdb 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -645,6 +645,7 @@ struct v4l2_pix_for

Re: [PATCH v2 2/2] media: Introduce helpers to fill pixel format structs

2019-02-11 Thread Ezequiel Garcia
Hello André, On Mon, 2019-02-11 at 17:11 -0200, André Almeida wrote: > On 2/6/19 7:29 PM, Ezequiel Garcia wrote: > > Add two new API helpers, v4l2_fill_pixfmt and v4l2_fill_pixfmt_mp, > > to be used by drivers to calculate plane sizes and bytes per lines. > > > >

Re: [PATCH v3 2/2] media: cedrus: Add H264 decoding support

2019-02-11 Thread Ezequiel Garcia
On Mon, 2019-02-11 at 15:39 +0100, Maxime Ripard wrote: > Introduce some basic H264 decoding support in cedrus. So far, only the > baseline profile videos have been tested, and some more advanced features > used in higher profiles are not even implemented. > > Signed-off-by: Maxime Ripard [..]

Re: [PATCH v3 1/2] media: uapi: Add H264 low-level decoder API compound controls.

2019-02-11 Thread Ezequiel Garcia
On Mon, 2019-02-11 at 15:39 +0100, Maxime Ripard wrote: > From: Pawel Osciak > > Stateless video codecs will require both the H264 metadata and slices in > order to be able to decode frames. > > This introduces the definitions for a new pixel format for H264 slices that > have been parsed, as we

Re: [PATCH v3 1/2] media: uapi: Add H264 low-level decoder API compound controls.

2019-02-12 Thread Ezequiel Garcia
On Tue, 2019-02-12 at 14:05 +0100, Maxime Ripard wrote: > Hi, > > On Mon, Feb 11, 2019 at 04:21:47PM +0100, Hans Verkuil wrote: > > > I think the API should be designed with 4k video in mind. So if some of > > > these constants would be too small when dealing with 4k (even if the > > > current HW

Re: [PATCH v3 0/2] media: cedrus: Add H264 decoding support

2019-02-12 Thread Ezequiel Garcia
Hey Tomasz, On Tue, 2019-02-12 at 21:50 +0900, Tomasz Figa wrote: > Hi Maxime, > > On Mon, Feb 11, 2019 at 11:39 PM Maxime Ripard > wrote: > > Hi, > > > > Here is a new version of the H264 decoding support in the cedrus > > driver. > > Thanks for working on this. Please see my comments below.

Re: [PATCH v3 0/2] media: cedrus: Add H264 decoding support

2019-02-13 Thread Ezequiel Garcia
On Wed, 2019-02-13 at 12:02 +0900, Tomasz Figa wrote: > On Wed, Feb 13, 2019 at 6:22 AM Ezequiel Garcia > wrote: > > Hey Tomasz, > > > > On Tue, 2019-02-12 at 21:50 +0900, Tomasz Figa wrote: > > > Hi Maxime, > > > > > > On Mon, Feb 11, 2019

[RFC] media: uapi: Add VP8 low-level decoder API compound controls.

2019-02-13 Thread Ezequiel Garcia
From: Pawel Osciak These controls are to be used with the new low-level decoder API for VP8 to provide additional parameters for the hardware that cannot parse the input stream. Signed-off-by: Pawel Osciak [ezequiel: rebased] Signed-off-by: Ezequiel Garcia --- As the H.264 interface is

Re: [RFC] media: uapi: Add VP8 low-level decoder API compound controls.

2019-02-13 Thread Ezequiel Garcia
Hi, On Wed, 2019-02-13 at 18:15 -0300, Ezequiel Garcia wrote: > From: Pawel Osciak > > These controls are to be used with the new low-level decoder API for VP8 > to provide additional parameters for the hardware that cannot parse the > input stream. > > Signed-off-by: Pawe

Re: [RFC] media: uapi: Add VP8 low-level decoder API compound controls.

2019-02-14 Thread Ezequiel Garcia
On Wed, 2019-02-13 at 21:35 -0500, Nicolas Dufresne wrote: > Le mer. 13 févr. 2019 à 16:23, Ezequiel Garcia > a écrit : > > Hi, > > > > On Wed, 2019-02-13 at 18:15 -0300, Ezequiel Garcia wrote: > > > From: Pawel Osciak > > > > > > These con

Re: [PATCH 1/1] v4l: ioctl: Validate num_planes before using it

2019-02-15 Thread Ezequiel Garcia
On Thu, 2019-01-10 at 14:43 +0200, Sakari Ailus wrote: > The for loop to reset the memory of the plane reserved fields runs over > num_planes provided by the user without validating it. Ensure num_planes > is no more than VIDEO_MAX_PLANES before the loop. > > Fixes: 4e1e0eb0e074 ("media: v4l2-ioct

Re: [PATCH 1/1] v4l: ioctl: Validate num_planes before using it

2019-02-15 Thread Ezequiel Garcia
On Fri, 2019-02-15 at 17:05 +0100, Hans Verkuil wrote: > On 2/15/19 4:52 PM, Ezequiel Garcia wrote: > > On Thu, 2019-01-10 at 14:43 +0200, Sakari Ailus wrote: > > > The for loop to reset the memory of the plane reserved fields runs over > > > num_planes provided by the

[PATCH] media: v4l: ioctl: Sanitize num_planes before using it

2019-02-18 Thread Ezequiel Garcia
w the planes array by accident. Fixes: 9048b2e15b11c5 ("media: v4l: ioctl: Validate num_planes before using it") Signed-off-by: Ezequiel Garcia --- drivers/media/v4l2-core/v4l2-ioctl.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/media

[PATCH 0/4] Add debug messages to v4l2-ctrls

2019-02-18 Thread Ezequiel Garcia
debug attribute, this series introduces a debug module parameter, and a new debug level, which enables v4l2-ctrl debugging. Having this is quite useful when bringing-up stateless codecs, using the Request API. Ezequiel Garcia (4): media: v4l: Simplify dev_debug flags media: v4l: Improve debug dp

<    1   2   3   4   5   6   7   8   9   10   >