Use vaMapBuffer() on Intel GPUs

This commit is contained in:
Alexander David Frick 2022-03-03 03:47:40 -06:00 committed by GitHub
parent 1904e045cd
commit ce05f00f9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2696,8 +2696,17 @@ uint64_t VaapiWrapper::GetEncodedChunkSize(VABufferID buffer_id,
TRACE_EVENT0("media,gpu", "VaapiWrapper::GetEncodedChunkSize");
base::AutoLockMaybe auto_lock(va_lock_);
TRACE_EVENT0("media,gpu", "VaapiWrapper::GetEncodedChunkSizeLocked");
// vaSyncSurface() is not necessary on Intel platforms as long as there is a
// vaMapBuffer() like in ScopedVABufferMapping below.
// vaSyncSurface() synchronizes all active workloads (potentially many, e.g.
// for k-SVC encoding). On Intel, we'd rather use the more fine-grained
// vaMapBuffer() in ScopedVABufferMapping below. see b/184312032.
if (VaapiWrapper::GetImplementationType() != VAImplementation::kIntelI965 &&
VaapiWrapper::GetImplementationType() != VAImplementation::kIntelIHD) {
VAStatus va_res = vaSyncSurface(va_display_, sync_surface_id);
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVASyncSurface, 0u);
}
ScopedVABufferMapping mapping(va_lock_, va_display_, buffer_id);
if (!mapping.IsValid())