GNOME Bugzilla – Bug 733952
videopool: allocate page-aligned buffers
Last modified: 2018-11-03 11:30:46 UTC
In order to improve interop with GPU resources, it would help to make sure video buffer allocations are page-aligned. This is in view to using userptr (kernel >= 3.16) and expose that to the GPU for further processing.
There are two ways to implement that:
1. At the video pool level, in the alloc_buffer() implementation.
2. At the system allocator level, through an additional settable param.
Approach (1) is trivial, while approach (2) is more generic and has the potential to be used in other scenarios beyond video buffers.
What is the preferred approach? Thanks.
Memory alignment requirement shall be negotiated and this is already supported. The element that will receive the buffer simply propose an allocator and params that set the alignment, upstream will use it if possible. That element will need to check if alignment was respected in order to decide if a copy is needed or not.
USERPTR in most context isn't as simple as having page-aligned buffers though. As of today, most GPU runs without iommus, hence requires contiguous memory (added to some alignment requirement) and some even go further with only using memory from a specific reserved bank.
I think this bug is invalid, correct me if I'm wrong.
It might make sense to use page alignment as default... or maybe not :)
Well, the idea was to make sure to use mmap() and additional gst flags, if necessary. But, yes, let's try a HW specific way before trying to be generic.
So any progress in this reflection ? Also, how to we ensure something is page align ? How to we handle that outside Linux ?
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/127.