summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-12-08BMMv2: dma_buf based BMMHEADv2.0.0masterRussell King
This is a complete redesign and rewrite of libbmm. This implementation is based upon dma_bufs - where a dma_buf is a kernel-side buffer which can be passed to and from other subsystems. libbmm becomes a provider of dma_bufs - it permits userspace to allocate such things. When a dma_buf is allocated, userspace is handed a file descriptor which is unique to this buffer. This file descriptor can then be passed into other subsystems, which can then request access to this buffer. The file descriptor supports very few operations - it can be mmap()d to provide userspace access to the buffer, and it can be closed when it is no longer required. Internally in the kernel, dma_bufs are reference counted, so the dma_buf will only be freed when the last user gives up its reference.
2013-12-08Add dma_buf export API by physical addressv1.1.3Russell King
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.
2013-12-05Fix bmm_attach() followed by bmm_get_paddr()Russell King
Attaching to a buffer with an offset, and then subsequently asking for it's physical address returned the non-offset buffer. Fix this by tracking the physical offset.
2013-07-30Better tracking of phys/virt addressesRussell King
Implement better tracking of phys/virt address usage. This permits us to track multiple virtual mappings for the same physical allocation.
2013-07-30Fix debuggingRussell King
Use %z for sizeof() arguments Extra debugging for conflicting RBtree entries
2013-06-23Update debian changelog to 1.1.2 and update ABIv1.1.2Russell King
2013-06-23Turn on compiler warnings and fix themRussell King
Fix the "warning: function declaration isn't a prototype" warnings in the bmm_lib code, printf formats in the test code, and make test functions static.
2013-06-23Add bmm_malloc_aligned_phys() APIRussell King
Vmeta really wants the physical and virtual address of the buffer. Adjust the BMM API to give that to it.
2013-06-23Use free-by-physical address kernel APIRussell King
Use the new free-by-physical address kernel API. This allows us to free bmm buffers which have not been mapped into user memory. This also allows us to free a bmm buffer which failed to mmap().
2013-06-23Make libbmm more efficientRussell King
libbmm calls into the kernel a lot to perform various functions such as translating between virtual and physical addresses, finding out the buffer size, and so forth. Much of this can be done in userspace, because we have that information at the point where the buffer is allocated. Rather than having to keep fetching it from the kernel, store it in our own local bmm_buffer structure, and store this in a pair of rb trees - one indexed by physical address and the other by virtual address. This allows us to efficiently look up the bmm_buffer structure by either address, and retrieve the other buffer attribute(s). Reference: http://web.eecs.utk.edu/~plank/plank/rbtree/rbtree.html
2013-06-22Add dma_buf export APIRussell King
Add an API to allow bmm buffers to be exported as dma_buf objects, so they can be imported into DRM without needing to resort to passing physical addresses around.
2013-06-22Add method to get kernel driver versionRussell King
Add a method to allow the userspace library to obtain the API version of the kernel driver. This allows us to automatically adjust to changes in the API and fail cleanly when we detect an incompatibility.
2013-06-22Make debug output go to stderrRussell King
2013-06-20Open the bmm device with O_CLOEXECRussell King
We don't want to pass the BMM file descriptor to child programs, so ensure that it is opened using the O_CLOEXEC flag to prevent that happening.
2012-12-05Remove unused bmm_get_kern_paddr() functionRussell King
Userspace should not be dealing with kernel space addresses at all. Thankfully this function is unused, so we can merely delete it.
2012-12-01Fix debian build warningRussell King
dpkg-gencontrol: warning: Depends field of package libbmm1-dbg: unknown substitution variable ${shlibs:Depends}
2012-12-01Fix up debian build rulesRussell King
Use the built-in autoreconf support, and build in separate directory
2012-10-25Update debian changelog to 1.1.1v1.1.1Russell King
2012-10-25Add aligned malloc function [new kernel required]Russell King
vmeta wants to allocate memory with specific alignments. Rather than having vmeta request more memory of bmm, and then doing alignment on the result, provide a proper API to do this task. This requires an updated kernel.
2012-10-25Avoid making /dev/bmmRussell King
Modern systems use udev to manage /dev, and so /dev/bmm should be already created. Nevertheless, having a library try to create a device node is insane; the library doesn't know what context it is being called from. Neither should it try to create device nodes as non-root users. Get rid of this code.
2012-10-25Fix debuggingRussell King
For debugging, we need to include stdio. While we're here, lets clean up the debug macro a bit too.
2012-10-25Make physical addresses 'unsigned long'Russell King
Rather than having physical addresses be a void * pointer, make them integer like; they're really just numbers because we can't ever dereference them and they certainly aren't pointer-like.
2012-10-22fd 0 is a valid fd numberRussell King
Do not use 0 to indicate that the fd is uninitialized; use -1 instead.
2012-10-22Update debian build for previous changesRussell King
2012-10-22Remove bmm_dma_memcpy() and bmm_dma_sync()Russell King
2012-10-22Move private definitions to bmm_lib_priv.hRussell King
2012-10-22Separate init and udev scripts into separate packageRussell King
2012-10-22Initial libbmm git checkinRussell King