1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
865 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef __RK_ION_H__
#define __RK_ION_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
申请ion内存
is_cma 是否申请CMA heap内存若为false则申请SYSTEM heap内存
is_cacheable 申请的内存是否支持cache
is_dma32 申请的内存是否限制地址在4G以内
fd 存放返回的ion内存的dmabuf fd
成功 返回0
失败 返回负值
*/
int ion_alloc(uint32_t len, bool is_cma, bool is_cacheable, bool is_dma32, int *fd);
/*
获取ion内存的物理地址
fd dmabuf's fd
paddr 存放返回的物理地址,如果非物理连续的内存,则地址被设置为-1
成功 返回0
失败 返回负值
*/
int ion_get_phys(int fd, uint64_t *paddr);
/*
查询系统是否支持ION
支持 返回true
不支持 返回false
*/
bool ion_check_support();
#ifdef __cplusplus
}
#endif
#endif