vaCreateBuffer() should not hold a BufferLock in executing memcpy
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 383
- Avg merge
- 8d 18h
- Merged PRs (30d)
- 4
Description
### What Feature?
vaCreateBuffer(), if a given |data| is not null, copies |data| into a created buffer.
[The current vaCreateBuffer() implementation](https://github.com/intel/media-driver/blob/427e7910a7528a9220c10586cb26cccf28efafde/media_driver/linux/common/ddi/media_libva.cpp#L3242) acquires a BufferLock in the begging of the function and releases in the end of the function.
Therefore, memcpy is executed while the lock is held.
The bufferlock is basically required to operate on a bufferHeap, if I understand correctly.
So the lock scope should be more narrow; at least memcpy should be performed without holding the lock.
### What's the usage scenario would be benifited?
Video Conference
### What impacted?
The concurrent function calls e.g. vaCreateBuffer() will not be blocked by memcpy in vaCreateBuffer().
### Do you want to contribute a patch to develop this feature?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.