2020-11-17 08:47:39

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v3 0/4] media: meson: Add support for the Amlogic GE2D Accelerator Unit

The GE2D is a 2D accelerator with various features like configurable blitter
with alpha blending, frame rotation, scaling, format conversion and colorspace
conversion.

The driver implements a Memory2Memory VB2 V4L2 streaming device permitting:
- 0, 90, 180, 270deg rotation
- horizontal/vertical flipping
- source cropping
- destination compositing
- 32bit/24bit/16bit format conversion

This adds the support for the GE2D version found in the AXG SoCs Family.

The missing features are:
- Source scaling
- Colorspace conversion
- Advanced alpha blending & blitting options

Dependencies:
- Patches 1-3: None
- Patch 4: https://lkml.kernel.org/r/[email protected] (applied for 5.11)

Changes since v2:
- removed error check in and after get_frame()
- moved the v4l2_file_operations lower in the code to avoid adding vidioc_setup_cap_fmt on top
- removed all memcpy of pix_fmt
- simplified & fixed ge2d_start_streaming
- added local buffer type check in vidioc_g_selection instead of using get_frame error
- removed impossible <0 rectangle check, fixed error string
- added comment on condition after V4L2_CID_ROTATE

Changes since v1:
- Rebased on v5.10-rc1

/ # v4l2-compliance -s
v4l2-compliance SHA: ea16a7ef13a902793a5c2626b0cefc4d956147f3, 64 bits, 64-bit time_t

Compliance test for meson-ge2d device /dev/video0:

Driver Info:
Driver name : meson-ge2d
Card type : meson-ge2d
Bus info : platform:meson-ge2d
Driver version : 5.9.0
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

test invalid ioctls: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 4 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK
test Composing: OK
test Scaling: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Test input 0:

Streaming ioctls:
test read/write: OK (Not Supported)
test blocking wait: OK
Video Capture: Captured 58 buffers
test MMAP (no poll): OK
Video Capture: Captured 58 buffers
test MMAP (select): OK
Video Capture: Captured 58 buffers
test MMAP (epoll): OK
test USERPTR (no poll): OK (Not Supported)
test USERPTR (select): OK (Not Supported)
test DMABUF: Cannot test, specify --expbuf-device

Total for meson-ge2d device /dev/video0: 52, Succeeded: 52, Failed: 0, Warnings: 0

Neil Armstrong (4):
dt-bindings: media: Add bindings for the Amlogic GE2D Accelerator Unit
media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit
MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver
arm64: dts: meson-axg: add GE2D node

.../bindings/media/amlogic,axg-ge2d.yaml | 47 +
MAINTAINERS | 9 +
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 9 +
drivers/media/platform/Kconfig | 13 +
drivers/media/platform/Makefile | 2 +
drivers/media/platform/meson/ge2d/Makefile | 3 +
drivers/media/platform/meson/ge2d/ge2d-regs.h | 360 ++++++
drivers/media/platform/meson/ge2d/ge2d.c | 1091 +++++++++++++++++
8 files changed, 1534 insertions(+)
create mode 100644 Documentation/devicetree/bindings/media/amlogic,axg-ge2d.yaml
create mode 100644 drivers/media/platform/meson/ge2d/Makefile
create mode 100644 drivers/media/platform/meson/ge2d/ge2d-regs.h
create mode 100644 drivers/media/platform/meson/ge2d/ge2d.c

--
2.25.1


2020-11-17 08:48:14

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v3 3/4] MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver

Signed-off-by: Neil Armstrong <[email protected]>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index e73636b75f29..db93156dcaba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11412,6 +11412,15 @@ F: Documentation/devicetree/bindings/media/amlogic,meson-gx-ao-cec.yaml
F: drivers/media/cec/platform/meson/ao-cec-g12a.c
F: drivers/media/cec/platform/meson/ao-cec.c

+MESON GE2D DRIVER FOR AMLOGIC SOCS
+M: Neil Armstrong <[email protected]>
+L: [email protected]
+L: [email protected]
+S: Supported
+T: git git://linuxtv.org/media_tree.git
+F: Documentation/devicetree/bindings/media/amlogic,axg-ge2d.yaml
+F: drivers/media/meson/ge2d/
+
MESON NAND CONTROLLER DRIVER FOR AMLOGIC SOCS
M: Liang Yang <[email protected]>
L: [email protected]
--
2.25.1

2020-11-17 08:48:44

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v3 4/4] arm64: dts: meson-axg: add GE2D node

This adds the node for the GE2D accelerator unit.

Signed-off-by: Neil Armstrong <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
index b9efc8469265..376f5c3f6188 100644
--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
@@ -1563,6 +1563,15 @@ saradc: adc@9000 {
};
};

+ ge2d: ge2d@ff940000 {
+ compatible = "amlogic,axg-ge2d";
+ reg = <0x0 0xff940000 0x0 0x10000>;
+ interrupts = <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_VAPB>;
+ resets = <&reset RESET_GE2D>;
+ reset-names = "core";
+ };
+
gic: interrupt-controller@ffc01000 {
compatible = "arm,gic-400";
reg = <0x0 0xffc01000 0 0x1000>,
--
2.25.1

2020-12-02 12:31:31

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] media: meson: Add support for the Amlogic GE2D Accelerator Unit

On 17/11/2020 09:44, Neil Armstrong wrote:
> The GE2D is a 2D accelerator with various features like configurable blitter
> with alpha blending, frame rotation, scaling, format conversion and colorspace
> conversion.
>
> The driver implements a Memory2Memory VB2 V4L2 streaming device permitting:
> - 0, 90, 180, 270deg rotation
> - horizontal/vertical flipping
> - source cropping
> - destination compositing
> - 32bit/24bit/16bit format conversion
>
> This adds the support for the GE2D version found in the AXG SoCs Family.
>
> The missing features are:
> - Source scaling
> - Colorspace conversion
> - Advanced alpha blending & blitting options
>
> Dependencies:
> - Patches 1-3: None
> - Patch 4: https://lkml.kernel.org/r/[email protected] (applied for 5.11)
>
> Changes since v2:
> - removed error check in and after get_frame()
> - moved the v4l2_file_operations lower in the code to avoid adding vidioc_setup_cap_fmt on top
> - removed all memcpy of pix_fmt
> - simplified & fixed ge2d_start_streaming
> - added local buffer type check in vidioc_g_selection instead of using get_frame error
> - removed impossible <0 rectangle check, fixed error string
> - added comment on condition after V4L2_CID_ROTATE
>
> Changes since v1:
> - Rebased on v5.10-rc1
>
> / # v4l2-compliance -s
> v4l2-compliance SHA: ea16a7ef13a902793a5c2626b0cefc4d956147f3, 64 bits, 64-bit time_t

That's too old: additional checks for CSC handling have been added since
that time. It probably won't affect this driver, but still I prefer it if you
can update to the latest version and verify that it still passes all the tests.

Regards,

Hans

>
> Compliance test for meson-ge2d device /dev/video0:
>
> Driver Info:
> Driver name : meson-ge2d
> Card type : meson-ge2d
> Bus info : platform:meson-ge2d
> Driver version : 5.9.0
> Capabilities : 0x84208000
> Video Memory-to-Memory
> Streaming
> Extended Pix Format
> Device Capabilities
> Device Caps : 0x04208000
> Video Memory-to-Memory
> Streaming
> Extended Pix Format
>
> Required ioctls:
> test VIDIOC_QUERYCAP: OK
>
> Allow for multiple opens:
> test second /dev/video0 open: OK
> test VIDIOC_QUERYCAP: OK
> test VIDIOC_G/S_PRIORITY: OK
> test for unlimited opens: OK
>
> test invalid ioctls: OK
> Debug ioctls:
> test VIDIOC_DBG_G/S_REGISTER: OK
> test VIDIOC_LOG_STATUS: OK (Not Supported)
>
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 0 Audio Inputs: 0 Tuners: 0
>
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
>
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> test VIDIOC_G/S_EDID: OK (Not Supported)
>
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> test VIDIOC_QUERYCTRL: OK
> test VIDIOC_G/S_CTRL: OK
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 4 Private Controls: 0
>
> Format ioctls:
> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> test VIDIOC_G/S_PARM: OK (Not Supported)
> test VIDIOC_G_FBUF: OK (Not Supported)
> test VIDIOC_G_FMT: OK
> test VIDIOC_TRY_FMT: OK
> test VIDIOC_S_FMT: OK
> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> test Cropping: OK
> test Composing: OK
> test Scaling: OK (Not Supported)
>
> Codec ioctls:
> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>
> Buffer ioctls:
> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> test VIDIOC_EXPBUF: OK
> test Requests: OK (Not Supported)
>
> Test input 0:
>
> Streaming ioctls:
> test read/write: OK (Not Supported)
> test blocking wait: OK
> Video Capture: Captured 58 buffers
> test MMAP (no poll): OK
> Video Capture: Captured 58 buffers
> test MMAP (select): OK
> Video Capture: Captured 58 buffers
> test MMAP (epoll): OK
> test USERPTR (no poll): OK (Not Supported)
> test USERPTR (select): OK (Not Supported)
> test DMABUF: Cannot test, specify --expbuf-device
>
> Total for meson-ge2d device /dev/video0: 52, Succeeded: 52, Failed: 0, Warnings: 0
>
> Neil Armstrong (4):
> dt-bindings: media: Add bindings for the Amlogic GE2D Accelerator Unit
> media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit
> MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver
> arm64: dts: meson-axg: add GE2D node
>
> .../bindings/media/amlogic,axg-ge2d.yaml | 47 +
> MAINTAINERS | 9 +
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 9 +
> drivers/media/platform/Kconfig | 13 +
> drivers/media/platform/Makefile | 2 +
> drivers/media/platform/meson/ge2d/Makefile | 3 +
> drivers/media/platform/meson/ge2d/ge2d-regs.h | 360 ++++++
> drivers/media/platform/meson/ge2d/ge2d.c | 1091 +++++++++++++++++
> 8 files changed, 1534 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/media/amlogic,axg-ge2d.yaml
> create mode 100644 drivers/media/platform/meson/ge2d/Makefile
> create mode 100644 drivers/media/platform/meson/ge2d/ge2d-regs.h
> create mode 100644 drivers/media/platform/meson/ge2d/ge2d.c
>

2020-12-02 12:44:59

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] media: meson: Add support for the Amlogic GE2D Accelerator Unit

Hi,

On 02/12/2020 13:27, Hans Verkuil wrote:
> On 17/11/2020 09:44, Neil Armstrong wrote:
>> The GE2D is a 2D accelerator with various features like configurable blitter
>> with alpha blending, frame rotation, scaling, format conversion and colorspace
>> conversion.
>>
>> The driver implements a Memory2Memory VB2 V4L2 streaming device permitting:
>> - 0, 90, 180, 270deg rotation
>> - horizontal/vertical flipping
>> - source cropping
>> - destination compositing
>> - 32bit/24bit/16bit format conversion
>>
>> This adds the support for the GE2D version found in the AXG SoCs Family.
>>
>> The missing features are:
>> - Source scaling
>> - Colorspace conversion
>> - Advanced alpha blending & blitting options
>>
>> Dependencies:
>> - Patches 1-3: None
>> - Patch 4: https://lkml.kernel.org/r/[email protected] (applied for 5.11)
>>
>> Changes since v2:
>> - removed error check in and after get_frame()
>> - moved the v4l2_file_operations lower in the code to avoid adding vidioc_setup_cap_fmt on top
>> - removed all memcpy of pix_fmt
>> - simplified & fixed ge2d_start_streaming
>> - added local buffer type check in vidioc_g_selection instead of using get_frame error
>> - removed impossible <0 rectangle check, fixed error string
>> - added comment on condition after V4L2_CID_ROTATE
>>
>> Changes since v1:
>> - Rebased on v5.10-rc1
>>
>> / # v4l2-compliance -s
>> v4l2-compliance SHA: ea16a7ef13a902793a5c2626b0cefc4d956147f3, 64 bits, 64-bit time_t
>
> That's too old: additional checks for CSC handling have been added since
> that time. It probably won't affect this driver, but still I prefer it if you
> can update to the latest version and verify that it still passes all the tests.

Ok

Neil

>
> Regards,
>
> Hans
>
>>
>> Compliance test for meson-ge2d device /dev/video0:
>>
>> Driver Info:
>> Driver name : meson-ge2d
>> Card type : meson-ge2d
>> Bus info : platform:meson-ge2d
>> Driver version : 5.9.0
>> Capabilities : 0x84208000
>> Video Memory-to-Memory
>> Streaming
>> Extended Pix Format
>> Device Capabilities
>> Device Caps : 0x04208000
>> Video Memory-to-Memory
>> Streaming
>> Extended Pix Format
>>
>> Required ioctls:
>> test VIDIOC_QUERYCAP: OK
>>
>> Allow for multiple opens:
>> test second /dev/video0 open: OK
>> test VIDIOC_QUERYCAP: OK
>> test VIDIOC_G/S_PRIORITY: OK
>> test for unlimited opens: OK
>>
>> test invalid ioctls: OK
>> Debug ioctls:
>> test VIDIOC_DBG_G/S_REGISTER: OK
>> test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>> test VIDIOC_ENUMAUDIO: OK (Not Supported)
>> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>> test VIDIOC_G/S_AUDIO: OK (Not Supported)
>> Inputs: 0 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>> Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>> test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls:
>> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>> test VIDIOC_QUERYCTRL: OK
>> test VIDIOC_G/S_CTRL: OK
>> test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>> Standard Controls: 4 Private Controls: 0
>>
>> Format ioctls:
>> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>> test VIDIOC_G/S_PARM: OK (Not Supported)
>> test VIDIOC_G_FBUF: OK (Not Supported)
>> test VIDIOC_G_FMT: OK
>> test VIDIOC_TRY_FMT: OK
>> test VIDIOC_S_FMT: OK
>> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>> test Cropping: OK
>> test Composing: OK
>> test Scaling: OK (Not Supported)
>>
>> Codec ioctls:
>> test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>> test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>> test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>
>> Buffer ioctls:
>> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>> test VIDIOC_EXPBUF: OK
>> test Requests: OK (Not Supported)
>>
>> Test input 0:
>>
>> Streaming ioctls:
>> test read/write: OK (Not Supported)
>> test blocking wait: OK
>> Video Capture: Captured 58 buffers
>> test MMAP (no poll): OK
>> Video Capture: Captured 58 buffers
>> test MMAP (select): OK
>> Video Capture: Captured 58 buffers
>> test MMAP (epoll): OK
>> test USERPTR (no poll): OK (Not Supported)
>> test USERPTR (select): OK (Not Supported)
>> test DMABUF: Cannot test, specify --expbuf-device
>>
>> Total for meson-ge2d device /dev/video0: 52, Succeeded: 52, Failed: 0, Warnings: 0
>>
>> Neil Armstrong (4):
>> dt-bindings: media: Add bindings for the Amlogic GE2D Accelerator Unit
>> media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit
>> MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver
>> arm64: dts: meson-axg: add GE2D node
>>
>> .../bindings/media/amlogic,axg-ge2d.yaml | 47 +
>> MAINTAINERS | 9 +
>> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 9 +
>> drivers/media/platform/Kconfig | 13 +
>> drivers/media/platform/Makefile | 2 +
>> drivers/media/platform/meson/ge2d/Makefile | 3 +
>> drivers/media/platform/meson/ge2d/ge2d-regs.h | 360 ++++++
>> drivers/media/platform/meson/ge2d/ge2d.c | 1091 +++++++++++++++++
>> 8 files changed, 1534 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/media/amlogic,axg-ge2d.yaml
>> create mode 100644 drivers/media/platform/meson/ge2d/Makefile
>> create mode 100644 drivers/media/platform/meson/ge2d/ge2d-regs.h
>> create mode 100644 drivers/media/platform/meson/ge2d/ge2d.c
>>
>

2020-12-08 16:57:32

by Nicolas Dufresne

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] media: meson: Add support for the Amlogic GE2D Accelerator Unit

Le mardi 17 novembre 2020 à 09:44 +0100, Neil Armstrong a écrit :
> The GE2D is a 2D accelerator with various features like configurable blitter
> with alpha blending, frame rotation, scaling, format conversion and colorspace
> conversion.
>
> The driver implements a Memory2Memory VB2 V4L2 streaming device permitting:
> - 0, 90, 180, 270deg rotation
> - horizontal/vertical flipping
> - source cropping
> - destination compositing
> - 32bit/24bit/16bit format conversion
>
> This adds the support for the GE2D version found in the AXG SoCs Family.
>
> The missing features are:
> - Source scaling
> - Colorspace conversion
> - Advanced alpha blending & blitting options

Is there some Open Source software using this driver ? GStreamer got some
support, but it's mostly focused on CSC and Scaling (flipping should work, but
rotation is not implemented). But I'm not aware of anything else, hence asking.

>
> Dependencies:
> - Patches 1-3: None
> - Patch 4:
> https://lkml.kernel.org/r/[email protected] (appli
> ed for 5.11)
>
> Changes since v2:
> - removed error check in and after get_frame()
> - moved the v4l2_file_operations lower in the code to avoid adding
> vidioc_setup_cap_fmt on top
> - removed all memcpy of pix_fmt
> - simplified & fixed ge2d_start_streaming
> - added local buffer type check in vidioc_g_selection instead of using
> get_frame error
> - removed impossible <0 rectangle check, fixed error string
> - added comment on condition after V4L2_CID_ROTATE
>
> Changes since v1:
> - Rebased on v5.10-rc1
>
> / # v4l2-compliance -s
> v4l2-compliance SHA: ea16a7ef13a902793a5c2626b0cefc4d956147f3, 64 bits, 64-bit
> time_t
>
> Compliance test for meson-ge2d device /dev/video0:
>
> Driver Info:
>         Driver name      : meson-ge2d
>         Card type        : meson-ge2d
>         Bus info         : platform:meson-ge2d
>         Driver version   : 5.9.0
>         Capabilities     : 0x84208000
>                 Video Memory-to-Memory
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x04208000
>                 Video Memory-to-Memory
>                 Streaming
>                 Extended Pix Format
>
> Required ioctls:
>         test VIDIOC_QUERYCAP: OK
>
> Allow for multiple opens:
>         test second /dev/video0 open: OK
>         test VIDIOC_QUERYCAP: OK
>         test VIDIOC_G/S_PRIORITY: OK
>         test for unlimited opens: OK
>
>         test invalid ioctls: OK
> Debug ioctls:
>         test VIDIOC_DBG_G/S_REGISTER: OK
>         test VIDIOC_LOG_STATUS: OK (Not Supported)
>
> Input ioctls:
>         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>         test VIDIOC_ENUMAUDIO: OK (Not Supported)
>         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>         Inputs: 0 Audio Inputs: 0 Tuners: 0
>
> Output ioctls:
>         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>         Outputs: 0 Audio Outputs: 0 Modulators: 0
>
> Input/Output configuration ioctls:
>         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>         test VIDIOC_G/S_EDID: OK (Not Supported)
>
> Control ioctls:
>         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>         test VIDIOC_QUERYCTRL: OK
>         test VIDIOC_G/S_CTRL: OK
>         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>         Standard Controls: 4 Private Controls: 0
>
> Format ioctls:
>         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>         test VIDIOC_G/S_PARM: OK (Not Supported)
>         test VIDIOC_G_FBUF: OK (Not Supported)
>         test VIDIOC_G_FMT: OK
>         test VIDIOC_TRY_FMT: OK
>         test VIDIOC_S_FMT: OK
>         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>         test Cropping: OK
>         test Composing: OK
>         test Scaling: OK (Not Supported)
>
> Codec ioctls:
>         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>
> Buffer ioctls:
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test VIDIOC_EXPBUF: OK
>         test Requests: OK (Not Supported)
>
> Test input 0:
>
> Streaming ioctls:
>         test read/write: OK (Not Supported)
>         test blocking wait: OK
>         Video Capture: Captured 58 buffers               
>         test MMAP (no poll): OK
>         Video Capture: Captured 58 buffers               
>         test MMAP (select): OK
>         Video Capture: Captured 58 buffers               
>         test MMAP (epoll): OK
>         test USERPTR (no poll): OK (Not Supported)
>         test USERPTR (select): OK (Not Supported)
>         test DMABUF: Cannot test, specify --expbuf-device
>
> Total for meson-ge2d device /dev/video0: 52, Succeeded: 52, Failed: 0,
> Warnings: 0
>
> Neil Armstrong (4):
>   dt-bindings: media: Add bindings for the Amlogic GE2D Accelerator Unit
>   media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit
>   MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver
>   arm64: dts: meson-axg: add GE2D node
>
>  .../bindings/media/amlogic,axg-ge2d.yaml      |   47 +
>  MAINTAINERS                                   |    9 +
>  arch/arm64/boot/dts/amlogic/meson-axg.dtsi    |    9 +
>  drivers/media/platform/Kconfig                |   13 +
>  drivers/media/platform/Makefile               |    2 +
>  drivers/media/platform/meson/ge2d/Makefile    |    3 +
>  drivers/media/platform/meson/ge2d/ge2d-regs.h |  360 ++++++
>  drivers/media/platform/meson/ge2d/ge2d.c      | 1091 +++++++++++++++++
>  8 files changed, 1534 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/amlogic,axg-
> ge2d.yaml
>  create mode 100644 drivers/media/platform/meson/ge2d/Makefile
>  create mode 100644 drivers/media/platform/meson/ge2d/ge2d-regs.h
>  create mode 100644 drivers/media/platform/meson/ge2d/ge2d.c
>


2020-12-08 17:26:30

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] media: meson: Add support for the Amlogic GE2D Accelerator Unit

Hi,

On 08/12/2020 17:54, Nicolas Dufresne wrote:
> Le mardi 17 novembre 2020 à 09:44 +0100, Neil Armstrong a écrit :
>> The GE2D is a 2D accelerator with various features like configurable blitter
>> with alpha blending, frame rotation, scaling, format conversion and colorspace
>> conversion.
>>
>> The driver implements a Memory2Memory VB2 V4L2 streaming device permitting:
>> - 0, 90, 180, 270deg rotation
>> - horizontal/vertical flipping
>> - source cropping
>> - destination compositing
>> - 32bit/24bit/16bit format conversion
>>
>> This adds the support for the GE2D version found in the AXG SoCs Family.
>>
>> The missing features are:
>> - Source scaling
>> - Colorspace conversion
>> - Advanced alpha blending & blitting options
>
> Is there some Open Source software using this driver ? GStreamer got some
> support, but it's mostly focused on CSC and Scaling (flipping should work, but
> rotation is not implemented). But I'm not aware of anything else, hence asking.

Rotation orks with gstreamer by tweaking the rotation control manually and forcing the reversed height/width
after the v4l2convert.
Apart that, I made it works with the LVGL UI library to accelerate buffers switching and blitting
on the DRM buffers.

Neil

>
>>
>> Dependencies:
>> - Patches 1-3: None
>> - Patch 4:
>> https://lkml.kernel.org/r/[email protected] (appli
>> ed for 5.11)
>>
>> Changes since v2:
>> - removed error check in and after get_frame()
>> - moved the v4l2_file_operations lower in the code to avoid adding
>> vidioc_setup_cap_fmt on top
>> - removed all memcpy of pix_fmt
>> - simplified & fixed ge2d_start_streaming
>> - added local buffer type check in vidioc_g_selection instead of using
>> get_frame error
>> - removed impossible <0 rectangle check, fixed error string
>> - added comment on condition after V4L2_CID_ROTATE
>>
>> Changes since v1:
>> - Rebased on v5.10-rc1
>>
>> / # v4l2-compliance -s
>> v4l2-compliance SHA: ea16a7ef13a902793a5c2626b0cefc4d956147f3, 64 bits, 64-bit
>> time_t
>>
>> Compliance test for meson-ge2d device /dev/video0:
>>
>> Driver Info:
>>         Driver name      : meson-ge2d
>>         Card type        : meson-ge2d
>>         Bus info         : platform:meson-ge2d
>>         Driver version   : 5.9.0
>>         Capabilities     : 0x84208000
>>                 Video Memory-to-Memory
>>                 Streaming
>>                 Extended Pix Format
>>                 Device Capabilities
>>         Device Caps      : 0x04208000
>>                 Video Memory-to-Memory
>>                 Streaming
>>                 Extended Pix Format
>>
>> Required ioctls:
>>         test VIDIOC_QUERYCAP: OK
>>
>> Allow for multiple opens:
>>         test second /dev/video0 open: OK
>>         test VIDIOC_QUERYCAP: OK
>>         test VIDIOC_G/S_PRIORITY: OK
>>         test for unlimited opens: OK
>>
>>         test invalid ioctls: OK
>> Debug ioctls:
>>         test VIDIOC_DBG_G/S_REGISTER: OK
>>         test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>>         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>         test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>         test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>         Inputs: 0 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>>         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>         Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>>         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>         test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls:
>>         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>>         test VIDIOC_QUERYCTRL: OK
>>         test VIDIOC_G/S_CTRL: OK
>>         test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>>         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>>         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>         Standard Controls: 4 Private Controls: 0
>>
>> Format ioctls:
>>         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>         test VIDIOC_G/S_PARM: OK (Not Supported)
>>         test VIDIOC_G_FBUF: OK (Not Supported)
>>         test VIDIOC_G_FMT: OK
>>         test VIDIOC_TRY_FMT: OK
>>         test VIDIOC_S_FMT: OK
>>         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>         test Cropping: OK
>>         test Composing: OK
>>         test Scaling: OK (Not Supported)
>>
>> Codec ioctls:
>>         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>
>> Buffer ioctls:
>>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>         test VIDIOC_EXPBUF: OK
>>         test Requests: OK (Not Supported)
>>
>> Test input 0:
>>
>> Streaming ioctls:
>>         test read/write: OK (Not Supported)
>>         test blocking wait: OK
>>         Video Capture: Captured 58 buffers               
>>         test MMAP (no poll): OK
>>         Video Capture: Captured 58 buffers               
>>         test MMAP (select): OK
>>         Video Capture: Captured 58 buffers               
>>         test MMAP (epoll): OK
>>         test USERPTR (no poll): OK (Not Supported)
>>         test USERPTR (select): OK (Not Supported)
>>         test DMABUF: Cannot test, specify --expbuf-device
>>
>> Total for meson-ge2d device /dev/video0: 52, Succeeded: 52, Failed: 0,
>> Warnings: 0
>>
>> Neil Armstrong (4):
>>   dt-bindings: media: Add bindings for the Amlogic GE2D Accelerator Unit
>>   media: meson: Add M2M driver for the Amlogic GE2D Accelerator Unit
>>   MAINTAINERS: Add myself as maintainer of the Amlogic GE2D driver
>>   arm64: dts: meson-axg: add GE2D node
>>
>>  .../bindings/media/amlogic,axg-ge2d.yaml      |   47 +
>>  MAINTAINERS                                   |    9 +
>>  arch/arm64/boot/dts/amlogic/meson-axg.dtsi    |    9 +
>>  drivers/media/platform/Kconfig                |   13 +
>>  drivers/media/platform/Makefile               |    2 +
>>  drivers/media/platform/meson/ge2d/Makefile    |    3 +
>>  drivers/media/platform/meson/ge2d/ge2d-regs.h |  360 ++++++
>>  drivers/media/platform/meson/ge2d/ge2d.c      | 1091 +++++++++++++++++
>>  8 files changed, 1534 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/amlogic,axg-
>> ge2d.yaml
>>  create mode 100644 drivers/media/platform/meson/ge2d/Makefile
>>  create mode 100644 drivers/media/platform/meson/ge2d/ge2d-regs.h
>>  create mode 100644 drivers/media/platform/meson/ge2d/ge2d.c
>>
>
>