Toybrick

./rgaImDemo 报错

MWM

中级会员

积分
257
楼主
发表于 2022-9-21 17:12:17    查看: 6126|回复: 6 | [复制链接]    打印 | 只看该作者
麻烦大神指导下


运行./rgaImDemo  --fill=red

输出如下:
Start selecting mode 0
im2d fill ..
fill red ...
MODE = 9
open file
open file
rga_api version 1.8.1_[0]
RgaCollorFill(1717) RGA_COLORFILL fail: Invalid argument
RgaCollorFill(1718) RGA_COLORFILL fail: Invalid argument
srect[x,y,w,h] = [0, 0, 0, 0] src[w,h,ws,hs] = [0, 0, 0, 0]

drect[x,y,w,h] = [100, 100, 300, 300] dst[w,h,ws,hs] = [300, 300, 1280, 720]

usage[0x280000]
filling .... cost time 160 us, Fatal error: Failed to call RockChipRga interface, query log to find the cause of failure.
open /usr/data/out0w1280-h720-rgba8888.bin and write ok



------------------------------------------------
journalctl  日志
-----------------------------------------------
Sep 21 16:04:48 toybrick kernel: [dhd][wlan0] wl_run_escan : LEGACY_SCAN sync ID: 13, bssidx: 0
Sep 21 16:04:51 toybrick kernel: rga_policy: invalid function policy
Sep 21 16:04:51 toybrick kernel: rga_job: job assign failed
Sep 21 16:04:51 toybrick kernel: rga_job: failed to get scheduler, rga_job_commit(661)
Sep 21 16:04:51 toybrick kernel: rga_job: failed to commit job!
Sep 21 16:04:51 toybrick kernel: rga: rga_request_commit failed





回复

使用道具 举报

jefferyzhang

版主

积分
13574
沙发
发表于 2022-9-23 09:10:33 | 只看该作者
他的这个demo只能当api参考,代码需要自己根据实际情况写的
回复

使用道具 举报

guyanxiao

注册会员

积分
174
板凳
发表于 2022-9-26 16:18:17 | 只看该作者
确认这个问题存在

./rgaImDemo --fill=blue
Start selecting mode 0
im2d fill ..
fill blue ...
MODE = 9
open file
open file
rga_api version 1.8.1_[0]
RgaCollorFill(1717) RGA_COLORFILL fail: Invalid argument
RgaCollorFill(1718) RGA_COLORFILL fail: Invalid argument
srect[x,y,w,h] = [0, 0, 0, 0] src[w,h,ws,hs] = [0, 0, 0, 0]

drect[x,y,w,h] = [100, 100, 320, 320] dst[w,h,ws,hs] = [320, 320, 1280, 720]

usage[0x280000]
filling .... cost time 326 us, Fatal error: Failed to call RockChipRga interface, query log to find the cause of failure.
open /usr/data/out0w1280-h720-rgba8888.bin and write ok

cat driver_version
RGA multicore Device Driver: v1.2.10

rga debug信息如下:

[178426.366860] rga: import buffer info:
[178426.366871] rga_debugger: external: memory = 0x7fbeabd010, type = virt_addr
[178426.366876] rga_debugger: param: w = 1280, h = 720, f = RGBA8888, size = 0
[178426.367165] rga_dma_buf: iova_align size = 3690496
[178426.367584] rga_dma_buf: iova_align size = 3690496
[178426.367963] rga_mm: import buffer:
[178426.367967] rga_mm: handle = 1 refcount = 1 mm_flag = 0x2
[178426.367973] rga_mm: virtual address: va = 0x7fbeabd010, pages = 000000007d1e0919, size = 3690496
[178426.367977] rga_mm: core 1: iova = 0xffc00000, sgt = 0000000048e4cdc5, size = 3690496
[178426.367980] rga_mm: core 2: iova = 0xffc00000, sgt = 0000000050e818fa, size = 3690496
[178426.367984] rga_mm: core 0: iova = 0x0, sgt = 0000000000000000, size = 0
[178426.368099] rga: import buffer info:
[178426.368103] rga_debugger: external: memory = 0x7fbe738010, type = virt_addr
[178426.368107] rga_debugger: param: w = 1280, h = 720, f = RGBA8888, size = 0
[178426.368366] rga_dma_buf: iova_align size = 3690496
[178426.369040] rga_dma_buf: iova_align size = 3690496
[178426.369691] rga_mm: import buffer:
[178426.369695] rga_mm: handle = 2 refcount = 1 mm_flag = 0x2
[178426.369699] rga_mm: virtual address: va = 0x7fbe738010, pages = 00000000715b1646, size = 3690496
[178426.369702] rga_mm: core 1: iova = 0xff800000, sgt = 000000007aedbec8, size = 3690496
[178426.369706] rga_mm: core 2: iova = 0xff800000, sgt = 00000000fb5e207e, size = 3690496
[178426.369709] rga_mm: core 0: iova = 0x0, sgt = 0000000000000000, size = 0
[178426.369951] rga_debugger: render_mode = 2, bitblit_mode=0, rotate_mode = 0
[178426.369961] rga_debugger: src: y = 0 uv = 0 v = 0 aw = 0 ah = 0 vw = 0 vh = 0
[178426.369964] rga_debugger: src: xoff = 0, yoff = 0, format = 0x0, rd_mode = 0
[178426.369970] rga_debugger: dst: y=2 uv=0 v=e1000 aw=320 ah=320 vw=1280 vh=720
[178426.369974] rga_debugger: dst: xoff = 100, yoff = 100, format = 0x0, rd_mode = 1
[178426.369977] rga_debugger: mmu: mmu_flag=0 en=0
[178426.369979] rga_debugger: alpha: rop_mode = 0
[178426.369982] rga_debugger: yuv2rgb mode is 0
[178426.369984] rga_debugger: set core = 0, priority = 0, in_fence_fd = -1
[178426.370019] rga_policy: start policy on core = 1
[178426.370022] rga_policy: core = 1, break on feature
[178426.370025] rga_policy: start policy on core = 2
[178426.370027] rga_policy: core = 2, break on feature
[178426.370029] rga_policy: start policy on core = 4
[178426.370031] rga_policy: RGA2 only support under 4G memory!
[178426.370034] rga_policy: optional_cores = 0
[178426.370037] rga_policy: invalid function policy
[178426.370059] rga_policy: assign core: -1
[178426.370063] rga_job: job assign failed
[178426.370068] rga_job: failed to get scheduler, rga_job_commit(661)
[178426.370076] rga_job: failed to commit job!
[178426.370081] rga: rga_request_commit failed
[178426.370261] rga: release buffer handle[1]
[178426.370264] rga_mm: release buffer:
[178426.370268] rga_mm: handle = 1 refcount = 1 mm_flag = 0x2
[178426.370274] rga_mm: virtual address: va = 0x7fbeabd010, pages = 000000007d1e0919, size = 3690496
[178426.370278] rga_mm: core 1: iova = 0xffc00000, sgt = 0000000048e4cdc5, size = 3690496
[178426.370281] rga_mm: core 2: iova = 0xffc00000, sgt = 0000000050e818fa, size = 3690496
[178426.370284] rga_mm: core 0: iova = 0x0, sgt = 0000000000000000, size = 0
[178426.370778] rga: release buffer handle[2]
[178426.370783] rga_mm: release buffer:
[178426.370786] rga_mm: handle = 2 refcount = 1 mm_flag = 0x2
[178426.370789] rga_mm: virtual address: va = 0x7fbe738010, pages = 00000000715b1646, size = 3690496
[178426.370793] rga_mm: core 1: iova = 0xff800000, sgt = 000000007aedbec8, size = 3690496
[178426.370796] rga_mm: core 2: iova = 0xff800000, sgt = 00000000fb5e207e, size = 3690496
[178426.370799] rga_mm: core 0: iova = 0x0, sgt = 0000000000000000, size = 0


debug信息里面有一个 rga_policy: RGA2 only support under 4G memory! 看上去比较可疑
demo里面其它的命令都可以正常执行
是否是因为rga不能在超过4G的内存上使用color fill
需求是算法执行后在视频上画框,如果rga color fill有限制,该如何实现?
能否给个示例代码?
回复

使用道具 举报

jefferyzhang

版主

积分
13574
地板
发表于 2022-9-26 17:44:28 | 只看该作者
这个log说明你没用3588的api写代码,3588上有多颗rga,rga2是旧的rga,只能寻址32bit空间,rga3无限制。
如果你用malloc分配空间,那大概率分配到是32bit以外的地址
回复

使用道具 举报

guyanxiao

注册会员

积分
174
5#
发表于 2022-9-27 08:50:14 | 只看该作者
谢谢Jeffery的信息,问题是没看到哪里有rga3的文档,现在找到的都是老的信息
回复

使用道具 举报

cang_rong

新手上路

积分
36
6#
发表于 2022-12-3 14:28:26 | 只看该作者
我在rk3588上调试rga填充图像,调试代码来自https://github.com/airockchip/librga
在rgaImDemo.cpp中加入:
STATUS = imconfig(IM_CONFIG_SCHEDULER_CORE, IM_SCHEDULER_RGA3_CORE0);
尝试启动RGA3,结果报错:
//=======================================================================
Start selecting mode 0
im2d fill ..
fill red ...
MODE = 9
[main][289]src_buf addr: 0x7f7ff9d010        dst_buf addr: 0x7f7fc18010
open file
open file
[main][306]src_buf addr: 0x7f7ff9d010        dst_buf addr: 0x7f7fc18010
rga_api version 1.8.1_[0]
651, imconfig return:Run successfully
653, imconfig return:Run successfully
RgaCollorFill(1717) RGA_COLORFILL fail: Invalid argument
RgaCollorFill(1718) RGA_COLORFILL fail: Invalid argument
srect[x,y,w,h] = [0, 0, 0, 0] src[w,h,ws,hs] = [0, 0, 0, 0]

drect[x,y,w,h] = [100, 100, 300, 300] dst[w,h,ws,hs] = [300, 300, 1280, 720]

usage[0x280000]
filling .... cost time 138 us, Fatal error: Failed to call RockChipRga interface, query log to find the cause of failure.
open /usr/data/out0w1280-h720-rgba8888.bin and write ok
//=======================================================================
以上是在16GB的开发板上的调试结果,在4GB的开发板上可以正确执行。
查阅文档可知:
**A1.8:**由于目前RGA1/RGA2的MMU仅支持最大32位的物理地址,所以当在搭载4G以上DDR的设备中,传给RGA大于4G内存空间的buffer时,RGA驱动会通过dma接口将高位地址的内存里的数据拷贝至swiotlb预留的低位内存上,并返回对应的地址以供RGA读写,RGA工作结束后再通过dma将结果拷贝至原本的高位目标地址上,因此增加了CPU的介入,导致librga整体的工作时间严重增加。对于这种仅搭载RGA2/RGA1,并且设备DDR大于4G的情况,建议调用RGA时使用低于4G空间的内存,保证RGA的效率。

问题:
在rk3588j 16GB的板卡上如何正确使用RGA3?
回复

使用道具 举报

cang_rong

新手上路

积分
36
7#
发表于 2022-12-6 15:37:39 | 只看该作者
文档《RGA IM2D API 开发指南》(发布版本:V2.1.0)的表格指出RGA3不支持color fill。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表