Re: i.MX6Q + ov5640 CSI-2 Framerate (on 5.4-rc3)

2019-10-21 Thread Philipp Zabel
Hi Adam, Fabio, On Fri, 2019-10-18 at 16:00 -0300, Fabio Estevam wrote: > Hi Adam, > > Adding Steve and Philipp in case they can help. > > On Tue, Oct 15, 2019 at 1:52 AM Adam Ford wrote: > > I have an i.MX6Q with an ov5640 connected to the mipi-csi2 interface. > > > > I am routing ov5640 -> i

Re: [PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields

2019-10-16 Thread Philipp Zabel
On Wed, 2019-10-16 at 15:37 +0200, Paul Kocialkowski wrote: [...] > > > The bottomline is that we have use cases for each of the two set of fields > > > independently, so I feel like this is reason enough to avoid mixing them > > > together. > > > > What do you mean by mixing together? Hardware pa

Re: [PATCH] media: hantro: relax s_fmt(out) busy error

2019-10-08 Thread Philipp Zabel
Hi Tomasz, On Tue, 2019-10-08 at 23:05 +0900, Tomasz Figa wrote: > Hi Philipp, > > On Tue, Oct 8, 2019 at 9:38 PM Philipp Zabel wrote: > > > > Setting the output format resets the capture queue, so we return -EBUSY > > while the capture queue has buffers alloc

[PATCH] media: hantro: relax s_fmt(out) busy error

2019-10-08 Thread Philipp Zabel
Setting the output format resets the capture queue, so we return -EBUSY while the capture queue has buffers allocated. If capture dimensions and pixel format don't change though, we can allow setting the output format without reallocating the capture queue. Signed-off-by: Philipp Zabel ---

Re: [PATCH 2/2] media: uapi: h264: clarify pic_order_cnt_bit_size field

2019-09-26 Thread Philipp Zabel
Hi Hans, On Thu, 2019-09-26 at 15:23 +0200, Hans Verkuil wrote: > On 9/5/19 3:12 PM, Philipp Zabel wrote: > > Since pic_order_cnt_bit_size is not a syntax element itself, explicitly > > state that it is the total size in bits of the pic_order_cnt_lsb, > > delta

Re: [PATCH v4 1/3] media: v4l2-subdev: add g_csi_active_lanes() op

2019-09-25 Thread Philipp Zabel
Pinchart wrote: > > Hi Philipp, > > > > (CC'ing Sakari, Jacopo, Kieran and Niklas) > > > > Thank you for the patch. > > > > On Tue, Sep 24, 2019 at 01:49:53PM +0200, Philipp Zabel wrote: > > > Add a subdevice video operation that allows to

Re: [PATCH v4 1/3] media: v4l2-subdev: add g_csi_active_lanes() op

2019-09-25 Thread Philipp Zabel
Hi Laurent, On Wed, 2019-09-25 at 16:41 +0300, Laurent Pinchart wrote: > Hi Philipp, > > (CC'ing Sakari, Jacopo, Kieran and Niklas) > > Thank you for the patch. > > On Tue, Sep 24, 2019 at 01:49:53PM +0200, Philipp Zabel wrote: > > Add a subdevice video op

[PATCH v4 1/3] media: v4l2-subdev: add g_csi_active_lanes() op

2019-09-24 Thread Philipp Zabel
Add a subdevice video operation that allows to query the number of data lanes a MIPI CSI-2 TX is actively transmitting on. Suggested-by: Hans Verkuil Signed-off-by: Philipp Zabel --- New in v4. --- include/media/v4l2-subdev.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/media

[PATCH v4 0/3] Add g_csi_active_lanes for dynamic active lanes

2019-09-24 Thread Philipp Zabel
and change its configuration accordingly. Changes since v3 [1]: - Add g_csi_active_lanes() subdevice video operation, implement it in tc358743, and use it in imx6-mipi-csi2. [1] https://patchwork.linuxtv.org/patch/53331/ regards Philipp Philipp Zabel (3): media: v4l2-subdev: add

[PATCH v4 2/3] media: tc358743: fix connected/active CSI-2 lane reporting

2019-09-24 Thread Philipp Zabel
supported in pdata mode. In device tree mode, do not report lane count and clock mode at all, as the receiver driver can determine these from the device tree. To allow communicating the number of currently active lanes, use the newly added g_csi_active_lanes() video op. Signed-off-by: Philipp Zabel

[PATCH v4 3/3] media: imx: ask source subdevice for number of active data lanes

2019-09-24 Thread Philipp Zabel
Use the newly added g_csi_active_lanes() video op to determine the number of active data lanes used by the transmitter. If this subdev call is not supported or does not return the number of active lanes, default to using all connected data lanes as before. Signed-off-by: Philipp Zabel

Re: coda9 jpeg support?

2019-09-18 Thread Philipp Zabel
Hi Tim, On Tue, 2019-09-17 at 12:00 -0700, Tim Harvey wrote: [...] > I have pulled your branch and boot-tested it. I see the 2 new video > devices but noticed that the JPEG decoder shows up as an element for > video4linux2 the JPEG encoder doesn't show up (gstreamer v1.14.5) - > any idea why that

Re: coda9 jpeg support?

2019-09-17 Thread Philipp Zabel
Hi Tim, On Fri, 2019-09-13 at 09:00 -0700, Tim Harvey wrote: > Greetings, > > What would need to be done to support JPEG enc/dec for coda9? here is a WIP that still needs some cleanup for upstreaming: https://git.pengutronix.de/cgit/pza/linux/log/?h=coda/jpeg Basically I'd like to avoid addi

[PATCH 2/3] media: imx: fix and simplify pixel format enumeration

2019-09-12 Thread Philipp Zabel
;422P' (Planar YUV 4:2:2) [5]: 'NV12' (Y/CbCr 4:2:0) [6]: 'NV16' (Y/CbCr 4:2:2) [7]: 'RGBP' (16-bit RGB 5-6-5) [8]: 'RGB3' (24-bit RGB 8-8-8) [9]: 'BGR3' (24-bit BGR 8-8-8) [10]: 'BX24' (32-bi

[PATCH 3/3] media: imx: fix media bus format enumeration

2019-09-12 Thread Philipp Zabel
: MEDIA_BUS_FMT_SRGGB14_1X14 0x3020: MEDIA_BUS_FMT_SRGGB16_1X16 0x2001: MEDIA_BUS_FMT_Y8_1X8 0x200a: MEDIA_BUS_FMT_Y10_1X10 0x2013: MEDIA_BUS_FMT_Y12_1X12 Signed-off-by: Philipp Zabel --- drivers/staging/media/imx/imx-media-utils.c | 19 +++ 1 file changed, 15

[PATCH 1/3] media: imx: enable V4L2_PIX_FMT_XBGR32, _BGRX32, and _RGBX32

2019-09-12 Thread Philipp Zabel
Now that proper V4L2 pixel formats exist for all 32-bit RGB permutations, drop support for the poorly defined legacy format V4L2_PIX_FMT_BGR32. Signed-off-by: Philipp Zabel --- drivers/staging/media/imx/imx-media-utils.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff

Re: [RFC] V4L2 & Metadata: switch to /dev/v4l-metaX instead of /dev/videoX

2019-09-12 Thread Philipp Zabel
On Thu, 2019-09-12 at 16:49 +0200, Hans Verkuil wrote: > On 9/12/19 4:21 PM, Mauro Carvalho Chehab wrote: > > Em Thu, 12 Sep 2019 14:16:11 +0100 > > Kieran Bingham escreveu: > > > > > Hi Hans, > > > > > > On 12/09/2019 08:48, Hans Verkuil wrote: > > > > Hi all, > > > > > > > > I am increasingly

[PATCH v2] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields

2019-09-10 Thread Philipp Zabel
ds to the default values if the slice does not have the num_ref_idx_active_override flag set. The drivers will then always enable the override internally and ignore the default fields completely. Clarify this requirement in the API documentation. Signed-off-by: Philipp Zabel --- Changes sin

[PATCH] media: uapi: h264: clarify V4L2_PIX_FMT_H264_SLICE format

2019-09-10 Thread Philipp Zabel
Document that the slice headers must be included for the benefit of decoders that parse them (partially) in hardware, and that the start code is optional. Add a link to the ITU-T Rec. H.264 specification section that describes the slice format. Signed-off-by: Philipp Zabel --- Documentation

Re: [PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields

2019-09-09 Thread Philipp Zabel
On Mon, 2019-09-09 at 14:43 +0200, Hans Verkuil wrote: > On 9/9/19 2:27 PM, Philipp Zabel wrote: > > On Mon, 2019-09-09 at 14:09 +0200, Hans Verkuil wrote: > > > On 9/5/19 1:42 PM, Philipp Zabel wrote: [...] > > > >

Re: [PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields

2019-09-09 Thread Philipp Zabel
On Mon, 2019-09-09 at 14:09 +0200, Hans Verkuil wrote: > On 9/5/19 1:42 PM, Philipp Zabel wrote: > > To explain why num_ref_idx_active_override_flag is not part of the API, > > describe how the num_ref_idx_l[01]_active_minus1 fields and the > > num_ref_idx_l[01]_default_act

Re: [PATCH 3/3] media: hantro: h264: Fix the frame_num wraparound case

2019-09-09 Thread Philipp Zabel
t;media: hantro: Add core bits to support H264 decoding") > Reported-by: Francois Buergisser > Signed-off-by: Boris Brezillon Thank you, excellent timing. I've just seen this corruption for the first time last Friday. All three patches Reviewed-by: Philipp Zabel Tested-by: Philipp Zabel (on i.MX8MQ) regards Philipp

Re: [PATCH 1/2] media: uapi: h264: Add num_ref_idx_active_override_flag

2019-09-09 Thread Philipp Zabel
On Mon, 2019-09-09 at 16:09 +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 11:17 PM Nicolas Dufresne > wrote: > > > > Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > > > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > > >

[PATCH 2/2] media: uapi: h264: clarify pic_order_cnt_bit_size field

2019-09-05 Thread Philipp Zabel
Since pic_order_cnt_bit_size is not a syntax element itself, explicitly state that it is the total size in bits of the pic_order_cnt_lsb, delta_pic_order_cnt_bottom, delta_pic_order_cnt[0], and delta_pic_order_cnt[1] syntax elements contained in the slice. Signed-off-by: Philipp Zabel

[PATCH 1/2] media: uapi: h264: clarify dec_ref_pic_marking_bit_size fields

2019-09-05 Thread Philipp Zabel
Since dec_ref_pic_marking_bit_size is not a syntax element itself, explicitly state that this is the size in bits of the dec_ref_pic_marking() syntax element contained in the slice. Signed-off-by: Philipp Zabel --- Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 2 +- 1 file changed, 1

[PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields

2019-09-05 Thread Philipp Zabel
To explain why num_ref_idx_active_override_flag is not part of the API, describe how the num_ref_idx_l[01]_active_minus1 fields and the num_ref_idx_l[01]_default_active_minus1 fields are used, depending on whether the decoder parses slice headers itself or not. Signed-off-by: Philipp Zabel

Re: [PATCH 2/2] media: hantro: h264: per-slice num_ref_idx_l[01]_active override

2019-09-05 Thread Philipp Zabel
On Thu, 2019-09-05 at 19:34 +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel wrote: > > > > If the slice header had the num_ref_idx_active_override flag set, we > > should use the num_ref_idx_l[01]_active_minus1 fields instead of the >

Re: [PATCH 1/2] media: uapi: h264: Add num_ref_idx_active_override_flag

2019-09-05 Thread Philipp Zabel
On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel wrote: > > > > This flag tells the kernel whether the slice header contained the > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > num_ref_idx_

[PATCH] media: hantro: streamline open, reuse error path

2019-09-05 Thread Philipp Zabel
This adds a label to the error path to avoid calling v4l2_m2m_ctx_init() and kfree(ctx) in two places each. Signed-off-by: Philipp Zabel --- drivers/staging/media/hantro/hantro_drv.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/hantro

[PATCH 2/2] media: hantro: h264: per-slice num_ref_idx_l[01]_active override

2019-09-05 Thread Philipp Zabel
If the slice header had the num_ref_idx_active_override flag set, we should use the num_ref_idx_l[01]_active_minus1 fields instead of the defaults from the PPS. Signed-off-by: Philipp Zabel --- drivers/staging/media/hantro/hantro_g1_h264_dec.c | 13 +++-- 1 file changed, 11 insertions

[PATCH 1/2] media: uapi: h264: Add num_ref_idx_active_override_flag

2019-09-05 Thread Philipp Zabel
This flag tells the kernel whether the slice header contained the num_ref_idx_l[01]_active_minus1 syntax elements, or whether the num_ref_idx_l[01]_default_active_minus1 from PPS should be used instead. Signed-off-by: Philipp Zabel --- Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3

Re: [PATCH 2/4] media: hantro: Simplify buffer helpers

2019-09-04 Thread Philipp Zabel
> Signed-off-by: Ezequiel Garcia Reviewed-by: Philipp Zabel regards Philipp

Re: [PATCH 1/4] media: hantro: Simplify macroblock macros

2019-09-04 Thread Philipp Zabel
On Tue, 2019-09-03 at 15:17 -0300, Ezequiel Garcia wrote: > It seems all codecs are using a 16x16 size macroblock, > and so it's possible to have just one set of macroblock macros. > > Signed-off-by: Ezequiel Garcia Reviewed-by: Philipp Zabel regards Philipp

Re: [PATCH 3/4] media: hantro: Add helper for the H264 motion vectors allocation

2019-09-04 Thread Philipp Zabel
On Tue, 2019-09-03 at 15:17 -0300, Ezequiel Garcia wrote: > Introduce a helper to allow easier enablement of the post-processing > feature. No functional changes intended. > > Signed-off-by: Ezequiel Garcia > --- > drivers/staging/media/hantro/hantro.h | 6 ++ > drivers/staging/media/ha

Re: [PATCH v3 5/7] media: v4l2-core: Add new helper for area controls

2019-08-23 Thread Philipp Zabel
On Fri, 2019-08-23 at 15:05 +0200, Ricardo Ribalda Delgado wrote: > On Fri, Aug 23, 2019 at 2:56 PM Philipp Zabel wrote: > > > > On Fri, 2019-08-23 at 14:37 +0200, Ricardo Ribalda Delgado wrote: > > > Adding a V4L2_CID_UNIT_CELL_SIZE control requires a lot of boilerplat

Re: [PATCH v3 4/7] media: imx214: Add new control with V4L2_CID_UNIT_CELL_SIZE

2019-08-23 Thread Philipp Zabel
On Fri, 2019-08-23 at 14:37 +0200, Ricardo Ribalda Delgado wrote: > According to the product brief, the unit cell size is 1120 nanometers^2. > > https://www.sony-semicon.co.jp/products_en/IS/sensor1/img/products/ProductBrief_IMX214_20150428.pdf > > Signed-off-by: Ricardo Ribalda Delgado If the

Re: [PATCH v3 3/7] Documentation: media: Document V4L2_CTRL_TYPE_AREA

2019-08-23 Thread Philipp Zabel
On Fri, 2019-08-23 at 14:37 +0200, Ricardo Ribalda Delgado wrote: > A struct v4l2_area containing the width and the height of a rectangular > area. > > Signed-off-by: Ricardo Ribalda Delgado > Suggested-by: Hans Verkuil > --- > Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 6 ++ > 1 f

Re: [PATCH v3 2/7] Documentation: media: Describe V4L2_CID_UNIT_CELL_SIZE

2019-08-23 Thread Philipp Zabel
On Fri, 2019-08-23 at 14:37 +0200, Ricardo Ribalda Delgado wrote: > New control to pass to userspace the width/height of a pixel. Which is > needed for calibration and lens selection. > > Signed-off-by: Ricardo Ribalda Delgado > --- > Documentation/media/uapi/v4l/ext-ctrls-image-source.rst | 8 +

Re: [PATCH v3 5/7] media: v4l2-core: Add new helper for area controls

2019-08-23 Thread Philipp Zabel
On Fri, 2019-08-23 at 14:37 +0200, Ricardo Ribalda Delgado wrote: > Adding a V4L2_CID_UNIT_CELL_SIZE control requires a lot of boilerplate, > try to minimize it by adding a new helper. > > Suggested-by: Philipp Zabel > Signed-off-by: Ricardo Ribalda Delgado > --- > drivers

Re: [PATCH v9] media: imx: add csc/scaler mem2mem device

2019-08-19 Thread Philipp Zabel
Hi Steve, On Fri, 2019-08-16 at 16:17 -0700, Steve Longerbeam wrote: > Hi Philipp, > > If you haven't already, can you please test rotation with this version, > with both non-tiled and tiled scaling conversions. I found rotation was > broken in v8. > > Steve I've tested a few resolutions with

Re: [PATCH v9] media: imx: add csc/scaler mem2mem device

2019-08-14 Thread Philipp Zabel
On Wed, 2019-08-14 at 14:24 +0200, Philipp Zabel wrote: > Add a single imx-media mem2mem video device that uses the IPU IC PP > (image converter post processing) task for scaling and colorspace > conversion. > On i.MX6Q/DL SoCs with two IPUs currently only the first IPU is used. [...

[PATCH v9] media: imx: add csc/scaler mem2mem device

2019-08-14 Thread Philipp Zabel
in a single pass, arbitrary sizes can be achieved by rendering multiple tiles per frame. Signed-off-by: Philipp Zabel [slongerb...@gmail.com: use ipu_image_convert_adjust(), fix device_run() error handling, add missing media-device header, unregister and remove the mem2mem device in error paths

[PATCH v4l-utils] v4l-helpers.h: count mappings separately from buffers

2019-08-13 Thread Philipp Zabel
This is required to avoid leaking mapped buffers when trying to unmap after reqbufs(0), to test buffer orphaning. Fixes: 6300b376cb3e ("v4l2-compliance: test orphaned buffer support"); Signed-off-by: Philipp Zabel --- utils/common/v4l-helpers.h | 8 ++-- 1 file changed, 6 insert

Re: [PATCH v3] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-08-08 Thread Philipp Zabel
Hi Sakari, On Thu, 2019-08-08 at 11:26 +0300, Sakari Ailus wrote: [...] > > > Have you checked how it works if you simply leave out this test? Whether this works or not depends on the sensor used, and for some sensor/drivers may depend on timing (or random factors influencing it). See below. [..

Re: [PATCH v2] media: i2c: ov5645: Fix power sequence

2019-07-31 Thread Philipp Zabel
expected by some CSI-2 controllers. > > Many thanks to Fabio Estevam for his help debugging this issue. > > Tested-by: Fabio Estevam > Signed-off-by: Ezequiel Garcia > --- > Changes in v2: > * As suggested by Philipp, move the initial configuration > to the ov5645_global_init_setting array. Reviewed-by: Philipp Zabel regards Philipp

Re: [PATCH 01/14] v4l2-ioctl.c: OR flags in v4l_fill_fmtdesc(), not don't overwrite

2019-07-24 Thread Philipp Zabel
On Wed, 2019-07-24 at 15:30 +0200, Hans Verkuil wrote: > On 7/24/19 3:22 PM, Philipp Zabel wrote: > > On Wed, 2019-07-24 at 13:05 +0200, Hans Verkuil wrote: > > > If a driver sets a FMT flag in the enum_fmt op, then that will be > > > ignored since v4l_fill_fm

Re: [PATCH 01/14] v4l2-ioctl.c: OR flags in v4l_fill_fmtdesc(), not don't overwrite

2019-07-24 Thread Philipp Zabel
On Wed, 2019-07-24 at 13:05 +0200, Hans Verkuil wrote: > If a driver sets a FMT flag in the enum_fmt op, then that will be > ignored since v4l_fill_fmtdesc() overwrites it again. > > v4l_fill_fmtdesc() should OR its flag, not overwrite it. > > Signed-off-by: Hans Verkuil > --- > drivers/media/v

Re: [PATCH] media: i2c: ov5645: Fix power up sequence

2019-07-04 Thread Philipp Zabel
Hi Ezequiel, On Wed, 2019-07-03 at 10:10 -0300, Ezequiel Garcia wrote: > This is mostly a port of Jacopo's fix: > > commit aa4bb8b8838ffcc776a79f49a4d7476b82405349 > Author: Jacopo Mondi > Date: Fri Jul 6 05:51:52 2018 -0400 > > media: ov5640: Re-work MIPI startup sequence > > In the

Re: [RFC] Stateful codecs and requirements for compressed formats

2019-07-03 Thread Philipp Zabel
On Wed, 2019-07-03 at 17:32 +0900, Tomasz Figa wrote: > Hi Hans, > > On Fri, Jun 28, 2019 at 11:34 PM Hans Verkuil wrote: > > > > Hi all, > > > > I hope I Cc-ed everyone with a stake in this issue. > > > > One recurring question is how a stateful encoder fills buffers and how a > > stateful >

Re: [PATCH] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-06-30 Thread Philipp Zabel
On Thu, 2019-06-27 at 15:12 -0700, Steve Longerbeam wrote: > > On 6/27/19 5:56 AM, Philipp Zabel wrote: > > Hi Fabio, > > > > On Thu, 2019-06-27 at 09:38 -0300, Fabio Estevam wrote: > > > Hi Philipp, > > > > > > On Thu, Jun 27, 2019 at 5:43

Re: [PATCH v3] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-06-30 Thread Philipp Zabel
stream start, > even if the sensor initial sequence wasn't the expected. > > Also improve the warning message to better explain the problem and provide > a hint that the sensor driver needs to be fixed. > > Signed-off-by: Ezequiel Garcia > Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel thanks Philipp

Re: [PATCH] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-06-27 Thread Philipp Zabel
Hi Fabio, On Thu, 2019-06-27 at 09:38 -0300, Fabio Estevam wrote: > Hi Philipp, > > On Thu, Jun 27, 2019 at 5:43 AM Philipp Zabel wrote: > > > Are there any visual artifacts in the first frame(s) in this case? > > I do not observe visual artifacts when runnin

Re: [PATCH] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-06-27 Thread Philipp Zabel
On Wed, 2019-06-26 at 16:29 -0700, Steve Longerbeam wrote: > Hi Fabio, > > On 6/26/19 4:22 PM, Fabio Estevam wrote: > > Hi Steve, > > > > On Wed, Jun 26, 2019 at 6:19 PM Steve Longerbeam > > wrote: > > > > > Did you only get the LP-11 timeout warning message with this patch on > > > the OV5645

Re: [PATCH] v4l2-ioctl: call v4l_pix_format_touch() for TRY_FMT

2019-06-26 Thread Philipp Zabel
v4l_pix_format_touch(&p->fmt.pix); Reviewed-by: Philipp Zabel regards Philipp

Re: [PATCH 02/16] coda: set device_caps in struct video_device

2019-06-26 Thread Philipp Zabel
-off-by: Hans Verkuil > Cc: Philipp Zabel > --- > drivers/media/platform/coda/coda-common.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/media/platform/coda/coda-common.c > b/drivers/media/platform/coda/coda-common.c > index 01428de259

Re: [PATCH] media: imx: mipi csi-2: Don't fail if initial state times-out

2019-06-26 Thread Philipp Zabel
outright failure to capture as a consequence. > Signed-off-by: Ezequiel Garcia Reviewed-by: Philipp Zabel regards Philipp > --- > drivers/staging/media/imx/imx6-mipi-csi2.c | 33 ++ > 1 file changed, 9 insertions(+), 24 deletions(-) > > diff --git a/

[PATCH 13/28] media: coda: do not enforce 512-byte initial bitstream payload on CODA960

2019-06-18 Thread Philipp Zabel
On CODA960, sequence initialization can succeed if less than 512 bytes are ready in the bitstream ring buffer. On other variants, warn about too small payload in start_streaming. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 4 +++- 1 file changed, 3 insertions

[PATCH 01/28] media: coda: implement CMD_START to restart decoding

2019-06-18 Thread Philipp Zabel
: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 751b0be1c2ea..a5e0d5c1528e 100644 --- a/drivers/media

[PATCH 14/28] media: coda: flush bitstream ring buffer on decoder restart

2019-06-18 Thread Philipp Zabel
buffers that have been queued during draining, to resume decoding immediately. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 20 drivers/media/platform/coda/coda-common.c | 7 +++ drivers/media/platform/coda/coda.h| 1 + 3 files changed

[PATCH 07/28] media: coda: split decoder sequence initialization out of start decoding

2019-06-18 Thread Philipp Zabel
VIDIOC_REQBUFS() on the CAPTURE queue. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index

[PATCH 17/28] media: coda: mark the last output buffer on decoder stop command

2019-06-18 Thread Philipp Zabel
Mark the last output buffer to be decoded and only copy pending queued output buffers into the bitstream ring buffer in the BIT processor decoder case. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 3 +++ drivers/media/platform/coda/coda-common.c | 6 ++ 2

[PATCH 16/28] media: coda: allow flagging last output buffer internally

2019-06-18 Thread Philipp Zabel
Since V4L2_BUF_FLAG_LAST is a CAPTURE only flag, clear it from OUTPUT buffers in QBUF and DQBUF. This allows to use the flag internally to signal the last buffer to decode after a decoder stop command was issued. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 20

[PATCH 22/28] media: coda: flag the last encoded buffer

2019-06-18 Thread Philipp Zabel
Use the flagged last output buffer to also flag the corresponding capture buffer after encoding. This causes the end of stream event to be issued and the buffer to be dequeued with the last flag set. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 16

[PATCH 25/28] media: coda: mark last returned frame

2019-06-18 Thread Philipp Zabel
If reordering is not enabled, the last decoded frame has to be the last returned buffer. Otherwise wait for the firmware to report no more frame to display. In that case the return buffer is the last one as well, and can be reported as such. Signed-off-by: Philipp Zabel --- drivers/media

[PATCH 15/28] media: coda: increment sequence offset for the last returned frame

2019-06-18 Thread Philipp Zabel
If no more frames are decoded in bitstream end mode, and a previously decoded frame has been returned, the firmware still increments the frame number. To avoid a sequence number mismatch after decoder restart, increment the sequence_offset correction parameter. Signed-off-by: Philipp Zabel

[PATCH 03/28] media: coda: fix mpeg2 sequence number handling

2019-06-18 Thread Philipp Zabel
Sequence number handling assumed that the BIT processor frame number starts counting at 1, but this is not true for the MPEG-2 decoder, which starts at 0. Fix the sequence counter offset detection to handle this. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 5

[PATCH 19/28] media: coda: mark the last output buffer on encoder stop command

2019-06-18 Thread Philipp Zabel
Mark the last output buffer to be encoded. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 4002a5b8c9ea..c55124e8b4c8

[PATCH 12/28] media: coda: pad first buffer with repeated MPEG headers to fix sequence init

2019-06-18 Thread Philipp Zabel
). Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 59 ++-- drivers/media/platform/coda/coda-mpeg2.c | 43 + drivers/media/platform/coda/coda-mpeg4.c | 38 +++ drivers/media/platform/coda/coda.h | 2 + 4 files ch

[PATCH 08/28] media: coda: add sequence initialization work

2019-06-18 Thread Philipp Zabel
Add a sequence initialization work item to be run when OUTPUT buffers are queued in the initialization state. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 25 +++ drivers/media/platform/coda/coda-common.c | 24 ++ drivers

[PATCH 05/28] media: coda: add coda_wake_up_capture_queue

2019-06-18 Thread Philipp Zabel
Combine setting the last_buffer_dequeued flag on the capture video queue and waking up its done workqueue into a helper function. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a

[PATCH 04/28] media: coda: fix last buffer handling in V4L2_ENC_CMD_STOP

2019-06-18 Thread Philipp Zabel
. Signed-off-by: Marco Felsch [l.st...@pengutronix.de: switch to flush_work, reword commit message] Signed-off-by: Lucas Stach Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/coda/coda-common.c b

[PATCH 23/28] media: coda: lock capture queue wakeup against encoder stop command

2019-06-18 Thread Philipp Zabel
Make sure that an encoder stop command running concurrently with an encoder finish_run always either flags the last returned buffer or wakes up the capture queue to signal the end of stream condition afterwards. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 7

[PATCH 10/28] media: coda: integrate internal frame metadata into a structure

2019-06-18 Thread Philipp Zabel
Combine the separate auxiliary buffer, buffer meta, frame type, and decode error arrays into an array of struct coda_internal_frame. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 62 +- drivers/media/platform/coda/coda.h | 12 +++-- 2

[PATCH 28/28] media: coda: encoder parameter change support

2019-06-18 Thread Philipp Zabel
Add support for dynamically changing the GOP size, bitrate, frame rate, constant intra quantization parameter, number of intra refresh macro blocks and slice mode parameters. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 83 +++ drivers/media

[PATCH 20/28] media: coda: retire coda_buf_is_end_of_stream

2019-06-18 Thread Philipp Zabel
Using the output queue sequence counter to determine the last buffer to be encoded or decoded always was fragile at best. Now that we have the last buffer flag propagating from the output queue to the capture queue correctly, this is not needed anymore. Signed-off-by: Philipp Zabel --- drivers

[PATCH 09/28] media: coda: implement decoder source change event

2019-06-18 Thread Philipp Zabel
The stateful decoder API requires decoders to signal detection of stream dimensions via the V4L2_EVENT_SOURCE_CHANGE event. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/media/platform

[PATCH 21/28] media: coda: only wake up capture queue if no pending buffers to encode

2019-06-18 Thread Philipp Zabel
If there are no pending queued output buffers to be encoded, waking up the capture queue with -EPIPE signals end of stream. If there are pending buffers on the other hand, setting the V4L2_BUF_FLAG_LAST on the resulting encoded capture buffers is all that is needed. Signed-off-by: Philipp Zabel

[PATCH 00/28] media: coda: fixes and improvements

2019-06-18 Thread Philipp Zabel
V4L2_ENC_CMD_STOP media: coda: fix V4L2_DEC_CMD_STOP when all buffers are already consumed Michael Tretter (1): media: coda: implement CMD_START to restart decoding Philipp Zabel (25): media: coda: use mem2mem try_en/decoder_cmd helpers media: coda: fix mpeg2 sequence number handling media: coda

[PATCH 27/28] media: coda: add coda_slice_mode() function

2019-06-18 Thread Philipp Zabel
Changing slice mode dynamically while encoding will require to calculate the register value again, so split it out into a separate function. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 45 ++ 1 file changed, 24 insertions(+), 21 deletions

[PATCH 26/28] media: coda: store device pointer in driver structure instead of pdev

2019-06-18 Thread Philipp Zabel
From: Philipp Zabel Currently the platform device pointer is stored in struct coda_dev, only to convert it into a device pointer wherever it is used. Just store the device pointer directly. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 7 +++-- drivers/media

[PATCH 06/28] media: coda: fix V4L2_DEC_CMD_STOP when all buffers are already consumed

2019-06-18 Thread Philipp Zabel
run workers pending at that point, we need to synchronize with them, so the sequence number comparison reads stable values. Signed-off-by: Marco Felsch [l.st...@pengutronix.de: rewrite to fix multi-context use-cases, reword commit message] Signed-off-by: Lucas Stach Signed-off-by: Philipp Zabel

[PATCH 18/28] media: coda: only set the stream end flags if there are no more pending output buffers

2019-06-18 Thread Philipp Zabel
If there are still queued output buffers pending to be copied into the bitstream ring buffer, setting the stream end flag should be deferred until the marked last output buffer is written into the bitstream ring buffer. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c

[PATCH 11/28] media: coda: make coda_bitstream_queue more versatile

2019-06-18 Thread Philipp Zabel
Pass vaddr and size to coda_bitstream_queue instead of a struct vb2_v4l2_buffer to make it reusable for queueing data that is not exactly a whole v4l2 buffer into the bitstream ringbuffer. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c | 23 +-- 1

[PATCH 24/28] media: coda: mark last pending buffer or last meta on decoder stop command

2019-06-18 Thread Philipp Zabel
up the capture queue as there will be no more decoded frames. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-bit.c| 4 +++ drivers/media/platform/coda/coda-common.c | 44 +++ drivers/media/platform/coda/coda.h| 1 + 3 files changed, 42

[PATCH 02/28] media: coda: use mem2mem try_en/decoder_cmd helpers

2019-06-18 Thread Philipp Zabel
Use mem2mem try_en/decoder_cmd helpers to ensure consistent behaviour with other video codec drivers. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/media/platform/coda

Re: [PATCH v8] media: imx: add mem2mem device

2019-06-14 Thread Philipp Zabel
Hi Steve, On Tue, 2019-06-11 at 18:08 -0700, Steve Longerbeam wrote: > Hi Philipp, > > Version 9 will also need to fix merge conflicts due to the recent module > re-org and the switch to sync registration for the IPU internal subdevs. > > I've done that work already, feel free to cherry-pick it

Re: [PATCH v4 00/10] Rename Rockchip VPU driver to Hantro, add initial i.MX8M support

2019-06-12 Thread Philipp Zabel
On Wed, 2019-06-12 at 10:00 +0200, Hans Verkuil wrote: > On 6/12/19 9:55 AM, Hans Verkuil wrote: > > On 6/11/19 2:50 PM, Philipp Zabel wrote: > > > There are several other SoCs that contain Hantro IP based VPUs, such as > > > NXP i.MX8MQ (Hantro G1 and G2) and i.MX8MM

[PATCH v7] media: hantro: Add support for MPEG-2 decoding on RK3328

2019-06-12 Thread Philipp Zabel
From: Jonas Karlman Add necessary bits to support MPEG2 decoding on RK3328. Signed-off-by: Jonas Karlman Signed-off-by: Ezequiel Garcia Signed-off-by: Philipp Zabel --- Changes since v6 [1]: - Rebased onto Hantro rename series [2] [1] https://patchwork.linuxtv.org/patch/56402/ [2] https

[PATCH v5 06/10] media: hantro: add support for separate control block

2019-06-12 Thread Philipp Zabel
On i.MX8MQ/MM a separate control block contains registers for per-core resets, clock gating, and fuse register control. Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon --- drivers/staging/media/hantro/hantro.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging

[PATCH v5 04/10] media: hantro: make irq names configurable

2019-06-12 Thread Philipp Zabel
The i.MX8MQ bindings will use different IRQ names ("g1" instead of "vdpu", and "g2"), so make them configurable. This also allows to register more than two IRQs, which will be required for i.MX8MM support later (it will add "h1" instead of "vepu").

[PATCH v5 03/10] media: hantro: add PM runtime resume callback

2019-06-12 Thread Philipp Zabel
It seems that on i.MX8MQ the power domain controller does not propagate resets to the VPU cores on resume. Add a callback to allow implementing manual reset of the VPU cores after ungating the power domain. Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon --- drivers/staging/media

[PATCH v5 07/10] media: hantro: allow arbitrary number of clocks

2019-06-12 Thread Philipp Zabel
Dynamically allocate clocks and move clock names out of struct hantro_variant. This lifts the four clock limit and allows to use ARRAY_SIZE() to fill .num_clocks to reduce the risk of mismatches. Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon --- Changes since v4 [1]: - Rebased onto

[PATCH v5 05/10] media: hantro: add support for named register ranges

2019-06-12 Thread Philipp Zabel
Add support for multiple register ranges with SoC specific names. Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon --- drivers/staging/media/hantro/hantro.h | 8 ++-- drivers/staging/media/hantro/hantro_drv.c | 24 +-- 2 files changed, 24 insertions(+), 8

[PATCH v5 09/10] media: hantro: add initial i.MX8MQ support

2019-06-12 Thread Philipp Zabel
For now this just enables MPEG-2 decoding on the Hantro G1 on i.MX8MQ. Signed-off-by: Philipp Zabel -- Changes since v4 [1]: - Fix duplicated num_irqs initializer [1] https://patchwork.linuxtv.org/patch/56802/ --- drivers/staging/media/hantro/Kconfig| 16 +- drivers/staging/media

[PATCH v5 08/10] media: dt-bindings: Document i.MX8MQ and i.MX8MM VPU bindings

2019-06-12 Thread Philipp Zabel
Add devicetree binding documentation for the Hantro G1/G2 VPU on i.MX8MQ and for the Hantro G1/G2/H1 VPU on i.MX8MM. Signed-off-by: Philipp Zabel --- .../devicetree/bindings/media/imx8m-vpu.txt | 56 +++ 1 file changed, 56 insertions(+) create mode 100644 Documentation

[PATCH v5 10/10] media: hantro: add initial i.MX8MM support (untested)

2019-06-12 Thread Philipp Zabel
This should enable MPEG-2 decoding on the Hantro G1 and JPEG encoding on the Hantro H1 on i.MX8MM. Signed-off-by: Philipp Zabel --- drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h| 1 + drivers/staging/media/hantro/imx8m_vpu_hw.c | 139

[PATCH v5 02/10] media: hantro: print video device name in addition to device node

2019-06-12 Thread Philipp Zabel
It can be helpful to know which video device was registered at which device node. Signed-off-by: Philipp Zabel Reviewed-by: Boris Brezillon --- drivers/staging/media/hantro/hantro_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/hantro

[PATCH v5 00/10] Rename Rockchip VPU driver to Hantro, add initial i.MX8M support

2019-06-12 Thread Philipp Zabel
oding on i.MX8MM may or may not work, I don't have the hardware to test. Changes since v4: - Rebased onto media-tree master, RK3328 support will have to be rebased as well - Fixed duplicated num_irqs initializer in imx8mq_vpu_variant regards Philipp Philipp Zabel (10): rockchip/vpu

[PATCH v4 09/10] media: hantro: add initial i.MX8MQ support

2019-06-11 Thread Philipp Zabel
For now this just enables MPEG-2 decoding on the Hantro G1 on i.MX8MQ. Signed-off-by: Philipp Zabel --- drivers/staging/media/hantro/Kconfig| 16 +- drivers/staging/media/hantro/Makefile | 3 + drivers/staging/media/hantro/hantro_drv.c | 3 + drivers/staging/media/hantro

[PATCH v4 00/10] Rename Rockchip VPU driver to Hantro, add initial i.MX8M support

2019-06-11 Thread Philipp Zabel
staging/media Kconfig in alphabetic order. - Rename bases to reg_bases - Move dynamic clocks before i.MX8M support. regards Philipp Philipp Zabel (10): rockchip/vpu: rename from rockchip to hantro media: hantro: print video device name in addition to device node media: hantro: add PM runtim

  1   2   3   4   5   6   7   8   9   10   >