Add Rockchip RGA V4l2 support
Subsystems (4)
Jacob Chen
maintainerv12 cover Add Rockchip RGA V4l2 support
change in V12:
- adding an entry to MAINTAINERS
- fix checkpatch
change in V11:
- fix compile warning
change in V10:
- move to rockchip/rga
- changes according to comments
- some style changes
change in V9:
- remove protduff things
- test with the latest v4l2-compliance
change in V8:
- remove protduff things
change in V6,V7:
- correct warning in checkpatch.pl
change in V5:
- v4l2-compliance: handle invalid pxielformat
- v4l2-compliance: add subscribe_event
- add colorspace support
change in V4:
- document the controls.
- change according to Hans's comments
change in V3:
- rename the controls.
- add pm_runtime support.
- enable node by default.
- correct spelling in documents.
change in V2:
- generalize the controls.
- map buffers (10-50 us) in every cmd-run rather than in buffer-import to avoid get_free_pages failed on actively used systems.
- remove status in dt-bindings examples.
Jacob Chen (5):
dt-bindings: Document the Rockchip RGA bindings rockchip/rga: v4l2 m2m support
MAINTAINERS: add entry for Rockchip RGA driver
ARM: dts: rockchip: add RGA device node for RK3288
arm64: dts: rockchip: add RGA device node for RK3399
.../devicetree/bindings/media/rockchip-rga.txt | 33 + MAINTAINERS | 7 + arch/arm/boot/dts/rk3288.dtsi | 11 + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 11 + drivers/media/platform/Kconfig | 15 + drivers/media/platform/Makefile | 2 + drivers/media/platform/rockchip/rga/Makefile | 3 + drivers/media/platform/rockchip/rga/rga-buf.c | 154 +++ drivers/media/platform/rockchip/rga/rga-hw.c | 421 ++++++++ drivers/media/platform/rockchip/rga/rga-hw.h | 437 +++++++++ drivers/media/platform/rockchip/rga/rga.c | 1012 ++++++++++++++++++++ drivers/media/platform/rockchip/rga/rga.h | 125 +++ 12 files changed, 2231 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/rockchip-rga.txt create mode 100644 drivers/media/platform/rockchip/rga/Makefile create mode 100644 drivers/media/platform/rockchip/rga/rga-buf.c create mode 100644 drivers/media/platform/rockchip/rga/rga-hw.c create mode 100644 drivers/media/platform/rockchip/rga/rga-hw.h create mode 100644 drivers/media/platform/rockchip/rga/rga.c create mode 100644 drivers/media/platform/rockchip/rga/rga.h
Signature · 1 line
2.14.1
Jacob Chen
maintainerPATCH v12 1/5 dt-bindings: Document the Rockchip RGA bindings
Add DT bindings documentation for Rockchip RGA
--- .../devicetree/bindings/media/rockchip-rga.txt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/rockchip-rga.txt
Documentation/devicetree/bindings/media/rockchip-rga.txt new file +33 -0
@@ -0,0 +1,33 @@ +device-tree bindings for rockchip 2D raster graphic acceleration controller (RGA) + +RGA is a standalone 2D raster graphic acceleration unit. It accelerates 2D +graphics operations, such as point/line drawing, image scaling, rotation, +BitBLT, alpha blending and image blur/sharpness. + +Required properties: +- compatible: value should be one of the following + "rockchip,rk3288-rga"; + "rockchip,rk3399-rga"; + +- interrupts: RGA interrupt specifier. + +- clocks: phandle to RGA sclk/hclk/aclk clocks + +- clock-names: should be "aclk", "hclk" and "sclk" + +- resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. +- reset-names: should be "core", "axi" and "ahb" + +Example: +SoC-specific DT entry: + rga: rga at ff680000 { + compatible = "rockchip,rk3399-rga"; + reg = <0xff680000 0x10000>; + interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA_CORE>; + clock-names = "aclk", "hclk", "sclk"; + + resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>; + reset-names = "core, "axi", "ahb"; + };
Signature · 1 line
2.14.1
Jacob Chen
maintainerPATCH v12 2/5 rockchip/rga: v4l2 m2m support
In reply to Jacob ChenRockchip RGA is a separate 2D raster graphic acceleration unit. It accelerates 2D graphics operations, such as point/line drawing, image scaling, rotation, BitBLT, alpha blending and image blur/sharpness
The driver supports various operations from the rendering pipeline.
- copy
- fast solid color fill
- rotation
- flip
- alpha blending
The code in rga-hw.c is used to configure regs according to operations The code in rga-buf.c is used to create private mmu table for RGA.
--- drivers/media/platform/Kconfig | 15 + drivers/media/platform/Makefile | 2 + drivers/media/platform/rockchip/rga/Makefile | 3 + drivers/media/platform/rockchip/rga/rga-buf.c | 154 ++++ drivers/media/platform/rockchip/rga/rga-hw.c | 421 ++++++++++ drivers/media/platform/rockchip/rga/rga-hw.h | 437 +++++++++++ drivers/media/platform/rockchip/rga/rga.c | 1012 +++++++++++++++++++++++++ drivers/media/platform/rockchip/rga/rga.h | 125 +++ 8 files changed, 2169 insertions(+) create mode 100644 drivers/media/platform/rockchip/rga/Makefile create mode 100644 drivers/media/platform/rockchip/rga/rga-buf.c create mode 100644 drivers/media/platform/rockchip/rga/rga-hw.c create mode 100644 drivers/media/platform/rockchip/rga/rga-hw.h create mode 100644 drivers/media/platform/rockchip/rga/rga.c create mode 100644 drivers/media/platform/rockchip/rga/rga.h
drivers/media/platform/Kconfig +15 -0
@@ -458,6 +458,21 @@ config VIDEO_RENESAS_VSP1 To compile this driver as a module, choose M here: the module will be called vsp1. +config VIDEO_ROCKCHIP_RGA + tristate "Rockchip Raster 2d Graphic Acceleration Unit" + depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA + depends on ARCH_ROCKCHIP || COMPILE_TEST + select VIDEOBUF2_DMA_SG + select V4L2_MEM2MEM_DEV + default n + ---help--- + This is a v4l2 driver for Rockchip SOC RGA 2d graphics accelerator. + Rockchip RGA is a separate 2D raster graphic acceleration unit. + It accelerates 2D graphics operations, such as point/line drawing, + image scaling, rotation, BitBLT, alpha blending and image blur/sharpness. + + To compile this driver as a module choose m here. + config VIDEO_TI_VPE tristate "TI VPE (Video Processing Engine) driver" depends on VIDEO_DEV && VIDEO_V4L2
drivers/media/platform/Makefile +2 -0
@@ -62,6 +62,8 @@ obj-$(CONFIG_VIDEO_RENESAS_FDP1) += rcar_fdp1.o obj-$(CONFIG_VIDEO_RENESAS_JPU) += rcar_jpu.o obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1/ +obj-$(CONFIG_VIDEO_ROCKCHIP_RGA) += rockchip/rga/ + obj-y += omap/ obj-$(CONFIG_VIDEO_AM437X_VPFE) += am437x/
drivers/media/platform/rockchip/rga/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +rockchip-rga-objs := rga.o rga-hw.o rga-buf.o + +obj-$(CONFIG_VIDEO_ROCKCHIP_RGA) += rockchip-rga.o
drivers/media/platform/rockchip/rga/rga-buf.c new file +154 -0
154 lines not on this page · raw message
drivers/media/platform/rockchip/rga/rga-hw.c new file +421 -0
421 lines not on this page · raw message
drivers/media/platform/rockchip/rga/rga-hw.h new file +437 -0
437 lines not on this page · raw message
drivers/media/platform/rockchip/rga/rga.c new file +1012 -0
1,012 lines not on this page · raw message
drivers/media/platform/rockchip/rga/rga.h new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.14.1
Jacob Chen
maintainerPATCH v12 3/5 MAINTAINERS: add entry for Rockchip RGA driver
In reply to Jacob Chen--- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -11509,6 +11509,13 @@ F: drivers/hid/hid-roccat* F: include/linux/hid-roccat* F: Documentation/ABI/*/sysfs-driver-hid-roccat* +ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER +M: Jacob chen <[email protected]> +L: linux-media at vger.kernel.org +S: Maintained +F: drivers/media/platform/rockchip/rga/ +F: Documentation/devicetree/bindings/media/rockchip-rga.txt + ROCKER DRIVER M: Jiri Pirko <[email protected]> L: netdev at vger.kernel.org
Signature · 1 line
2.14.1
Jacob Chen
maintainerPATCH v12 4/5 ARM: dts: rockchip: add RGA device node for RK3288
In reply to Jacob ChenThis patch add the RGA dt config of rk3288 SoC.
--- arch/arm/boot/dts/rk3288.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/boot/dts/rk3288.dtsi +11 -0
@@ -972,6 +972,17 @@ status = "disabled"; }; + rga: rga at ff920000 { + compatible = "rockchip,rk3288-rga"; + reg = <0x0 0xff920000 0x0 0x180>; + interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA>; + clock-names = "aclk", "hclk", "sclk"; + power-domains = <&power RK3288_PD_VIO>; + resets = <&cru SRST_RGA_CORE>, <&cru SRST_RGA_AXI>, <&cru SRST_RGA_AHB>; + reset-names = "core", "axi", "ahb"; + }; + vopb: vop at ff930000 { compatible = "rockchip,rk3288-vop"; reg = <0x0 0xff930000 0x0 0x19c>;
Signature · 1 line
2.14.1
Jacob Chen
maintainerPATCH v12 5/5 arm64: dts: rockchip: add RGA device node for RK3399
In reply to Jacob ChenThis patch add the RGA dt config of RK3399 SoC.
--- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +11 -0
@@ -1204,6 +1204,17 @@ status = "disabled"; }; + rga: rga at ff680000 { + compatible = "rockchip,rk3399-rga"; + reg = <0x0 0xff680000 0x0 0x10000>; + interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA_CORE>; + clock-names = "aclk", "hclk", "sclk"; + resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>; + reset-names = "core", "axi", "ahb"; + power-domains = <&power RK3399_PD_RGA>; + }; + efuse0: efuse at ff690000 { compatible = "rockchip,rk3399-efuse"; reg = <0x0 0xff690000 0x0 0x80>;
Signature · 1 line
2.14.1
Heiko Stuebner
maintainerRe: [PATCH v12 4/5] ARM: dts: rockchip: add RGA device node for RK3288
In reply to Jacob ChenAm Mittwoch, 11. Oktober 2017, 15:29:37 CEST schrieb Jacob Chen:
Quoted 4 lines
This patch add the RGA dt config of rk3288 SoC.
Signed-off-by Jacob Chen <[email protected]>Signed-off-by Yakir Yang <[email protected]>
applied for 4.15
Thanks
Heiko
Heiko Stuebner
maintainerRe: [PATCH v12 5/5] arm64: dts: rockchip: add RGA device node for RK3399
In reply to Jacob ChenAm Mittwoch, 11. Oktober 2017, 15:29:38 CEST schrieb Jacob Chen:
Quoted 4 lines
This patch add the RGA dt config of RK3399 SoC.
Signed-off-by Jacob Chen <[email protected]>Signed-off-by Yakir Yang <[email protected]>
applied for 4.15
Thanks
Heiko