-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvdpau-support.patch
101 lines (97 loc) · 5.02 KB
/
vdpau-support.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
diff -up chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.23~ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
--- chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.23~ 2021-08-12 21:10:18.000000000 +0200
+++ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2021-08-15 05:43:22.496747377 +0200
@@ -714,7 +714,8 @@ void VaapiVideoDecodeAccelerator::Assign
// implementation we get from |vaapi_picture_factory_| requires the video
// processing pipeline for downloading the decoded frame from the internal
// surface, we need to create a |vpp_vaapi_wrapper_|.
- if (requires_vpp && buffer_allocation_mode_ != BufferAllocationMode::kNone) {
+ if (requires_vpp && buffer_allocation_mode_ != BufferAllocationMode::kNone &&
+ buffer_allocation_mode_ != BufferAllocationMode::kWrapVdpau) {
if (!vpp_vaapi_wrapper_) {
vpp_vaapi_wrapper_ = VaapiWrapper::Create(
VaapiWrapper::kVideoProcess, VAProfileNone,
@@ -1228,6 +1229,12 @@ VaapiVideoDecodeAccelerator::DecideBuffe
return BufferAllocationMode::kReduced;
return BufferAllocationMode::kSuperReduced;
#else
+ // NVIDIA blobs use VDPAU
+ if (VaapiWrapper::GetImplementationType() == VAImplementation::kNVIDIAVDPAU) {
+ LOG(INFO) << "VA-API driver on VDPAU backend";
+ return BufferAllocationMode::kWrapVdpau;
+ }
+
// TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
// |output_mode_| as well.
if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
@@ -1238,7 +1245,7 @@ VaapiVideoDecodeAccelerator::DecideBuffe
// associated format reconciliation copy, avoiding all internal buffer
// allocations.
// TODO(crbug.com/911754): Enable for VP9 Profile 2.
- if (IsGeminiLakeOrLater() &&
+ if (false && IsGeminiLakeOrLater() &&
(profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY ||
(profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX))) {
// Add one to the reference frames for the one being currently egressed, and
diff -up chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.h.23~ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.h
--- chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.h.23~ 2021-08-12 21:10:18.000000000 +0200
+++ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_video_decode_accelerator.h 2021-08-15 05:43:22.496747377 +0200
@@ -212,6 +212,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeA
// Using |client_|s provided PictureBuffers and as many internally
// allocated.
kNormal,
+ kWrapVdpau,
};
// Decides the concrete buffer allocation mode, depending on the hardware
diff -up chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.cc.23~ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.cc
--- chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.cc.23~ 2021-08-15 05:43:22.495747385 +0200
+++ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.cc 2021-08-15 05:46:02.893592386 +0200
@@ -224,6 +224,9 @@ media::VAImplementation VendorStringToIm
} else if (base::StartsWith(va_vendor_string, "Intel iHD driver",
base::CompareCase::SENSITIVE)) {
return media::VAImplementation::kIntelIHD;
+ } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU",
+ base::CompareCase::SENSITIVE)) {
+ return media::VAImplementation::kNVIDIAVDPAU;
}
return media::VAImplementation::kOther;
}
@@ -2181,6 +2184,11 @@ VaapiWrapper::ExportVASurfaceAsNativePix
return nullptr;
}
+ if (GetImplementationType() == VAImplementation::kNVIDIAVDPAU) {
+ LOG(ERROR) << "Disabled due to potential breakage.";
+ return nullptr;
+ }
+
VADRMPRIMESurfaceDescriptor descriptor;
{
base::AutoLock auto_lock(*va_lock_);
@@ -2892,6 +2900,10 @@ bool VaapiWrapper::CreateSurfaces(
va_surfaces->resize(num_surfaces);
VASurfaceAttrib attribute;
memset(&attribute, 0, sizeof(attribute));
+
+ if (GetImplementationType() != VAImplementation::kNVIDIAVDPAU) {
+ // Nvidia's VAAPI-VDPAU driver doesn't support this attribute
+
attribute.type = VASurfaceAttribUsageHint;
attribute.flags = VA_SURFACE_ATTRIB_SETTABLE;
attribute.value.type = VAGenericValueTypeInteger;
@@ -2903,6 +2915,7 @@ bool VaapiWrapper::CreateSurfaces(
static_assert(std::is_same<std::underlying_type<SurfaceUsageHint>::type,
int32_t>::value,
"The underlying type of SurfaceUsageHint is not int32_t");
+ }
VAStatus va_res;
{
diff -up chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.h.23~ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.h
--- chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.h.23~ 2021-08-12 21:10:18.000000000 +0200
+++ chromium-93.0.4577.42/media/gpu/vaapi/vaapi_wrapper.h 2021-08-15 05:43:22.497747370 +0200
@@ -89,6 +89,7 @@ enum class VAImplementation {
kIntelIHD,
kOther,
kInvalid,
+ kNVIDIAVDPAU,
};
// This class handles VA-API calls and ensures proper locking of VA-API calls