ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.
BSD 2-Clause "Simplified" License
539 stars 165 forks source link

Allocating multiple DMA buffers but not in a single parse #81

Open rajatkha opened 2 years ago

rajatkha commented 2 years ago

What if I want to allocate two buffers of size 256 bytes but not in a single go? insmod u-dma-buf.ko udmabuf0=256 udmabuf1=256 --> this is correct but what if I want to allocate them separately? insmod u-dma-buf.ko udmabuf0=256 now what about the udmabuf1? How do I allocate this now?

ikwzm commented 2 years ago

Thank you for the issue.

How about using /dev/u-dma-buf/mgr? Allocate the buffer as follows:

shell# insmod u-dma-buf.ko udmabuf0=256
shell# echo 'create udmabuf1 256 > /dev/u-dma-buf-mgr

Alternatively, use device tree overlay to allocate the buffer. See the Readme.md for more details.

rajatkha commented 2 years ago

Thanks for replying. I tried with the above method but facing this error on executing echo 'create udmabuf1 256' > /dev/u-dma-buf-mgr -bash: /dev/u-dma-buf-mgr: Permission denied

Any solutions to this?

ikwzm commented 2 years ago

Does /dev/u-dma-buf-mrg exist?

What is the permission for /dev/u-dma-buf-mgr ?