intel / media-driver

Intel Graphics Media Driver to support hardware decode, encode and video processing.
https://github.com/intel/media-driver/wiki
Other
1.01k stars 346 forks source link

vaCreateBuffer() should not hold a BufferLock in executing memcpy #1408

Open rosetta-jpn opened 2 years ago

rosetta-jpn commented 2 years ago

What Feature?

vaCreateBuffer(), if a given |data| is not null, copies |data| into a created buffer. The current vaCreateBuffer() implementation 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

rosetta-jpn commented 2 years ago

@zlma7001 FYI

XinfengZhang commented 1 year ago

I agree with rosetta-jpn , @MicroYY please help to narrow the protection area.