当前位置: 首页 > news >正文

瑞芯微RK35xx升级RGA驱动版本和API版本

瑞芯微RK35xx升级RGA驱动版本和API版本

  • 1、开发环境
  • 2、RGA升级步骤
    • 2.1 RGA内核驱动
    • 2.2 RGA API库升级
  • 3、异常情况解决

1、开发环境

Ubuntu版本:20.04
内核版本:5.10
Ubuntu板卡端版本:20.04
RGA驱动版本:RGA multicore Device Driver: v1.2.23
RGA API版本:v1.10.1

2、RGA升级步骤

2.1 RGA内核驱动

如果想更换RGA的驱动,可以在github下载RGA的最新驱动,地址如下
https://github.com/airockchip/librga
1、将下载到的驱动替换SDK中kernel/drivers/video/rockchip/rga3
2、如果一开始没有打开RGA3的配置,可以参考如下配置,否则可以忽略

CONFIG_VIDEO_ROCKCHIP_RGA=y
# CONFIG_ROCKCHIP_RGA is not set
CONFIG_ROCKCHIP_MULTI_RGA=y
CONFIG_ROCKCHIP_RGA_ASYNC=y
# CONFIG_ROCKCHIP_RGA_PROC_FS is not set
CONFIG_ROCKCHIP_RGA_DEBUG_FS=y
CONFIG_ROCKCHIP_RGA_DEBUGGER=y

3、重新编译即可,如果报错,请自行查找原因
4、查看RGA驱动版本

root@admin:~# cat /sys/kernel/debug/rkrga/driver_version 
RGA multicore Device Driver: v1.2.23

2.2 RGA API库升级

1、首先去github上下载librga最新版本包
下载地址如下
https://github.com/airockchip/librga
在这里插入图片描述
2、查看源码根目录下的README.md是否兼容内核驱动版本。
在这里插入图片描述
3、编译librga.so库

修改toolchains/toolchain_linux.cmake中的TOOLCHAIN_NAME和TOOLCHAIN_HOME
SET(TOOLCHAIN_NAME "aarch64-linux-gnu")
SET(TOOLCHAIN_HOME "/home/admin/3588/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu")# this is required
#SET(CMAKE_SYSTEM_NAME Linux)# specify the cross compiler
SET(CMAKE_C_COMPILER ${TOOLCHAIN_HOME}/bin/${TOOLCHAIN_NAME}-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_HOME}/bin/${TOOLCHAIN_NAME}-g++)# where is the target environment
SET(CMAKE_FIND_ROOT_PATH  ${TOOLCHAIN_HOME})# search for programs in the build host directories (not necessary)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

执行指令./cmake-linux.sh,编译完成后,会在librga/build/build_linux/install/出现编译后的库和测试程序。
在这里插入图片描述
把lib中的库文件移到文件系统中的/usr/lib/aarch64-linux-gnu/目录下。
把bin文件夹中的rgaImDemo拷贝到文件系统/bin目录下

4、查看RGA的API版本,如下

root@admin:~# rgaImDemo --querystring
Start selecting mode 0
im2d querystring ..
RGA demo mode = 0x0RGA vendor            : Rockchip Electronics Co.,Ltd.
RGA_api version       : v1.10.1_[0]
RGA version           : RGA_2_Enhance RGA_3 
Max input             : 8192x8192
Max output            : 8128x8128
Byte stride           : 16 byte
Scale limit           : 0.0625 ~ 16
Input support format  : RGBA/ARGB_8888 RGB_888 RGB_565 ARGB_4444 ARGB_5551 YUV420_sp_8bit YUV420_sp_10bit YUV420_p_8bit YUV420_p_10bit YUV422_sp_8bit YUV422_sp_10bit YUV422_p_8bit YUV422_p_10bit YUYV422 YUV400 
output support format : RGBA/ARGB_8888 RGB_888 RGB_565 ARGB_4444 ARGB_5551 RGBA_4444 RGBA_5551 YUV420_sp_8bit YUV420_sp_10bit YUV420_p_8bit YUV422_sp_8bit YUV422_sp_10bit YUV422_p_8bit YUYV420 YUYV422 YUV400 Y4 
RGA feature           : color_fill color_palette ROP quantize src1_r2y_csc dst_full_csc FBC_mode blend_in_YUV BT.2020 
expected performance  : max 4 pixel/cycle 

5、测试是否可用

root@admin:~# rgaImDemo -w6 --copy  
Start selecting mode 0
im2d while .. 6 time.
Start selecting mode 80
im2d copy ..
RGA demo mode = 0x81
alloc buffer from "/dev/dma_heap/system-uncached-dma32".
Could not open /data/in0w1280-h720-rgba8888.bin
can not open file for src channel, memset to 0x11.
This is 1 time in the loop
copying .... cost time 675 us
This is 2 time in the loop
copying .... cost time 722 us
This is 3 time in the loop
copying .... cost time 762 us
This is 4 time in the loop
copying .... cost time 758 us
This is 5 time in the loop
copying .... cost time 720 us
This is 6 time in the loop
copying .... cost time 724 us
open /data/out0w1280-h720-rgba8888.bin and write ok

3、异常情况解决

在RK3568中更新过程中,试过运行./rgaImDemo -w6 --copy时报一下错误

root@admin:~# ./rgaImDemo -w6 --copy
Start selecting mode 0
im2d while .. 6 time.
Start selecting mode 80
im2d copy ..
RGA demo mode = 0x81
"/dev/dma_heap/system-uncached-dma32" does not exist, so use malloc.
rga_api version 1.10.1_[0]
[ 1343.362455] rga_mm: RGA_MMU unsupported memory largFeailed to import virtualaddr for src chanrnel! Invalid parameters: The current er ror tmessageh is empty!
an 4G!
[ 1343.362512] rga_mm: schedulerroot@lanxus:~#  core[4] unsupported mm_flag[0x0]!
[ 1343.362643] rga_mm: rga_mm_map_buffer map virtual address error!
[ 1343.362674] rga: buffer[0] mm import buffer failed! memory = 0x7fb5efe010, type = virt_addr(0x1)

解决办法如下:
修改Uboot中uboot/arch/arm/mach-rockchip/param.c文件

		for (i = 0, n = 0; i < count; i++, n++) {base = t->u.ddr_mem.bank[i];size = t->u.ddr_mem.bank[i + count];/* 0~4GB */if (base < SZ_4GB) {mem[n].base = base;mem[n].size = ddr_mem_get_usable_size(base, size);if (base + size > SZ_4GB) {n++;mem[n].base_u64 = SZ_4GB;mem[n].size_u64 = base + size - SZ_4GB;}} 
+			//else {
+			//	/* 4GB+ */
+			//	mem[n].base_u64 = base;
+			//	mem[n].size_u64 = size;
+			//}assert(n < count + MEM_RESV_COUNT);}
http://www.dtcms.com/a/553662.html

相关文章:

  • C++ 与 Go 相互调用实践指南:基于 SWIG + Director 模式
  • 做音乐的网站设计网站版权设置
  • SAP ABAP 视图表/表 表维护视图字段更新
  • 汇编、反汇编和机器码
  • 网站做跳转链接馆陶网站推广
  • 逻辑回归正则化解释性实验报告:L2 正则对模型系数收缩的可视化分析
  • LeetCode 412 - Fizz Buzz
  • 大型门户网站建设特点怎么知道一个网站是谁做的
  • IDC报告:阿里云市场份额升至26.8%,连续5季度上涨
  • 佛山房地产网站建设51建模网官方网站
  • 字格格子模板合集:多样练字格硬笔书法训练模板(可打印)
  • Arduino ESP32-C3 串口使用注意事项
  • MCP是什么及如何开发一个MCPServer
  • 程序逆向分析
  • 卷绕设备与叠片设备
  • 个人可以做购物网站吗西安曲江文化园区建设开发有限公司网站
  • 网站当前链接深圳坪地网站建设 自助建站 五合一建站平台
  • GD32F407VE天空星开发板的ADC按键(ADKey)的实现
  • 使用 Nginx 轻松处理跨域请求(CORS)
  • 2025 年世界职业院校技能大赛机电设备安装与运维赛道备赛
  • 网站备案帐号用织梦做模板网站
  • 我的第一份工作:996
  • 贵州网推传媒有限公司企业网站seo优
  • 矿泉水除溴化物的解决方案
  • Bugku-Web题目-cookies
  • C# 类的方法介绍
  • 打破数据孤岛:制造行业档案管理方案如何实现数据互通与协同?
  • 加强 廉政网站建设衍艺网站建设
  • 中企高呈建设网站律师在哪个网站做推广好
  • 昆山非标设计工厂6名SolidWorks设计师共享一台服务器