2020-09-12 14:32:35

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
and V4L2 raw API testing utility
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented

best regards,
Martin

Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
media: cedrus: Register all codecs as capability
dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
ARM: dts: sun8i: v3s: Add node for system control
media: cedrus: Add support for V3s
dt-bindings: media: cedrus: Add V3s compatible
ARM: dts: sun8i: v3s: Add video engine node

.../allwinner,sun4i-a10-video-engine.yaml | 1 +
.../allwinner,sun4i-a10-system-control.yaml | 6 ++++
arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
.../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
6 files changed, 71 insertions(+), 1 deletion(-)

--
2.17.1


2020-09-12 14:33:16

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 1/6] media: cedrus: Register all codecs as capability

All codecs should have capabilities.
For example "Allwinner V3s" does not support "MPEG2".

Signed-off-by: Martin Cerveny <[email protected]>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 18 +++++++++++++++++-
drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
.../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 7c6b91f0e780..ae7e154eca9f 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -479,42 +479,58 @@ static int cedrus_remove(struct platform_device *pdev)
}

static const struct cedrus_variant sun4i_a10_cedrus_variant = {
+ .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate = 320000000,
};

static const struct cedrus_variant sun5i_a13_cedrus_variant = {
+ .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate = 320000000,
};

static const struct cedrus_variant sun7i_a20_cedrus_variant = {
+ .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate = 320000000,
};

static const struct cedrus_variant sun8i_a33_cedrus_variant = {
- .capabilities = CEDRUS_CAPABILITY_UNTILED,
+ .capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate = 320000000,
};

static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
CEDRUS_CAPABILITY_H265_DEC,
.mod_rate = 402000000,
};

static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
CEDRUS_CAPABILITY_H265_DEC,
.mod_rate = 402000000,
};

static const struct cedrus_variant sun50i_h5_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
CEDRUS_CAPABILITY_H265_DEC,
.mod_rate = 402000000,
};

static const struct cedrus_variant sun50i_h6_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
CEDRUS_CAPABILITY_H265_DEC,
.quirks = CEDRUS_QUIRK_NO_DMA_OFFSET,
.mod_rate = 600000000,
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h
index 96765555ab8a..b6032f40cde8 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
@@ -28,6 +28,8 @@

#define CEDRUS_CAPABILITY_UNTILED BIT(0)
#define CEDRUS_CAPABILITY_H265_DEC BIT(1)
+#define CEDRUS_CAPABILITY_H264_DEC BIT(2)
+#define CEDRUS_CAPABILITY_MPEG2_DEC BIT(3)

#define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index 16d82309e7b6..cb4aca5be415 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -38,10 +38,12 @@ static struct cedrus_format cedrus_formats[] = {
{
.pixelformat = V4L2_PIX_FMT_MPEG2_SLICE,
.directions = CEDRUS_DECODE_SRC,
+ .capabilities = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.pixelformat = V4L2_PIX_FMT_H264_SLICE,
.directions = CEDRUS_DECODE_SRC,
+ .capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.pixelformat = V4L2_PIX_FMT_HEVC_SLICE,
--
2.17.1

2020-09-12 14:33:51

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 6/6] ARM: dts: sun8i: v3s: Add video engine node

Allwinner V3S SoC has a video engine.
Add a node for it.

Signed-off-by: Martin Cerveny <[email protected]>
---
arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 3f18866fb37b..3fb01dc1a9ba 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -195,6 +195,16 @@
};
};

+ video-codec@1c0e000 {
+ compatible = "allwinner,sun8i-v3s-video-engine";
+ reg = <0x01c0e000 0x1000>;
+ clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+ <&ccu CLK_DRAM_VE>;
+ clock-names = "ahb", "mod", "ram";
+ resets = <&ccu RST_BUS_VE>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+ allwinner,sram = <&ve_sram 1>;
+ };

mmc0: mmc@1c0f000 {
compatible = "allwinner,sun7i-a20-mmc";
--
2.17.1

2020-09-12 14:34:14

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 3/6] ARM: dts: sun8i: v3s: Add node for system control

Allwinner V3s has system control and SRAM C1 region similar to H3.

Signed-off-by: Martin Cerveny <[email protected]>
---
arch/arm/boot/dts/sun8i-v3s.dtsi | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e5312869c0d2..3f18866fb37b 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -138,6 +138,29 @@
};
};

+ syscon: system-control@1c00000 {
+ compatible = "allwinner,sun8i-v3s-system-control",
+ "allwinner,sun8i-h3-system-control";
+ reg = <0x01c00000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ sram_c: sram@1d00000 {
+ compatible = "mmio-sram";
+ reg = <0x01d00000 0x80000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x01d00000 0x80000>;
+
+ ve_sram: sram-section@0 {
+ compatible = "allwinner,sun8i-v3s-sram-c1",
+ "allwinner,sun4i-a10-sram-c1";
+ reg = <0x000000 0x80000>;
+ };
+ };
+ };
+
tcon0: lcd-controller@1c0c000 {
compatible = "allwinner,sun8i-v3s-tcon";
reg = <0x01c0c000 0x1000>;
--
2.17.1

2020-09-12 14:34:22

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 5/6] dt-bindings: media: cedrus: Add V3s compatible

Allwinner V3s SoC contains video engine. Add compatible for it.

Signed-off-by: Martin Cerveny <[email protected]>
---
.../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 4cc1a670c986..08515c18cbb7 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -18,6 +18,7 @@ properties:
- allwinner,sun7i-a20-video-engine
- allwinner,sun8i-a33-video-engine
- allwinner,sun8i-h3-video-engine
+ - allwinner,sun8i-v3s-video-engine
- allwinner,sun50i-a64-video-engine
- allwinner,sun50i-h5-video-engine
- allwinner,sun50i-h6-video-engine
--
2.17.1

2020-09-12 14:35:35

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 2/6] dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s compatibles

Allwinner V3s has system control similar to that in H3.
Add compatibles for system control with SRAM C1 region.

Signed-off-by: Martin Cerveny <[email protected]>
---
.../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
index f5825935fd22..9577d6c1494a 100644
--- a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
+++ b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
@@ -33,6 +33,9 @@ properties:
- const: allwinner,sun4i-a10-system-control
- const: allwinner,sun8i-a23-system-control
- const: allwinner,sun8i-h3-system-control
+ - items:
+ - const: allwinner,sun8i-v3s-system-control
+ - const: allwinner,sun8i-h3-system-control
- const: allwinner,sun50i-a64-sram-controller
deprecated: true
- const: allwinner,sun50i-a64-system-control
@@ -86,6 +89,9 @@ patternProperties:
- items:
- const: allwinner,sun8i-h3-sram-c1
- const: allwinner,sun4i-a10-sram-c1
+ - items:
+ - const: allwinner,sun8i-v3s-sram-c1
+ - const: allwinner,sun4i-a10-sram-c1
- items:
- const: allwinner,sun50i-a64-sram-c1
- const: allwinner,sun4i-a10-sram-c1
--
2.17.1

2020-09-12 14:37:03

by Martin Cerveny

[permalink] [raw]
Subject: [PATCH v2 4/6] media: cedrus: Add support for V3s

V3s video engine runs at lower speed and support video decoder
for H.264 and JPEG/MJPEG only.

Signed-off-by: Martin Cerveny <[email protected]>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index ae7e154eca9f..79ec5e07b416 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -511,6 +511,12 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.mod_rate = 402000000,
};

+static const struct cedrus_variant sun8i_v3s_cedrus_variant = {
+ .capabilities = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_H264_DEC,
+ .mod_rate = 297000000,
+};
+
static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
CEDRUS_CAPABILITY_MPEG2_DEC |
@@ -557,6 +563,10 @@ static const struct of_device_id cedrus_dt_match[] = {
.compatible = "allwinner,sun8i-h3-video-engine",
.data = &sun8i_h3_cedrus_variant,
},
+ {
+ .compatible = "allwinner,sun8i-v3s-video-engine",
+ .data = &sun8i_v3s_cedrus_variant,
+ },
{
.compatible = "allwinner,sun50i-a64-video-engine",
.data = &sun50i_a64_cedrus_variant,
--
2.17.1

2020-09-22 23:01:54

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 2/6] dt-bindings: sram: allwinner, sun4i-a10-system-control: Add V3s compatibles

On Sat, 12 Sep 2020 16:30:48 +0200, Martin Cerveny wrote:
> Allwinner V3s has system control similar to that in H3.
> Add compatibles for system control with SRAM C1 region.
>
> Signed-off-by: Martin Cerveny <[email protected]>
> ---
> .../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>

Acked-by: Rob Herring <[email protected]>

2020-09-22 23:05:10

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 5/6] dt-bindings: media: cedrus: Add V3s compatible

On Sat, 12 Sep 2020 16:30:51 +0200, Martin Cerveny wrote:
> Allwinner V3s SoC contains video engine. Add compatible for it.
>
> Signed-off-by: Martin Cerveny <[email protected]>
> ---
> .../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
> 1 file changed, 1 insertion(+)
>

Acked-by: Rob Herring <[email protected]>

2020-10-30 11:08:01

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

Maxime,

Are you OK with this series? It looks good to me.

Regards,

Hans

On 12/09/2020 16:30, Martin Cerveny wrote:
> First patch extends cedrus capability to all decoders
> because V3s missing MPEG2 decoder.
>
> Next two patches add system control node (SRAM C1) and
> next three patches add support for Cedrus VPU.
>
> Tested on "Lichee Zero" V3s platform with testing LCD patch
> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
> and V4L2 raw API testing utility
> ( https://github.com/mcerveny/v4l2-request-test ):
> - enabled LCD (DRM dual VI and sigle UI planes)
> - added RGB panel
> - enabled PWM
>
> There is low memory on V3s (64MB) and maximum must be available to CMA:
> - CONFIG_CMA_SIZE_MBYTES=28
> - add swap to swapout other processes
> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>
> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
> JPEG/MJPEG still unimplemented, encoder unimplemented
>
> best regards,
> Martin
>
> Changes since v1:
> - patch 0005 rename
> - added testing description
>
> Martin Cerveny (6):
> media: cedrus: Register all codecs as capability
> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
> compatibles
> ARM: dts: sun8i: v3s: Add node for system control
> media: cedrus: Add support for V3s
> dt-bindings: media: cedrus: Add V3s compatible
> ARM: dts: sun8i: v3s: Add video engine node
>
> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
> 6 files changed, 71 insertions(+), 1 deletion(-)
>

2020-10-30 15:52:07

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

Hi!

On Fri, Oct 30, 2020 at 12:06:10PM +0100, Hans Verkuil wrote:
> Maxime,
>
> Are you OK with this series? It looks good to me.

I am, you can take it. I'll merge the dt patches through arm-soc

Thanks!
Maxime


Attachments:
(No filename) (226.00 B)
signature.asc (235.00 B)
Download all attachments

2020-11-05 13:56:52

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

Hi Martin,

On 12/09/2020 16:30, Martin Cerveny wrote:
> First patch extends cedrus capability to all decoders
> because V3s missing MPEG2 decoder.
>
> Next two patches add system control node (SRAM C1) and
> next three patches add support for Cedrus VPU.
>
> Tested on "Lichee Zero" V3s platform with testing LCD patch
> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
> and V4L2 raw API testing utility
> ( https://github.com/mcerveny/v4l2-request-test ):
> - enabled LCD (DRM dual VI and sigle UI planes)
> - added RGB panel
> - enabled PWM
>
> There is low memory on V3s (64MB) and maximum must be available to CMA:
> - CONFIG_CMA_SIZE_MBYTES=28
> - add swap to swapout other processes
> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>
> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
> JPEG/MJPEG still unimplemented, encoder unimplemented

When I tried to merged these patches I got merge conflicts.

Possibly due to other 5.10 changes, but certainly because of conflicts
with patches from Jernej:

https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/

I've merged Jerne's patches and posted a PR for that:
https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/

Can you rebase your patches on top of my branch that contains Jernej's patches?

https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e

Once my PR is merged into the media_tree master I can take your rebased
patches.

Regards,

Hans

>
> best regards,
> Martin
>
> Changes since v1:
> - patch 0005 rename
> - added testing description
>
> Martin Cerveny (6):
> media: cedrus: Register all codecs as capability
> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
> compatibles
> ARM: dts: sun8i: v3s: Add node for system control
> media: cedrus: Add support for V3s
> dt-bindings: media: cedrus: Add V3s compatible
> ARM: dts: sun8i: v3s: Add video engine node
>
> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
> 6 files changed, 71 insertions(+), 1 deletion(-)
>

2020-11-15 19:25:28

by Martin Cerveny

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

Hello.

On Thu, 5 Nov 2020, Hans Verkuil wrote:

> Hi Martin,
>
> On 12/09/2020 16:30, Martin Cerveny wrote:
>> First patch extends cedrus capability to all decoders
>> because V3s missing MPEG2 decoder.
>>
>> Next two patches add system control node (SRAM C1) and
>> next three patches add support for Cedrus VPU.
>>
>> Tested on "Lichee Zero" V3s platform with testing LCD patch
>> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
>> and V4L2 raw API testing utility
>> ( https://github.com/mcerveny/v4l2-request-test ):
>> - enabled LCD (DRM dual VI and sigle UI planes)
>> - added RGB panel
>> - enabled PWM
>>
>> There is low memory on V3s (64MB) and maximum must be available to CMA:
>> - CONFIG_CMA_SIZE_MBYTES=28
>> - add swap to swapout other processes
>> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>>
>> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
>> JPEG/MJPEG still unimplemented, encoder unimplemented
>
> When I tried to merged these patches I got merge conflicts.
>
> Possibly due to other 5.10 changes, but certainly because of conflicts
> with patches from Jernej:
>
> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>
> I've merged Jerne's patches and posted a PR for that:
> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>
> Can you rebase your patches on top of my branch that contains Jernej's patches?
>
> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e
>
> Once my PR is merged into the media_tree master I can take your rebased
> patches.

I updated patches:
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e

BUT, commit (555 commits) for v5.10-1
https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):

1) colors are disrupted

There are missing some initialization now.

If I use "5.9" compatible code
(last bisect good point https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29 )
then reboot (not power-off!) and use new code
( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
and colors are OK.

2) decoding of complex streams fails

( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
- bbb-h264-all-i-32 - OK
- bbb-h264-32 - bad from frame 5
- bbb-h264-high-32 - bad from frame 6

best regards,
Martin

>> Changes since v1:
>> - patch 0005 rename
>> - added testing description
>>
>> Martin Cerveny (6):
>> media: cedrus: Register all codecs as capability
>> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
>> compatibles
>> ARM: dts: sun8i: v3s: Add node for system control
>> media: cedrus: Add support for V3s
>> dt-bindings: media: cedrus: Add V3s compatible
>> ARM: dts: sun8i: v3s: Add video engine node
>>
>> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
>> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
>> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
>> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
>> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
>> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>> 6 files changed, 71 insertions(+), 1 deletion(-)
>>
>

2020-11-16 08:42:57

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

On 15/11/2020 19:59, Martin Cerveny wrote:
> Hello.
>
> On Thu, 5 Nov 2020, Hans Verkuil wrote:
>
>> Hi Martin,
>>
>> On 12/09/2020 16:30, Martin Cerveny wrote:
>>> First patch extends cedrus capability to all decoders
>>> because V3s missing MPEG2 decoder.
>>>
>>> Next two patches add system control node (SRAM C1) and
>>> next three patches add support for Cedrus VPU.
>>>
>>> Tested on "Lichee Zero" V3s platform with testing LCD patch
>>> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
>>> and V4L2 raw API testing utility
>>> ( https://github.com/mcerveny/v4l2-request-test ):
>>> - enabled LCD (DRM dual VI and sigle UI planes)
>>> - added RGB panel
>>> - enabled PWM
>>>
>>> There is low memory on V3s (64MB) and maximum must be available to CMA:
>>> - CONFIG_CMA_SIZE_MBYTES=28
>>> - add swap to swapout other processes
>>> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>>>
>>> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
>>> JPEG/MJPEG still unimplemented, encoder unimplemented
>>
>> When I tried to merged these patches I got merge conflicts.
>>
>> Possibly due to other 5.10 changes, but certainly because of conflicts
>> with patches from Jernej:
>>
>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>
>> I've merged Jerne's patches and posted a PR for that:
>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>
>> Can you rebase your patches on top of my branch that contains Jernej's patches?
>>
>> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e
>>
>> Once my PR is merged into the media_tree master I can take your rebased
>> patches.
>
> I updated patches:
> https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e
>
> BUT, commit (555 commits) for v5.10-1
> https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
> disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):
>
> 1) colors are disrupted
>
> There are missing some initialization now.
>
> If I use "5.9" compatible code
> (last bisect good point https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29 )
> then reboot (not power-off!) and use new code
> ( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
> and colors are OK.

Could this or the next issue be related to this bug fix?

https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f

That fix isn't yet in our master tree.

>
> 2) decoding of complex streams fails
>
> ( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
> - bbb-h264-all-i-32 - OK
> - bbb-h264-32 - bad from frame 5
> - bbb-h264-high-32 - bad from frame 6

I think cedrus devs need to take a look at these issues.

Regards,

Hans

>
> best regards,
> Martin
>
>>> Changes since v1:
>>> - patch 0005 rename
>>> - added testing description
>>>
>>> Martin Cerveny (6):
>>> media: cedrus: Register all codecs as capability
>>> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
>>> compatibles
>>> ARM: dts: sun8i: v3s: Add node for system control
>>> media: cedrus: Add support for V3s
>>> dt-bindings: media: cedrus: Add V3s compatible
>>> ARM: dts: sun8i: v3s: Add video engine node
>>>
>>> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
>>> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
>>> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
>>> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
>>> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
>>> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>>> 6 files changed, 71 insertions(+), 1 deletion(-)
>>>
>>

2020-11-16 09:42:02

by Martin Cerveny

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder



On Mon, 16 Nov 2020, Hans Verkuil wrote:

> On 15/11/2020 19:59, Martin Cerveny wrote:
>> Hello.
>>
>> On Thu, 5 Nov 2020, Hans Verkuil wrote:
>>
>>> Hi Martin,
>>>
>>> On 12/09/2020 16:30, Martin Cerveny wrote:
>>>> First patch extends cedrus capability to all decoders
>>>> because V3s missing MPEG2 decoder.
>>>>
>>>> Next two patches add system control node (SRAM C1) and
>>>> next three patches add support for Cedrus VPU.
>>>>
>>>> Tested on "Lichee Zero" V3s platform with testing LCD patch
>>>> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
>>>> and V4L2 raw API testing utility
>>>> ( https://github.com/mcerveny/v4l2-request-test ):
>>>> - enabled LCD (DRM dual VI and sigle UI planes)
>>>> - added RGB panel
>>>> - enabled PWM
>>>>
>>>> There is low memory on V3s (64MB) and maximum must be available to CMA:
>>>> - CONFIG_CMA_SIZE_MBYTES=28
>>>> - add swap to swapout other processes
>>>> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>>>>
>>>> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
>>>> JPEG/MJPEG still unimplemented, encoder unimplemented
>>>
>>> When I tried to merged these patches I got merge conflicts.
>>>
>>> Possibly due to other 5.10 changes, but certainly because of conflicts
>>> with patches from Jernej:
>>>
>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>
>>> I've merged Jerne's patches and posted a PR for that:
>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>
>>> Can you rebase your patches on top of my branch that contains Jernej's patches?
>>>
>>> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e
>>>
>>> Once my PR is merged into the media_tree master I can take your rebased
>>> patches.
>>
>> I updated patches:
>> https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e
>>
>> BUT, commit (555 commits) for v5.10-1
>> https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
>> disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):
>>
>> 1) colors are disrupted
>>
>> There are missing some initialization now.
>>
>> If I use "5.9" compatible code
>> (last bisect good point https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29 )
>> then reboot (not power-off!) and use new code
>> ( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
>> and colors are OK.
>
> Could this or the next issue be related to this bug fix?
>
> https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f
>
> That fix isn't yet in our master tree.

Confirmed. It recovers colors !

>>
>> 2) decoding of complex streams fails
>>
>> ( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
>> - bbb-h264-all-i-32 - OK
>> - bbb-h264-32 - bad from frame 5
>> - bbb-h264-high-32 - bad from frame 6
>
> I think cedrus devs need to take a look at these issues.

Maybe something wrong in my testing code,
problematic commit swapped some variables between structures :-(

I try to investigate more, regards Martin

> Regards,
>
> Hans
>
>>
>> best regards,
>> Martin
>>
>>>> Changes since v1:
>>>> - patch 0005 rename
>>>> - added testing description
>>>>
>>>> Martin Cerveny (6):
>>>> media: cedrus: Register all codecs as capability
>>>> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
>>>> compatibles
>>>> ARM: dts: sun8i: v3s: Add node for system control
>>>> media: cedrus: Add support for V3s
>>>> dt-bindings: media: cedrus: Add V3s compatible
>>>> ARM: dts: sun8i: v3s: Add video engine node
>>>>
>>>> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
>>>> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
>>>> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
>>>> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
>>>> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
>>>> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>>>> 6 files changed, 71 insertions(+), 1 deletion(-)
>>>>
>>>
>

2020-11-16 12:23:57

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

On 16/11/2020 13:07, Martin Cerveny wrote:
> Hello.
>
> On Mon, 16 Nov 2020, Martin Cerveny wrote:
>> On Mon, 16 Nov 2020, Hans Verkuil wrote:
>>> On 15/11/2020 19:59, Martin Cerveny wrote:
>>>> On Thu, 5 Nov 2020, Hans Verkuil wrote:
>>>>> On 12/09/2020 16:30, Martin Cerveny wrote:
>>>>>> First patch extends cedrus capability to all decoders
>>>>>> because V3s missing MPEG2 decoder.
>>>>>>
>>>>>> Next two patches add system control node (SRAM C1) and
>>>>>> next three patches add support for Cedrus VPU.
>>>>>>
>>>>>> Tested on "Lichee Zero" V3s platform with testing LCD patch
>>>>>> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
>>>>>> and V4L2 raw API testing utility
>>>>>> ( https://github.com/mcerveny/v4l2-request-test ):
>>>>>> - enabled LCD (DRM dual VI and sigle UI planes)
>>>>>> - added RGB panel
>>>>>> - enabled PWM
>>>>>>
>>>>>> There is low memory on V3s (64MB) and maximum must be available to CMA:
>>>>>> - CONFIG_CMA_SIZE_MBYTES=28
>>>>>> - add swap to swapout other processes
>>>>>> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>>>>>>
>>>>>> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
>>>>>> JPEG/MJPEG still unimplemented, encoder unimplemented
>>>>>
>>>>> When I tried to merged these patches I got merge conflicts.
>>>>>
>>>>> Possibly due to other 5.10 changes, but certainly because of conflicts
>>>>> with patches from Jernej:
>>>>>
>>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>>>
>>>>> I've merged Jerne's patches and posted a PR for that:
>>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>>>
>>>>> Can you rebase your patches on top of my branch that contains Jernej's
>>>>> patches?
>>>>>
>>>>> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e
>>>>>
>>>>> Once my PR is merged into the media_tree master I can take your rebased
>>>>> patches.
>>>>
>>>> I updated patches:
>>>> https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e
>>>>
>>>> BUT, commit (555 commits) for v5.10-1
>>>> https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
>>>> disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):
>>>>
>>>> 1) colors are disrupted
>>>>
>>>> There are missing some initialization now.
>>>>
>>>> If I use "5.9" compatible code
>>>> (last bisect good point
>>>> https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29
>>>> )
>>>> then reboot (not power-off!) and use new code
>>>> ( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
>>>> and colors are OK.
>>>
>>> Could this or the next issue be related to this bug fix?
>>>
>>> https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f
>>>
>>> That fix isn't yet in our master tree.
>>
>> Confirmed. It recovers colors !
>>
>>>>
>>>> 2) decoding of complex streams fails
>>>>
>>>> ( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
>>>> - bbb-h264-all-i-32 - OK
>>>> - bbb-h264-32 - bad from frame 5
>>>> - bbb-h264-high-32 - bad from frame 6
>>>
>>> I think cedrus devs need to take a look at these issues.
>>
>> Maybe something wrong in my testing code,
>> problematic commit swapped some variables between structures :-(
>>
>> I try to investigate more, regards Martin
>
> Yes. I found new format in ref_pic_list.
> I updated test application. All H.264 tests are working now.
>
> https://github.com/mcerveny/v4l2-request-test
>
> Is it necessary to release new "Patch V3" (rebased) series from
> https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e or not ?

Yes, please! That would be much appreciated.

Regards,

Hans

>
> Regards, Martin
>
>>> Regards,
>>>
>>> Hans
>>>
>>>>
>>>> best regards,
>>>> Martin
>>>>
>>>>>> Changes since v1:
>>>>>> - patch 0005 rename
>>>>>> - added testing description
>>>>>>
>>>>>> Martin Cerveny (6):
>>>>>> media: cedrus: Register all codecs as capability
>>>>>> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
>>>>>> compatibles
>>>>>> ARM: dts: sun8i: v3s: Add node for system control
>>>>>> media: cedrus: Add support for V3s
>>>>>> dt-bindings: media: cedrus: Add V3s compatible
>>>>>> ARM: dts: sun8i: v3s: Add video engine node
>>>>>>
>>>>>> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
>>>>>> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
>>>>>> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
>>>>>> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
>>>>>> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
>>>>>> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>>>>>> 6 files changed, 71 insertions(+), 1 deletion(-)
>>>>>>
>>>>>
>>>
>>

2020-11-17 01:50:08

by Martin Cerveny

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

Hello.

On Mon, 16 Nov 2020, Martin Cerveny wrote:
> On Mon, 16 Nov 2020, Hans Verkuil wrote:
>> On 15/11/2020 19:59, Martin Cerveny wrote:
>>> On Thu, 5 Nov 2020, Hans Verkuil wrote:
>>>> On 12/09/2020 16:30, Martin Cerveny wrote:
>>>>> First patch extends cedrus capability to all decoders
>>>>> because V3s missing MPEG2 decoder.
>>>>>
>>>>> Next two patches add system control node (SRAM C1) and
>>>>> next three patches add support for Cedrus VPU.
>>>>>
>>>>> Tested on "Lichee Zero" V3s platform with testing LCD patch
>>>>> ( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
>>>>> and V4L2 raw API testing utility
>>>>> ( https://github.com/mcerveny/v4l2-request-test ):
>>>>> - enabled LCD (DRM dual VI and sigle UI planes)
>>>>> - added RGB panel
>>>>> - enabled PWM
>>>>>
>>>>> There is low memory on V3s (64MB) and maximum must be available to CMA:
>>>>> - CONFIG_CMA_SIZE_MBYTES=28
>>>>> - add swap to swapout other processes
>>>>> - decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)
>>>>>
>>>>> Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
>>>>> JPEG/MJPEG still unimplemented, encoder unimplemented
>>>>
>>>> When I tried to merged these patches I got merge conflicts.
>>>>
>>>> Possibly due to other 5.10 changes, but certainly because of conflicts
>>>> with patches from Jernej:
>>>>
>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>>
>>>> I've merged Jerne's patches and posted a PR for that:
>>>> https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
>>>>
>>>> Can you rebase your patches on top of my branch that contains Jernej's
>>>> patches?
>>>>
>>>> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e
>>>>
>>>> Once my PR is merged into the media_tree master I can take your rebased
>>>> patches.
>>>
>>> I updated patches:
>>> https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e
>>>
>>> BUT, commit (555 commits) for v5.10-1
>>> https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
>>> disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):
>>>
>>> 1) colors are disrupted
>>>
>>> There are missing some initialization now.
>>>
>>> If I use "5.9" compatible code
>>> (last bisect good point
>>> https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29
>>> )
>>> then reboot (not power-off!) and use new code
>>> ( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
>>> and colors are OK.
>>
>> Could this or the next issue be related to this bug fix?
>>
>> https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f
>>
>> That fix isn't yet in our master tree.
>
> Confirmed. It recovers colors !
>
>>>
>>> 2) decoding of complex streams fails
>>>
>>> ( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
>>> - bbb-h264-all-i-32 - OK
>>> - bbb-h264-32 - bad from frame 5
>>> - bbb-h264-high-32 - bad from frame 6
>>
>> I think cedrus devs need to take a look at these issues.
>
> Maybe something wrong in my testing code,
> problematic commit swapped some variables between structures :-(
>
> I try to investigate more, regards Martin

Yes. I found new format in ref_pic_list.
I updated test application. All H.264 tests are working now.

https://github.com/mcerveny/v4l2-request-test

Is it necessary to release new "Patch V3" (rebased) series from
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e or not ?

Regards, Martin

>> Regards,
>>
>> Hans
>>
>>>
>>> best regards,
>>> Martin
>>>
>>>>> Changes since v1:
>>>>> - patch 0005 rename
>>>>> - added testing description
>>>>>
>>>>> Martin Cerveny (6):
>>>>> media: cedrus: Register all codecs as capability
>>>>> dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
>>>>> compatibles
>>>>> ARM: dts: sun8i: v3s: Add node for system control
>>>>> media: cedrus: Add support for V3s
>>>>> dt-bindings: media: cedrus: Add V3s compatible
>>>>> ARM: dts: sun8i: v3s: Add video engine node
>>>>>
>>>>> .../allwinner,sun4i-a10-video-engine.yaml | 1 +
>>>>> .../allwinner,sun4i-a10-system-control.yaml | 6 ++++
>>>>> arch/arm/boot/dts/sun8i-v3s.dtsi | 33 +++++++++++++++++++
>>>>> drivers/staging/media/sunxi/cedrus/cedrus.c | 28 +++++++++++++++-
>>>>> drivers/staging/media/sunxi/cedrus/cedrus.h | 2 ++
>>>>> .../staging/media/sunxi/cedrus/cedrus_video.c | 2 ++
>>>>> 6 files changed, 71 insertions(+), 1 deletion(-)
>>>>>
>>>>
>>
>