Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 684272 | Differences between
and this patch

Collapse All | Expand All

(-)dev/chrome/browser/about_flags.cc (-3 / +3 lines)
Lines 1400-1406 const FeatureEntry kFeatureEntries[] = { Link Here
1400
        "disable-accelerated-video-decode",
1400
        "disable-accelerated-video-decode",
1401
        flag_descriptions::kAcceleratedVideoDecodeName,
1401
        flag_descriptions::kAcceleratedVideoDecodeName,
1402
        flag_descriptions::kAcceleratedVideoDecodeDescription,
1402
        flag_descriptions::kAcceleratedVideoDecodeDescription,
1403
        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
1403
        kOsAll,
1404
        SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
1404
        SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
1405
    },
1405
    },
1406
#if defined(OS_WIN)
1406
#if defined(OS_WIN)
Lines 1922-1931 const FeatureEntry kFeatureEntries[] = { Link Here
1922
     FEATURE_VALUE_TYPE(service_manager::features::kXRSandbox)},
1922
     FEATURE_VALUE_TYPE(service_manager::features::kXRSandbox)},
1923
#endif  // ENABLE_ISOLATED_XR_SERVICE
1923
#endif  // ENABLE_ISOLATED_XR_SERVICE
1924
#endif  // ENABLE_VR
1924
#endif  // ENABLE_VR
1925
#if defined(OS_CHROMEOS)
1925
#if defined(OS_LINUX) && !defined(OS_ANDROID)
1926
    {"disable-accelerated-mjpeg-decode",
1926
    {"disable-accelerated-mjpeg-decode",
1927
     flag_descriptions::kAcceleratedMjpegDecodeName,
1927
     flag_descriptions::kAcceleratedMjpegDecodeName,
1928
     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
1928
     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux,
1929
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
1929
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
1930
#endif  // OS_CHROMEOS
1930
#endif  // OS_CHROMEOS
1931
    {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
1931
    {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
(-)dev/chrome/browser/flag_descriptions.cc (-3 / +7 lines)
Lines 2933-2941 const char kMacViewsTaskManagerDescripti Link Here
2933
2933
2934
#endif
2934
#endif
2935
2935
2936
// Chrome OS -------------------------------------------------------------------
2936
#if defined(OS_LINUX) && !defined(OS_ANDROID)
2937
2938
#if defined(OS_CHROMEOS)
2939
2937
2940
const char kAcceleratedMjpegDecodeName[] =
2938
const char kAcceleratedMjpegDecodeName[] =
2941
    "Hardware-accelerated mjpeg decode for captured frame";
2939
    "Hardware-accelerated mjpeg decode for captured frame";
Lines 2943-2948 const char kAcceleratedMjpegDecodeDescri Link Here
2943
    "Enable hardware-accelerated mjpeg decode for captured frame where "
2941
    "Enable hardware-accelerated mjpeg decode for captured frame where "
2944
    "available.";
2942
    "available.";
2945
2943
2944
#endif
2945
2946
// Chrome OS -------------------------------------------------------------------
2947
2948
#if defined(OS_CHROMEOS)
2949
2946
const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
2950
const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
2947
const char kAllowTouchpadThreeFingerClickDescription[] =
2951
const char kAllowTouchpadThreeFingerClickDescription[] =
2948
    "Enables touchpad three-finger-click as middle button.";
2952
    "Enables touchpad three-finger-click as middle button.";
(-)dev/chrome/browser/flag_descriptions.h (-3 / +7 lines)
Lines 1758-1770 extern const char kPermissionPromptPersi Link Here
1758
1758
1759
#endif  // defined(OS_MACOSX)
1759
#endif  // defined(OS_MACOSX)
1760
1760
1761
// Chrome OS ------------------------------------------------------------------
1761
#if defined(OS_LINUX) && !defined(OS_ANDROID)
1762
1763
#if defined(OS_CHROMEOS)
1764
1762
1765
extern const char kAcceleratedMjpegDecodeName[];
1763
extern const char kAcceleratedMjpegDecodeName[];
1766
extern const char kAcceleratedMjpegDecodeDescription[];
1764
extern const char kAcceleratedMjpegDecodeDescription[];
1767
1765
1766
#endif
1767
1768
// Chrome OS ------------------------------------------------------------------
1769
1770
#if defined(OS_CHROMEOS)
1771
1768
extern const char kAllowTouchpadThreeFingerClickName[];
1772
extern const char kAllowTouchpadThreeFingerClickName[];
1769
extern const char kAllowTouchpadThreeFingerClickDescription[];
1773
extern const char kAllowTouchpadThreeFingerClickDescription[];
1770
1774
(-)dev/content/gpu/BUILD.gn (+5 lines)
Lines 6-11 import("//build/config/jumbo.gni") Link Here
6
import("//build/config/ui.gni")
6
import("//build/config/ui.gni")
7
import("//gpu/vulkan/features.gni")
7
import("//gpu/vulkan/features.gni")
8
import("//media/media_options.gni")
8
import("//media/media_options.gni")
9
import("//media/gpu/args.gni")
9
import("//ui/ozone/ozone.gni")
10
import("//ui/ozone/ozone.gni")
10
11
11
# See //content/BUILD.gn for how this works.
12
# See //content/BUILD.gn for how this works.
Lines 127-130 target(link_target_type, "gpu_sources") Link Here
127
      (!is_chromecast || is_cast_desktop_build)) {
128
      (!is_chromecast || is_cast_desktop_build)) {
128
    configs += [ "//build/config/linux/dri" ]
129
    configs += [ "//build/config/linux/dri" ]
129
  }
130
  }
131
132
  if (is_desktop_linux && use_vaapi) {
133
    public_configs = [ "//build/config/linux/libva" ]
134
  }
130
}
135
}
(-)dev/gpu/config/software_rendering_list.json (-11 lines)
Lines 370-386 Link Here
370
      ]
370
      ]
371
    },
371
    },
372
    {
372
    {
373
      "id": 48,
374
      "description": "Accelerated video decode is unavailable on Linux",
375
      "cr_bugs": [137247],
376
      "os": {
377
        "type": "linux"
378
      },
379
      "features": [
380
        "accelerated_video_decode"
381
      ]
382
    },
383
    {
384
      "id": 50,
373
      "id": 50,
385
      "description": "Disable VMware software renderer on older Mesa",
374
      "description": "Disable VMware software renderer on older Mesa",
386
      "cr_bugs": [145531, 332596, 571899, 629434],
375
      "cr_bugs": [145531, 332596, 571899, 629434],
(-)dev/media/base/media_switches.cc (-1 / +1 lines)
Lines 509-515 bool IsVideoCaptureAcceleratedJpegDecodi Link Here
509
          switches::kUseFakeMjpegDecodeAccelerator)) {
509
          switches::kUseFakeMjpegDecodeAccelerator)) {
510
    return true;
510
    return true;
511
  }
511
  }
512
#if defined(OS_CHROMEOS)
512
#if defined(OS_LINUX) && !defined(OS_ANDROID)
513
  return true;
513
  return true;
514
#endif
514
#endif
515
  return false;
515
  return false;
(-)dev/media/filters/BUILD.gn (-1 / +2 lines)
Lines 5-10 Link Here
5
import("//build/config/jumbo.gni")
5
import("//build/config/jumbo.gni")
6
import("//media/media_options.gni")
6
import("//media/media_options.gni")
7
import("//third_party/libaom/options.gni")
7
import("//third_party/libaom/options.gni")
8
import("//media/gpu/args.gni")
8
9
9
jumbo_source_set("filters") {
10
jumbo_source_set("filters") {
10
  # Do not expand the visibility here without double-checking with OWNERS, this
11
  # Do not expand the visibility here without double-checking with OWNERS, this
Lines 212-218 jumbo_source_set("filters") { Link Here
212
    deps += [ "//media/base/android" ]
213
    deps += [ "//media/base/android" ]
213
  }
214
  }
214
215
215
  if (current_cpu != "arm" && is_linux) {
216
  if (use_vaapi) {
216
    sources += [
217
    sources += [
217
      "h264_bitstream_buffer.cc",
218
      "h264_bitstream_buffer.cc",
218
      "h264_bitstream_buffer.h",
219
      "h264_bitstream_buffer.h",
(-)dev/media/gpu/BUILD.gn (+1 lines)
Lines 546-551 if (is_chromeos || is_linux) { Link Here
546
    if (use_ozone) {
546
    if (use_ozone) {
547
      deps += [ "//ui/ozone" ]
547
      deps += [ "//ui/ozone" ]
548
    }
548
    }
549
    public_configs = [ "//build/config/linux/libva" ]
549
  }
550
  }
550
}
551
}
551
552
(-)dev/media/gpu/gpu_video_decode_accelerator_factory.cc (+3 lines)
Lines 183-188 GpuVideoDecodeAcceleratorFactory::Create Link Here
183
    vda = (this->*create_vda_function)(workarounds, gpu_preferences, media_log);
183
    vda = (this->*create_vda_function)(workarounds, gpu_preferences, media_log);
184
    if (vda && vda->Initialize(config, client))
184
    if (vda && vda->Initialize(config, client))
185
      return vda;
185
      return vda;
186
    else
187
      LOG(ERROR) << "Initialization of one or more VDAs failed.";
186
  }
188
  }
187
189
188
  return nullptr;
190
  return nullptr;
Lines 241-246 GpuVideoDecodeAcceleratorFactory::Create Link Here
241
    const gpu::GpuDriverBugWorkarounds& workarounds,
243
    const gpu::GpuDriverBugWorkarounds& workarounds,
242
    const gpu::GpuPreferences& gpu_preferences,
244
    const gpu::GpuPreferences& gpu_preferences,
243
    MediaLog* media_log) const {
245
    MediaLog* media_log) const {
246
  LOG(WARNING) << "Initializing VAAPI VDA.";
244
  std::unique_ptr<VideoDecodeAccelerator> decoder;
247
  std::unique_ptr<VideoDecodeAccelerator> decoder;
245
  decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_cb_,
248
  decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_cb_,
246
                                                bind_image_cb_));
249
                                                bind_image_cb_));
(-)dev/media/gpu/ipc/service/gpu_video_decode_accelerator.cc (+2 lines)
Lines 381-386 bool GpuVideoDecodeAccelerator::Initiali Link Here
381
    LOG(ERROR) << "Failed creating the VDA factory";
381
    LOG(ERROR) << "Failed creating the VDA factory";
382
    return false;
382
    return false;
383
  }
383
  }
384
  LOG(WARNING) << "Created the VDA factory";
384
385
385
  const gpu::GpuDriverBugWorkarounds& gpu_workarounds =
386
  const gpu::GpuDriverBugWorkarounds& gpu_workarounds =
386
      stub_->channel()->gpu_channel_manager()->gpu_driver_bug_workarounds();
387
      stub_->channel()->gpu_channel_manager()->gpu_driver_bug_workarounds();
Lines 394-399 bool GpuVideoDecodeAccelerator::Initiali Link Here
394
               << (config.is_encrypted() ? " with encryption" : "");
395
               << (config.is_encrypted() ? " with encryption" : "");
395
    return false;
396
    return false;
396
  }
397
  }
398
  LOG(WARNING) << "Created VDA";
397
399
398
  // Attempt to set up performing decoding tasks on IO thread, if supported by
400
  // Attempt to set up performing decoding tasks on IO thread, if supported by
399
  // the VDA.
401
  // the VDA.
(-)dev/media/gpu/vaapi/vaapi_video_decode_accelerator.cc (+15 lines)
Lines 64-69 void ReportToUMA(VAVDADecoderFailure fai Link Here
64
                            VAVDA_DECODER_FAILURES_MAX + 1);
64
                            VAVDA_DECODER_FAILURES_MAX + 1);
65
}
65
}
66
66
67
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
67
// Returns true if the CPU is an Intel Kaby/Gemini/Sky Lake or later.
68
// Returns true if the CPU is an Intel Kaby/Gemini/Sky Lake or later.
68
// Cpu platform id's are referenced from the following file in kernel source
69
// Cpu platform id's are referenced from the following file in kernel source
69
// arch/x86/include/asm/intel-family.h
70
// arch/x86/include/asm/intel-family.h
Lines 85-90 bool IsGeminiLakeOrLater() { Link Here
85
      cpuid.model() >= kGeminiLakeModelId;
86
      cpuid.model() >= kGeminiLakeModelId;
86
  return is_geminilake_or_later;
87
  return is_geminilake_or_later;
87
}
88
}
89
#endif
88
90
89
}  // namespace
91
}  // namespace
90
92
Lines 634-639 void VaapiVideoDecodeAccelerator::Assign Link Here
634
  const unsigned int va_format = GetVaFormatForVideoCodecProfile(profile_);
636
  const unsigned int va_format = GetVaFormatForVideoCodecProfile(profile_);
635
  std::vector<VASurfaceID> va_surface_ids;
637
  std::vector<VASurfaceID> va_surface_ids;
636
638
639
  // Nvidia doesn't support VAProfileNone, so don't try to create a temporary
640
  // copy buffer there. It's not needed anyways for hardware video decoding
641
  // to work.
642
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
637
  // If we aren't in BufferAllocationMode::kNone, we have to allocate a
643
  // If we aren't in BufferAllocationMode::kNone, we have to allocate a
638
  // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
644
  // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
639
  // internal decoded frame.
645
  // internal decoded frame.
Lines 647-652 void VaapiVideoDecodeAccelerator::Assign Link Here
647
      NotifyError(PLATFORM_FAILURE);
653
      NotifyError(PLATFORM_FAILURE);
648
    }
654
    }
649
  }
655
  }
656
#endif
650
657
651
  for (size_t i = 0; i < buffers.size(); ++i) {
658
  for (size_t i = 0; i < buffers.size(); ++i) {
652
    DCHECK(requested_pic_size_ == buffers[i].size());
659
    DCHECK(requested_pic_size_ == buffers[i].size());
Lines 655-663 void VaapiVideoDecodeAccelerator::Assign Link Here
655
    // only used as a copy destination. Therefore, the VaapiWrapper used and
662
    // only used as a copy destination. Therefore, the VaapiWrapper used and
656
    // owned by |picture| is |vpp_vaapi_wrapper_|.
663
    // owned by |picture| is |vpp_vaapi_wrapper_|.
657
    std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create(
664
    std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create(
665
#if defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
666
            vaapi_wrapper_,
667
#else
658
        (buffer_allocation_mode_ == BufferAllocationMode::kNone)
668
        (buffer_allocation_mode_ == BufferAllocationMode::kNone)
659
            ? vaapi_wrapper_
669
            ? vaapi_wrapper_
660
            : vpp_vaapi_wrapper_,
670
            : vpp_vaapi_wrapper_,
671
#endif
661
        make_context_current_cb_, bind_image_cb_, buffers[i]);
672
        make_context_current_cb_, bind_image_cb_, buffers[i]);
662
    RETURN_AND_NOTIFY_ON_FAILURE(picture, "Failed creating a VaapiPicture",
673
    RETURN_AND_NOTIFY_ON_FAILURE(picture, "Failed creating a VaapiPicture",
663
                                 PLATFORM_FAILURE, );
674
                                 PLATFORM_FAILURE, );
Lines 1070-1075 VaapiVideoDecodeAccelerator::GetSupporte Link Here
1070
1081
1071
VaapiVideoDecodeAccelerator::BufferAllocationMode
1082
VaapiVideoDecodeAccelerator::BufferAllocationMode
1072
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() const {
1083
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() const {
1084
#if defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
1085
  return BufferAllocationMode::kNormal;
1086
#else
1073
  // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
1087
  // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
1074
  // |output_mode_| as well.
1088
  // |output_mode_| as well.
1075
  if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
1089
  if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
Lines 1098-1103 VaapiVideoDecodeAccelerator::DecideBuffe Link Here
1098
    return BufferAllocationMode::kReduced;
1112
    return BufferAllocationMode::kReduced;
1099
1113
1100
  return BufferAllocationMode::kSuperReduced;
1114
  return BufferAllocationMode::kSuperReduced;
1115
#endif
1101
}
1116
}
1102
1117
1103
bool VaapiVideoDecodeAccelerator::IsBufferAllocationModeReducedOrSuperReduced()
1118
bool VaapiVideoDecodeAccelerator::IsBufferAllocationModeReducedOrSuperReduced()
(-)dev/media/gpu/vaapi/vaapi_wrapper.cc (-10 / +23 lines)
Lines 265-270 void VADisplayState::PreSandboxInitializ Link Here
265
      base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
265
      base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
266
  if (drm_file.IsValid())
266
  if (drm_file.IsValid())
267
    VADisplayState::Get()->SetDrmFd(drm_file.GetPlatformFile());
267
    VADisplayState::Get()->SetDrmFd(drm_file.GetPlatformFile());
268
269
  const char kNvidiaPath[] = "/dev/dri/nvidiactl";
270
  base::File nvidia_file = base::File(
271
      base::FilePath::FromUTF8Unsafe(kNvidiaPath),
272
      base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
268
}
273
}
269
274
270
VADisplayState::VADisplayState()
275
VADisplayState::VADisplayState()
Lines 292-300 bool VADisplayState::Initialize() { Link Here
292
}
297
}
293
298
294
bool VADisplayState::InitializeOnce() {
299
bool VADisplayState::InitializeOnce() {
295
  static_assert(VA_MAJOR_VERSION >= 1 && VA_MINOR_VERSION >= 1,
296
                "Requires VA-API >= 1.1.0");
297
298
  switch (gl::GetGLImplementation()) {
300
  switch (gl::GetGLImplementation()) {
299
    case gl::kGLImplementationEGLGLES2:
301
    case gl::kGLImplementationEGLGLES2:
300
      va_display_ = vaGetDisplayDRM(drm_fd_.get());
302
      va_display_ = vaGetDisplayDRM(drm_fd_.get());
Lines 302-311 bool VADisplayState::InitializeOnce() { Link Here
302
    case gl::kGLImplementationDesktopGL:
304
    case gl::kGLImplementationDesktopGL:
303
#if defined(USE_X11)
305
#if defined(USE_X11)
304
      va_display_ = vaGetDisplay(gfx::GetXDisplay());
306
      va_display_ = vaGetDisplay(gfx::GetXDisplay());
305
#else
307
      if (vaDisplayIsValid(va_display_))
306
      LOG(WARNING) << "VAAPI video acceleration not available without "
308
        break;
307
                      "DesktopGL (GLX).";
308
#endif  // USE_X11
309
#endif  // USE_X11
310
      va_display_ = vaGetDisplayDRM(drm_fd_.get());
309
      break;
311
      break;
310
    // Cannot infer platform from GL, try all available displays
312
    // Cannot infer platform from GL, try all available displays
311
    case gl::kGLImplementationNone:
313
    case gl::kGLImplementationNone:
Lines 338-345 bool VADisplayState::InitializeOnce() { Link Here
338
  int major_version, minor_version;
340
  int major_version, minor_version;
339
  VAStatus va_res = vaInitialize(va_display_, &major_version, &minor_version);
341
  VAStatus va_res = vaInitialize(va_display_, &major_version, &minor_version);
340
  if (va_res != VA_STATUS_SUCCESS) {
342
  if (va_res != VA_STATUS_SUCCESS) {
341
    LOG(ERROR) << "vaInitialize failed: " << vaErrorStr(va_res);
343
    LOG(ERROR) << "vaInitialize failed (ignore if using Wayland desktop environment): " << vaErrorStr(va_res);
342
    return false;
344
    va_display_ = vaGetDisplayDRM(drm_fd_.get());
345
    if (!vaDisplayIsValid(va_display_)) {
346
      LOG(ERROR) << "Could not get a valid DRM VA display";
347
      return false;
348
    }
349
    va_res = vaInitialize(va_display_, &major_version, &minor_version);
350
    if (va_res != VA_STATUS_SUCCESS) {
351
      LOG(ERROR) << "vaInitialize failed using DRM: " << vaErrorStr(va_res);
352
      return false;
353
    } else {
354
      LOG(WARNING) << "vaInitialize succeeded for DRM";
355
    }
343
  }
356
  }
344
357
345
  va_initialized_ = true;
358
  va_initialized_ = true;
Lines 347-353 bool VADisplayState::InitializeOnce() { Link Here
347
  va_vendor_string_ = vaQueryVendorString(va_display_);
360
  va_vendor_string_ = vaQueryVendorString(va_display_);
348
  DLOG_IF(WARNING, va_vendor_string_.empty())
361
  DLOG_IF(WARNING, va_vendor_string_.empty())
349
      << "Vendor string empty or error reading.";
362
      << "Vendor string empty or error reading.";
350
  DVLOG(1) << "VAAPI version: " << major_version << "." << minor_version << " "
363
  VLOG(1) << "VAAPI version: " << major_version << "." << minor_version << " "
351
           << va_vendor_string_;
364
           << va_vendor_string_;
352
365
353
  // The VAAPI version is determined from what is loaded on the system by
366
  // The VAAPI version is determined from what is loaded on the system by
Lines 680-686 bool VASupportedProfiles::AreAttribsSupp Link Here
680
    if (attribs[i].type != required_attribs[i].type ||
693
    if (attribs[i].type != required_attribs[i].type ||
681
        (attribs[i].value & required_attribs[i].value) !=
694
        (attribs[i].value & required_attribs[i].value) !=
682
            required_attribs[i].value) {
695
            required_attribs[i].value) {
683
      DVLOG(1) << "Unsupported value " << required_attribs[i].value
696
      VLOG(1) << "Unsupported value " << required_attribs[i].value
684
               << " for attribute type " << required_attribs[i].type;
697
               << " for attribute type " << required_attribs[i].type;
685
      return false;
698
      return false;
686
    }
699
    }

Return to bug 684272