Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Arnd Bergmann
On Fri, Jul 14, 2017 at 3:09 PM, Dan Carpenter wrote: > On Fri, Jul 14, 2017 at 03:55:26PM +0300, Dan Carpenter wrote: >> I don't agree with it as a static analysis dev... > > What I mean is if it's a macro that returns -ENODEV or a function that > returns -ENODEV, they

[PATCH 5/6] v4l: vsp1: Convert LUT to use a fragment pool

2017-07-14 Thread Kieran Bingham
Adapt the LUT to allocate a fragment pool for passing the table updates to hardware. Two bodies are pre-allocated in the pool to manage a userspace update before the hardware has taken a previous set of tables. Signed-off-by: Kieran Bingham ---

[PATCH 4/6] v4l: vsp1: Convert CLU to use a fragment pool

2017-07-14 Thread Kieran Bingham
Adapt the CLU to allocate a fragment pool for passing the table updates to hardware. Two bodies are pre-allocated in the pool to manage a userspace update before the hardware has taken a previous set of tables. Signed-off-by: Kieran Bingham ---

[PATCH 0/6] vsp1: TLB optimisation

2017-07-14 Thread Kieran Bingham
Each display list currently allocates an area of DMA memory to store register settings for the VSP1 to process. Each of these allocations adds pressure to the IPMMU TLB entries. We can reduce the pressure by pre-allocating larger areas and dividing the area across multiple bodies represented as a

[PATCH 1/6] v4l: vsp1: Protect fragments against overflow

2017-07-14 Thread Kieran Bingham
The fragment write function relies on the code never asking it to write more than the entries available in the list. Currently with each list body containing 256 entries, this is fine, but we can reduce this number greatly saving memory. In preparation of this - add a level of protection to

[PATCH 6/6] v4l: vsp1: Remove old fragment management

2017-07-14 Thread Kieran Bingham
Fragments are no longer 'freed' in interrupt context, but instead released back to their respective pools. This allows us to remove the garbage collector in the DLM. Signed-off-by: Kieran Bingham --- drivers/media/platform/vsp1/vsp1_dl.c | 151

[PATCH 2/6] v4l: vsp1: Provide a fragment pool

2017-07-14 Thread Kieran Bingham
Each display list allocates a body to store register values in a dma accessible buffer from a dma_alloc_wc() allocation. Each of these results in an entry in the TLB, and a large number of display list allocations adds pressure to this resource. Reduce TLB pressure on the IPMMUs by allocating

[PATCH 3/6] v4l: vsp1: Convert display lists to use new fragment pool

2017-07-14 Thread Kieran Bingham
Adapt the dl->body0 object to use an object from the fragment pool. This greatly reduces the pressure on the TLB for IPMMU use cases, as all of the lists use a single allocation for the main body Signed-off-by: Kieran Bingham ---

Re: [PATCH] ata: sata_rcar: add gen[23] fallback compatibility strings

2017-07-14 Thread Rob Herring
On Tue, Jul 11, 2017 at 01:44:20PM +0200, Simon Horman wrote: > Add fallback compatibility string for R-Car Gen 2 and 3. > > In the case of Renesas R-Car hardware we know that there are generations of > SoCs, e.g. Gen 1 and 2. But beyond that its not clear what the relationship > between IP

[PATCH v2 5/6] v4l: vsp1: Provide UDS register updates

2017-07-14 Thread Kieran Bingham
Provide register definitions required for UDS phase and partition algorithm support. These registers are applicable to Gen3 hardware only. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart ---

[PATCH v2 4/6] v4l: vsp1: Move partition rectangles to struct and operate directly

2017-07-14 Thread Kieran Bingham
As we develop the partition algorithm, we need to store more information per partition to describe the phase and other parameters. To keep this data together, further abstract the existing v4l2_rect into a partition specific structure When generating the partition windows, operate directly on

[PATCH v2 3/6] v4l: vsp1: Remove redundant context variables

2017-07-14 Thread Kieran Bingham
The vsp1_pipe object context variables for div_size and current_partition allowed state to be maintained through processing the partitions during processing. Now that the partition tables are calculated during stream on, there is no requirement to store these variables in the pipe object.

[PATCH v2 6/6] v4l: vsp1: Allow entities to participate in the partition algorithm

2017-07-14 Thread Kieran Bingham
The configuration of the pipeline and entities directly affects the inputs required to each entity for the partition algorithm. Thus it makes sense to involve those entities in the decision making process. Extend the entity ops API to provide an optional '.partition' operation. This allows

[PATCH v2 2/6] v4l: vsp1: Calculate partition sizes at stream start.

2017-07-14 Thread Kieran Bingham
Previously the active window and partition sizes for each partition were calculated for each partition every frame. This data is constant and only needs to be calculated once at the start of the stream. Extend the vsp1_pipe object to dynamically store the number of partitions required and

[PATCH v2 0/6] vsp1 partition algorithm improvements

2017-07-14 Thread Kieran Bingham
Some updates and initial improvements for the VSP1 partition algorithm that remove redundant processing and variables, reducing the processing done in interrupt context slightly. Patches 1, 2 and 3 clean up the calculation of the partition windows such that they are only calculated once at

[PATCH v2 1/6] v4l: vsp1: Move vsp1_video_pipeline_setup_partitions() function

2017-07-14 Thread Kieran Bingham
Separate the code change from the function move so that code changes can be clearly identified. This commit has no functional change. The partition algorithm functions will be changed, and vsp1_video_pipeline_setup_partitions() will call vsp1_video_partition(). To prepare for that, move the

Re: clk: renesas: rcar-gen3: Fix error return code in cpg_sd_clock_recalc_rate

2017-07-14 Thread Wolfram Sang
On Thu, Apr 20, 2017 at 02:46:33AM +0900, Yoshihiro Kaneko wrote: > From: Takeshi Kihara > > In .recalc_rate of struct clk_ops, it is desirable to return 0 if an > error occurs, but -EINVAL is returned. This patch fixes it. > > Fixes: 5b1defde7054 ("clk: renesas:

Re: [PATCH] clk: renesas: rcar-gen3: Fix error return code in cpg_sd_clock_recalc_rate

2017-07-14 Thread Wolfram Sang
On Thu, Jul 13, 2017 at 11:06:56PM +0200, Wolfram Sang wrote: > From: Takeshi Kihara > > In .recalc_rate of struct clk_ops, it is desirable to return 0 if an > error occurs, but -EINVAL is returned. This patch fixes it. > > Fixes: 5b1defde7054 ("clk: renesas:

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
On Fri, Jul 14, 2017 at 03:55:26PM +0300, Dan Carpenter wrote: > I don't agree with it as a static analysis dev... What I mean is if it's a macro that returns -ENODEV or a function that returns -ENODEV, they should both be treated the same. The other warnings this check prints are quite clever.

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
On Fri, Jul 14, 2017 at 11:36:56AM +0200, Arnd Bergmann wrote: > @@ -1158,7 +1158,8 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) >*/ > fmt_src.pad = pad->index; > fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE; > - if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL,

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Arnd Bergmann
On Fri, Jul 14, 2017 at 2:05 PM, Dan Carpenter wrote: > Changing: > > - if (!frob()) { > + if (frob() == 0) { > > is a totally pointless change. They're both bad, because they're doing > success testing instead of failure testing, but probably the second one > is

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
Changing: - if (!frob()) { + if (frob() == 0) { is a totally pointless change. They're both bad, because they're doing success testing instead of failure testing, but probably the second one is slightly worse. This warning seems dumb. I can't imagine it has even a 10% success rate at finding

[PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Arnd Bergmann
v4l2_subdev_call is a macro returning whatever the callback return type is, usually 'int'. With gcc-7 and ccache, this can lead to many wanings like: media/platform/pxa_camera.c: In function 'pxa_mbus_build_fmts_xlate': media/platform/pxa_camera.c:766:27: error: ?: using integer constants in

Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending

2017-07-14 Thread Chen-Yu Tsai
Hi, On Thu, Jul 13, 2017 at 10:41 PM, Maxime Ripard wrote: > In the earlier display engine designs, any register access while a commit > is pending is forbidden. > > One of the symptoms is that reading a register will return another, random, > register value

[PATCH] arm64: dts: renesas: ulcb: sound clock-frequency needs descending order

2017-07-14 Thread Simon Horman
From: Vladimir Barinov Correct order of sound clock frequencies for ULCB boards used with r8a7795 and r8a7796 SoCs. These sounds clock frequencies are used as the ADG clock (output clocks for audio module) initial setting and sound codec's initial

[GIT PULL] Second Round of Renesas ARM Based SoC Fixes for v4.13

2017-07-14 Thread Simon Horman
Hi Olof, Hi Kevin, Hi Arnd, Please consider these second round of Renesas ARM based SoC fixes for v4.13. This pull request is based on the previous round of such requests, tagged as renesas-fixes-for-v4.13, which I have already sent a pull-request for. That pull request provides the same fix as

Re: [PATCH v2 08/14] v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances

2017-07-14 Thread Kieran Bingham
On 14/07/17 00:31, Laurent Pinchart wrote: > Hi Kieran, > > On Thursday 13 Jul 2017 18:49:19 Kieran Bingham wrote: >> On 26/06/17 19:12, Laurent Pinchart wrote: >>> New Gen3 SoCs come with two new VSP2 variants names VSP2-BS and VSP2-DL, >>> as well as a new VSP2-D variant on V3M and V3H SoCs.

Re: [PATCH v2] ARM: dts: iwg20m: Add MMCIF0 support

2017-07-14 Thread Simon Horman
On Thu, Jul 13, 2017 at 06:31:33PM +0200, Geert Uytterhoeven wrote: > On Thu, Jul 13, 2017 at 5:39 PM, Chris Paterson > wrote: > > Define the iwg20m board dependent part of the MMCIF0 device node. > > > > Signed-off-by: Chris Paterson >

Re: [PATCH] arm64: dts: renesas: salvator-xs: Add VC6 clock generator

2017-07-14 Thread Simon Horman
On Thu, Jul 13, 2017 at 01:19:12PM +0200, Geert Uytterhoeven wrote: > On Thu, Jul 13, 2017 at 1:06 PM, Laurent Pinchart > wrote: > > The VC6 is an I2C-controlled programmable clock generator, used on the > > board to provide a display dot clock. Add it

Re: [PATCH 2/2] arm64: dts: r8a7795: salvator-xs: Connect DU dot clocks 0 and 3

2017-07-14 Thread Simon Horman
On Thu, Jul 13, 2017 at 01:20:16PM +0200, Geert Uytterhoeven wrote: > On Thu, Jul 13, 2017 at 1:09 PM, Laurent Pinchart > wrote: > > The DU dot clocks 0 and 3 are provided by the programmable VC6 clock > > generator. Connect them to the clock source

Re: [PATCH 2/2] arm64: dts: renesas: r8a7796: Add resets property to VSP devices

2017-07-14 Thread Simon Horman
On Fri, Jul 14, 2017 at 09:20:31AM +0200, Simon Horman wrote: > On Thu, Jul 13, 2017 at 01:17:10PM +0200, Geert Uytterhoeven wrote: > > On Thu, Jul 13, 2017 at 12:58 PM, Laurent Pinchart > > wrote: > > > The VSP nodes are missing the resets property. Add

Re: [PATCH 1/2] arm64: dts: renesas: r8a7796: Add resets property to FCP devices

2017-07-14 Thread Simon Horman
On Thu, Jul 13, 2017 at 01:16:19PM +0200, Geert Uytterhoeven wrote: > On Thu, Jul 13, 2017 at 12:58 PM, Laurent Pinchart > wrote: > > The FCP nodes are missing the resets property. Add it. > > > > Fixes: 7153c69fb8e1 ("arm64: dts: renesas: r8a7796: Add

Re: [PATCH 2/2] arm64: dts: renesas: r8a7796: Add resets property to VSP devices

2017-07-14 Thread Simon Horman
On Thu, Jul 13, 2017 at 01:17:10PM +0200, Geert Uytterhoeven wrote: > On Thu, Jul 13, 2017 at 12:58 PM, Laurent Pinchart > wrote: > > The VSP nodes are missing the resets property. Add it. > > > > Fixes: 5a89c826745f ("arm64: dts: renesas: r8a7796: Add