Support Nuvoton NPCM Video Capture/Encode Engine
Subsystems (4)
v4 cover Support Nuvoton NPCM Video Capture/Encode Engine
This patch series add DTS node, dt-bindings document and drivers for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.
VCD can capture/differentiate video data from digital or analog sources, then the ECE will compress the data into HEXTILE format.
HEXTILE compressed format is defined in Remote Framebuffer Protocol (RFC 6143) and is used by VNC features, so we also add a patch to support it.
Changes since v1:
- Add Hextile document and locate with vendor formats.
- Add video driver entry in MAINTAINERS
- Change config name to CONFIG_VIDEO_NPCM_VCD_ECE
- Reduce the waiting time after resetting the VCD/ECE module
- Correct data types of some variables
Marvin Lin (5):
arm: dts: Add node for NPCM Video Capture/Encode Engine
dt-bindings: media: Add dt-bindings for NPCM Video Capture/Encode
Engine
dt-bindings: arm/npcm: Add dt-bindings for Graphics Core Information
media: Add HEXTILE compressed format
drivers: media: platform: Add NPCM Video Capture/Encode Engine driver
.../bindings/arm/npcm/nuvoton,gfxi.yaml | 41 + .../bindings/media/nuvoton,npcm-video.yaml | 87 + .../media/v4l/pixfmt-reserved.rst | 7 + MAINTAINERS | 9 + arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 19 + drivers/media/platform/Kconfig | 1 + drivers/media/platform/Makefile | 1 + drivers/media/platform/nuvoton/Kconfig | 12 + drivers/media/platform/nuvoton/Makefile | 2 + drivers/media/platform/nuvoton/npcm-video.c | 2064 +++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 12 files changed, 2245 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml create mode 100644 drivers/media/platform/nuvoton/Kconfig create mode 100644 drivers/media/platform/nuvoton/Makefile create mode 100644 drivers/media/platform/nuvoton/npcm-video.c
Signature · 1 line
2.17.1
PATCH RESEND v4 1/5 arm: dts: Add node for NPCM Video Capture/Encode Engine
Add node for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. Tested with Nuvoton NPCM750 evaluation board.
--- arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi +19 -0
@@ -178,6 +178,19 @@ status = "disabled"; }; + video: video@f0810000 { + compatible = "nuvoton,npcm750-video"; + reg = <0xf0810000 0x10000>, <0xf0820000 0x2000>; + reg-names = "vcd", "ece"; + interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; + resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_VCD>, + <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>; + reset-names = "vcd", "ece"; + nuvoton,syscon-gcr = <&gcr>; + nuvoton,syscon-gfxi = <&gfxi>; + status = "disabled"; + }; + apb { #address-cells = <1>; #size-cells = <1>;
@@ -553,6 +566,12 @@ pinctrl-0 = <&smb15_pins>; status = "disabled"; }; + + gfxi: gfxi@e000 { + compatible = "nuvoton,npcm750-gfxi", "syscon", + "simple-mfd"; + reg = <0xe000 0x100>; + }; }; };
Signature · 1 line
2.17.1
PATCH RESEND v4 2/5 dt-bindings: media: Add dt-bindings for NPCM Video Capture/Encode Engine
In reply to Marvin LinAdd dt-bindings document for NPCM Video Capture/Encode Engine.
--- .../bindings/media/nuvoton,npcm-video.yaml | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml new file +87 -0
@@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/nuvoton,npcm-video.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton NPCM Video Capture/Encode Engine Device Tree Bindings + +maintainers: + - Joseph Liu <[email protected]> + - Marvin Lin <[email protected]> + +description: | + Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine + (ECE) present on Nuvoton NPCM SoCs. + +properties: + compatible: + enum: + - nuvoton,npcm750-video + - nuvoton,npcm845-video + + reg: + items: + - description: VCD registers + - description: ECE registers + + reg-names: + items: + - const: vcd + - const: ece + + interrupts: + maxItems: 1 + + resets: + items: + - description: VCD reset control + - description: ECE reset control + + reset-names: + items: + - const: vcd + - const: ece + + nuvoton,syscon-gcr: + $ref: /schemas/types.yaml#definitions/phandle + description: Phandle to the Global Control Register DT node + + nuvoton,syscon-gfxi: + $ref: /schemas/types.yaml#definitions/phandle + description: Phandle to the Graphics Core Information DT node + + memory-region: + description: + CMA pool to use for buffers allocation instead of the default CMA pool. + +required: + - compatible + - reg + - reg-names + - interrupts + - resets + - reset-names + - nuvoton,syscon-gcr + - nuvoton,syscon-gfxi + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/nuvoton,npcm7xx-reset.h> + + video: video@f0810000 { + compatible = "nuvoton,npcm750-video"; + reg = <0xf0810000 0x10000>, + <0xf0820000 0x2000>; + reg-names = "vcd", "ece"; + interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; + resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_VCD>, + <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>; + reset-names = "vcd", "ece"; + nuvoton,syscon-gcr = <&gcr>; + nuvoton,syscon-gfxi = <&gfxi>; + };
Signature · 1 line
2.17.1
PATCH RESEND v4 3/5 dt-bindings: arm/npcm: Add dt-bindings for Graphics Core Information
In reply to Marvin LinAdd dt-bindings document for Graphics Core Information (GFXI) node. It is necessary for the NPCM Video Capture/Encode Engine driver to retrieve Graphics core information.
--- .../bindings/arm/npcm/nuvoton,gfxi.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml new file +41 -0
@@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/npcm/nuvoton,gfxi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Graphics Core Information block in Nuvoton SoCs + +maintainers: + - Joseph Liu <[email protected]> + - Marvin Lin <[email protected]> + +description: + The Graphics Core Information (GFXI) are a block of registers in Nuvoton SoCs + that analyzes Graphics core behavior and provides inforomation in registers. + +properties: + compatible: + items: + - enum: + - nuvoton,npcm750-gfxi + - nuvoton,npcm845-gfxi + - const: syscon + - const: simple-mfd + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + gfxi: gfxi@e000 { + compatible = "nuvoton,npcm750-gfxi", "syscon", "simple-mfd"; + reg = <0xe000 0x100>; + };
Signature · 1 line
2.17.1
PATCH RESEND v4 4/5 media: Add HEXTILE compressed format
In reply to Marvin LinAdd HEXTILE compressed format. This format is defined in Remote Framebuffer Protocol (RFC 6143) and is used by Encoding Compression Engine present on Nuvoton NPCM SoCs.
--- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 7 +++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 9 insertions(+)
Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +7 -0
@@ -239,6 +239,13 @@ please make a proposal on the linux-media mailing list. It remains an opaque intermediate format and the MDP hardware must be used to convert ``V4L2_PIX_FMT_MT21C`` to ``V4L2_PIX_FMT_NV12M``, ``V4L2_PIX_FMT_YUV420M`` or ``V4L2_PIX_FMT_YVU420``. + * .. _V4L2-PIX-FMT-HEXTILE: + + - ``V4L2_PIX_FMT_HEXTILE`` + - 'HXTL' + - Compressed format used by Nuvoton NPCM video driver. This format is + defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile + Encoding). .. raw:: latex \normalsize
drivers/media/v4l2-core/v4l2-ioctl.c +1 -0
@@ -1441,6 +1441,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_SE401 : descr ="GSPCA SE401" ;break ;case V4L2_PIX_FMT_S5C_UYVY_JPG : descr ="S5C73MX interleaved UYVY/JPEG" ;break ;case V4L2_PIX_FMT_MT21C : descr ="Mediatek Compressed Format" ;break ; +case V4L2_PIX_FMT_HEXTILE : descr ="Hextile Compressed Format" ;break ;default :if (fmt->description[0 ])return ;
include/uapi/linux/videodev2.h +1 -0
@@ -746,6 +746,7 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I')/* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4')/* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4')/* BTTV 8-bit dithered RGB */ +#define V4L2_PIX_FMT_HEXTILE v4l2_fourcc('H', 'X', 'T', 'L')/* Hextile compression */ /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b')/* IPU3 packed 10-bit BGGR bayer */
Signature · 1 line
2.17.1
PATCH RESEND v4 5/5 drivers: media: platform: Add NPCM Video Capture/Encode Engine driver
In reply to Marvin LinAdd driver for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. The VCD can capture and differentiate video data from digital or analog sources, then the ECE will compress the data into HEXTILE format. This driver implements V4L2 interfaces to support OpenBMC KVM feature, also tested with VNC Viewer and openbmc/obmc-ikvm to verify the video output result.
--- MAINTAINERS | 9 + drivers/media/platform/Kconfig | 1 + drivers/media/platform/Makefile | 1 + drivers/media/platform/nuvoton/Kconfig | 12 + drivers/media/platform/nuvoton/Makefile | 2 + drivers/media/platform/nuvoton/npcm-video.c | 2064 +++++++++++++++++++ 6 files changed, 2089 insertions(+) create mode 100644 drivers/media/platform/nuvoton/Kconfig create mode 100644 drivers/media/platform/nuvoton/Makefile create mode 100644 drivers/media/platform/nuvoton/npcm-video.c
MAINTAINERS +9 -0
@@ -2435,6 +2435,15 @@ F: drivers/*/*npcm* F: drivers/*/*/*npcm* F: include/dt-bindings/clock/nuvoton,npcm7xx-clock.h +ARM/NUVOTON NPCM VIDEO ENGINE DRIVER +M: Joseph Liu <[email protected]> +M: Marvin Lin <[email protected]> +L: [email protected] +L: [email protected] (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml +F: drivers/media/platform/nuvoton/ + ARM/NUVOTON WPCM450 ARCHITECTURE M: Jonathan Neuschäfer <[email protected]> L: [email protected] (moderated for non-subscribers)
drivers/media/platform/Kconfig +1 -0
@@ -72,6 +72,7 @@ source "drivers/media/platform/chips-media/Kconfig" source "drivers/media/platform/intel/Kconfig" source "drivers/media/platform/marvell/Kconfig" source "drivers/media/platform/mediatek/Kconfig" +source "drivers/media/platform/nuvoton/Kconfig" source "drivers/media/platform/nvidia/Kconfig" source "drivers/media/platform/nxp/Kconfig" source "drivers/media/platform/qcom/Kconfig"
drivers/media/platform/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-y += chips-media/ obj-y += intel/ obj-y += marvell/ obj-y += mediatek/ +obj-y += nuvoton/ obj-y += nvidia/ obj-y += nxp/ obj-y += qcom/
drivers/media/platform/nuvoton/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-only + +comment "Nuvoton media platform drivers" + +config VIDEO_NUVOTON_NPCM_VCD_ECE + tristate "Nuvoton NPCM Video Capture/Encode Engine driver" + depends on V4L_PLATFORM_DRIVERS + depends on VIDEO_DEV + select VIDEOBUF2_DMA_CONTIG + help + Support for the Video Capture/Differentiation Engine (VCD) and + Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.
drivers/media/platform/nuvoton/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_VIDEO_NUVOTON_NPCM_VCD_ECE) += npcm-video.o
drivers/media/platform/nuvoton/npcm-video.c new file +2064 -0
2,064 lines not on this page · raw message
Signature · 1 line
2.17.1