diff options
author | Russell King <rmk+cubox@arm.linux.org.uk> | 2013-12-05 18:46:37 +0000 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2013-12-08 21:35:46 +0000 |
commit | dcad449e26e81b71e4a498dc5bfaf014a5566acd (patch) | |
tree | 3267d9da183ea6f6ab94d7de3422b3c98b20127a /bmm_lib.c | |
parent | 6def9c19ccdfb0cb2c22a5f1dcfb3bb1aba60c99 (diff) |
Add dma_buf export API by physical addressv1.1.3
Add an API to export BMM buffers by passing in a physical address.
This allows a BMM buffer without a virtual mapping to be passed to
other device drivers.
Diffstat (limited to 'bmm_lib.c')
-rw-r--r-- | bmm_lib.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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; |