[GIT FIXES for 4.20] Fwnode parsing fix

2018-12-07 Thread sakari . ailus
deletions(-) -- Sakari Ailus

Re: [PATCH 1/2] media: pxa_camera: don't deferenciate a NULL pointer

2018-12-07 Thread Sakari Ailus
rivers simply do it this way without WARN_ON(). > + WARN_ON(1); > + return -ENODEV; > } else { > pcdev->platform_flags = pcdev->pdata->flags; > pcdev->mclk = pcdev->pdata->mclk_10khz * 1; -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH v2 1/1] media: Add a Kconfig option for the Request API

2018-12-05 Thread Sakari Ailus
as buffer flags. The driver requiring requests (cedrus) now depends on the Kconfig option as well. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil --- since v1: - Write out the #ifdef's in request creation - The option's functionality was reversed in request creation, fixed that drivers

[PATCH 1/1] ipu3-cio2: Allow probe to succeed if there are no sensors connected

2018-12-05 Thread Sakari Ailus
The device won't be powered off on systems that have no sensors connected unless it has a driver bound to it. Allow that to happen even if there are no sensors connected to cio2. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 1/1] media: Add a Kconfig option for the Request API

2018-12-05 Thread Sakari Ailus
as buffer flags. The driver requiring requests (cedrus) now depends on the Kconfig option as well. Signed-off-by: Sakari Ailus --- I hope this covers now everything... I was thinking how to make the option name itself more worrisome but I couldn't come up with a better language that would

[GIT PULL for 4.21] More sensor driver patches

2018-12-05 Thread sakari . ailus
-async.c | 4 - drivers/media/v4l2-core/v4l2-fwnode.c | 2 +- 10 files changed, 703 insertions(+), 337 deletions(-) -- Regards, Sakari Ailus

[PATCH 1/1] v4l uapi: Make "Vertical Colour Bars" menu item a little more generic

2018-12-04 Thread Sakari Ailus
The test pattern could contain a different number of colour bars than eight, make the entry more useful by removing "Eight " from the name. Signed-off-by: Sakari Ailus --- include/uapi/linux/v4l2-controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/

Re: [PATCH 1/1] media: Use common test pattern menu entries

2018-12-04 Thread sakari . ailus
On Tue, Nov 27, 2018 at 07:19:52PM +0800, Bingbu Cao wrote: > > On 11/27/2018 05:33 PM, Sakari Ailus wrote: > > diff --git a/include/uapi/linux/v4l2-controls.h > > b/include/uapi/linux/v4l2-controls.h > > index 998983a6e6b7..a74ff6f1ac88 100644 > > --- a/incl

[PATCH v2 1/1] media: Use common test pattern menu entries

2018-12-04 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- since v1: - Fix

Re: [PATCH v2] v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields

2018-12-04 Thread sakari . ailus
e/v4l2-ioctl.c > @@ -1512,6 +1512,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, > struct v4l2_format *p = arg; > struct video_device *vfd = video_devdata(file); > int ret = check_fmt(file, p->type); > + int i; unsigned int; same below. With that, Acke

Re: [PATCH v9 04/13] media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7

2018-12-03 Thread Sakari Ailus
y_pads_init(>mipi_sd.entity, CSIS_PADS_NUM, > + state->pads); > + if (ret < 0) > + goto unregister_subdev; > + > + memcpy(state->events, mipi_csis_events, sizeof(state->events)); > + > + pm_runtime_enable(dev); > + if (!pm_runtime_enabled(dev)) { > + ret = mipi_csis_pm_resume(dev, true); > + if (ret < 0) > + goto unregister_all; > + } > + > + dev_info(>dev, "lanes: %d, hs_settle: %d, wclk: %d, freq: %u\n", > + state->bus.num_data_lanes, state->hs_settle, > + state->wrap_clk ? 1 : 0, state->clk_frequency); > + return 0; > + > +unregister_all: > + media_entity_cleanup(>mipi_sd.entity); > +unregister_subdev: > + v4l2_async_unregister_subdev(>mipi_sd); > +disable_clock: > + mipi_csis_clk_disable(state); > + > + return ret; > +} > + > +static int mipi_csis_pm_suspend(struct device *dev, bool runtime) > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + int ret = 0; > + > + mutex_lock(>lock); > + if (state->flags & ST_POWERED) { > + mipi_csis_stop_stream(state); > + ret = regulator_disable(state->mipi_phy_regulator); > + if (ret) > + goto unlock; > + mipi_csis_clk_disable(state); > + state->flags &= ~ST_POWERED; > + if (!runtime) > + state->flags |= ST_SUSPENDED; > + } > + > + unlock: > + mutex_unlock(>lock); > + > + return ret ? -EAGAIN : 0; > +} > + > +static int mipi_csis_pm_resume(struct device *dev, bool runtime) > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + int ret = 0; > + > + mutex_lock(>lock); > + if (!runtime && !(state->flags & ST_SUSPENDED)) > + goto unlock; > + > + if (!(state->flags & ST_POWERED)) { > + ret = regulator_enable(state->mipi_phy_regulator); > + if (ret) > + goto unlock; > + > + state->flags |= ST_POWERED; > + mipi_csis_clk_enable(state); > + } > + if (state->flags & ST_STREAMING) > + mipi_csis_start_stream(state); > + > + state->flags &= ~ST_SUSPENDED; > + > + unlock: > + mutex_unlock(>lock); > + > + return ret ? -EAGAIN : 0; > +} > + > +static int mipi_csis_suspend(struct device *dev) > +{ > + return mipi_csis_pm_suspend(dev, false); > +} > + > +static int mipi_csis_resume(struct device *dev) > +{ > + return mipi_csis_pm_resume(dev, false); > +} > + > +static int mipi_csis_runtime_suspend(struct device *dev) > +{ > + return mipi_csis_pm_suspend(dev, true); > +} > + > +static int mipi_csis_runtime_resume(struct device *dev) > +{ > + return mipi_csis_pm_resume(dev, true); > +} > + > +static int mipi_csis_remove(struct platform_device *pdev) > +{ > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + > + v4l2_async_unregister_subdev(>mipi_sd); > + v4l2_async_notifier_unregister(>subdev_notifier); > + > + pm_runtime_disable(>dev); > + mipi_csis_pm_suspend(>dev, true); > + mipi_csis_clk_disable(state); > + media_entity_cleanup(>mipi_sd.entity); > + pm_runtime_set_suspended(>dev); > + > + return 0; > +} > + > +static const struct dev_pm_ops mipi_csis_pm_ops = { > + SET_RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume, > +NULL) > + SET_SYSTEM_SLEEP_PM_OPS(mipi_csis_suspend, mipi_csis_resume) > +}; > + > +static const struct of_device_id mipi_csis_of_match[] = { > + { .compatible = "fsl,imx7-mipi-csi2", }, > + { /* sentinel */ }, > +}; > +MODULE_DEVICE_TABLE(of, mipi_csis_of_match); > + > +static struct platform_driver mipi_csis_driver = { > + .probe = mipi_csis_probe, > + .remove = mipi_csis_remove, > + .driver = { > + .of_match_table = mipi_csis_of_match, > + .name = CSIS_DRIVER_NAME, > + .pm = _csis_pm_ops, > + }, > +}; > + > +module_platform_driver(mipi_csis_driver); > + > +MODULE_DESCRIPTION("i.MX7 MIPI CSI-2 Receiver driver"); > +MODULE_LICENSE("GPL"); > +MODULE_ALIAS("platform:imx7-mipi-csi2"); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: unify some sony camera sensors pattern naming

2018-12-03 Thread Sakari Ailus
amera sensors have same test pattern > > > definitions, this patch unify the pattern naming > > > to make it more clear to the userspace. > > > > > > Suggested-by: Sakari Ailus > > > Signed-off-by: Bingbu Cao > > > --- > > > drive

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-12-03 Thread Sakari Ailus
Hi Laurent, On Fri, Nov 30, 2018 at 01:07:53AM +0200, Laurent Pinchart wrote: > Hello Bing, > > On Wednesday, 7 November 2018 06:16:47 EET Bing Bu Cao wrote: > > On 11/01/2018 08:03 PM, Sakari Ailus wrote: > > > On Mon, Oct 29, 2018 at 03:22:54PM -0700, Yong Zhi wrote: &g

Re: [PATCH v7 03/16] v4l: Add Intel IPU3 meta data uAPI

2018-12-01 Thread Sakari Ailus
Hi Yong, On Thu, Nov 29, 2018 at 11:06:23PM +, Zhi, Yong wrote: > Hi, Sakari, > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Thursday, November 29, 2018 4:46 PM > > To: Zhi, Yong > > Cc: linux-media

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-30 Thread Sakari Ailus
Hi Laurent, On Fri, Nov 30, 2018 at 01:09:37AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > > On Friday, 9 November 2018 12:09:54 EET Sakari Ailus wrote: > > On Wed, Nov 07, 2018 at 12:16:47PM +0800, Bing Bu Cao wrote: > > > On 11/01/2018 08:03 PM, Sakari Ailus w

Re: [PATCH v7 09/16] intel-ipu3: css: Add support for firmware management

2018-11-28 Thread Sakari Ailus
define IMGU_FW_NAME "ipu3-fw.bin" Shouldn't this be "intel/ipu3-fw.bin"? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH for v4.20 0/5] vb2 fixes (mostly request API related)

2018-11-28 Thread sakari . ailus
0, but I think it is also possible > to apply them for 4.21 since the request API is only used by virtual > drivers and a staging driver. For patches 2--5: Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH for v4.20 1/5] vb2: don't call __vb2_queue_cancel if vb2_start_streaming failed

2018-11-28 Thread Sakari Ailus
ing if sufficient buffers > are queued') > Cc: # for v4.16 and up Acked-by: Sakari Ailus > --- > drivers/media/common/videobuf2/videobuf2-core.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/media/common/videobuf2/videobuf2-core.c

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-28 Thread Sakari Ailus
On Wed, Nov 28, 2018 at 09:29:01AM +0100, Marco Felsch wrote: > On 18-11-27 23:15, Sakari Ailus wrote: > > On Tue, Nov 27, 2018 at 11:02:53AM +0100, Marco Felsch wrote: > > > From: Enrico Scholz > > > > > > The chip can be configured to output data transitions

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
2 + select V4L2_FWNODE help This driver supports MT9M111, MT9M112 and MT9M131 cameras from Micron/Aptina -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 03:12:29PM +0100, Philipp Zabel wrote: > Hi Sakari, > > On Tue, 2018-11-27 at 15:50 +0200, Sakari Ailus wrote: > > Hi Philipp, > > > > On Tue, Nov 27, 2018 at 02:39:27PM +0100, Philipp Zabel wrote: > > > Hi Sakari, > > > &g

Re: [PATCH v3 5/6] dt-bindings: media: mt9m111: add pclk-sample property

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 03:21:05PM +0100, Marco Felsch wrote: > Hi Sakari, > > On 18-11-27 15:13, Sakari Ailus wrote: > > Hi Marco, > > > > On Tue, Nov 27, 2018 at 11:02:52AM +0100, Marco Felsch wrote: > > > Add the pclk-sample property to the list of optio

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
Hi Philipp, On Tue, Nov 27, 2018 at 02:39:27PM +0100, Philipp Zabel wrote: > Hi Sakari, > > On Tue, 2018-11-27 at 15:19 +0200, Sakari Ailus wrote: > > Hi Marco, > > > > On Tue, Nov 27, 2018 at 11:02:53AM +0100, Marco Felsch wrote: > > > From: Enri

Re: [PATCH v4 2/2] dt-bindings: Document the Rockchip RK1608 bindings

2018-11-27 Thread Sakari Ailus
/* If you have a second sensor, > + * add the 'endpoint@1' node here. > + */ > + sensor_in1: endpoint@1 { > + remote-endpoint = <_out1>; > + }; > + }; > + }; > + }; > +}; > diff --git a/MAINTAINERS b/MAINTAINERS > index b2a98e3..04d227b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -141,6 +141,7 @@ M:Leo Wen > S: Maintained > F: drivers/media/spi/rk1608.c > F: drivers/media/spi/rk1608.h > +F: Documentation/devicetree/bindings/media/rk1608.txt > > 3C59X NETWORK DRIVER > M: Steffen Klassert -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
endpoint_free(_cfg); out_put_fw: fwnode_handle_put(np); Please base on current media tree master on the next time. Thanks. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 5/6] dt-bindings: media: mt9m111: add pclk-sample property

2018-11-27 Thread Sakari Ailus
mt9m111_1: endpoint { > remote-endpoint = <_camera>; > + pclk-sample = <1>; > }; > }; > }; -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [RESEND PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 01:11:42PM +0100, Luca Ceresoli wrote: > Hi Sakari, Bingbu, > > On 27/11/18 10:34, Sakari Ailus wrote: > > While the test pattern menu itself is not standardised, many devices > > support the same test patterns. Aligning the menu entries helps the

[RESEND PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- Fixed Andy's email

Re: [PATCH v2] media: unify some sony camera sensors pattern naming

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 05:03:26PM +0800, bingbu@intel.com wrote: > From: Bingbu Cao > > Some Sony camera sensors have same pattern > definitions, this patch unify the pattern naming > to make it more clear to the userspace. > > Suggested-by: Sakari Ailus > S

[PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- drivers/media/i2c

Re: [PATCH 2/2] media: imx355: fix wrong order in test pattern menus

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 10:45:02AM +0800, Bingbu Cao wrote: > > > On 11/26/2018 04:57 PM, Sakari Ailus wrote: > > Hi Bing Bu, > > > > On Mon, Nov 26, 2018 at 03:43:34PM +0800, bingbu@intel.com wrote: > > > From: Bingbu Cao > > > > &g

Re: [PATCH] media: unify some sony camera sensors pattern naming

2018-11-27 Thread Sakari Ailus
naming > > to make it more clear to the userspace. > > > > Suggested-by: Sakari Ailus > > Signed-off-by: Bingbu Cao > > --- > > drivers/media/i2c/imx258.c | 8 > > drivers/media/i2c/imx319.c | 8 > > drivers/media/i2c/imx355.c |

[PATCH 1/1] v4l: ioctl: Allow drivers to fill in the format description

2018-11-26 Thread Sakari Ailus
the description begins with a non-nil character before issuing the warning. Signed-off-by: Sakari Ailus Suggested-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2

Re: [PATCH 2/2] media: imx355: fix wrong order in test pattern menus

2018-11-26 Thread Sakari Ailus
ight Vertical Colour Bars", "Colour Bars With Fade to Grey", "Pseudorandom Sequence (PN9)", }; It's not strictly necessary from interface point of view, but for the user space it'd be good to align the naming. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3] media: video-i2c: check if chip struct has set_power function

2018-11-25 Thread Sakari Ailus
Hi Matt, On Sat, Nov 24, 2018 at 02:03:23PM -0800, Matt Ranostay wrote: > Not all future supported video chips will always have power management > support, and so it is important to check before calling set_power() is > defined. > > Cc: Sakari Ailus > Cc: Hans Verkuil &g

Re: 'bad remote port parent' warnings

2018-11-23 Thread Sakari Ailus
0 (-22) > [3.457342] imx-ipuv3-csi: probe of imx-ipuv3-csi.1 failed with error -22 > [3.464498] imx-ipuv3 280.ipu: driver could not parse > port@0/endpoint@0 (-22) > [3.472120] imx-ipuv3-csi: probe of imx-ipuv3-csi.4 failed with error -22 I'm not sure if this is a real problem, I pre

[yavta PATCH 1/1] Zero dev in main()

2018-11-22 Thread Sakari Ailus
From: Sakari Ailus This is necessary since video_open() may not be always called soon Signed-off-by: Sakari Ailus --- yavta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yavta.c b/yavta.c index c7986bd..de5376d 100644 --- a/yavta.c +++ b/yavta.c @@ -342,7 +342,6

Re: is it possible to use single IOCTL to setup media pipeline?

2018-11-22 Thread Sakari Ailus
nfiguring the media > topology would solve the performance problem. There have been ideas of moving all IOCTL handling to the media device, in a way that would allow issuing them in the same fashion than controls. This was discussed in last year's media summit actually. I think this could be done once the request API is otherwise working for e.g. camera devices. I don't expect this to materialise in near (or even medium) term though. -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

[GIT PULL for 4.21] Sensor and CSI driver patches

2018-11-22 Thread Sakari Ailus
A31 compatible Nathan Chancellor (1): media: imx214: Remove unnecessary self assignment in for loop Rui Miguel Silva (1): media: ov2680: fix null dereference at power on Sakari Ailus (2): v4l: uAPI doc: Simplify NATIVE_SIZE selection target documentation v4l: uAPI doc: Chang

Re: [PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-22 Thread Sakari Ailus
On Tue, Nov 20, 2018 at 09:21:50AM -0200, Mauro Carvalho Chehab wrote: > Em Tue, 20 Nov 2018 12:49:46 +0200 > Sakari Ailus escreveu: > > > Hi Greg, > > > > On Mon, Nov 19, 2018 at 06:46:21PM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Nov 19, 2018 at

Re: [PATCH] media: ov2680: fix null dereference at power on

2018-11-22 Thread Sakari Ailus
e they'll wrap in git log. I've re-wrapped it this time. Thanks. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v8 03/12] media: staging/imx7: add imx7 CSI subdev driver

2018-11-21 Thread Sakari Ailus
struct device *dev = csi->dev; > + > + csi->clk_disp_axi = devm_clk_get(dev, "axi"); > + if (IS_ERR(csi->clk_disp_axi)) { > + dev_err(dev, "Could not get csi axi clock\n"); > + return -ENODEV; > + } > + > + csi->clk_disp_dcic = devm_clk_get(dev, "dcic"); > + if (IS_ERR(csi->clk_disp_dcic)) { > + dev_err(dev, "Could not get disp dcic clock\n"); > + return -ENODEV; > + } > + > + csi->clk_csi_mclk = devm_clk_get(dev, "mclk"); > + if (IS_ERR(csi->clk_csi_mclk)) { > + dev_err(dev, "Could not get csi mclk clock\n"); > + return -ENODEV; > + } Could you use devm_clk_bulk_get()? > + > + return 0; > +} > + > +static int imx7_csi_probe(struct platform_device *pdev) > +{ > + struct device *dev = >dev; > + struct device_node *node = dev->of_node; > + struct imx7_csi *csi; > + struct resource *res; > + int ret; > + > + csi = devm_kzalloc(>dev, sizeof(*csi), GFP_KERNEL); > + if (!csi) > + return -ENOMEM; > + > + platform_set_drvdata(pdev, >sd); > + csi->dev = dev; > + > + ret = imx7_csi_parse_dt(csi); > + if (ret < 0) > + return -ENODEV; > + > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + csi->irq = platform_get_irq(pdev, 0); > + if (!res || csi->irq < 0) { > + dev_err(dev, "Missing platform resources data\n"); > + return -ENODEV; > + } > + > + csi->regbase = devm_ioremap_resource(dev, res); > + if (IS_ERR(csi->regbase)) { > + dev_err(dev, "Failed platform resources map\n"); > + return -ENODEV; > + } > + > + spin_lock_init(>irqlock); > + mutex_init(>lock); > + > + /* install interrupt handler */ > + ret = devm_request_irq(dev, csi->irq, imx7_csi_irq_handler, 0, "csi", > +(void *)csi); > + if (ret < 0) { > + dev_err(dev, "Request CSI IRQ failed.\n"); > + return -ENODEV; mutex_destroy(); better to add a label below. > + } > + > + /* add media device */ > + csi->imxmd = imx_media_dev_init(dev); > + if (IS_ERR(csi->imxmd)) > + return PTR_ERR(csi->imxmd); > + > + ret = imx_media_of_add_csi(csi->imxmd, node); > + if (ret < 0) > + goto media_cleanup; > + > + ret = imx_media_dev_notifier_register(csi->imxmd); > + if (ret < 0) > + goto media_cleanup; > + > + v4l2_subdev_init(>sd, _csi_subdev_ops); > + v4l2_set_subdevdata(>sd, csi); > + csi->sd.internal_ops = _csi_internal_ops; > + csi->sd.entity.ops = _csi_entity_ops; > + csi->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; > + csi->sd.dev = >dev; > + csi->sd.owner = THIS_MODULE; > + csi->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; > + csi->sd.grp_id = IMX_MEDIA_GRP_ID_CSI; > + snprintf(csi->sd.name, sizeof(csi->sd.name), "csi"); > + > + csi->vdev = imx_media_capture_device_init(>sd, IMX7_CSI_PAD_SRC); > + if (IS_ERR(csi->vdev)) > + return PTR_ERR(csi->vdev); > + > + v4l2_ctrl_handler_init(>ctrl_hdlr, 0); > + csi->sd.ctrl_handler = >ctrl_hdlr; > + > + ret = v4l2_async_register_fwnode_subdev(>sd, > + sizeof(struct v4l2_async_subdev), > + NULL, 0, imx7_csi_parse_endpoint); > + if (ret) > + goto free; > + > + return 0; > + > +free: > + v4l2_ctrl_handler_free(>ctrl_hdlr); > + mutex_destroy(>lock); > + imx_media_capture_device_remove(csi->vdev); > + > +media_cleanup: > + imx_media_dev_cleanup(csi->imxmd); > + > + return ret; > +} > + > +static int imx7_csi_remove(struct platform_device *pdev) > +{ > + struct v4l2_subdev *sd = platform_get_drvdata(pdev); > + struct imx7_csi *csi = v4l2_get_subdevdata(sd); > + > + v4l2_ctrl_handler_free(>ctrl_hdlr); > + mutex_destroy(>lock); Please unregister the devices before the two above lines. > + imx_media_capture_device_remove(csi->vdev); > + imx_media_dev_notifier_unregister(csi->imxmd); > + imx_media_dev_cleanup(csi->imxmd); > + media_entity_cleanup(>entity); > + v4l2_async_unregister_subdev(sd); > + > + return 0; > +} > + > +static const struct of_device_id imx7_csi_of_match[] = { > + { .compatible = "fsl,imx7-csi" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, imx7_csi_of_match); > + > +static struct platform_driver imx7_csi_driver = { > + .probe = imx7_csi_probe, > + .remove = imx7_csi_remove, > + .driver = { > + .of_match_table = imx7_csi_of_match, > + .name = "imx7-csi", > + }, > +}; > +module_platform_driver(imx7_csi_driver); > + > +MODULE_DESCRIPTION("i.MX7 CSI subdev driver"); > +MODULE_AUTHOR("Rui Miguel Silva "); > +MODULE_LICENSE("GPL"); > +MODULE_ALIAS("platform:imx7-csi"); -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v8 05/12] media: dt-bindings: add bindings for i.MX7 media driver

2018-11-21 Thread Sakari Ailus
Hi Rui, On Wed, Nov 21, 2018 at 11:15:51AM +, Rui Miguel Silva wrote: > Add bindings documentation for i.MX7 media drivers. > The imx7 MIPI CSI2 and imx7 CMOS Sensor Interface. > > Signed-off-by: Rui Miguel Silva > Reviewed-by: Rob Herring > Acked-by: Sakari Ailus >

[PATCH 1/1] v4l: uAPI doc: Changing frame interval won't change format

2018-11-21 Thread Sakari Ailus
Document that changing the frame interval has no effect on frame size. While this was the assumption in the API, it was not documented as such. Signed-off-by: Sakari Ailus --- Documentation/media/uapi/v4l/vidioc-g-parm.rst | 3 +++ Documentation/media/uapi/v4l/vidioc-subdev-g

Re: [PATCH] media: video-i2c: don't use msleep for 1ms - 20ms

2018-11-20 Thread Sakari Ailus
ce msleep(2) by usleep_range(2000, 3000). > > Reported-by: Hans Verkuil > Cc: Matt Ranostay > Cc: Sakari Ailus > Cc: Hans Verkuil > Cc: Mauro Carvalho Chehab > Signed-off-by: Akinobu Mita Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: 'bad remote port parent' warnings

2018-11-20 Thread Sakari Ailus
eo-mux 20e.iomuxc-gpr:ipu2_csi1_mux: bad remote > port parent > > Is there anything we should do to prevent this from happening? Where's the DT source for the board? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-20 Thread Sakari Ailus
Hi Greg, On Mon, Nov 19, 2018 at 06:46:21PM +0100, Greg Kroah-Hartman wrote: > On Mon, Nov 19, 2018 at 07:03:54PM +0200, Sakari Ailus wrote: > > Hi Greg, > > > > On Mon, Nov 19, 2018 at 04:14:00PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Nov 14, 2018 at 11:37:

[GIT PULL for 4.21] Sensor and CSI driver patches

2018-11-20 Thread Sakari Ailus
ioctl and event interface media: ov772x: support log_status ioctl and event interface Chen, JasonX Z (1): media: imx258: remove test pattern map from driver Nathan Chancellor (1): media: imx214: Remove unnecessary self assignment in for loop Sakari Ailus (1): v4l: uAPI doc

Re: [PATCH] videodev2.h: add V4L2_BUF_CAP_SUPPORTS_PREPARE_BUF/CREATE_BUFS

2018-11-20 Thread Sakari Ailus
On Tue, Nov 20, 2018 at 10:41:42AM +0100, Hans Verkuil wrote: > On 11/20/2018 10:27 AM, Sakari Ailus wrote: > > Hi Hans, > > > > On Tue, Nov 20, 2018 at 09:58:43AM +0100, Hans Verkuil wrote: > >> Add new buffer capability flags to indicate if the VIDIOC_PREPARE_

Re: [PATCH] videodev2.h: add V4L2_BUF_CAP_SUPPORTS_PREPARE_BUF/CREATE_BUFS

2018-11-20 Thread Sakari Ailus
c8e8ff810190..6648f8ba2277 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -879,6 +879,8 @@ struct v4l2_requestbuffers { > #define V4L2_BUF_CAP_SUPPORTS_USERPTR(1 << 1) > #define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2)

Re: [PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-19 Thread Sakari Ailus
Hi Greg, On Mon, Nov 19, 2018 at 04:14:00PM +0100, Greg Kroah-Hartman wrote: > On Wed, Nov 14, 2018 at 11:37:46AM +0200, Sakari Ailus wrote: > > [ upstream commit 92539d3eda2c090b382699bbb896d4b54e9bdece ] > > There is no such git commit id in Linus's tree :( Right. At

Re: [PATCH v2 3/9] phy: Add MIPI D-PHY configuration options

2018-11-19 Thread Sakari Ailus
ar lanes; This is related to the data_lanes DT property. I assume this is intended to be the number of active lanes. And presumably the first "lanes" number of lanes would be used in that case? > +}; > + > +#endif /* __PHY_MIPI_DPHY_H_ */ > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h > index 89cf8b685546..d7ea2dc4e2be 100644 > --- a/include/linux/phy/phy.h > +++ b/include/linux/phy/phy.h > @@ -20,6 +20,8 @@ > #include > #include > > +#include > + > struct phy; > > enum phy_mode { > @@ -47,8 +49,12 @@ enum phy_mode { > > /** > * union phy_configure_opts - Opaque generic phy configuration > + * > + * @mipi_dphy: Configuration set applicable for phys supporting > + * the MIPI_DPHY phy mode. > */ > union phy_configure_opts { > + struct phy_configure_opts_mipi_dphy mipi_dphy; > }; > > /** -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v2 4/9] phy: dphy: Add configuration helpers

2018-11-19 Thread Sakari Ailus
+ return -EINVAL; > + > + if (cfg->ta_go != 4 * cfg->lpx) > + return -EINVAL; > + > + if (cfg->ta_sure < cfg->lpx || cfg->ta_sure > 2 * cfg->lpx) > + return -EINVAL; > + > + if (cfg->wakeup < 100) > + return -EINVAL; > + > + return 0; > +} > +EXPORT_SYMBOL(phy_mipi_dphy_config_validate); > diff --git a/include/linux/phy/phy-mipi-dphy.h > b/include/linux/phy/phy-mipi-dphy.h > index 0b05932916af..5e3673778afa 100644 > --- a/include/linux/phy/phy-mipi-dphy.h > +++ b/include/linux/phy/phy-mipi-dphy.h > @@ -229,4 +229,10 @@ struct phy_configure_opts_mipi_dphy { > unsigned char lanes; > }; > > +int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, > + unsigned int bpp, > + unsigned int lanes, > + struct phy_configure_opts_mipi_dphy *cfg); > +int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg); > + > #endif /* __PHY_MIPI_DPHY_H_ */ -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv2 2/4] vivid: use per-queue mutexes instead of one global mutex.

2018-11-19 Thread Sakari Ailus
NULL; > - mutex_lock(>mutex); > } > diff --git a/drivers/media/platform/vivid/vivid-sdr-cap.c > b/drivers/media/platform/vivid/vivid-sdr-cap.c > index dcdc80e272c2..5dfb598af742 100644 > --- a/drivers/media/platform/vivid/vivid-sdr-cap.c > +++ b/drivers/media/platform/vivid/vivid-sdr-cap.c > @@ -305,10 +305,8 @@ static void sdr_cap_stop_streaming(struct vb2_queue *vq) > } > > /* shutdown control thread */ > - mutex_unlock(>mutex); > kthread_stop(dev->kthread_sdr_cap); > dev->kthread_sdr_cap = NULL; > - mutex_lock(>mutex); > } > > static void sdr_cap_buf_request_complete(struct vb2_buffer *vb) > -- > 2.19.1 > -- Sakari Ailus sakari.ai...@linux.intel.com

[ANN] Edinburgh Media Summit 2018 meeting report

2018-11-17 Thread Sakari Ailus
o Ribalda Sakari Ailus Sean Young Seung-Woo Kim Stefan Klug Vinod Koul CEC status - Hans Verkuil - Hans prensented an update on CEC status. Besides the slides, noteworthy information is maintained here: https://hverkuil.home.xs4all.nl/cec-s

Re: [PATCH v2 3/6] media: mt9m111: add support to select formats and fps for {Q,SXGA}

2018-11-16 Thread Sakari Ailus
Hi Hans, On Fri, Nov 16, 2018 at 02:31:01PM +0100, Hans Verkuil wrote: > On 11/16/2018 02:26 PM, Sakari Ailus wrote: > > Hi Marco, Michael, > > > > On Mon, Oct 29, 2018 at 07:24:07PM +0100, Marco Felsch wrote: > >> From: Michael Grzeschik > >> > >&g

Re: [PATCH v2 4/6] media: mt9m111: allow to setup pixclk polarity

2018-11-16 Thread Sakari Ailus
e(struct i2c_client *client, > /* Default HIGHPOWER context */ > mt9m111->ctx = _b; > > + ret = mt9m111_probe_fw(client, mt9m111); > + if (ret) > + return ret; Can you do this before v4l2_clk_get()? That'll go anyway, but for now, you'd need extra error handling for it. > + > v4l2_i2c_subdev_init(>subdev, client, _subdev_ops); > mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > Please also put this patch after the DT binding changes. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v2 3/6] media: mt9m111: add support to select formats and fps for {Q,SXGA}

2018-11-16 Thread Sakari Ailus
nterval = fi->interval; > + > + return 0; > +} > + > static int mt9m111_enum_mbus_code(struct v4l2_subdev *sd, > struct v4l2_subdev_pad_config *cfg, > struct v4l2_subdev_mbus_code_enum *code) > @@ -905,6 +1062,8 @@ static int mt9m111_g_mbus_config(struct v4l2_subdev *sd, > static const struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = { > .g_mbus_config = mt9m111_g_mbus_config, > .s_stream = mt9m111_s_stream, > + .g_frame_interval = mt9m111_g_frame_interval, > + .s_frame_interval = mt9m111_s_frame_interval, > }; > > static const struct v4l2_subdev_pad_ops mt9m111_subdev_pad_ops = { > @@ -1021,6 +1180,10 @@ static int mt9m111_probe(struct i2c_client *client, > goto out_hdlfree; > #endif > > + mt9m111->current_mode = _mode_data[MT9M111_MODE_SXGA_15FPS]; > + mt9m111->frame_interval.numerator = 1; > + mt9m111->frame_interval.denominator = mt9m111->current_mode->max_fps; > + > /* Second stage probe - when a capture adapter is there */ > mt9m111->rect.left = MT9M111_MIN_DARK_COLS; > mt9m111->rect.top = MT9M111_MIN_DARK_ROWS; -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH 4/4] media: ov5640: Add additional media bus formats

2018-11-16 Thread Sakari Ailus
YV8_1X16: > /* YUV422, YUYV */ > val = 0x30; > break; -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: media: ov8856: Add support for OV8856 sensor

2018-11-16 Thread Sakari Ailus
e? Just the diff is fine, I'll then squash it to the patch. Thanks. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3] media: vb2: Allow reqbufs(0) with "in use" MMAP buffers

2018-11-15 Thread Sakari Ailus
ind missing munmap() in userspace. This patch thus has the > > potential > > of causing memory leaks in userspace. Is there a way we could assist > > application developers with this ? > > Should we just keep the debug message? (rephrased of course) > > That way you can enable debugging and see that this happens. > > It sounds reasonable to me. Makes sense IMO. -- Sakari Ailus e-mail: sakari.ai...@iki.fi

[PATCH v2 for v4.9 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-14 Thread Sakari Ailus
nt: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed-off-by: Sakari Ailus Tested-by: Dave Stevenson Reviewed-by: Hans Verkuil Tested-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab [Sakari Ailus: Backported to v4.9 stable] Signed-off-by: Sakari Ail

[PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-14 Thread Sakari Ailus
nt: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed-off-by: Sakari Ailus Tested-by: Dave Stevenson Reviewed-by: Hans Verkuil Tested-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab [Sakari Ailus: Backported to v4.4 stable] Signed-off-by: Sakari Ail

Re: [PATCH v4.9 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-14 Thread Sakari Ailus
Hi Sasha, On Thu, Nov 08, 2018 at 12:28:53PM -0500, Sasha Levin wrote: > On Thu, Nov 08, 2018 at 01:46:06PM +0200, Sakari Ailus wrote: > > [ upstream commit 92539d3eda2c090b382699bbb896d4b54e9bdece ] > > > > Patch ad608fbcf166 changed how events were subscribed to address a

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-13 Thread Sakari Ailus
r pointing this out. I've uploaded the entire set here: https://git.linuxtv.org/sailus/media_tree.git/log/?h=ipu3-v7> including the 10th patch: https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ipu3-v7=41e2f0d114dbc195efed079202d22748ddedbe83> It's too big to get through the list server. :-( Luckily, it's mostly tables so there's not much to review there. Default settings, effectively. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 4/4] SoC camera: Tidy the header

2018-11-13 Thread Sakari Ailus
Hi Hans, Mauro, On Wed, Oct 31, 2018 at 07:54:21AM -0300, Mauro Carvalho Chehab wrote: > Em Wed, 31 Oct 2018 11:00:22 +0100 > Hans Verkuil escreveu: > > > On 10/31/2018 10:40 AM, Mauro Carvalho Chehab wrote: > > > Em Wed, 31 Oct 2018 11:29:45 +0200 >

Re: [PATCH] media: vb2: Allow reqbufs(0) with "in use" MMAP buffers

2018-11-13 Thread Sakari Ailus
_cancel out of the mmap_lock > and added V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS] > Signed-off-by: Philipp Zabel This lets the user to allocate lots of mmap'ed buffers that are pinned in physical memory. Considering that we don't really have a proper mechanism to limit that anyway, Acked-by:

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-13 Thread Sakari Ailus
On Tue, Nov 13, 2018 at 07:04:01PM +0800, Bing Bu Cao wrote: > > > On 11/13/2018 06:31 PM, Sakari Ailus wrote: > > Hi Bing Bu, > > > > On Mon, Nov 12, 2018 at 12:31:16PM +0800, Bing Bu Cao wrote: > >> > >> On 11/09/2018 06:09 PM, Sakari Ailus wrote:

Re: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control

2018-11-13 Thread Sakari Ailus
On Tue, Nov 13, 2018 at 10:55:46PM +0900, Akinobu Mita wrote: > 2018年11月13日(火) 19:37 Sakari Ailus : > > > > On Tue, Nov 13, 2018 at 01:00:50AM +0900, Akinobu Mita wrote: > > > The ov2640 has the test pattern generator features. This makes use of > > > it thro

Re: [PATCH 3/7] media: ov2640: add V4L2_CID_TEST_PATTERN control

2018-11-13 Thread Sakari Ailus
On Tue, Nov 13, 2018 at 01:00:50AM +0900, Akinobu Mita wrote: > The ov2640 has the test pattern generator features. This makes use of > it through V4L2_CID_TEST_PATTERN control. > > Cc: Sakari Ailus > Cc: Mauro Carvalho Chehab > Signed-off-by: Akinobu Mita > --- > dr

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-13 Thread Sakari Ailus
Hi Bing Bu, On Mon, Nov 12, 2018 at 12:31:16PM +0800, Bing Bu Cao wrote: > > > On 11/09/2018 06:09 PM, Sakari Ailus wrote: > > Hi Bing Bu, > > > > On Wed, Nov 07, 2018 at 12:16:47PM +0800, Bing Bu Cao wrote: > >> On 11/01/2018 08:03 PM, Sakari Ailus wrot

Re: [PATCH v7 08/16] intel-ipu3: css: Add dma buff pool utility functions

2018-11-12 Thread Sakari Ailus
Hi Yong, On Fri, Nov 09, 2018 at 11:16:44PM +, Zhi, Yong wrote: > Hi, Sakari, > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Thursday, November 8, 2018 9:36 AM > > To: Zhi, Yong > > Cc: linux-media

Re: [PATCH v7 15/16] intel-ipu3: Add imgu top level pci device driver

2018-11-09 Thread Sakari Ailus
imgu_video_device { > + const char *name; > + bool output;/* Frames to the driver? */ > + bool immutable; /* Can not be enabled/disabled */ > + bool enabled; > + int queued; /* Buffers already queued */ The queued field is unused. > + struct v4l2_format vdev_fmt;/* Currently set format */ > + > + /* Private fields */ > + struct video_device vdev; > + struct media_pad vdev_pad; > + struct v4l2_mbus_framefmt pad_fmt; > + struct vb2_queue vbq; > + struct list_head buffers; > + /* Protect vb2_queue and vdev structs*/ > + struct mutex lock; > + atomic_t sequence; > +}; > + -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v7 14/16] intel-ipu3: Add v4l2 driver based on media framework

2018-11-09 Thread Sakari Ailus
bdev: > + media_entity_cleanup(>subdev.entity); > +fail_media_entity: > + kfree(imgu->subdev_pads); > +fail_subdev_pads: > + v4l2_device_unregister(>v4l2_dev); > +fail_v4l2_dev: > + media_device_cleanup(>media_dev); > + > + return r; > +} > +EXPORT_SYMBOL_GPL(ipu3_v4l2_register); > + > +int ipu3_v4l2_unregister(struct imgu_device *imgu) > +{ > + unsigned int i; > + > + media_device_unregister(>media_dev); > + media_device_cleanup(>media_dev); media_device_cleanup() should take place after unregistering the sub-devices. > + > + for (i = 0; i < IMGU_NODE_NUM; i++) { > + video_unregister_device(>nodes[i].vdev); > + media_entity_cleanup(>nodes[i].vdev.entity); > + mutex_destroy(>nodes[i].lock); > + } > + > + v4l2_device_unregister_subdev(>subdev); > + media_entity_cleanup(>subdev.entity); > + kfree(imgu->subdev_pads); > + v4l2_device_unregister(>v4l2_dev); > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(ipu3_v4l2_unregister); > + > +void ipu3_v4l2_buffer_done(struct vb2_buffer *vb, > +enum vb2_buffer_state state) > +{ > + struct ipu3_vb2_buffer *b = > + container_of(vb, struct ipu3_vb2_buffer, vbb.vb2_buf); > + > + list_del(>list); > + vb2_buffer_done(>vbb.vb2_buf, state); > +} > +EXPORT_SYMBOL_GPL(ipu3_v4l2_buffer_done); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v7 12/16] intel-ipu3: css: Initialize css hardware

2018-11-09 Thread Sakari Ailus
u3_css { > + struct device *dev; > + void __iomem *base; > + const struct firmware *fw; > + struct imgu_fw_header *fwp; > + int iomem_length; u32? The same for the length parameter in ccs_init(). -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-09 Thread Sakari Ailus
om: Bing Bu Cao [mailto:bingbu@linux.intel.com] > > Sent: Tuesday, November 6, 2018 10:17 PM > > To: Sakari Ailus ; Zhi, Yong > > > > Cc: linux-media@vger.kernel.org; tf...@chromium.org; > > mche...@kernel.org; hans.verk...@cisco.com; > > laurent.pinch...@ideasonboard.com

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-09 Thread Sakari Ailus
Hi Bing Bu, On Wed, Nov 07, 2018 at 12:16:47PM +0800, Bing Bu Cao wrote: > > On 11/01/2018 08:03 PM, Sakari Ailus wrote: > > Hi Yong, > > > > Thanks for the update! > > > > On Mon, Oct 29, 2018 at 03:22:54PM -0700, Yong Zhi wrote: > >> Hi, > >

Re: [PATCH v7 08/16] intel-ipu3: css: Add dma buff pool utility functions

2018-11-08 Thread Sakari Ailus
l { > + struct { > + struct ipu3_css_map param; > + long framenum; > + } entry[IPU3_CSS_POOL_SIZE]; > + unsigned int last; /* Latest entry */ > +}; > + > +int ipu3_css_dma_buffer_resize(struct imgu_device *imgu, > +struct ipu3_css_map *map, size_t size); > +void ipu3_css_pool_cleanup(struct imgu_device *imgu, > +struct ipu3_css_pool *pool); > +int ipu3_css_pool_init(struct imgu_device *imgu, struct ipu3_css_pool *pool, > +size_t size); > +int ipu3_css_pool_get(struct ipu3_css_pool *pool, long framenum); > +void ipu3_css_pool_put(struct ipu3_css_pool *pool); > +const struct ipu3_css_map *ipu3_css_pool_last(struct ipu3_css_pool *pool, > + unsigned int last); > + > +#endif -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH v3.16 0/2] V4L2 event subscription fixes

2018-11-08 Thread Sakari Ailus
/media_tree.git/commit/?id=92539d3eda2c090b382699bbb896d4b54e9bdece> Sakari Ailus (2): v4l: event: Prevent freeing event subscriptions while accessed v4l: event: Add subscription to list before calling "add" operation drivers/media/v4l2-core/v4l2

[PATCH v3.16 1/2] v4l: event: Prevent freeing event subscriptions while accessed

2018-11-08 Thread Sakari Ailus
. This change also results in making the elems field less special: subscriptions are only added to the event list once they are fully initialised. Signed-off-by: Sakari Ailus Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart Cc: sta...@vger.kernel.org # for 4.14 and up Fixes: c3b5b0241f62 ("V4

[PATCH v3.16 2/2] v4l: event: Add subscription to list before calling "add" operation

2018-11-08 Thread Sakari Ailus
nt: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed-off-by: Sakari Ailus Tested-by: Dave Stevenson Reviewed-by: Hans Verkuil Tested-by: Hans Verkuil Cc: sta...@vger.kernel.org (for 4.14 and up) Signed-off-by: Mauro Carvalho Chehab --- drivers/med

[PATCH v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-08 Thread Sakari Ailus
nt: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed-off-by: Sakari Ailus Tested-by: Dave Stevenson Reviewed-by: Hans Verkuil Tested-by: Hans Verkuil Cc: sta...@vger.kernel.org (for 4.14 and up) Signed-off-by: Mauro Carvalho Chehab --- drivers/med

[PATCH v4.9 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-08 Thread Sakari Ailus
nt: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed-off-by: Sakari Ailus Tested-by: Dave Stevenson Reviewed-by: Hans Verkuil Tested-by: Hans Verkuil Cc: sta...@vger.kernel.org (for 4.14 and up) Signed-off-by: Mauro Carvalho Chehab --- Hi Greg, This is a

[PATCH 1/1] v4l: uAPI doc: Simplify NATIVE_SIZE selection target documentation

2018-11-07 Thread Sakari Ailus
The NATIVE_SIZE target is documented for mem2mem devices but no driver has ever apparently used it. It may be never needed; remove it for now. Suggested-by: Hans Verkuil Signed-off-by: Sakari Ailus --- Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 7 +-- 1 file changed, 1

Re: [PATCH v4l-utils] keytable: fix compilation warning

2018-11-07 Thread Sakari Ailus
On Wed, Nov 07, 2018 at 12:02:14PM +, Sean Young wrote: > keytable.c: In function ‘parse_opt’: > keytable.c:835:7: warning: ‘param’ may be used uninitialized in this function > [-Wuninitialized] > > Signed-off-by: Sean Young Acked-by: Sakari Ailus -- Sakari Ailus e-

Re: [PATCH 1/3] media: imx: add capture compose rectangle

2018-11-07 Thread Sakari Ailus
Hi Philipp, On Tue, Nov 06, 2018 at 03:44:07PM +0100, Philipp Zabel wrote: > Hi Sakari, > > On Tue, 2018-11-06 at 16:01 +0200, Sakari Ailus wrote: > [...] > > @@ -290,6 +294,35 @@ static int capture_s_std(struct file *file, void *fh, > > v4l2_std_id std) > > &g

Re: [PATCH v7 05/12] media: dt-bindings: add bindings for i.MX7 media driver

2018-11-07 Thread Sakari Ailus
On Fri, Aug 10, 2018 at 03:20:38PM +0100, Rui Miguel Silva wrote: > Add bindings documentation for i.MX7 media drivers. > The imx7 MIPI CSI2 and imx7 CMOS Sensor Interface. > > Reviewed-by: Rob Herring > Signed-off-by: Rui Miguel Silva Acked-by: Sakari Ailus - -- Sakari

Re: [PATCH] media: imx258: remove test pattern map from driver

2018-11-07 Thread Sakari Ailus
l_ops = { > .open = imx258_open, > }; > @@ -1250,6 +1237,7 @@ static int imx258_probe(struct i2c_client *client) > > /* Initialize subdev */ > imx258->sd.internal_ops = _internal_ops; > + imx258->sd.entity.ops = _subdev_entity_ops; Ditto. > imx258->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > imx258->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; > -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] [v4l-utils] libv4l2subdev: Add MEDIA_BUS_FMT_FIXED to mbus_formats[]

2018-11-07 Thread Sakari Ailus
, + { "Y8", MEDIA_BUS_FMT_Y8_1X8 }, { "Y10", MEDIA_BUS_FMT_Y10_1X10 }, { "Y12", MEDIA_BUS_FMT_Y12_1X12 }, { "YUYV", MEDIA_BUS_FMT_YUYV8_1X16 }, @@ -968,7 +968,6 @@ static struct { { "bt2020", V4L2_COLORSPACE_BT2020 }, { "raw", V4L2_COLORSPACE_RAW }, { "dcip3", V4L2_COLORSPACE_DCI_P3 }, - }; const char *v4l2_subdev_colorspace_to_string(enum v4l2_colorspace colorspace) -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH] [v4l-utils] libv4l2subdev: Add MEDIA_BUS_FMT_FIXED to mbus_formats[]

2018-11-07 Thread Sakari Ailus
ruct { > { "srgb", V4L2_COLORSPACE_SRGB }, > { "oprgb", V4L2_COLORSPACE_OPRGB }, > { "bt2020", V4L2_COLORSPACE_BT2020 }, > + { "raw", V4L2_COLORSPACE_RAW }, > { "dcip3", V4L2_COLORSPACE_DCI_P3 }, > + Extra newlne.

Re: [PATCH 1/3] media: imx: add capture compose rectangle

2018-11-06 Thread Sakari Ailus
d *fh, > +struct v4l2_selection *s) > +{ > + struct capture_priv *priv = video_drvdata(file); > + > + switch (s->target) { > + case V4L2_SEL_TGT_CROP: > + case V4L2_SEL_TGT_CROP_DEFAULT: > + case V4L2_SEL_TGT_CROP_B

[GIT PULL for 4.20] Sensor and ISP driver patches for 4.21

2018-11-06 Thread Sakari Ailus
Sakari Ailus (4): media: docs: Document metadata format in struct v4l2_format omap3isp: Unregister media device as first ipu3-cio2: Unregister device nodes first, then release resources ipu3-cio2: Use cio2_queues_exit .../devicetree/bindings/media/i2c/sony,imx214.txt | 53

Re: [RFC] Create test script(s?) for regression testing

2018-11-06 Thread Sakari Ailus
sily test > our patches with this script (I use a VM for that). > > I think maintaining the script (or perhaps scripts) in v4l-utils is best since > that keeps it in sync with the latest kernel and v4l-utils developments. Makes sense --- and that can be always changed later on if there's a need to. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[GIT PULL FOR 4.20] Fix first event delivery

2018-11-06 Thread Sakari Ailus
to cbafeff167c91243f336e1703d7f86aa019b973e: v4l: event: Add subscription to list before calling "add" operation (2018-11-06 10:57:34 +0200) fix event subscription -------- Sakari Ailus (1):

Re: [PATCH v7 05/16] intel-ipu3: abi: Add structs

2018-11-06 Thread Sakari Ailus
Hi Raj, On Mon, Nov 05, 2018 at 07:05:53PM +, Mani, Rajmohan wrote: > Hi Sakari, > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Monday, November 05, 2018 12:28 AM > > To: Zhi, Yong > >

[PATCH v3 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-06 Thread Sakari Ailus
by: Dave Stevenson Signed-off-by: Sakari Ailus --- since v2: - More accurate commit message. No other changes. drivers/media/v4l2-core/v4l2-event.c | 43 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-event.c

[PATCH v2 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-05 Thread Sakari Ailus
afterwards) to be lost. Fix this by adding the subscription to the list before calling the "add" callback, and clean up afterwards if that fails. Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signed

[PATCH 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-05 Thread Sakari Ailus
afterwards) to be lost. Fix this by adding the subscription to the list before calling the "add" callback, and clean up afterwards if that fails. Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson Signe

Re: VIDIOC_SUBSCRIBE_EVENT for V4L2_EVENT_CTRL regression?

2018-11-05 Thread Sakari Ailus
h_lock, flags); > - list_add(>list, >subscribed); > - spin_unlock_irqrestore(>vdev->fh_lock, flags); > - > out_unlock: > mutex_unlock(>subscribe_lock); > > Is there a need to iterate the sev->events list and free any > potentially pending events there in the ops->add error path? > We still have the subscribe_lock held, so I don't think that it > reintroduces the issue that the patch was fixing of unsubscribing > before subscribed. The events queued during that time need to be removed. Indeed the issue appears to be that the add op is called before the event is added to the list, and therefore the check whether it's subscribed fails. > > This patch has also been merged to stable, so 4.14 is affected as well. Yes, and the earlier stable kernels as well. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v7 06/16] intel-ipu3: mmu: Implement driver

2018-11-05 Thread Sakari Ailus
v); How about: if (!pm_runtime_get_if_in_use(mmu->dev)) return; func(mmu); pm_runtime_put(mmu->dev); > +} -- Sakari Ailus sakari.ai...@linux.intel.com

  1   2   3   4   5   6   7   8   9   10   >