Open whwalker opened 2 years ago
估计是你那这的 drm 分配器打开和 mmap 的 flag 不对,对比下看看
我看 os_allocator_drm_open 里面是 读写 打开的/dev/dri/card0,
fd = open(dev_drm, O_RDWR | O_CLOEXEC);
还没有走到 os_allocator_drm_mmap 里面去,是在 os_allocator_drm_alloc 里面调用 drm_alloc时失败了
static MPP_RET os_allocator_drm_alloc(void *ctx, MppBufferInfo *info)
{
...
drm_dbg_func("dev %d alloc alignment %d size %d\n", p->drm_device,
p->alignment, info->size);
ret = drm_alloc(p->drm_device, info->size, p->alignment,
(RK_U32 *)&info->hnd, p->flags); // 在这里失败了
...
}
drm_alloc 调用 drm_ioctl ,drm_ioctl调用 ioctl 失败的
ret = drm_ioctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &dmcb);
log如下:
mpp[273772]: mpi_dec_utils: input file /home/sky/RemixOS.h264 size 36038629
mpp[273772]: mpi_dec_utils: cmd parse result:
mpp[273772]: mpi_dec_utils: input file name: /home/sky/RemixOS.h264
mpp[273772]: mpi_dec_utils: output file name:
mpp[273772]: mpi_dec_utils: width : 0
mpp[273772]: mpi_dec_utils: height : 0
mpp[273772]: mpi_dec_utils: type : 7
mpp[273772]: mpi_dec_utils: max frames : 10
mpp[273772]: mpi_dec_test: mpi_dec_test start
mpp[273772]: mpp_info: mpp version: 786b79f9 author: Yandong Lin 2021-11-03 [h265d_parser]: Fix h265d parser crash issue
mpp[273772]: mpi_dec_test: 0xc78bf581aee0 mpi_dec_test decoder test start w 0 h 0 type 7
mpp[273772]: mpp_rt: NOT found ion allocator
mpp[273772]: mpp_rt: found drm allocator
mpp[273772]: mpp_drm: os_allocator_drm_open enter
mpp[273772]: mpp_drm: os_allocator_drm_open open drm dev fd 5
mpp[273772]: mpp_drm: os_allocator_drm_open leave dev 5
mpp[273772]: mpp_drm: os_allocator_drm_open enter
mpp[273772]: mpp_drm: os_allocator_drm_open open drm dev fd 6
mpp[273772]: mpp_drm: os_allocator_drm_open leave dev 6
mpp[273772]: mpp_drm: os_allocator_drm_alloc dev 5 alloc alignment 4096 size 3840
mpp[273772]: mpp_drm: os_allocator_drm_alloc, size=3840, alignment=4096
mpp[273772]: mpp_drm: drm_ioctl drm_ioctl c02064b2 with code -1: Function not implemented
mpp[273772]: mpp_drm: drm_alloc drm_ioctl ret =-1
mpp[273772]: mpp_drm: os_allocator_drm_alloc drm_alloc failed ret -1
mpp[273772]: mpp_buffer: mpp_buffer_create failed to create buffer with size 3840
不太明白“drm 分配器打开和 mmap 的 flag 不对” ,从log看还没有走到 os_allocator_drm_mmap 里面去调用 mmap, 提示的是功能没有实现
mpp[273772]: mpp_drm: drm_ioctl drm_ioctl c02064b2 with code -1: Function not implemented
麻烦再帮忙看看,谢谢。
或者能否给个RK3399上可编译运行的demo源码?
mpp默认是打开/dev/dri/card0,如果机器中存在多个drm设备时候可能打开的不是vop drm驱动设备。
我的平台是rk3399+ubuntu 20.04,运行系统自带的mpi_dec_test可以解码h264, 从github下载源码编译的mpp_dec_test解码h264一直报错内存分配出错,请问是什么原因? 具体log见下面
自己编译的mpi_dec_test运行log:
系统自带的mpi_dec_test运行正常,log如下:
系统信息如下:
编译: cd mpp/build/linux/aarch64; 修改 arm.linux.cross.cmake,然后 ./make-Makefiles.bash; make; 编译出的。 arm.linux.cross.cmake 内容如下: