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

32 lines
784 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_DMABUF_H__
#define __RK_DMABUF_H__
#include <stdint.h>
#include <sys/mman.h>
#include "linux4.19/dma-buf.h"
#ifdef __cplusplus
extern "C" {
#endif
int dmabuf_sync(int fd, uint64_t flags);
int dmabuf_sync_partial(int fd, uint32_t offset, uint32_t len, uint64_t flags);
off_t dmabuf_get_size(int fd);
void* dmabuf_mmap(int fd, off_t offset, size_t len);
/*
申请dmabuf内存
is_cma 是否申请CMA heap内存若为false则申请SYSTEM heap内存
is_cacheable 申请的内存是否支持cache
is_dma32 申请的内存是否限制地址在4G以内
fd 存放返回的dmabuf fd
成功 返回0
失败 返回负值
*/
int dmabuf_alloc(uint32_t len, bool is_cma, bool is_cacheable, bool is_dma32, int *fd);
#ifdef __cplusplus
}
#endif
#endif