Add synchronization for drain and worker for encode
A drain can not occur before all buffers are sent, but since a drain and worker (which handles sending buffers to the hypervisor) runs on different treads they can run in parallel which can lead to data races between buffers and drain. To prevent that drain will check if all buffers were sent already and if not wait for a notification from the worker which will be sent when it finishes sending buffers. Signed-off-by:Patryk Busse <pbu@semihalf.com> BUG=b:232394659 TEST=android.mediav2.cts.CodecEncoderTest Change-Id: If7e8db7e70832b0b6bbf9fca6afe4645f96be2c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4098528 Commit-Queue: Marcin Wojtas <mwojtas@google.com> Reviewed-by:
Alexandre Courbot <acourbot@chromium.org> Tested-by:
Patryk Busse <pbu@semihalf.com> Signed-off-by:
Slawomir Rosek <srosek@google.com>
Loading
Please sign in to comment