summaryrefslogtreecommitdiff
path: root/bmm_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'bmm_lib.c')
-rw-r--r--bmm_lib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/bmm_lib.c b/bmm_lib.c
index 72f5301..d6a3271 100644
--- a/bmm_lib.c
+++ b/bmm_lib.c
@@ -565,6 +565,23 @@ int bmm_get_dmabuf_fd(void *vaddr)
return ret < 0 ? -1 : io.output;
}
+int bmm_get_phys_dmabuf_fd(unsigned long paddr)
+{
+ int ret;
+ ioctl_arg_t io;
+
+ if (bmm_init() < 0 || API_FEAT(bmm_api) < API_FEAT_GET_DMABUF_FD)
+ return -1;
+
+ io.input = paddr;
+ io.output = 0;
+ io.arg = 0;
+
+ ret = ioctl(bmm_fd, BMM_GET_PHYS_DMABUF_FD, &io);
+
+ return ret < 0 ? -1 : io.output;
+}
+
unsigned long bmm_get_mem_size(void *vaddr)
{
struct bmm_virt_buffer *vbuf;