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

2019-03-07 Thread Tomasz Figa
Hi Maxime, On Thu, Mar 7, 2019 at 10:20 PM 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 par

[RFC v1 1/4] dt-binding: mt8183: Add Mediatek MDP3 dt-bindings

2019-03-07 Thread Daoyuan Huang
From: daoyuan huang This patch adds DT binding document for Media Data Path 3 (MDP3) a unit in multimedia system used for scaling and color format convert. Signed-off-by: Ping-Hsun Wu Signed-off-by: daoyuan huang --- .../bindings/media/mediatek,mt8183-mdp3.txt| 217 +++

[RFC v1 0/4] media: mediatek: support mdp3 on mt8183 platform

2019-03-07 Thread Daoyuan Huang
From: daoyuan huang This is the first version of RFC patch for Media Data Path 3 (MDP3), MDP3 is used for scaling and color format conversion. support using GCE to write register in critical time limitation. support V4L2 m2m device control. --- Based on v5.0-rc1 and these series: device tree: ht

[RFC v1 3/4] media: platform: Add Mediatek MDP3 driver KConfig

2019-03-07 Thread Daoyuan Huang
From: daoyuan huang This patch adds Kconfig for Mediatek Media Data Path 3 (MDP3) driver. MDP3 is used to do scaling and color format conversion. Signed-off-by: Ping-Hsun Wu Signed-off-by: daoyuan huang --- drivers/media/platform/Kconfig | 18 ++ drivers/media/platform/Makefi

[RFC v1 2/4] dts: arm64: mt8183: Add Mediatek MDP3 nodes

2019-03-07 Thread Daoyuan Huang
From: daoyuan huang Add device nodes for Media Data Path 3 (MDP3) modules. Signed-off-by: Ping-Hsun Wu Signed-off-by: daoyuan huang --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 109 +++ 1 file changed, 109 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/

cron job: media_tree daily build: WARNINGS

2019-03-07 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: Fri Mar 8 05:00:12 CET 2019 media-tree git hash:15d90a6ae98e6d2c68497b44a491cb9efbb98ab1 media_build git

Re: [PATCH v2 2/6] staging: video: rockchip: add v4l2 decoder

2019-03-07 Thread Joe Perches
On Thu, 2019-03-07 at 18:03 +0800, Randy Li wrote: > It is based on the vendor driver sent to mail list before. trivial notes: > diff --git a/drivers/staging/rockchip-mpp/mpp_debug.h > b/drivers/staging/rockchip-mpp/mpp_debug.h [] > +#define mpp_debug_func(type, fmt, args...) \

[PATCH v6 4/7] gpu: ipu-v3: ipu-ic: Add support for Rec.709 encoding

2019-03-07 Thread Steve Longerbeam
Add support for Rec.709 encoding and inverse encoding. Reported-by: Tim Harvey Signed-off-by: Steve Longerbeam --- Changes in v5: - moved API changes to a previous patch. - moved CSC coeff calc to new function calc_csc_coeffs(). Changes in v4: - fix compile error. Chnges in v3: - none. Changes i

[PATCH v6 5/7] gpu: ipu-v3: ipu-ic: Add support for limited range encoding

2019-03-07 Thread Steve Longerbeam
Add support for the following conversions: - YUV full-range to YUV limited-range - YUV limited-range to YUV full-range - YUV limited-range to RGB full-range - RGB full-range to YUV limited-range The last two conversions require operating on the YUV full-range encoding and inverse encoding coeffic

[PATCH v6 6/7] media: imx: Try colorimetry at both sink and source pads

2019-03-07 Thread Steve Longerbeam
The colorimetry parameters need to be tested at both sink and source pads. Specifically, for prpencvf, the IC only supports RGB full-range quantization at input and output. Fix this by cleaning up imx_media_fill_default_mbus_fields(), renaming to imx_media_try_colorimetry(), and call it at both si

[PATCH v6 0/7] media: imx: Add support for BT.709 encoding

2019-03-07 Thread Steve Longerbeam
This patchset adds support for the BT.709 encoding and inverse encoding matrices to the ipu_ic task init functions. The imx-media driver can now support both BT.601 and BT.709 encoding. History: v6: - tweak some of the coefficients slightly, they were not getting rounded correctly. - move the in

[PATCH v6 2/7] gpu: ipu-v3: ipu-ic: Fix BT.601 coefficients

2019-03-07 Thread Steve Longerbeam
The ycbcr2rgb and inverse rgb2ycbcr tables define the BT.601 Y'CbCr encoding coefficients. The rgb2ycbcr table specifically describes the BT.601 encoding from full range RGB to full range YUV. Add table comments to make this more clear. The ycbcr2rgb inverse table describes encoding YUV limited r

[PATCH v6 1/7] gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM

2019-03-07 Thread Steve Longerbeam
The saturation bit was being set at bit 9 in the second 32-bit word of the TPMEM CSC. This isn't correct, the saturation bit is bit 42, which is bit 10 of the second word. Fixes: 1aa8ea0d2bd5d ("gpu: ipu-v3: Add Image Converter unit") Signed-off-by: Steve Longerbeam Cc: sta...@vger.kernel.org --

[PATCH v6 3/7] gpu: ipu-v3: ipu-ic: Fully describe colorspace conversions

2019-03-07 Thread Steve Longerbeam
Only providing the input and output RGB/YUV space to the IC task init functions is not sufficient. To fully characterize a colorspace conversion, the colorspace (chromaticities), Y'CbCr encoding standard, and quantization also need to be specified. Define a 'struct ipu_ic_colorspace' that includes

[PATCH v6 7/7] media: imx: Allow BT.709 encoding for IC routes

2019-03-07 Thread Steve Longerbeam
The IC now supports BT.709 Y'CbCr encoding, in addition to existing BT.601 encoding, so allow both, for pipelines that route through the IC. Reported-by: Tim Harvey Signed-off-by: Steve Longerbeam --- Changes in v5: - rebased this patch on top of repurposing the function to imx_media_try_color

[PATCH V4 1/2] init i2c already in it930x_frontend_attach

2019-03-07 Thread Jose Alberto Reguero
i2c bus is already needed when the frontend is probed, so init it already in it930x_frontend_attach.That prevents errors like si2168: probe of 6-0067 failed with error -5 From: Andreas Kemnade Signed-off-by: Andreas Kemnade Signed-off-by: Jose Alberto Reguero diff -upr linux/drivers/media/us

[PATCH V4 2/2] Add support for the Avermedia TD310

2019-03-07 Thread Jose Alberto Reguero
This patch add support for Avermedia TD310 usb stick. V4 add usb-ids part of the patch. V3 add a table for the i2c addresses an other needed options. Signed-off-by: Jose Alberto Reguero diff -upr linux/drivers/media/usb/dvb-usb-v2/af9035.c linux.new/drivers/media/usb/dvb-usb-v2/af9035.c ---

[PATCH V4 0/2] Add support for the Avermedia TD310

2019-03-07 Thread Jose Alberto Reguero
Diferences from V3: fix incomplete patch . Diferences from V2: changes as requested. Jose Alberto Reguero -- Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi brevedad.

Re: [PATCH V3 2/2] Add support for the Avermedia TD310

2019-03-07 Thread kbuild test robot
Hi Jose, Thank you for the patch! Yet something to improve: [auto build test ERROR on linuxtv-media/master] [also build test ERROR on v5.0 next-20190306] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/

Re: [PATCH V3 2/2] Add support for the Avermedia TD310

2019-03-07 Thread Jose Alberto Reguero
El 7 de marzo de 2019 23:38:47 CET, kbuild test robot escribió: >Hi Jose, > >Thank you for the patch! Yet something to improve: > >[auto build test ERROR on linuxtv-media/master] >[also build test ERROR on v5.0 next-20190306] >[if your patch is applied to the wrong git tree, please drop us a note

Re: [PATCH v3 31/31] media: rcar-csi2: Implement has_route()

2019-03-07 Thread Jacopo Mondi
Hi Sakari, On Thu, Mar 07, 2019 at 02:56:10PM +0200, Sakari Ailus wrote: > Hi Jacopo, > > On Tue, Mar 05, 2019 at 07:51:50PM +0100, Jacopo Mondi wrote: > > Now that the rcar-csi2 subdevice supports internal routing, add an > > has_route() operation used during graph traversal. > > > > The internal

Re: [PATCH 4/4] ti-vpe: Parse local endpoint for properties, not the remote one

2019-03-07 Thread kbuild test robot
Hi Sakari, I love your patch! Yet something to improve: [auto build test ERROR on linuxtv-media/master] [also build test ERROR on v5.0 next-20190306] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/comm

Re: [PATCH 8/8] media: vimc: propagate pixel format in the stream

2019-03-07 Thread André Almeida
On 3/6/19 7:42 PM, Helen Koike wrote: Media bus codes were being mapped to pixelformats, which causes a limitation on vimc because not all pixelformats can be mapped to media bus codes. Also, media bus codes are an internal configuration from the device. Userspace only assures media bus codes m

Re: [PATCH 7/8] media: vimc: stream: init/terminate the first entity

2019-03-07 Thread André Almeida
On 3/6/19 7:42 PM, Helen Koike wrote: The s_stream callback was not being called for the first entity in the stream pipeline array. Instead of verifying the type of the node (video or subdevice) and calling s_stream from the second entity in the pipeline, do this process for all the entities in t

Re: [PATCH 5/8] media: vimc: stream: cleanup frame field from struct vimc_stream

2019-03-07 Thread André Almeida
Hello, I've tested the stream (with the default media bus format and using an alternative one) using a custom user space application and tested all capture entities using qv4l2 -d /dev/videoX (where X is each of the capture entities). Also, I have checked v4l2-compliance -d /dev/videoX and wi

Re: [PATCH v3 12/31] media: entity: Add an iterator helper for connected pads

2019-03-07 Thread Jacopo Mondi
Hi Ian, Sakari, On Thu, Mar 07, 2019 at 10:27:36AM +, Ian Arkver wrote: > On 07/03/2019 10:09, Sakari Ailus wrote: > > Hi Jacopo, > > > > On Tue, Mar 05, 2019 at 07:51:31PM +0100, Jacopo Mondi wrote: > > > From: Sakari Ailus > > > > > > Add a helper macro for iterating over pads that are conn

Suppor for a new usb webcam for the uvcdriver

2019-03-07 Thread Salvador Fernández
Hi developers, In the past( https://www.spinics.net/lists/linux-media/msg147477.html ) I reported how to add support to a new HP USB webcam for the uvcdriver driver. It was only a matter of adding de vendorId y productId to the driver and the webcam worked perfectly. I believe that change will not

Re: [PATCH v2 0/6] [WIP]: rockchip mpp for v4l2 video deocder

2019-03-07 Thread Nicolas Dufresne
Le jeudi 07 mars 2019 à 18:03 +0800, Randy Li a écrit : > Although I really want to push those work after I added more codec > supports, but I found it is more urge to do those in v4l2 core framework and > userspace. > > I would use this driver to present the current problems, write down a > summa

[GIT PULL for v5.1-rc1] media updates

2019-03-07 Thread Mauro Carvalho Chehab
Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media media/v5.1-1 For: - Removal of sensor drivers that got converted from soc_camera; - Remaining soc_camera drivers got moved to staging; - Some documentation cleanups and improvements; - the imx staging

Re: [PATCHv2 7/9] v4l2-subdev: handle module refcounting here

2019-03-07 Thread Sakari Ailus
Hi Laurent, Hans, On Tue, Mar 05, 2019 at 09:52:14PM +0200, Laurent Pinchart wrote: > Hi Hans, > > (CC'ing Sakari) > > Thank you for the patch. > > On Tue, Mar 05, 2019 at 10:58:45AM +0100, hverkuil-ci...@xs4all.nl wrote: > > From: Hans Verkuil > > > > The module ownership refcounting was don

Re: [PATCH v1.1 4/4] ti-vpe: Parse local endpoint for properties, not the remote one

2019-03-07 Thread Sakari Ailus
On Thu, Mar 07, 2019 at 09:34:12AM -0600, Benoit Parrot wrote: > Sakari Ailus wrote on Tue [2019-Mar-05 > 22:48:44 +0200]: > > On Tue, Mar 05, 2019 at 11:38:42AM -0600, Benoit Parrot wrote: > > > Sakari Ailus wrote on Tue [2019-Mar-05 > > > 18:32:40 +0200]: > > > > Hi Benoit, > > > > > > > > O

Re: [PATCH v1.1 4/4] ti-vpe: Parse local endpoint for properties, not the remote one

2019-03-07 Thread Benoit Parrot
Sakari Ailus wrote on Tue [2019-Mar-05 22:48:44 +0200]: > On Tue, Mar 05, 2019 at 11:38:42AM -0600, Benoit Parrot wrote: > > Sakari Ailus wrote on Tue [2019-Mar-05 > > 18:32:40 +0200]: > > > Hi Benoit, > > > > > > On Tue, Mar 05, 2019 at 08:34:09AM -0600, Benoit Parrot wrote: > > > > Sakari, >

Re: [PATCH v3 19/31] media: Documentation: Add GS_ROUTING documentation

2019-03-07 Thread Sakari Ailus
Hi Jacopo, Thanks for writing the documentation for this! The text is nice and informative; I have a few suggestions below. On Tue, Mar 05, 2019 at 07:51:38PM +0100, Jacopo Mondi wrote: > Add documentation for VIDIOC_SUBDEV_G/S_ROUTING ioctl and add > description of multiplexed media pads and in

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

2019-03-07 Thread Maxime Ripard
Hi, Here is a new version of the H264 decoding support in the cedrus driver. As you might already know, the cedrus driver relies on the Request API, and is a reverse engineered driver for the video decoding engine found on the Allwinner SoCs. This work has been possible thanks to the work done b

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

2019-03-07 Thread Maxime Ripard
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 well as the structures used to pass the metadata from the userspace to t

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

2019-03-07 Thread Maxime Ripard
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. Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard --- drivers/staging/media/sunxi/cedrus/Make

Re: [PATCH v3 31/31] media: rcar-csi2: Implement has_route()

2019-03-07 Thread Sakari Ailus
Hi Jacopo, On Tue, Mar 05, 2019 at 07:51:50PM +0100, Jacopo Mondi wrote: > Now that the rcar-csi2 subdevice supports internal routing, add an > has_route() operation used during graph traversal. > > The internal routing between the sink and the source pads depends on the > virtual channel used to

Re: [PATCH v3 28/31] adv748x: afe: Implement has_route()

2019-03-07 Thread Sakari Ailus
On Tue, Mar 05, 2019 at 07:51:47PM +0100, Jacopo Mondi wrote: > Now that the adv748x subdevice supports internal routing, add an > has_route() operation used during media graph traversal. > > Signed-off-by: Jacopo Mondi > --- > drivers/media/i2c/adv748x/adv748x-afe.c | 26 +++

Re: [PATCH v3 12/31] media: entity: Add an iterator helper for connected pads

2019-03-07 Thread Sakari Ailus
On Thu, Mar 07, 2019 at 10:27:36AM +, Ian Arkver wrote: > On 07/03/2019 10:09, Sakari Ailus wrote: > > Hi Jacopo, > > > > On Tue, Mar 05, 2019 at 07:51:31PM +0100, Jacopo Mondi wrote: > > > From: Sakari Ailus > > > > > > Add a helper macro for iterating over pads that are connected through >

Re: [PATCH] media: adv748x: Don't disable CSI-2 on link_setup

2019-03-07 Thread Ian Arkver
Hi Jacopo, On 07/03/2019 10:35, Jacopo Mondi wrote: Hi Laurent, On Wed, Mar 06, 2019 at 09:15:21PM +0200, Laurent Pinchart wrote: Hi Jacopo, On Wed, Mar 06, 2019 at 12:26:59PM +0100, Jacopo Mondi wrote: When both the media links between AFE and HDMI and the two TX CSI-2 outputs gets disabled

Re: [PATCH] media: adv748x: Don't disable CSI-2 on link_setup

2019-03-07 Thread Jacopo Mondi
Hi Laurent, On Wed, Mar 06, 2019 at 09:15:21PM +0200, Laurent Pinchart wrote: > Hi Jacopo, > > On Wed, Mar 06, 2019 at 12:26:59PM +0100, Jacopo Mondi wrote: > > When both the media links between AFE and HDMI and the two TX CSI-2 outputs > > gets disabled, the routing register ADV748X_IO_10 gets ze

Re: [PATCH v3 12/31] media: entity: Add an iterator helper for connected pads

2019-03-07 Thread Ian Arkver
On 07/03/2019 10:09, Sakari Ailus wrote: Hi Jacopo, On Tue, Mar 05, 2019 at 07:51:31PM +0100, Jacopo Mondi wrote: From: Sakari Ailus Add a helper macro for iterating over pads that are connected through enabled routes. This can be used to find all the connected pads within an entity, for inst

[PATCH v2 1/6] arm64: dts: rockchip: add power domain to iommu

2019-03-07 Thread Randy Li
From: Randy Li Signed-off-by: Randy Li --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 4 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index 84f14b132e8f..

[PATCH v2 4/6] staging: video: rockchip: add video codec

2019-03-07 Thread Randy Li
From: Randy Li Signed-off-by: Randy Li --- drivers/staging/Kconfig | 2 ++ drivers/staging/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index c0901b96cfe4..5f84035e2a89 100644 --- a/drivers/staging/Kconfig +++ b/drivers/stagin

[PATCH v2 3/6] [TEST]: rockchip: mpp: support qptable

2019-03-07 Thread Randy Li
I don't care, I don't want to store buffers for a session. I just want to use it to verify the FFmpeg. I want the memory region !!! It can save more time if those data are prepared in userspace. Signed-off-by: Randy Li --- drivers/staging/rockchip-mpp/mpp_dev_common.c | 3 +-- drivers/staging/

[PATCH v2 0/6] [WIP]: rockchip mpp for v4l2 video deocder

2019-03-07 Thread Randy Li
Although I really want to push those work after I added more codec supports, but I found it is more urge to do those in v4l2 core framework and userspace. I would use this driver to present the current problems, write down a summary here and I would reply to those threads later to push forward. 1

Re: [PATCH v3 12/31] media: entity: Add an iterator helper for connected pads

2019-03-07 Thread Sakari Ailus
Hi Jacopo, On Tue, Mar 05, 2019 at 07:51:31PM +0100, Jacopo Mondi wrote: > From: Sakari Ailus > > Add a helper macro for iterating over pads that are connected through > enabled routes. This can be used to find all the connected pads within an > entity, for instance starting from the pad which h

[PATCH v2 2/6] staging: video: rockchip: add v4l2 decoder

2019-03-07 Thread Randy Li
From: Randy Li It is based on the vendor driver sent to mail list before. Only MPEG2 video for VDPU2 works. And it need a patch to fill the QP table. I have finished the register table of the rkvdec and rk hevc decoder. But I can't feed its proper input stream, I will talk the reason below. Th

Re: [RFC PATCH V0 7/7] [media] platform: mtk-isp: Add Mediatek ISP Pass 1 driver

2019-03-07 Thread Tomasz Figa
Hi Frederic, Jungo, Sorry for making you wait. Here comes the second part. Please see my comments inline. [snip] > + > +#define MTK_CAM_IO_CON_PADS (1) > + > +/* mtk_cam_io_connection --> sensor IF --> sensor 1 */ > +/* --> sensor 2 */ nit: Comment style. Als

Re: [PATCH v3 00/31] v4l: add support for multiplexed streams

2019-03-07 Thread Sakari Ailus
Hi Jacopo, On Tue, Mar 05, 2019 at 07:51:19PM +0100, Jacopo Mondi wrote: > Hello, >third version of multiplexed stream support patch series. > > V2 sent by Niklas is available at: > https://patchwork.kernel.org/cover/10573817/ > > As per v2, most of the core patches are work from Sakari and

[PATCHv3 1/9] cec: fill in cec chardev kobject to ease debugging

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil The cec chardev kobject has no name, which made it hard to debug when kobject debugging is turned on. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/cec/cec-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/cec/cec-core.c

[PATCHv3 4/9] media-entity: set ent_enum->bmap to NULL after freeing it

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil Ensure that this pointer is set to NULL after it is freed. The vimc driver has a static media_entity and after unbinding and rebinding the vimc device the media code will try to free this pointer again since it wasn't set to NULL. Signed-off-by: Hans Verkuil --- drivers/medi

[PATCHv3 5/9] vim2m: replace devm_kzalloc by kzalloc

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil It is not possible to use devm_kzalloc since that memory is freed immediately when the device instance is unbound. Various objects like the video device may still be in use since someone has the device node open, and when that is closed it expects the memory to be around. So

[PATCHv3 3/9] vivid: use vzalloc for dev->bitmap_out

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil When vivid is unloaded it used vfree to free dev->bitmap_out, but it was actually allocated using kmalloc. Use vzalloc instead, conform what vivid-vid-cap.c does. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/vivid/vivid-vid-out.c | 14

[PATCHv3 2/9] media-devnode: fill in media chardev kobject to ease debugging

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil The media chardev kobject has no name, which made it hard to debug when kobject debugging is turned on. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/media-devnode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/media-devnod

[PATCHv3 7/9] v4l2-subdev: handle module refcounting here

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil The module ownership refcounting was done in media_entity_get/put, but that was very confusing and it did not work either in case an application had a v4l-subdevX device open and the module was unbound. When the v4l-subdevX device was closed the media_entity_put was never calle

[PATCHv3 8/9] vimc: free vimc_cap_device when the last user disappears

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil Don't free vimc_cap_device immediately, instead do this in the video_device release function which is called when the last user closes the video device. Only then is it safe to free the memory. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/plat

[PATCHv3 6/9] v4l2-subdev: add release() internal op

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil If the subdevice created a device node, then the v4l2_subdev cannot be freed until the last user of the device node closes it. This means that we need a release() callback in v4l2_subdev_internal_ops that is called from the video_device release function so the subdevice driver

[PATCHv3 0/9] Various core and virtual driver fixes

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil Various fixes for bugs that I found while working on the regression test-media script. The CONFIG_DEBUG_KOBJECT_RELEASE=y option in particular found a bunch of bugs where things were not released in the right order. Note that the first two patches are not bug fixes, but they

[PATCHv3 9/9] vimc: use new release op

2019-03-07 Thread hverkuil-cisco
From: Hans Verkuil Use the new v4l2_subdev_internal_ops release op to free the subdev memory only once the last user closed the file handle. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/vimc/vimc-common.c | 2 ++ drivers/media/platform/vimc/vimc-commo

Re: [PATCHv2 4/9] media-entity: set ent_enum->bmap to NULL after freeing it

2019-03-07 Thread Hans Verkuil
On 3/5/19 8:39 PM, Laurent Pinchart wrote: > Hi Hans, > > Thank you for the patch. > > On Tue, Mar 05, 2019 at 10:58:42AM +0100, hverkuil-ci...@xs4all.nl wrote: >> From: Hans Verkuil >> >> Ensure that this pointer is set to NULL after it is freed. >> The vimc driver has a static media_entity and

Re: [PATCHv2 6/9] v4l2-subdev: add release() internal op

2019-03-07 Thread Laurent Pinchart
Hi Hans, On Thu, Mar 07, 2019 at 09:54:53AM +0100, Hans Verkuil wrote: > On 3/5/19 8:46 PM, Laurent Pinchart wrote: > > On Tue, Mar 05, 2019 at 10:58:44AM +0100, hverkuil-ci...@xs4all.nl wrote: > >> From: Hans Verkuil > >> > >> If the subdevice created a device node, then the v4l2_subdev cannot >

Re: [PATCHv2 7/9] v4l2-subdev: handle module refcounting here

2019-03-07 Thread Hans Verkuil
On 3/5/19 8:52 PM, Laurent Pinchart wrote: > Hi Hans, > > (CC'ing Sakari) > > Thank you for the patch. > > On Tue, Mar 05, 2019 at 10:58:45AM +0100, hverkuil-ci...@xs4all.nl wrote: >> From: Hans Verkuil >> >> The module ownership refcounting was done in media_entity_get/put, >> but that was ver

Re: [PATCHv2 6/9] v4l2-subdev: add release() internal op

2019-03-07 Thread Hans Verkuil
On 3/5/19 8:46 PM, Laurent Pinchart wrote: > Hi Hans, > > Thank you for the patch. > > On Tue, Mar 05, 2019 at 10:58:44AM +0100, hverkuil-ci...@xs4all.nl wrote: >> From: Hans Verkuil >> >> If the subdevice created a device node, then the v4l2_subdev cannot >> be freed until the last user of the