android13/hardware/rockchip/libmpimmz/include/rk_ion.h

39 lines
865 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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