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

Collapse All | Expand All

(-)a/chrome/browser/about_flags.cc (-2 / +17 lines)
Lines 1235-1246 const FeatureEntry kFeatureEntries[] = { Link Here
1235
     flag_descriptions::kEnablePreventLayerSquashingDescription, kOsAll,
1235
     flag_descriptions::kEnablePreventLayerSquashingDescription, kOsAll,
1236
     FEATURE_VALUE_TYPE(features::kEnablePreventLayerSquashing)},
1236
     FEATURE_VALUE_TYPE(features::kEnablePreventLayerSquashing)},
1237
#if BUILDFLAG(ENABLE_WEBRTC)
1237
#if BUILDFLAG(ENABLE_WEBRTC)
1238
#if !defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
1238
    {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
1239
    {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
1239
     flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
1240
     flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
1240
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
1241
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
1241
    {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
1242
    {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
1242
     flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
1243
     flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
1243
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
1244
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
1245
#endif
1244
    {"enable-webrtc-hw-h264-encoding",
1246
    {"enable-webrtc-hw-h264-encoding",
1245
     flag_descriptions::kWebrtcHwH264EncodingName,
1247
     flag_descriptions::kWebrtcHwH264EncodingName,
1246
     flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
1248
     flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
Lines 1524-1529 const FeatureEntry kFeatureEntries[] = { Link Here
1524
     flag_descriptions::kShowTouchHudDescription, kOsCrOS,
1526
     flag_descriptions::kShowTouchHudDescription, kOsCrOS,
1525
     SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
1527
     SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
1526
#endif  // OS_CHROMEOS
1528
#endif  // OS_CHROMEOS
1529
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
1530
    {
1531
        "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
1532
        flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
1533
        SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
1534
    },
1535
#else
1527
    {
1536
    {
1528
        "disable-accelerated-video-decode",
1537
        "disable-accelerated-video-decode",
1529
        flag_descriptions::kAcceleratedVideoDecodeName,
1538
        flag_descriptions::kAcceleratedVideoDecodeName,
Lines 1531-1536 const FeatureEntry kFeatureEntries[] = { Link Here
1531
        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
1540
        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
1532
        SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
1541
        SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
1533
    },
1542
    },
1543
#endif
1534
#if defined(OS_WIN)
1544
#if defined(OS_WIN)
1535
    {"enable-hdr", flag_descriptions::kEnableHDRName,
1545
    {"enable-hdr", flag_descriptions::kEnableHDRName,
1536
     flag_descriptions::kEnableHDRDescription, kOsWin,
1546
     flag_descriptions::kEnableHDRDescription, kOsWin,
Lines 2252-2263 const FeatureEntry kFeatureEntries[] = { Link Here
2252
     FEATURE_VALUE_TYPE(features::kOpenVR)},
2262
     FEATURE_VALUE_TYPE(features::kOpenVR)},
2253
#endif  // ENABLE_OPENVR
2263
#endif  // ENABLE_OPENVR
2254
#endif  // ENABLE_VR
2264
#endif  // ENABLE_VR
2255
#if defined(OS_CHROMEOS)
2265
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
2266
    {"enable-accelerated-mjpeg-decode",
2267
     flag_descriptions::kAcceleratedMjpegDecodeName,
2268
     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
2269
     SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
2270
#elif defined(OS_CHROMEOS)
2256
    {"disable-accelerated-mjpeg-decode",
2271
    {"disable-accelerated-mjpeg-decode",
2257
     flag_descriptions::kAcceleratedMjpegDecodeName,
2272
     flag_descriptions::kAcceleratedMjpegDecodeName,
2258
     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
2273
     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
2259
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
2274
     SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
2260
#endif  // OS_CHROMEOS
2275
#endif
2261
    {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
2276
    {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
2262
     flag_descriptions::kV8CacheOptionsDescription, kOsAll,
2277
     flag_descriptions::kV8CacheOptionsDescription, kOsAll,
2263
     MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
2278
     MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
(-)a/chrome/browser/chromeos/login/chrome_restart_request.cc (-1 / +7 lines)
Lines 19-24 Link Here
19
#include "base/sys_info.h"
19
#include "base/sys_info.h"
20
#include "base/timer/timer.h"
20
#include "base/timer/timer.h"
21
#include "base/values.h"
21
#include "base/values.h"
22
#include "build/build_config.h"
22
#include "cc/base/switches.h"
23
#include "cc/base/switches.h"
23
#include "chrome/browser/browser_process.h"
24
#include "chrome/browser/browser_process.h"
24
#include "chrome/browser/chromeos/boot_times_recorder.h"
25
#include "chrome/browser/chromeos/boot_times_recorder.h"
Lines 84-91 void DeriveCommandLine(const GURL& start_url, Link Here
84
    ::switches::kDisable2dCanvasImageChromium,
85
    ::switches::kDisable2dCanvasImageChromium,
85
    ::switches::kDisableAccelerated2dCanvas,
86
    ::switches::kDisableAccelerated2dCanvas,
86
    ::switches::kDisableAcceleratedJpegDecoding,
87
    ::switches::kDisableAcceleratedJpegDecoding,
88
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
89
    ::switches::kEnableAcceleratedMjpegDecode,
90
    ::switches::kEnableAcceleratedVideo,
91
#else
87
    ::switches::kDisableAcceleratedMjpegDecode,
92
    ::switches::kDisableAcceleratedMjpegDecode,
88
    ::switches::kDisableAcceleratedVideoDecode,
93
    ::switches::kDisableAcceleratedVideoDecode,
94
#endif
89
    ::switches::kDisableBlinkFeatures,
95
    ::switches::kDisableBlinkFeatures,
90
    ::switches::kDisableCastStreamingHWEncoding,
96
    ::switches::kDisableCastStreamingHWEncoding,
91
    ::switches::kDisableDistanceFieldText,
97
    ::switches::kDisableDistanceFieldText,
Lines 163-169 void DeriveCommandLine(const GURL& start_url, Link Here
163
    ::switches::kDisableWebGLImageChromium,
169
    ::switches::kDisableWebGLImageChromium,
164
    ::switches::kEnableWebGLImageChromium,
170
    ::switches::kEnableWebGLImageChromium,
165
    ::switches::kEnableWebVR,
171
    ::switches::kEnableWebVR,
166
#if BUILDFLAG(ENABLE_WEBRTC)
172
#if BUILDFLAG(ENABLE_WEBRTC) && (defined(OS_CHROMEOS) || defined(OS_ANDROID))
167
    ::switches::kDisableWebRtcHWDecoding,
173
    ::switches::kDisableWebRtcHWDecoding,
168
    ::switches::kDisableWebRtcHWEncoding,
174
    ::switches::kDisableWebRtcHWEncoding,
169
#endif
175
#endif
(-)a/chrome/browser/flag_descriptions.cc (-1 / +12 lines)
Lines 14-19 const char kAccelerated2dCanvasDescription[] = Link Here
14
    "Enables the use of the GPU to perform 2d canvas rendering instead of "
14
    "Enables the use of the GPU to perform 2d canvas rendering instead of "
15
    "using software rendering.";
15
    "using software rendering.";
16
16
17
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
18
const char kAcceleratedVideoName[] = "Hardware-accelerated video";
19
const char kAcceleratedVideoDescription[] =
20
    "Hardware-accelerated video where VA-API driver is installed on the"
21
    "system.";
22
#endif
23
17
const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
24
const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
18
const char kAcceleratedVideoDecodeDescription[] =
25
const char kAcceleratedVideoDecodeDescription[] =
19
    "Hardware-accelerated video decode where available.";
26
    "Hardware-accelerated video decode where available.";
Lines 1586-1591 const char kWebrtcEchoCanceller3Name[] = "WebRTC Echo Canceller 3."; Link Here
1586
const char kWebrtcEchoCanceller3Description[] =
1593
const char kWebrtcEchoCanceller3Description[] =
1587
    "Experimental WebRTC echo canceller (AEC3).";
1594
    "Experimental WebRTC echo canceller (AEC3).";
1588
1595
1596
#if !defined(OS_LINUX) || !defined(OS_CHROMEOS)
1589
const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
1597
const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
1590
const char kWebrtcHwDecodingDescription[] =
1598
const char kWebrtcHwDecodingDescription[] =
1591
    "Support in WebRTC for decoding video streams using platform hardware.";
1599
    "Support in WebRTC for decoding video streams using platform hardware.";
Lines 1593-1598 const char kWebrtcHwDecodingDescription[] = Link Here
1593
const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
1601
const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
1594
const char kWebrtcHwEncodingDescription[] =
1602
const char kWebrtcHwEncodingDescription[] =
1595
    "Support in WebRTC for encoding video streams using platform hardware.";
1603
    "Support in WebRTC for encoding video streams using platform hardware.";
1604
#endif
1596
1605
1597
const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
1606
const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
1598
const char kWebrtcHwH264EncodingDescription[] =
1607
const char kWebrtcHwH264EncodingDescription[] =
Lines 2410-2423 const char kTranslateNewUxDescription[] = Link Here
2410
2419
2411
// Chrome OS -------------------------------------------------------------------
2420
// Chrome OS -------------------------------------------------------------------
2412
2421
2413
#if defined(OS_CHROMEOS)
2422
#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
2414
2423
2415
const char kAcceleratedMjpegDecodeName[] =
2424
const char kAcceleratedMjpegDecodeName[] =
2416
    "Hardware-accelerated mjpeg decode for captured frame";
2425
    "Hardware-accelerated mjpeg decode for captured frame";
2417
const char kAcceleratedMjpegDecodeDescription[] =
2426
const char kAcceleratedMjpegDecodeDescription[] =
2418
    "Enable hardware-accelerated mjpeg decode for captured frame where "
2427
    "Enable hardware-accelerated mjpeg decode for captured frame where "
2419
    "available.";
2428
    "available.";
2429
#endif
2420
2430
2431
#if defined(OS_CHROMEOS)
2421
const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
2432
const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
2422
const char kAllowTouchpadThreeFingerClickDescription[] =
2433
const char kAllowTouchpadThreeFingerClickDescription[] =
2423
    "Enables touchpad three-finger-click as middle button.";
2434
    "Enables touchpad three-finger-click as middle button.";
(-)a/chrome/browser/flag_descriptions.h (-3 / +11 lines)
Lines 37-42 namespace flag_descriptions { Link Here
37
extern const char kAccelerated2dCanvasName[];
37
extern const char kAccelerated2dCanvasName[];
38
extern const char kAccelerated2dCanvasDescription[];
38
extern const char kAccelerated2dCanvasDescription[];
39
39
40
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
41
extern const char kAcceleratedVideoName[];
42
extern const char kAcceleratedVideoDescription[];
43
#endif
40
extern const char kAcceleratedVideoDecodeName[];
44
extern const char kAcceleratedVideoDecodeName[];
41
extern const char kAcceleratedVideoDecodeDescription[];
45
extern const char kAcceleratedVideoDecodeDescription[];
42
46
Lines 1487-1499 extern const char kPermissionPromptPersistenceToggleDescription[]; Link Here
1487
1491
1488
#endif  // defined(OS_MACOSX)
1492
#endif  // defined(OS_MACOSX)
1489
1493
1490
// Chrome OS ------------------------------------------------------------------
1494
#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
1491
1492
#if defined(OS_CHROMEOS)
1493
1495
1494
extern const char kAcceleratedMjpegDecodeName[];
1496
extern const char kAcceleratedMjpegDecodeName[];
1495
extern const char kAcceleratedMjpegDecodeDescription[];
1497
extern const char kAcceleratedMjpegDecodeDescription[];
1496
1498
1499
#endif
1500
1501
// Chrome OS ------------------------------------------------------------------
1502
1503
#if defined(OS_CHROMEOS)
1504
1497
extern const char kAllowTouchpadThreeFingerClickName[];
1505
extern const char kAllowTouchpadThreeFingerClickName[];
1498
extern const char kAllowTouchpadThreeFingerClickDescription[];
1506
extern const char kAllowTouchpadThreeFingerClickDescription[];
1499
1507
(-)a/content/browser/gpu/compositor_util.cc (-1 / +1 lines)
Lines 98-104 const GpuFeatureData GetGpuFeatureData(size_t index, bool* eof) { Link Here
98
      {"video_decode",
98
      {"video_decode",
99
       manager->GetFeatureStatus(
99
       manager->GetFeatureStatus(
100
           gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
100
           gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
101
       command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
101
       !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
102
       "Accelerated video decode has been disabled, either via blacklist,"
102
       "Accelerated video decode has been disabled, either via blacklist,"
103
       " about:flags or the command line.",
103
       " about:flags or the command line.",
104
       true},
104
       true},
(-)a/content/browser/gpu/gpu_process_host.cc (-1 / +1 lines)
Lines 120-126 static const char* const kSwitchNames[] = { Link Here
120
    switches::kDisableGLExtensions,
120
    switches::kDisableGLExtensions,
121
    switches::kDisableLogging,
121
    switches::kDisableLogging,
122
    switches::kDisableShaderNameHashing,
122
    switches::kDisableShaderNameHashing,
123
#if BUILDFLAG(ENABLE_WEBRTC)
123
#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_LINUX)
124
    switches::kDisableWebRtcHWEncoding,
124
    switches::kDisableWebRtcHWEncoding,
125
#endif
125
#endif
126
#if defined(OS_WIN)
126
#if defined(OS_WIN)
(-)a/content/browser/renderer_host/media/video_capture_browsertest.cc (+5 lines)
Lines 164-171 class VideoCaptureBrowserTest : public ContentBrowserTest, Link Here
164
      base::CommandLine::ForCurrentProcess()->AppendSwitch(
164
      base::CommandLine::ForCurrentProcess()->AppendSwitch(
165
          switches::kUseFakeJpegDecodeAccelerator);
165
          switches::kUseFakeJpegDecodeAccelerator);
166
    } else {
166
    } else {
167
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
168
      base::CommandLine::ForCurrentProcess()->AppendSwitch(
169
          switches::kEnableAcceleratedMjpegDecode);
170
#else
167
      base::CommandLine::ForCurrentProcess()->AppendSwitch(
171
      base::CommandLine::ForCurrentProcess()->AppendSwitch(
168
          switches::kDisableAcceleratedMjpegDecode);
172
          switches::kDisableAcceleratedMjpegDecode);
173
#endif
169
    }
174
    }
170
  }
175
  }
171
176
(-)a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc (-4 / +10 lines)
Lines 65-79 void VideoCaptureGpuJpegDecoder::Initialize() { Link Here
65
  bool is_platform_supported =
65
  bool is_platform_supported =
66
      base::CommandLine::ForCurrentProcess()->HasSwitch(
66
      base::CommandLine::ForCurrentProcess()->HasSwitch(
67
          switches::kUseFakeJpegDecodeAccelerator);
67
          switches::kUseFakeJpegDecodeAccelerator);
68
#if defined(OS_CHROMEOS)
68
#if !defined(OS_ANDROID) && defined(OS_LINUX)
69
  // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish
69
  // Non-ChromeOS or Non-Linux platforms do not support HW JPEG decode now. Do
70
  // gpu channel to avoid introducing overhead.
70
  // not establish gpu channel to avoid introducing overhead.
71
  is_platform_supported = true;
71
  is_platform_supported = true;
72
#endif
72
#endif
73
73
74
  if (!is_platform_supported ||
74
  if (!is_platform_supported ||
75
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
76
      !base::CommandLine::ForCurrentProcess()->HasSwitch(
77
          switches::kEnableAcceleratedMjpegDecode)
78
#else
75
      base::CommandLine::ForCurrentProcess()->HasSwitch(
79
      base::CommandLine::ForCurrentProcess()->HasSwitch(
76
          switches::kDisableAcceleratedMjpegDecode)) {
80
          switches::kDisableAcceleratedMjpegDecode)
81
#endif
82
          ) {
77
    decoder_status_ = FAILED;
83
    decoder_status_ = FAILED;
78
    RecordInitDecodeUMA_Locked();
84
    RecordInitDecodeUMA_Locked();
79
    return;
85
    return;
(-)a/content/browser/renderer_host/render_process_host_impl.cc (+6 lines)
Lines 2537-2543 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( Link Here
2537
    switches::kDefaultTileHeight,
2537
    switches::kDefaultTileHeight,
2538
    switches::kDisable2dCanvasImageChromium,
2538
    switches::kDisable2dCanvasImageChromium,
2539
    switches::kDisableAcceleratedJpegDecoding,
2539
    switches::kDisableAcceleratedJpegDecoding,
2540
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
2541
    switches::kEnableAcceleratedVideo,
2542
#else
2540
    switches::kDisableAcceleratedVideoDecode,
2543
    switches::kDisableAcceleratedVideoDecode,
2544
#endif
2541
    switches::kDisableBackgroundTimerThrottling,
2545
    switches::kDisableBackgroundTimerThrottling,
2542
    switches::kDisableBreakpad,
2546
    switches::kDisableBreakpad,
2543
    switches::kDisableCompositorUkmForTests,
2547
    switches::kDisableCompositorUkmForTests,
Lines 2682-2689 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( Link Here
2682
    switches::kDisableMojoRenderer,
2686
    switches::kDisableMojoRenderer,
2683
#endif
2687
#endif
2684
#if BUILDFLAG(ENABLE_WEBRTC)
2688
#if BUILDFLAG(ENABLE_WEBRTC)
2689
#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
2685
    switches::kDisableWebRtcHWDecoding,
2690
    switches::kDisableWebRtcHWDecoding,
2686
    switches::kDisableWebRtcHWEncoding,
2691
    switches::kDisableWebRtcHWEncoding,
2692
#endif
2687
    switches::kEnableWebRtcSrtpAesGcm,
2693
    switches::kEnableWebRtcSrtpAesGcm,
2688
    switches::kEnableWebRtcSrtpEncryptedHeaders,
2694
    switches::kEnableWebRtcSrtpEncryptedHeaders,
2689
    switches::kEnableWebRtcStunOrigin,
2695
    switches::kEnableWebRtcStunOrigin,
(-)a/content/browser/webrtc/webrtc_media_recorder_browsertest.cc (-1 / +6 lines)
Lines 58-64 class WebRtcMediaRecorderTest Link Here
58
      return;
58
      return;
59
    // This flag is also used for encoding, https://crbug.com/616640.
59
    // This flag is also used for encoding, https://crbug.com/616640.
60
    base::CommandLine::ForCurrentProcess()->AppendSwitch(
60
    base::CommandLine::ForCurrentProcess()->AppendSwitch(
61
        switches::kDisableAcceleratedVideoDecode);
61
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
62
        switches::kEnableAcceleratedVideo
63
#else
64
        switches::kDisableAcceleratedVideoDecode
65
#endif
66
        );
62
  }
67
  }
63
68
64
 private:
69
 private:
(-)a/content/gpu/BUILD.gn (-1 / +14 lines)
Lines 8-13 import("//gpu/vulkan/features.gni") Link Here
8
import("//media/media_options.gni")
8
import("//media/media_options.gni")
9
import("//ui/ozone/ozone.gni")
9
import("//ui/ozone/ozone.gni")
10
10
11
# Unfortunately, using public_configs from media/gpu breaks unbundling
12
import("//media/gpu/args.gni")
13
if (is_desktop_linux && use_vaapi) {
14
  import("//build/config/linux/pkg_config.gni")
15
16
  pkg_config("libva_config") {
17
    packages = [ "libva" ]
18
  }
19
}
20
11
# See //content/BUILD.gn for how this works.
21
# See //content/BUILD.gn for how this works.
12
group("gpu") {
22
group("gpu") {
13
  visibility = [ "//content/*" ]  # This is an internal content API.
23
  visibility = [ "//content/*" ]  # This is an internal content API.
Lines 49-55 target(link_target_type, "gpu_sources") { Link Here
49
  ]
59
  ]
50
60
51
  configs += [ "//content:content_implementation" ]
61
  configs += [ "//content:content_implementation" ]
52
53
  deps = [
62
  deps = [
54
    "//base",
63
    "//base",
55
    "//base/third_party/dynamic_annotations",
64
    "//base/third_party/dynamic_annotations",
Lines 125-128 target(link_target_type, "gpu_sources") { Link Here
125
  if (is_desktop_linux && (!is_chromecast || is_cast_desktop_build)) {
134
  if (is_desktop_linux && (!is_chromecast || is_cast_desktop_build)) {
126
    configs += [ "//build/config/linux/dri" ]
135
    configs += [ "//build/config/linux/dri" ]
127
  }
136
  }
137
138
  if (is_desktop_linux) {
139
    public_configs = [ ":libva_config" ]
140
  }
128
}
141
}
(-)a/content/gpu/gpu_main.cc (-4 / +2 lines)
Lines 277-283 int GpuMain(const MainFunctionParams& parameters) { Link Here
277
  // Initializes StatisticsRecorder which tracks UMA histograms.
277
  // Initializes StatisticsRecorder which tracks UMA histograms.
278
  base::StatisticsRecorder::Initialize();
278
  base::StatisticsRecorder::Initialize();
279
279
280
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
280
#if defined(OS_LINUX)
281
  // Set thread priority before sandbox initialization.
281
  // Set thread priority before sandbox initialization.
282
  base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
282
  base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
283
#endif
283
#endif
Lines 306-312 int GpuMain(const MainFunctionParams& parameters) { Link Here
306
  GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
306
  GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
307
307
308
  base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
308
  base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
309
#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
309
#if defined(OS_LINUX)
310
  io_thread_priority = base::ThreadPriority::DISPLAY;
310
  io_thread_priority = base::ThreadPriority::DISPLAY;
311
#endif
311
#endif
312
312
Lines 366-375 bool StartSandboxLinux(gpu::GpuWatchdogThread* watchdog_thread, Link Here
366
  sandbox_options.accelerated_video_decode_enabled =
366
  sandbox_options.accelerated_video_decode_enabled =
367
      !gpu_prefs.disable_accelerated_video_decode;
367
      !gpu_prefs.disable_accelerated_video_decode;
368
368
369
#if defined(OS_CHROMEOS)
370
  sandbox_options.vaapi_accelerated_video_encode_enabled =
369
  sandbox_options.vaapi_accelerated_video_encode_enabled =
371
      !gpu_prefs.disable_vaapi_accelerated_video_encode;
370
      !gpu_prefs.disable_vaapi_accelerated_video_encode;
372
#endif
373
371
374
  bool res = service_manager::SandboxLinux::GetInstance()->InitializeSandbox(
372
  bool res = service_manager::SandboxLinux::GetInstance()->InitializeSandbox(
375
      service_manager::SandboxTypeFromCommandLine(
373
      service_manager::SandboxTypeFromCommandLine(
(-)a/content/gpu/gpu_sandbox_hook_linux.cc (-3 lines)
Lines 269-275 void LoadStandardLibraries( Link Here
269
      if (IsLibVAVersion2()) {
269
      if (IsLibVAVersion2()) {
270
        if (IsArchitectureX86_64()) {
270
        if (IsArchitectureX86_64()) {
271
          dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag);
271
          dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag);
272
          dlopen("/usr/lib64/va/drivers/hybrid_drv_video.so", dlopen_flag);
273
        } else if (IsArchitectureI386()) {
272
        } else if (IsArchitectureI386()) {
274
          dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag);
273
          dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag);
275
        }
274
        }
Lines 287-294 void LoadStandardLibraries( Link Here
287
        if (IsArchitectureX86_64()) {
286
        if (IsArchitectureX86_64()) {
288
          if (!dlopen("/usr/lib64/va1/drivers/i965_drv_video.so", dlopen_flag))
287
          if (!dlopen("/usr/lib64/va1/drivers/i965_drv_video.so", dlopen_flag))
289
            dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag);
288
            dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag);
290
          if (!dlopen("/usr/lib64/va1/drivers/hybrid_drv_video.so", dlopen_flag))
291
            dlopen("/usr/lib64/va/drivers/hybrid_drv_video.so", dlopen_flag);
292
        } else if (IsArchitectureI386()) {
289
        } else if (IsArchitectureI386()) {
293
          if (!dlopen("/usr/lib/va1/drivers/i965_drv_video.so", dlopen_flag))
290
          if (!dlopen("/usr/lib/va1/drivers/i965_drv_video.so", dlopen_flag))
294
            dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag);
291
            dlopen("/usr/lib/va/drivers/i965_drv_video.so", dlopen_flag);
(-)a/content/public/browser/gpu_utils.cc (-2 / +10 lines)
Lines 7-12 Link Here
7
#include "base/command_line.h"
7
#include "base/command_line.h"
8
#include "base/single_thread_task_runner.h"
8
#include "base/single_thread_task_runner.h"
9
#include "base/strings/string_number_conversions.h"
9
#include "base/strings/string_number_conversions.h"
10
#include "build/build_config.h"
10
#include "content/browser/gpu/gpu_process_host.h"
11
#include "content/browser/gpu/gpu_process_host.h"
11
#include "content/public/common/content_features.h"
12
#include "content/public/common/content_features.h"
12
#include "content/public/common/content_switches.h"
13
#include "content/public/common/content_switches.h"
Lines 55-66 const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() { Link Here
55
  gpu_preferences.in_process_gpu =
56
  gpu_preferences.in_process_gpu =
56
      command_line->HasSwitch(switches::kInProcessGPU);
57
      command_line->HasSwitch(switches::kInProcessGPU);
57
  gpu_preferences.disable_accelerated_video_decode =
58
  gpu_preferences.disable_accelerated_video_decode =
59
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
60
      !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
61
#else
58
      command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
62
      command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
59
#if defined(OS_CHROMEOS)
63
#endif
64
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
65
  gpu_preferences.disable_vaapi_accelerated_video_encode =
66
      !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
67
#elif defined(OS_CHROMEOS)
60
  gpu_preferences.disable_vaapi_accelerated_video_encode =
68
  gpu_preferences.disable_vaapi_accelerated_video_encode =
61
      command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
69
      command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode);
62
#endif
70
#endif
63
#if BUILDFLAG(ENABLE_WEBRTC)
71
#if BUILDFLAG(ENABLE_WEBRTC) && (!defined(OS_LINUX) || defined(OS_CHROMEOS))
64
  gpu_preferences.disable_web_rtc_hw_encoding =
72
  gpu_preferences.disable_web_rtc_hw_encoding =
65
      command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
73
      command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
66
#endif
74
#endif
(-)a/content/public/common/content_switches.cc (-1 / +12 lines)
Lines 78-89 const char kDisable3DAPIs[] = "disable-3d-apis"; Link Here
78
78
79
// Disable gpu-accelerated 2d canvas.
79
// Disable gpu-accelerated 2d canvas.
80
const char kDisableAccelerated2dCanvas[]    = "disable-accelerated-2d-canvas";
80
const char kDisableAccelerated2dCanvas[]    = "disable-accelerated-2d-canvas";
81
81
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
82
// Enable hardware accelerated mjpeg decode on linux
83
const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
84
#else
82
// Disable hardware acceleration of mjpeg decode for captured frame, where
85
// Disable hardware acceleration of mjpeg decode for captured frame, where
83
// available.
86
// available.
84
const char kDisableAcceleratedMjpegDecode[] =
87
const char kDisableAcceleratedMjpegDecode[] =
85
    "disable-accelerated-mjpeg-decode";
88
    "disable-accelerated-mjpeg-decode";
89
#endif
86
90
91
#if defined(OS_LINUX)
92
// Enables hardware acceleration of video for Linux only. VA-API driver
93
// is required to be present on the system installation.
94
const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
95
#endif
87
// Disables hardware acceleration of video decode, where available.
96
// Disables hardware acceleration of video decode, where available.
88
const char kDisableAcceleratedVideoDecode[] =
97
const char kDisableAcceleratedVideoDecode[] =
89
    "disable-accelerated-video-decode";
98
    "disable-accelerated-video-decode";
Lines 886-896 const char kZygoteProcess[] = "zygote"; Link Here
886
// ignores this switch on its stable and beta channels.
895
// ignores this switch on its stable and beta channels.
887
const char kDisableWebRtcEncryption[]      = "disable-webrtc-encryption";
896
const char kDisableWebRtcEncryption[]      = "disable-webrtc-encryption";
888
897
898
#if defined(OS_CHROMEOS)
889
// Disables HW decode acceleration for WebRTC.
899
// Disables HW decode acceleration for WebRTC.
890
const char kDisableWebRtcHWDecoding[]       = "disable-webrtc-hw-decoding";
900
const char kDisableWebRtcHWDecoding[]       = "disable-webrtc-hw-decoding";
891
901
892
// Disables HW encode acceleration for WebRTC.
902
// Disables HW encode acceleration for WebRTC.
893
const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
903
const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
904
#endif
894
905
895
// Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
906
// Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
896
// See https://tools.ietf.org/html/rfc7714 for further information.
907
// See https://tools.ietf.org/html/rfc7714 for further information.
(-)a/content/public/common/content_switches.h (+9 lines)
Lines 33-39 CONTENT_EXPORT extern const char kDisable2dCanvasImageChromium[]; Link Here
33
CONTENT_EXPORT extern const char kDisable3DAPIs[];
33
CONTENT_EXPORT extern const char kDisable3DAPIs[];
34
CONTENT_EXPORT extern const char kDisableAccelerated2dCanvas[];
34
CONTENT_EXPORT extern const char kDisableAccelerated2dCanvas[];
35
CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
35
CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
36
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
37
CONTENT_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
38
#else
36
CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
39
CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
40
#endif
37
CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
41
CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
38
CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[];
42
CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[];
39
extern const char kDisableBackingStoreLimit[];
43
extern const char kDisableBackingStoreLimit[];
Lines 106-111 CONTENT_EXPORT extern const char kDisableZeroCopyDxgiVideo[]; Link Here
106
CONTENT_EXPORT extern const char kDomAutomationController[];
110
CONTENT_EXPORT extern const char kDomAutomationController[];
107
extern const char kDisable2dCanvasClipAntialiasing[];
111
extern const char kDisable2dCanvasClipAntialiasing[];
108
CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
112
CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
113
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
114
CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
115
#endif
109
CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
116
CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
110
CONTENT_EXPORT extern const char kEnableAutomation[];
117
CONTENT_EXPORT extern const char kEnableAutomation[];
111
CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[];
118
CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[];
Lines 244-251 CONTENT_EXPORT extern const char kZygoteProcess[]; Link Here
244
251
245
#if BUILDFLAG(ENABLE_WEBRTC)
252
#if BUILDFLAG(ENABLE_WEBRTC)
246
CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
253
CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
254
#if defined(OS_CHROMEOS)
247
CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
255
CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
248
CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
256
CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
257
#endif
249
CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
258
CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
250
CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
259
CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
251
CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
260
CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
(-)a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc (-1 / +10 lines)
Lines 244-253 void PeerConnectionDependencyFactory::InitializeSignalingThread( Link Here
244
244
245
  const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
245
  const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
246
  if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
246
  if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
247
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
248
    if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
249
#else
247
    if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
250
    if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
251
#endif
248
      decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
252
      decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
249
253
250
    if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
254
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
255
    if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
256
#else
257
    if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
258
#endif
259
    {
251
      encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
260
      encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
252
    }
261
    }
253
  }
262
  }
(-)a/gpu/config/software_rendering_list.json (-11 lines)
Lines 372-388 Link Here
372
        "all"
372
        "all"
373
      ]
373
      ]
374
    },
374
    },
375
    {
376
      "id": 48,
377
      "description": "Accelerated video decode is unavailable on Linux",
378
      "cr_bugs": [137247],
379
      "os": {
380
        "type": "linux"
381
      },
382
      "features": [
383
        "accelerated_video_decode"
384
      ]
385
    },
386
    {
375
    {
387
      "id": 50,
376
      "id": 50,
388
      "description": "Disable VMware software renderer on older Mesa",
377
      "description": "Disable VMware software renderer on older Mesa",
(-)a/media/gpu/BUILD.gn (+11 lines)
Lines 24-29 if (is_mac) { Link Here
24
  import("//build/config/mac/mac_sdk.gni")
24
  import("//build/config/mac/mac_sdk.gni")
25
}
25
}
26
26
27
if (is_desktop_linux && use_vaapi) {
28
  import("//build/config/linux/pkg_config.gni")
29
30
  pkg_config("libva_config") {
31
    packages = [ "libva" ]
32
  }
33
}
34
27
if (use_vaapi) {
35
if (use_vaapi) {
28
  action("libva_generate_stubs") {
36
  action("libva_generate_stubs") {
29
    extra_header = "vaapi/va_stub_header.fragment"
37
    extra_header = "vaapi/va_stub_header.fragment"
Lines 302-307 component("gpu") { Link Here
302
        "v4l2/tegra_v4l2_device.h",
310
        "v4l2/tegra_v4l2_device.h",
303
      ]
311
      ]
304
    }
312
    }
313
    if (is_desktop_linux) {
314
      public_configs = [ ":libva_config" ]
315
    }
305
  }
316
  }
306
317
307
  if (use_vaapi) {
318
  if (use_vaapi) {
(-)a/media/gpu/gpu_video_decode_accelerator_factory.cc (+1 lines)
Lines 86-91 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities( Link Here
86
// profile (instead of calculating a superset).
86
// profile (instead of calculating a superset).
87
// TODO(posciak,henryhsu): improve this so that we choose a superset of
87
// TODO(posciak,henryhsu): improve this so that we choose a superset of
88
// resolutions and other supported profile parameters.
88
// resolutions and other supported profile parameters.
89
  DVLOG(1) << "Get Supported profiles";
89
#if defined(OS_WIN)
90
#if defined(OS_WIN)
90
  capabilities.supported_profiles =
91
  capabilities.supported_profiles =
91
      DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences,
92
      DXVAVideoDecodeAccelerator::GetSupportedProfiles(gpu_preferences,
(-)a/media/gpu/vaapi/vaapi_wrapper.cc (-5 / +1 lines)
Lines 207-217 bool VADisplayState::PostSandboxInitialization() { Link Here
207
207
208
  paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
208
  paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
209
  paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
209
  paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
210
#if defined(USE_X11)
210
  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
211
  // libva-x11 does not exist on libva >= 2
212
  if (VA_MAJOR_VERSION == 0)
213
    paths[kModuleVa_x11].push_back("libva-x11.so.1");
214
#endif
215
211
216
  const bool success = InitializeStubs(paths);
212
  const bool success = InitializeStubs(paths);
217
  if (!success) {
213
  if (!success) {

Return to bug 633332