nvidia-vdpau.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.h
  34. +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h
  35. @@ -204,6 +204,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator
  36. // Using |client_|s provided PictureBuffers and as many internally
  37. // allocated.
  38. kNormal,
  39. + kWrapVdpau,
  40. };
  41. // Decides the concrete buffer allocation mode, depending on the hardware
  42. --- a/media/gpu/vaapi/vaapi_wrapper.cc
  43. +++ b/media/gpu/vaapi/vaapi_wrapper.cc
  44. @@ -131,6 +131,9 @@ media::VAImplementation VendorStringToImplementationType(
  45. } else if (base::StartsWith(va_vendor_string, "Intel iHD driver",
  46. base::CompareCase::SENSITIVE)) {
  47. return media::VAImplementation::kIntelIHD;
  48. + } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU",
  49. + base::CompareCase::SENSITIVE)) {
  50. + return media::VAImplementation::kNVIDIAVDPAU;
  51. }
  52. return media::VAImplementation::kOther;
  53. }
  54. --- a/media/gpu/vaapi/vaapi_wrapper.h
  55. +++ b/media/gpu/vaapi/vaapi_wrapper.h
  56. @@ -79,6 +79,7 @@ enum class VAImplementation {
  57. kIntelIHD,
  58. kOther,
  59. kInvalid,
  60. + kNVIDIAVDPAU,
  61. };
  62. // This class handles VA-API calls and ensures proper locking of VA-API calls