一 开发环境
开发板:Firefly AIO-3399J
系统:Debian9
二 内核修改
//arch/arm64/boot/dts/rockchip/rk3399-linux.dtsi
+ rga: rga@ff680000 {
+ compatible = "rockchip,rga2";
+ dev_mode = <1>;
+ reg = <0x0 0xff680000 0x0 0x1000>;
+ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH 0>;
+ clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>,<&cru SCLK_RGA_CORE>;
+ clock-names = "aclk_rga", "hclk_rga","clk_rga";
+ power-domains = <&power RK3399_PD_RGA>;
+ dma-coherent;
+ status = "okay";
+ };
//arch/arm64/configs/firefly_linux_defconfig
+CONFIG_ROCKCHIP_RGA2=y
更新内核查看/dev/rga2节点是否存在
三 DEMO编译
1、下载代码到开发板的/opt/目录下,并重命名为librga_linux
2、复制代码中的demo到opt目录下
/opt/librga_linux
/opt/demo
3、librga_linux目录下make,生成librga.so,并复制到usr/lib目录下
cp /opt/librga_linux/lib/librga.so /usr/lib/
4、编译demo目录的模块,复制demo的data数据到/data/目录下,(没有data目录需要新建),执行demo的模块