Commit 42cb2be1 authored by Patryk Busse's avatar Patryk Busse Committed by Slawomir Rosek
Browse files

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: default avatarPatryk 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: default avatarAlexandre Courbot <acourbot@chromium.org>
Tested-by: default avatarPatryk Busse <pbu@semihalf.com>
Signed-off-by: default avatarSlawomir Rosek <srosek@google.com>
parent 45ecaf8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment