vdpau-support.patch 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
  2. +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
  3. @@ -641,6 +641,7 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
  4. // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
  5. // internal decoded frame.
  6. if (buffer_allocation_mode_ != BufferAllocationMode::kNone &&
  7. + buffer_allocation_mode_ != BufferAllocationMode::kWrapVdpau &&
  8. !vpp_vaapi_wrapper_) {
  9. vpp_vaapi_wrapper_ = VaapiWrapper::Create(
  10. VaapiWrapper::kVideoProcess, VAProfileNone,
  11. @@ -665,7 +666,8 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
  12. PictureBuffer buffer = buffers[i];
  13. buffer.set_size(requested_pic_size_);
  14. std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create(
  15. - (buffer_allocation_mode_ == BufferAllocationMode::kNone)
  16. + ((buffer_allocation_mode_ == BufferAllocationMode::kNone) ||
  17. + (buffer_allocation_mode_ == BufferAllocationMode::kWrapVdpau))
  18. ? vaapi_wrapper_
  19. : vpp_vaapi_wrapper_,
  20. make_context_current_cb_, bind_image_cb_, buffer);
  21. @@ -1093,6 +1095,12 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
  22. VaapiVideoDecodeAccelerator::BufferAllocationMode
  23. VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
  24. + // NVIDIA blobs use VDPAU
  25. + if (VaapiWrapper::GetImplementationType() == VAImplementation::kNVIDIAVDPAU) {
  26. + LOG(INFO) << "VA-API driver on VDPAU backend";
  27. + return BufferAllocationMode::kWrapVdpau;
  28. + }
  29. +
  30. // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
  31. // |output_mode_| as well.
  32. if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
  33. @@ -1105,7 +1113,7 @@ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
  34. // depends on the bitstream and sometimes it's not enough to cover the amount
  35. // of frames needed by the client pipeline (see b/133733739).
  36. // TODO(crbug.com/911754): Enable for VP9 Profile 2.
  37. - if (IsGeminiLakeOrLater() &&
  38. + if (false && IsGeminiLakeOrLater() &&
  39. (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY)) {
  40. // Add one to the reference frames for the one being currently egressed, and
  41. // an extra allocation for both |client_| and |decoder_|, see
  42. --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.h
  43. +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
  44. @@ -204,6 +204,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
  45. // Using |client_|s provided PictureBuffers and as many internally
  46. // allocated.
  47. kNormal,
  48. + kWrapVdpau,
  49. };
  50. // Decides the concrete buffer allocation mode, depending on the hardware
  51. --- a/media/gpu/vaapi/vaapi_wrapper.cc
  52. +++ b/media/gpu/vaapi/vaapi_wrapper.cc
  53. @@ -131,6 +131,9 @@ media::VAImplementation VendorStringToImplementationType(
  54. } else if (base::StartsWith(va_vendor_string, "Intel iHD driver",
  55. base::CompareCase::SENSITIVE)) {
  56. return media::VAImplementation::kIntelIHD;
  57. + } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU",
  58. + base::CompareCase::SENSITIVE)) {
  59. + return media::VAImplementation::kNVIDIAVDPAU;
  60. }
  61. return media::VAImplementation::kOther;
  62. }
  63. --- a/media/gpu/vaapi/vaapi_wrapper.h
  64. +++ b/media/gpu/vaapi/vaapi_wrapper.h
  65. @@ -79,6 +79,7 @@ enum class VAImplementation {
  66. kIntelIHD,
  67. kOther,
  68. kInvalid,
  69. + kNVIDIAVDPAU,
  70. };
  71. // This class handles VA-API calls and ensures proper locking of VA-API calls