Skip to contentSkip to conversation

Support Nuvoton NPCM Video Capture/Encode Engine

PATCH Superseded Marvin Lin 3 participants 17 messages Dec 27, 2022 – Feb 2, 2023

Subsystems (4)

v10 of 16 Superseded Latest is v16 →

lore
Share & tools
lore

Marvin Lin

author
#0 lore raw

v10 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 which is defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4. Hextile Encoding).

The output of v4l2-compliance:
v4l2-compliance 1.23.0-4965, 64 bits, 64-bit time_t v4l2-compliance SHA: d0964d133053 2022-11-06 14:46:45

Compliance test for npcm-video device /dev/video0:

Driver Info:

        Driver name      : npcm-video
        Card type        : NPCM Video Engine
        Bus info         : platform:npcm-video
        Driver version   : 5.15.50
        Capabilities     : 0x85200001

Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200001
Video Capture
Read/Write
Streaming
Extended Pix Format

Required ioctls:
test VIDIOC_QUERYCAP: OK
test invalid ioctls: 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

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) 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
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 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 test VIDIOC_DV_TIMINGS_CAP: OK
test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls (Input 0):
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
warn: /usr/src/debug/v4l-utils/1.22.1-r0/utils/v4l2-compliance/v4l2-test-controls.cpp(1070): V4L2_CID_DV_RX_POWER_PRESENT not found for input 0
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 1 Private Controls: 2

Format ioctls (Input 0):
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
warn: /usr/src/debug/v4l-utils/1.22.1-r0/utils/v4l2-compliance/v4l2-test-formats.cpp(1411): S_PARM is supported for buftype 1, but not for ENUM_FRAMEINTERVALS
test VIDIOC_G/S_PARM: OK
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 (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)

Codec ioctls (Input 0):
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 (Input 0):
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for npcm-video device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 2

Changes in v10:
- drivers/media/platform/nuvoton/npcm-video.c
* Let short functions to be inline function.
* Correct return type of some functions, and properly handle return value by callers.
* Correct the timing of removing rect_list and the flow of FIFO overrun case in irq.
* Adjust line breaks, indentations, and style of variable declarations.

Changes in v9:
- Change ECE node name to "video-codec".
- Drop redundant "bindings for" in commit subject of patch 2/7.
- Refine the format of VCD/ECE dt-binding document.

Changes in v8:
- Let VCD/ECE to be 2 separate nodes and update dt-binding documents.
- Move register definitions out to a local header file.
- Driver refinements (add error handling for memory allocation, remove unnecessary condition check and introduce "goto"s to handle similar error recovery paths).
- Correct properties and typo in GFXI dt-binding document.

Changes in v7:
- Add uapi documents for driver-specific controls.
- Implement driver-specific controls for switching capture mode and getting the count of compressed HEXTILE rectangles.
- Drop unnecessary "enum_framesizes" and "enum_frameintervals" functions.
- Include the output of v4l2-compliance in cover letter.

Changes in v6:
- Support NPCM845 and add compatible "nuvoton,npcm845-video".
- Correct pixel format to V4L2_PIX_FMT_HEXTILE which is newly added in this patch series.

Changes in v5:
- Simplify function prefix "nuvoton_" to "npcm_".
- Increase VCD_BUSY_TIMEOUT_US and ECE_POLL_TIMEOUT_US to 300ms to prevent polling timeout when ECC is enabled or system is busy.

Changes in v4:
- Fix compile warning reported by kernel test robot.

Changes in v3:
- 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.

Changes in v2:
- Add Hextile document and locate with vendor formats.

Marvin Lin (7):
ARM: dts: nuvoton: Add node for NPCM VCD and ECE engine
media: dt-binding: nuvoton: Add NPCM VCD and ECE engine
dt-bindings: arm: nuvoton: Add bindings for NPCM GFXI
media: v4l: Add HEXTILE compressed format
media: v4l2-ctrls: Reserve user control base for NPCM video controls
media: uapi: Add controls for NPCM video driver
media: nuvoton: Add driver for NPCM video capture and encode engine

 .../bindings/arm/npcm/nuvoton,gfxi.yaml       |   39 +
 .../bindings/media/nuvoton,npcm-ece.yaml      |   43 +
 .../bindings/media/nuvoton,npcm-vcd.yaml      |   72 +
 .../userspace-api/media/drivers/index.rst     |    1 +
 .../media/drivers/npcm-video.rst              |   67 +
 .../media/v4l/pixfmt-reserved.rst             |    7 +
 MAINTAINERS                                   |   12 +
 arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi |   23 +
 drivers/media/platform/Kconfig                |    1 +
 drivers/media/platform/Makefile               |    1 +
 drivers/media/platform/nuvoton/Kconfig        |   15 +
 drivers/media/platform/nuvoton/Makefile       |    2 +
 drivers/media/platform/nuvoton/npcm-regs.h    |  171 ++
 drivers/media/platform/nuvoton/npcm-video.c   | 1814 +++++++++++++++++
 drivers/media/v4l2-core/v4l2-ioctl.c          |    1 +
 include/uapi/linux/npcm-video.h               |   41 +
 include/uapi/linux/v4l2-controls.h            |    6 +
 include/uapi/linux/videodev2.h                |    1 +
 18 files changed, 2317 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
 create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-ece.yaml
 create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-vcd.yaml
 create mode 100644 Documentation/userspace-api/media/drivers/npcm-video.rst
 create mode 100644 drivers/media/platform/nuvoton/Kconfig
 create mode 100644 drivers/media/platform/nuvoton/Makefile
 create mode 100644 drivers/media/platform/nuvoton/npcm-regs.h
 create mode 100644 drivers/media/platform/nuvoton/npcm-video.c
 create mode 100644 include/uapi/linux/npcm-video.h
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v10 1/7 ARM: dts: nuvoton: Add node for NPCM VCD and ECE 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 | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi +23 -0
index c7b5ef15b716..13a76689e14a 100644
@@ -179,6 +179,24 @@ fiux: spi@fb001000 {
 			status = "disabled";
 		};
 
+		vcd: vcd@f0810000 {
+			compatible = "nuvoton,npcm750-vcd";
+			reg = <0xf0810000 0x10000>;
+			interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+			resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_VCD>;
+			nuvoton,sysgcr = <&gcr>;
+			nuvoton,sysgfxi = <&gfxi>;
+			nuvoton,ece = <&ece>;
+			status = "disabled";
+		};
+
+		ece: video-codec@f0820000 {
+			compatible = "nuvoton,npcm750-ece";
+			reg = <0xf0820000 0x2000>;
+			resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>;
+			status = "disabled";
+		};
+
 		apb {
 			#address-cells = <1>;
 			#size-cells = <1>;
@@ -554,6 +572,11 @@ i2c15: i2c@8f000 {
 				pinctrl-0 = <&smb15_pins>;
 				status = "disabled";
 			};
+
+			gfxi: gfxi@e000 {
+				compatible = "nuvoton,npcm750-gfxi", "syscon";
+				reg = <0xe000 0x100>;
+			};
 		};
 	};
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v10 2/7 media: dt-binding: nuvoton: Add NPCM VCD and ECE engine

In reply to Marvin Lin

Add dt-binding document for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.

---
 .../bindings/media/nuvoton,npcm-ece.yaml      | 43 +++++++++++
 .../bindings/media/nuvoton,npcm-vcd.yaml      | 72 +++++++++++++++++++
 2 files changed, 115 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-ece.yaml
 create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-vcd.yaml
Documentation/devicetree/bindings/media/nuvoton,npcm-ece.yaml new file +43 -0
new file mode 100644
index 000000000000..b47468e54504
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/nuvoton,npcm-ece.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Encoding Compression Engine
+
+maintainers:
+  - Joseph Liu <[email protected]>
+  - Marvin Lin <[email protected]>
+
+description: |
+  Video Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,npcm750-ece
+      - nuvoton,npcm845-ece
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/reset/nuvoton,npcm7xx-reset.h>
+
+    ece: video-codec@f0820000 {
+        compatible = "nuvoton,npcm750-ece";
+        reg = <0xf0820000 0x2000>;
+        resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>;
+    };
Documentation/devicetree/bindings/media/nuvoton,npcm-vcd.yaml new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#5 lore raw

PATCH v10 3/7 dt-bindings: arm: nuvoton: Add bindings for NPCM GFXI

In reply to Marvin Lin

Add dt-bindings document for Graphics Core Information (GFXI) node. It is used by NPCM video driver to retrieve Graphics core information.

---
 .../bindings/arm/npcm/nuvoton,gfxi.yaml       | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml new file +39 -0
new file mode 100644
index 000000000000..c033128e567a
@@ -0,0 +1,39 @@
+# 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 information in registers.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - nuvoton,npcm750-gfxi
+          - nuvoton,npcm845-gfxi
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    gfxi: gfxi@e000 {
+      compatible = "nuvoton,npcm750-gfxi", "syscon";
+      reg = <0xe000 0x100>;
+    };
Signature · 1 line
2.34.1
author
#8 lore raw

PATCH v10 4/7 media: v4l: Add HEXTILE compressed format

In reply to Marvin Lin

Add HEXTILE compressed format which is defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile Encoding) and is used by Encoding Compression Engine (ECE) 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
index 73cd99828010..e6ee0eebe691 100644
@@ -275,6 +275,13 @@ please make a proposal on the linux-media mailing list.
 
         Decoder's implementation can be found here,
         `aspeed_codec <https://github.com/AspeedTech-BMC/aspeed_codec/>`__
+    * .. _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
index 8e0a0ff62a70..a0e387335139 100644
@@ -1494,6 +1494,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
 		case V4L2_PIX_FMT_QC08C:	descr = "QCOM Compressed 8-bit Format"; break;
 		case V4L2_PIX_FMT_QC10C:	descr = "QCOM Compressed 10-bit Format"; break;
 		case V4L2_PIX_FMT_AJPG:		descr = "Aspeed JPEG"; break;
+		case V4L2_PIX_FMT_HEXTILE:	descr = "Hextile Compressed Format"; break;
 		default:
 			if (fmt->description[0])
 				return;
include/uapi/linux/videodev2.h +1 -0
index 1befd181a4cc..1ce21cc4fbf1 100644
@@ -778,6 +778,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_QC08C    v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */
 #define V4L2_PIX_FMT_QC10C    v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */
 #define V4L2_PIX_FMT_AJPG     v4l2_fourcc('A', 'J', 'P', 'G') /* Aspeed JPEG */
+#define V4L2_PIX_FMT_HEXTILE  v4l2_fourcc('H', 'X', 'T', 'L') /* Hextile compressed */
 
 /* 10bit raw 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.34.1
author
#9 lore raw

PATCH v10 5/7 media: v4l2-ctrls: Reserve user control base for NPCM video controls

In reply to Marvin Lin

Add a control base and reserve 16 controls for Nuvoton NPCM video controls.

---
 include/uapi/linux/v4l2-controls.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/uapi/linux/v4l2-controls.h +6 -0
index b73a8ba7df6c..aa5c9f64f1d6 100644
@@ -199,6 +199,12 @@ enum v4l2_colorfx {
  */
 #define V4L2_CID_USER_ASPEED_BASE		(V4L2_CID_USER_BASE + 0x11a0)
 
+/*
+ * The base for Nuvoton NPCM driver controls.
+ * We reserve 16 controls for this driver.
+ */
+#define V4L2_CID_USER_NPCM_BASE			(V4L2_CID_USER_BASE + 0x11b0)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
Signature · 1 line
2.34.1
author
#10 lore raw

PATCH v10 6/7 media: uapi: Add controls for NPCM video driver

In reply to Marvin Lin

Create controls for Nuvoton NPCM video driver to support setting capture mode of Video Capture/Differentiation (VCD) engine and getting the count of HEXTILE rectangles that is compressed by Encoding Compression Engine (ECE).

---
 .../userspace-api/media/drivers/index.rst     |  1 +
 .../media/drivers/npcm-video.rst              | 67 +++++++++++++++++++
 include/uapi/linux/npcm-video.h               | 41 ++++++++++++
 3 files changed, 109 insertions(+)
 create mode 100644 Documentation/userspace-api/media/drivers/npcm-video.rst
 create mode 100644 include/uapi/linux/npcm-video.h
Documentation/userspace-api/media/drivers/index.rst +1 -0
index 915dbf0f4db5..97d2ce8da6b3 100644
@@ -38,6 +38,7 @@ For more details see the file COPYING in the source distribution of Linux.
 	imx-uapi
 	max2175
 	meye-uapi
+	npcm-video
 	omap3isp-uapi
 	st-vgxy61
 	uvcvideo
Documentation/userspace-api/media/drivers/npcm-video.rst new file +67 -0

67 lines not on this page · raw message

include/uapi/linux/npcm-video.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#11 lore raw

PATCH v10 7/7 media: nuvoton: Add driver for NPCM video capture and encode engine

In reply to Marvin Lin

Add 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 and provides user controls to support KVM feature, also tested with VNC Viewer and openbmc/obmc-ikvm.

---
 MAINTAINERS                                 |   12 +
 drivers/media/platform/Kconfig              |    1 +
 drivers/media/platform/Makefile             |    1 +
 drivers/media/platform/nuvoton/Kconfig      |   15 +
 drivers/media/platform/nuvoton/Makefile     |    2 +
 drivers/media/platform/nuvoton/npcm-regs.h  |  171 ++
 drivers/media/platform/nuvoton/npcm-video.c | 1814 +++++++++++++++++++
 7 files changed, 2016 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-regs.h
 create mode 100644 drivers/media/platform/nuvoton/npcm-video.c
MAINTAINERS +12 -0
index f61eb221415b..1b56042d1dc3 100644
@@ -2603,6 +2603,18 @@ F:	drivers/rtc/rtc-nct3018y.c
 F:	include/dt-bindings/clock/nuvoton,npcm7xx-clock.h
 F:	include/dt-bindings/clock/nuvoton,npcm845-clk.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-ece.yaml
+F:	Documentation/devicetree/bindings/media/nuvoton,npcm-vcd.yaml
+F:	Documentation/userspace-api/media/drivers/npcm-video.rst
+F:	drivers/media/platform/nuvoton/
+F:	include/uapi/linux/npcm-video.h
+
 ARM/NUVOTON WPCM450 ARCHITECTURE
 M:	Jonathan Neuschäfer <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/media/platform/Kconfig +1 -0
index ee579916f874..91e54215de3a 100644
@@ -73,6 +73,7 @@ source "drivers/media/platform/intel/Kconfig"
 source "drivers/media/platform/marvell/Kconfig"
 source "drivers/media/platform/mediatek/Kconfig"
 source "drivers/media/platform/microchip/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
index 5453bb868e67..3296ec1ebe16 100644
@@ -16,6 +16,7 @@ obj-y += intel/
 obj-y += marvell/
 obj-y += mediatek/
 obj-y += microchip/
+obj-y += nuvoton/
 obj-y += nvidia/
 obj-y += nxp/
 obj-y += qcom/
drivers/media/platform/nuvoton/Kconfig new file +15 -0
new file mode 100644
index 000000000000..5047d1ba3de5
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+comment "Nuvoton media platform drivers"
+
+config VIDEO_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.
+	  The VCD can capture and differentiate video data from digital or
+	  analog sources, then the ECE will compress the data into HEXTILE
+	  format.
drivers/media/platform/nuvoton/Makefile new file +2 -0
new file mode 100644
index 000000000000..74a4e3fc8555
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_VIDEO_NPCM_VCD_ECE) += npcm-video.o
drivers/media/platform/nuvoton/npcm-regs.h new file +171 -0

171 lines not on this page · raw message

drivers/media/platform/nuvoton/npcm-video.c new file +1814 -0

1,814 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v10 2/7] media: dt-binding: nuvoton: Add NPCM VCD and ECE engine

In reply to Marvin Lin
Quoted 5 lines · Marvin Lin

Add dt-binding document for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs.

Subject - it is "dt-bindings", not "dt-bindings".

Use subject prefixes matching the subsystem (which you can get for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching).

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH v10 3/7] dt-bindings: arm: nuvoton: Add bindings for NPCM GFXI

In reply to Marvin Lin
Quoted 5 lines · Marvin Lin

Add dt-bindings document for Graphics Core Information (GFXI) node. It is used by NPCM video driver to retrieve Graphics core information.

The comment about subject from v8 applies here as well. Once you receive a comment apply it everywhere, fix all the issues, not only one.

Best regards,
Krzysztof

author
#4 lore raw

Re: [PATCH v10 2/7] media: dt-binding: nuvoton: Add NPCM VCD and ECE engine

In reply to Krzysztof Kozlowski
Quoted 5 lines

Subject - it is "dt-bindings", not "dt-bindings".

Use subject prefixes matching the subsystem (which you can get for example with git log --oneline -- DIRECTORY_OR_FILE on the directory your patch is touching).

I'll correct it in the next patch. Thanks for the remind.

Regards,
Marvin

author
#7 lore raw

Re: [PATCH v10 3/7] dt-bindings: arm: nuvoton: Add bindings for NPCM GFXI

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Thanks for the remind.

Quoted 2 lines

The comment about subject from v8 applies here as well. Once you receive a comment apply it everywhere, fix all the issues, not only one.

I'll drop redundant "bindings for" in commit subject. Sorry for my negligence.

Regards,
Marvin

#12 lore raw

Re: [PATCH v10 7/7] media: nuvoton: Add driver for NPCM video capture and encode engine

In reply to Marvin Lin

Dear Lin,

Thank you for the patches.

Am 27.12.22 um 10:51 schrieb Marvin Lin:

Quoted 3 lines

Add 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,

“differentiate video data” sounds uncommon to me. Am I just ignorant or is there a better term?

Quoted 3 lines

then the ECE will compress the data into HEXTILE format. This driver implements V4L2 interfaces and provides user controls to support KVM feature, also tested with VNC Viewer and openbmc/obmc-ikvm.

Wich VNC viewer and version? Maybe also paste the new dev_ log messages you get from one boot.

It’d be great if you noted the datasheet name and revision.

Quoted 106 lines
---
  MAINTAINERS                                 |   12 +
  drivers/media/platform/Kconfig              |    1 +
  drivers/media/platform/Makefile             |    1 +
  drivers/media/platform/nuvoton/Kconfig      |   15 +
  drivers/media/platform/nuvoton/Makefile     |    2 +
  drivers/media/platform/nuvoton/npcm-regs.h  |  171 ++
  drivers/media/platform/nuvoton/npcm-video.c | 1814 +++++++++++++++++++
  7 files changed, 2016 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-regs.h create mode 100644 drivers/media/platform/nuvoton/npcm-video.c

MAINTAINERS +12 -0
index f61eb221415b..1b56042d1dc3 100644
@@ -2603,6 +2603,18 @@ F:	drivers/rtc/rtc-nct3018y.c
  F:	include/dt-bindings/clock/nuvoton,npcm7xx-clock.h
  F:	include/dt-bindings/clock/nuvoton,npcm845-clk.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-ece.yaml
+F:	Documentation/devicetree/bindings/media/nuvoton,npcm-vcd.yaml
+F:	Documentation/userspace-api/media/drivers/npcm-video.rst
+F:	drivers/media/platform/nuvoton/
+F:	include/uapi/linux/npcm-video.h
+
  ARM/NUVOTON WPCM450 ARCHITECTURE
  M:	Jonathan Neuschäfer <[email protected]>
  L:	[email protected] (moderated for non-subscribers)
drivers/media/platform/Kconfig +1 -0
index ee579916f874..91e54215de3a 100644
@@ -73,6 +73,7 @@ source "drivers/media/platform/intel/Kconfig"
  source "drivers/media/platform/marvell/Kconfig"
  source "drivers/media/platform/mediatek/Kconfig"
  source "drivers/media/platform/microchip/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
index 5453bb868e67..3296ec1ebe16 100644
@@ -16,6 +16,7 @@ obj-y += intel/
  obj-y += marvell/
  obj-y += mediatek/
  obj-y += microchip/
+obj-y += nuvoton/
  obj-y += nvidia/
  obj-y += nxp/
  obj-y += qcom/
drivers/media/platform/nuvoton/Kconfig new file +15 -0
new file mode 100644
index 000000000000..5047d1ba3de5
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+comment "Nuvoton media platform drivers"
+
+config VIDEO_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.
+	  The VCD can capture and differentiate video data from digital or
+	  analog sources, then the ECE will compress the data into HEXTILE
+	  format.
drivers/media/platform/nuvoton/Makefile new file +2 -0
new file mode 100644
index 000000000000..74a4e3fc8555
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_VIDEO_NPCM_VCD_ECE) += npcm-video.o
drivers/media/platform/nuvoton/npcm-regs.h new file +9 -0
new file mode 100644
index 000000000000..f528f5726307
@@ -0,0 +1,171 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Register definition header for NPCM video driver
+ *
+ * Copyright (C) 2022 Nuvoton Technologies
+ */
+
+#ifndef _NPCM_REGS_H
+#define _NPCM_REGS_H

[…]

Quoted 112 lines
drivers/media/platform/nuvoton/npcm-regs.h new file +112 -0
+struct npcm_video_addr {
+	size_t size;
+	dma_addr_t dma;
+	void *virt;
+};
+
+struct npcm_video_buffer {
+	struct vb2_v4l2_buffer vb;
+	struct list_head link;
+};
+
+#define to_npcm_video_buffer(x) \
+	container_of((x), struct npcm_video_buffer, vb)
+
+enum {
+	VIDEO_STREAMING,
+	VIDEO_FRAME_INPRG,
+	VIDEO_STOPPED,
+};
+
+struct rect_list {
+	struct v4l2_clip clip;
+	struct list_head list;
+};
+
+struct rect_list_info {
+	struct rect_list *list;
+	struct rect_list *first;
+	struct list_head *head;
+	unsigned int index;
+	unsigned int tile_perline;
+	unsigned int tile_perrow;
+	unsigned int offset_perline;
+	unsigned int tile_size;
+	unsigned int tile_cnt;
+};
+
+struct npcm_ece {
+	struct regmap *regmap;
+	atomic_t clients;
+	struct reset_control *reset;
+};
+
+struct npcm_video {
+	struct regmap *gcr_regmap;
+	struct regmap *gfx_regmap;
+	struct regmap *vcd_regmap;
+
+	struct device *dev;
+	struct v4l2_ctrl_handler ctrl_handler;
+	struct v4l2_device v4l2_dev;
+	struct v4l2_pix_format pix_fmt;
+	struct v4l2_bt_timings active_timings;
+	struct v4l2_bt_timings detected_timings;
+	u32 v4l2_input_status;
+	struct vb2_queue queue;
+	struct video_device vdev;
+	struct mutex video_lock; /* v4l2 and videobuf2 lock */
+
+	struct list_head buffers;
+	spinlock_t lock; /* buffer list lock */
+	unsigned long flags;
+	unsigned int sequence;
+
+	size_t max_buffer_size;
+	struct npcm_video_addr src;
+	struct reset_control *reset;
+	struct npcm_ece ece;
+
+	unsigned int frame_rate;
+	unsigned int vb_index;
+	u32 bytesperline;
+	u8 bytesperpixel;
+	u32 rect_cnt;
+	u8 num_buffers;
+	struct list_head *list;
+	u32 *rect;
+	int ctrl_cmd;
+	int op_cmd;
+};
+
+#define to_npcm_video(x) container_of((x), struct npcm_video, v4l2_dev)
+
+static const struct v4l2_dv_timings_cap npcm_video_timings_cap = {
+	.type = V4L2_DV_BT_656_1120,
+	.bt = {
+		.min_width = MIN_WIDTH,
+		.max_width = MAX_WIDTH,
+		.min_height = MIN_HEIGHT,
+		.max_height = MAX_HEIGHT,
+		.min_pixelclock = 6574080, /* 640 x 480 x 24Hz */
+		.max_pixelclock = 138240000, /* 1920 x 1200 x 60Hz */
+		.standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
+			     V4L2_DV_BT_STD_CVT | V4L2_DV_BT_STD_GTF,
+		.capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
+				V4L2_DV_BT_CAP_REDUCED_BLANKING |
+				V4L2_DV_BT_CAP_CUSTOM,
+	},
+};
+
+static DECLARE_BITMAP(bitmap, BITMAP_SIZE);
+
+static void npcm_video_ece_prepend_rect_header(u8 *addr, u16 x, u16 y, u16 w, u16 h)
+{
+	__be16 x_pos = cpu_to_be16(x);
+	__be16 y_pos = cpu_to_be16(y);
+	__be16 width = cpu_to_be16(w);
+	__be16 height = cpu_to_be16(h);
+	__be32 encoding = cpu_to_be32(5); /* Hextile encoding */
+
+	memcpy(addr, &x_pos, 2);
+	memcpy(addr + 2, &y_pos, 2);

drivers/media/platform/nuvoton/npcm-regs.h

Quoted 10 lines
drivers/media/platform/nuvoton/npcm-regs.h new file +10 -0
+	memcpy(addr + 4, &width, 2);
+	memcpy(addr + 6, &height, 2);
+	memcpy(addr + 8, &encoding, 4);
+}
+
+static unsigned int npcm_video_ece_get_ed_size(struct npcm_video *video,
+					       u32 offset, u8 *addr)
+{
+	struct regmap *ece = video->ece.regmap;
+	u32 size, gap, val;

Using a fixed size type for variables not needing is, is actually not an optimization [1]. It’d be great, if you went over the whole change-set to use the non-fixed types, where possible. (You can also check the difference with scripts/bloat-o-meter.

Quoted 20 lines
drivers/media/platform/nuvoton/npcm-regs.h new file +20 -0
+	int ret;
+
+	ret = regmap_read_poll_timeout(ece, ECE_DDA_STS, val,
+				       (val & ECE_DDA_STS_CDREADY), 0,
+				       ECE_POLL_TIMEOUT_US);
+
+	if (ret) {
+		dev_warn(video->dev, "Wait for ECE_DDA_STS_CDREADY timeout\n");
+		return 0;
+	}
+
+	size = readl(addr + offset);
+	regmap_read(ece, ECE_HEX_CTRL, &val);
+	gap = FIELD_GET(ECE_HEX_CTRL_ENC_GAP, val);
+
+	dev_dbg(video->dev, "offset = %u, ed_size = %u, gap = %u\n", offset,
+		size, gap);
+
+	return size + gap;
+}

[…]

drivers/media/platform/nuvoton/npcm-regs.h

Quoted 4 lines
drivers/media/platform/nuvoton/npcm-regs.h new file +4 -0
+module_platform_driver(npcm_video_driver);
+
+MODULE_AUTHOR("Joseph Liu<[email protected]>");
+MODULE_AUTHOR("Marvin Lin<[email protected]>");

Please add a space before the <.

drivers/media/platform/nuvoton/npcm-regs.h

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-regs.h new file +2 -0
+MODULE_DESCRIPTION("Driver for Nuvoton NPCM Video Capture/Encode Engine");
+MODULE_LICENSE("GPL");

Not GPL v2?

Kind regards,

Paul

[1]: https://notabs.org/coding/smallIntsBigPenalty.htm

author
#13 lore raw

Re: [PATCH v10 7/7] media: nuvoton: Add driver for NPCM video capture and encode engine

Hi Paul,

Thanks for the review.

Quoted 6 lines
Quoted 3 lines

Add 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,

“differentiate video data” sounds uncommon to me. Am I just ignorant or is there a better term?

How about "The VCD can capture a frame from digital video input and compare two frames in memory, then the ECE will compress the frame data into HEXTITLE format", is it better?

Quoted 1 line

Wich VNC viewer and version?

I used RealVNC version 6.21.1109 to test.
Do I have to add this information in the commit message?

Quoted 2 lines

Maybe also paste the new dev_ log messages
you get from one boot.

Do you mean dev_info/dev_debug messages of the driver? If yes, I get these messages from one boot (only dev_info will be printed in default):

npcm-video f0810000.video: assigned reserved memory node framebuffer@0x33000000 npcm-video f0810000.video: NPCM video driver probed

Quoted 1 line

It’d be great if you noted the datasheet name and revision.

I can note the datasheet name and revision in the commit message but can't provide the file link because it is not public.
Is it ok with you?

Quoted 10 lines

drivers/media/platform/nuvoton/npcm-video.c line 178

Quoted 5 lines
drivers/media/platform/nuvoton/npcm-video.c new file +5 -0
+static unsigned int npcm_video_ece_get_ed_size(struct npcm_video *video,
+                                            u32 offset, u8 *addr)
+{
+     struct regmap *ece = video->ece.regmap;
+     u32 size, gap, val;

Using a fixed size type for variables not needing is, is actually not an optimization [1]. It’d be great, if you went over the whole change-set to use the non-fixed types, where possible. (You can also check the difference with scripts/bloat-o-meter.

So what I have to do is replace "u8/u16/u32" with "unsigned int" for generic local variables as much as possible.
Is my understanding correct?

Quoted 9 lines

drivers/media/platform/nuvoton/npcm-video.c line 1812

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_AUTHOR("Joseph Liu<[email protected]>");
+MODULE_AUTHOR("Marvin Lin<[email protected]>");

Please add a space before the <.

drivers/media/platform/nuvoton/npcm-video.c line 1814

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_DESCRIPTION("Driver for Nuvoton NPCM Video Capture/Encode Engine");
+MODULE_LICENSE("GPL");

Not GPL v2?

I'll correct them in the next patch.

Regards,
Marvin

#14 lore raw

Re: [PATCH v10 7/7] media: nuvoton: Add driver for NPCM video capture and encode engine

Dear Kun-Fa,

Am 29.12.22 um 09:55 schrieb Kun-Fa Lin:

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

Add 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,

“differentiate video data” sounds uncommon to me. Am I just ignorant or is there a better term?

How about "The VCD can capture a frame from digital video input and compare two frames in memory, then the ECE will compress the frame data into HEXTITLE format", is it better?

Yes, I prefer your suggestion.

Quoted 4 lines
Quoted 1 line

Wich VNC viewer and version?

I used RealVNC version 6.21.1109 to test.
Do I have to add this information in the commit message?

I do not think there are rules, but I prefer to have the test environment and procedure information in the commit message in case there are problems, and you want to reproduce things.

Quoted 8 lines
Quoted 1 line

Maybe also paste the new dev_ log messages you get from one boot.

Do you mean dev_info/dev_debug messages of the driver? If yes, I get these messages from one boot (only dev_info will be printed in default):

npcm-video f0810000.video: assigned reserved memory node framebuffer@0x33000000 npcm-video f0810000.video: NPCM video driver probed

Yes, that is what I meant. Maybe even the debug messages.

Quoted 5 lines
Quoted 1 line

It’d be great if you noted the datasheet name and revision.

I can note the datasheet name and revision in the commit message but can't provide the file link because it is not public.
Is it ok with you?

Yes, that would be ok with me.

Quoted 11 lines
Quoted 10 lines

drivers/media/platform/nuvoton/npcm-video.c line 178

Quoted 5 lines
drivers/media/platform/nuvoton/npcm-video.c new file +5 -0
+static unsigned int npcm_video_ece_get_ed_size(struct npcm_video *video,
+                                            u32 offset, u8 *addr)
+{
+     struct regmap *ece = video->ece.regmap;
+     u32 size, gap, val;

Using a fixed size type for variables not needing is, is actually not an optimization [1]. It’d be great, if you went over the whole change-set to use the non-fixed types, where possible. (You can also check the difference with scripts/bloat-o-meter.

Quoted 3 lines

So what I have to do is replace "u8/u16/u32" with "unsigned int" for generic local variables as much as possible.
Is my understanding correct?

Yes, I would say so.

Quoted 11 lines
Quoted 9 lines

drivers/media/platform/nuvoton/npcm-video.c line 1812

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_AUTHOR("Joseph Liu<[email protected]>");
+MODULE_AUTHOR("Marvin Lin<[email protected]>");

Please add a space before the <.

drivers/media/platform/nuvoton/npcm-video.c line 1814

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_DESCRIPTION("Driver for Nuvoton NPCM Video Capture/Encode Engine");
+MODULE_LICENSE("GPL");

Not GPL v2?

I'll correct them in the next patch.

Awesome.

Kind regards,

Paul

author
#15 lore raw

Re: [PATCH v10 7/7] media: nuvoton: Add driver for NPCM video capture and encode engine

Quoted 6 lines
Quoted 3 lines

How about "The VCD can capture a frame from digital video input and compare two frames in memory, then the ECE will compress the frame data into HEXTITLE format", is it better?

Yes, I prefer your suggestion.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Wich VNC viewer and version?

I used RealVNC version 6.21.1109 to test.
Do I have to add this information in the commit message?

I do not think there are rules, but I prefer to have the test environment and procedure information in the commit message in case there are problems, and you want to reproduce things.

OK, I'll do that.

Quoted 1 line

Yes, that is what I meant. Maybe even the debug messages.

I get these debug messages after VNC viewer connected:

npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD mode = 0x1000b, Hi Res mode npcm-video f0810000.video: Digital mode: 1600 x 1200 x 2, pixelclock 161666000, bytesperline 4096
npcm-video f0810000.video: ECE open: client 1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: offset = 0, ed_size = 1540907, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: offset = 0, ed_size = 1539638, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: offset = 0, ed_size = 1539638, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: offset = 0, ed_size = 1539638, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: offset = 0, ed_size = 1539638, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: offset = 0, ed_size = 1539638, gap = 12 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 npcm-video f0810000.video: VCD irq status 0x84b00ff1
npcm-video f0810000.video: Got resolution[1600x1200] -> [1600x1200], status 0 [...]

Quoted 17 lines
Quoted 3 lines

I can note the datasheet name and revision in the commit message but can't provide the file link because it is not public.
Is it ok with you?

Yes, that would be ok with me.

Quoted 3 lines

So what I have to do is replace "u8/u16/u32" with "unsigned int" for generic local variables as much as possible.
Is my understanding correct?

Yes, I would say so.

Quoted 5 lines
Quoted 5 lines

drivers/media/platform/nuvoton/npcm-video.c line 1812

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_AUTHOR("Joseph Liu<[email protected]>");
+MODULE_AUTHOR("Marvin Lin<[email protected]>");

Please add a space before the <.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

drivers/media/platform/nuvoton/npcm-video.c line 1814

Quoted 2 lines
drivers/media/platform/nuvoton/npcm-video.c new file +2 -0
+MODULE_DESCRIPTION("Driver for Nuvoton NPCM Video Capture/Encode Engine");
+MODULE_LICENSE("GPL");

Not GPL v2?

I'll correct them in the next patch.

Awesome.

Thank you for your feedback.

Regards,
Marvin

author
#16 lore raw

Re: [PATCH v10 7/7] media: nuvoton: Add driver for NPCM video capture and encode engine

Hi Paul,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

+MODULE_LICENSE("GPL");

Not GPL v2?

When using GPL v2, I got this warning from checkpatch.pl:

WARNING: Prefer "GPL" over "GPL v2" - see commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity") #2104: FILE: drivers/media/platform/nuvoton/npcm-video.c:1816:
+MODULE_LICENSE("GPL v2");

It looks better to keep GPL, do you have any suggestions?

Regards,
Marvin