Attention is currently required from: Pawel Osciak, David Staessens, Hirokazu Honda, Andres Calderon Jaramillo, Stéphane Marchesin, Kuang-che Wu, Miguel Casas, Sreerenj Balachandran.
Jianhui J Dai has uploaded this change for review.
media/gpu/vaapi: make VA-API lock configurable
All threads in GPU process acquire a common lock whenever calling VA-API
functions, because VA-API didn't ensure thread safety.
The statement of thread safety has been added since libva 2.10.0 [1].
However, the thread-safety of libva depends on backend implementation.
This CL introduces |optional_va_lock_| in VADisplayState, a simple
wrapper of |va_lock_|. It checks the implementation type to perform
locking or no-op if switch |kVaapiNoLock| allows it. |optional_va_lock_|
is valid between Initialize() and Deinitialize().
Current default value of the switch is DISABLED, this CL doesn't change
the lock behavior in VA-API. Instead of removing the locks at once, we
are going to experiment disabling the lock via a finch experiment with
the switch.
The benefits are:
- It will reduce the latency as avoiding cpu lock
- It will reduce the gpu power as converging jobs for gpu parallel
execution
- It will optimize the throughput for gpu which has multiple hw
decoder/encoder instances
Intel iHD driver is thread safe, allowing parallel VA-API calls.
[1] https://github.com/intel/libva/pull/347
Bug:1123429, b:182008564
Change-Id: I9fea19ec3085e22ab6b182eb664bdb1d7fcc1c5f
Co-Authored-By: hi...@chromium.org
---
M media/base/media_switches.cc
M media/base/media_switches.h
M media/gpu/vaapi/BUILD.gn
A media/gpu/vaapi/vaapi_lock.h
M media/gpu/vaapi/vaapi_unittest.cc
M media/gpu/vaapi/vaapi_utils.cc
M media/gpu/vaapi/vaapi_utils.h
M media/gpu/vaapi/vaapi_utils_unittest.cc
M media/gpu/vaapi/vaapi_wrapper.cc
M media/gpu/vaapi/vaapi_wrapper.h
10 files changed, 178 insertions(+), 80 deletions(-)
To view, visit change 2384545. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Pawel Osciak, David Staessens, Hirokazu Honda, Andres Calderon Jaramillo, Stéphane Marchesin, Kuang-che Wu, Miguel Casas, Sreerenj Balachandran.
Jianhui J Dai abandoned this change.
To view, visit change 2384545. To unsubscribe, or for help writing mail filters, visit settings.