|
本帖最后由 雁南飞 于 2023-9-8 10:33 编辑
板子是rk 3568,在https://github.com/airockchip/librga 下载了librga以及参考了sample中rag_copy_demo.cpp,实现了以下代码:- rga_buffer_t g_src_img;
- rga_buffer_t g_dst_img;
- rga_buffer_handle_t g_src_handle;
- rga_buffer_handle_t g_dst_handle;
- g_src_handle = 0;
- g_dst_handle = 0;
- memset(&g_src_img, 0, sizeof(g_src_img));
- memset(&g_dst_img, 0, sizeof(g_dst_img));
- memset(g_dst_buf, 0x80, width*height*3);
-
- g_src_handle = importbuffer_virtualaddr((char*)mpp_buffer_get_ptr(buffer), width*height*3);
- g_dst_handle = importbuffer_virtualaddr(g_dst_buf, width*height*3);
- if (g_src_handle == 0 || g_dst_handle == 0)
- {
- printf("importbuffer failed!\n");
- return ;
- }
- g_src_img = wrapbuffer_handle(g_src_handle, width, height, RK_FORMAT_RGB_888);
- g_dst_img = wrapbuffer_handle(g_dst_handle, width, height, RK_FORMAT_RGB_888);
- IM_STATUS checkRet = imcheck(g_src_img, g_dst_img, {}, {});
- if (IM_STATUS_NOERROR != checkRet)
- {
- printf("%d, check error! %s", __LINE__, imStrError((IM_STATUS)checkRet));
- return;
- }
- printf("dest handle:%d handle:%d fd:%d vir:%x phy:%x\n", g_dst_handle, g_dst_img.handle, g_dst_img.fd, g_dst_img.vir_addr, g_dst_img.phy_addr);
- printf("src handle:%d handle:%d fd:%d vir:%x phy:%x\n", g_src_handle, g_src_img.handle, g_src_img.fd, g_src_img.vir_addr, g_src_img.phy_addr);
- IM_STATUS retStatus = imcopy(g_src_img, g_dst_img);
- if (retStatus == IM_STATUS_SUCCESS)
- {
- printf("imcopy running success!\n");
- }
- else
- {
- printf("imcopy running failed, %s\n", imStrError((IM_STATUS)retStatus));
- }
- //这里对g_dst_buf进行操作,写文件之类
- //......
- if (g_src_handle)
- releasebuffer_handle(g_src_handle);
- if (g_dst_handle)
- releasebuffer_handle(g_dst_handle);
其中,printf打印的g_dst_handle、g_src_handle均为-1,fd,vir__addr, phy_addr这些值均为0,看着是不正常的。请问流程哪里出错了,或者还需要安装其他什么库?
其中,初始化的日志出现
- librga fail to get driver version! Compatibility mode will be enabled.
- 334 im2d_rga_impl rga_version_below_minimun_range_user_driver(304): The driver may be compatible, but it is best to update the driver to version 1.2.4. You can try to update the SDK or update the <SDK>/kernel/drivers/video/rockchip/rga3 directory individually. current version: librga 1.9.1, driver .
- rga_api version 1.9.1_[4]
|
|