- Up to 66.0.3359.81 - Bump to 66.0.3359.66 - Update chromium-gcc7.patch to include more quirks - Bump to 66.0.3359.45 - Bump to 66.0.3359.33 - Version bump to 66.0.3359.26 - Bump the requirement for the clang version - Conditionalize harfbuzz switch - Update to 66.0.3359.22 - Apply patches using %autopatch - Add patch to build with gcc7 properly chromium-gcc7.patch - Drop patch chromium-sandbox-pie.patch as we have pie default now - Add patch to build with leap variant of drm chromium-drm.patch - Add patch to build ffmpeg from system chromium-ffmpeg.patch - Up to 66.0.3355.0 - Disable clang by default again - Up to 66.0.3350.0 - Drop patch fix_network_api_crash.patch - Bump to 66.0.3343.3 - Bump to 65.0.3325.51 - Disable gconf support - Bump to 65.0.3325.31 - Update to 65.0.3325.18 - Try to have automatic ozone platform detection OBS-URL: https://build.opensuse.org/request/show/597716 OBS-URL: https://build.opensuse.org/package/show/network:chromium/chromium?expand=0&rev=1114
		
			
				
	
	
		
			578 lines
		
	
	
		
			26 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			578 lines
		
	
	
		
			26 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From d9ef948bf4a739f95acbd98ef88b04caa29d8dda Mon Sep 17 00:00:00 2001
 | |
| From: Daniel Charles <daniel.charles@intel.com>
 | |
| Date: Fri, 09 Feb 2018 14:39:27 -0800
 | |
| Subject: [PATCH] Enable VAVDA, VAVEA and VAJDA on linux with VAAPI only
 | |
| 
 | |
| This patch contains all the changes necessary to use VA-API along with
 | |
| vaapi-driver to run all media use cases supported with hardware acceleration.
 | |
| 
 | |
| It is intended to remain as experimental accessible from chrome://flags on linux.
 | |
| It requires libva/intel-vaapi-driver to be installed on the system path where
 | |
| chrome is executed.  Other drivers could be tested if available. Flags are
 | |
| kept independent for linux, where this feature has to be enabled before
 | |
| actually using it.  This should not change how other OSes use the flags
 | |
| already, the new flags will show at the buttom on the section of unavailable
 | |
| experiments
 | |
| 
 | |
| The changes cover a range of compiler pre-processor flags to enable the stack.
 | |
| It moves the presandbox operations to the vaapi_wrapper class as the hook function
 | |
| is available there. vaInit will open driver on the correct installed folder.
 | |
| 
 | |
| chrome flags consolidtation into only two flags for linux.  Mjpeg and accelerated
 | |
| video are used.  The other flags are kept for ChromeOS and other OSes.
 | |
| 
 | |
| Developer testing was made on skylake hardware, ChromeOS and Ubuntu.
 | |
| 
 | |
| BUG=NONE
 | |
| TEST=subjective testing with VAVDA,VAVEA and VAJDA, autotest for encoder
 | |
|      and decoder hardware accelerated
 | |
|      have libva/intel-vaapi-driver installed and not installed in the system
 | |
|      repeat on different hardware families
 | |
| 
 | |
| Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
 | |
| Change-Id: Ifbbf5c9e5221a8b5733fc6d4d0cf984a1f103171
 | |
| Signed-off-by: Daniel Charles <daniel.charles@intel.com>
 | |
| ---
 | |
| 
 | |
| Index: chromium-66.0.3359.81/chrome/browser/about_flags.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/chrome/browser/about_flags.cc
 | |
| +++ chromium-66.0.3359.81/chrome/browser/about_flags.cc
 | |
| @@ -1234,12 +1234,14 @@ const FeatureEntry kFeatureEntries[] = {
 | |
|       flag_descriptions::kUiPartialSwapDescription, kOsAll,
 | |
|       SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
 | |
|  #if BUILDFLAG(ENABLE_WEBRTC)
 | |
| +#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
 | |
|      {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
 | |
|       flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
 | |
|       SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
 | |
|      {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
 | |
|       flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
 | |
|       SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
 | |
| +#endif
 | |
|      {"enable-webrtc-hw-h264-encoding",
 | |
|       flag_descriptions::kWebrtcHwH264EncodingName,
 | |
|       flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
 | |
| @@ -1553,6 +1555,13 @@ const FeatureEntry kFeatureEntries[] = {
 | |
|       flag_descriptions::kShowTouchHudDescription, kOsCrOS,
 | |
|       SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
 | |
|  #endif  // OS_CHROMEOS
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +    {
 | |
| +        "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
 | |
| +        flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
 | |
| +        SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
 | |
| +    },
 | |
| +#else
 | |
|      {
 | |
|          "disable-accelerated-video-decode",
 | |
|          flag_descriptions::kAcceleratedVideoDecodeName,
 | |
| @@ -1560,6 +1569,7 @@ const FeatureEntry kFeatureEntries[] = {
 | |
|          kOsMac | kOsWin | kOsCrOS | kOsAndroid,
 | |
|          SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
 | |
|      },
 | |
| +#endif
 | |
|  #if defined(OS_WIN)
 | |
|      {"enable-hdr", flag_descriptions::kEnableHDRName,
 | |
|       flag_descriptions::kEnableHDRDescription, kOsWin,
 | |
| @@ -2280,12 +2290,17 @@ const FeatureEntry kFeatureEntries[] = {
 | |
|       FEATURE_VALUE_TYPE(features::kOpenVR)},
 | |
|  #endif  // ENABLE_OPENVR
 | |
|  #endif  // ENABLE_VR
 | |
| -#if defined(OS_CHROMEOS)
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +    {"enable-accelerated-mjpeg-decode",
 | |
| +     flag_descriptions::kAcceleratedMjpegDecodeName,
 | |
| +     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
 | |
| +     SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
 | |
| +#elif defined(OS_CHROMEOS)
 | |
|      {"disable-accelerated-mjpeg-decode",
 | |
|       flag_descriptions::kAcceleratedMjpegDecodeName,
 | |
|       flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
 | |
|       SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
 | |
| -#endif  // OS_CHROMEOS
 | |
| +#endif
 | |
|      {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
 | |
|       flag_descriptions::kV8CacheOptionsDescription, kOsAll,
 | |
|       MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
 | |
| Index: chromium-66.0.3359.81/chrome/browser/chromeos/login/chrome_restart_request.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/chrome/browser/chromeos/login/chrome_restart_request.cc
 | |
| +++ chromium-66.0.3359.81/chrome/browser/chromeos/login/chrome_restart_request.cc
 | |
| @@ -19,6 +19,7 @@
 | |
|  #include "base/sys_info.h"
 | |
|  #include "base/timer/timer.h"
 | |
|  #include "base/values.h"
 | |
| +#include "build/build_config.h"
 | |
|  #include "cc/base/switches.h"
 | |
|  #include "chrome/browser/browser_process.h"
 | |
|  #include "chrome/browser/chromeos/boot_times_recorder.h"
 | |
| @@ -84,9 +85,14 @@ void DeriveCommandLine(const GURL& start
 | |
|      ::switches::kDisable2dCanvasImageChromium,
 | |
|      ::switches::kDisableAccelerated2dCanvas,
 | |
|      ::switches::kDisableAcceleratedJpegDecoding,
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +    ::switches::kEnableAcceleratedMjpegDecode,
 | |
| +    ::switches::kEnableAcceleratedVideo,
 | |
| +#else
 | |
|      ::switches::kDisableAcceleratedMjpegDecode,
 | |
|      ::switches::kDisableAcceleratedVideoDecode,
 | |
|      ::switches::kDisableAcceleratedVideoEncode,
 | |
| +#endif
 | |
|      ::switches::kDisableBlinkFeatures,
 | |
|      ::switches::kDisableCastStreamingHWEncoding,
 | |
|      ::switches::kDisableDistanceFieldText,
 | |
| @@ -163,7 +169,7 @@ void DeriveCommandLine(const GURL& start
 | |
|      ::switches::kDisableWebGLImageChromium,
 | |
|      ::switches::kEnableWebGLImageChromium,
 | |
|      ::switches::kEnableWebVR,
 | |
| -#if BUILDFLAG(ENABLE_WEBRTC)
 | |
| +#if BUILDFLAG(ENABLE_WEBRTC) && (defined(OS_CHROMEOS) || defined(OS_ANDROID))
 | |
|      ::switches::kDisableWebRtcHWDecoding,
 | |
|      ::switches::kDisableWebRtcHWEncoding,
 | |
|  #endif
 | |
| Index: chromium-66.0.3359.81/chrome/browser/flag_descriptions.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/chrome/browser/flag_descriptions.cc
 | |
| +++ chromium-66.0.3359.81/chrome/browser/flag_descriptions.cc
 | |
| @@ -14,6 +14,13 @@ const char kAccelerated2dCanvasDescripti
 | |
|      "Enables the use of the GPU to perform 2d canvas rendering instead of "
 | |
|      "using software rendering.";
 | |
|  
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +const char kAcceleratedVideoName[] = "Hardware-accelerated video";
 | |
| +const char kAcceleratedVideoDescription[] =
 | |
| +    "Hardware-accelerated video where VA-API driver is installed on the"
 | |
| +    "system.";
 | |
| +#endif
 | |
| +
 | |
|  const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
 | |
|  const char kAcceleratedVideoDecodeDescription[] =
 | |
|      "Hardware-accelerated video decode where available.";
 | |
| @@ -1723,6 +1730,7 @@ const char kWebrtcEchoCanceller3Name[] =
 | |
|  const char kWebrtcEchoCanceller3Description[] =
 | |
|      "Experimental WebRTC echo canceller (AEC3).";
 | |
|  
 | |
| +#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
 | |
|  const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
 | |
|  const char kWebrtcHwDecodingDescription[] =
 | |
|      "Support in WebRTC for decoding video streams using platform hardware.";
 | |
| @@ -1730,6 +1738,7 @@ const char kWebrtcHwDecodingDescription[
 | |
|  const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
 | |
|  const char kWebrtcHwEncodingDescription[] =
 | |
|      "Support in WebRTC for encoding video streams using platform hardware.";
 | |
| +#endif
 | |
|  
 | |
|  const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
 | |
|  const char kWebrtcHwH264EncodingDescription[] =
 | |
| @@ -2549,14 +2558,16 @@ const char kTabStripKeyboardFocusDescrip
 | |
|  
 | |
|  // Chrome OS -------------------------------------------------------------------
 | |
|  
 | |
| -#if defined(OS_CHROMEOS)
 | |
| +#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
 | |
|  
 | |
|  const char kAcceleratedMjpegDecodeName[] =
 | |
|      "Hardware-accelerated mjpeg decode for captured frame";
 | |
|  const char kAcceleratedMjpegDecodeDescription[] =
 | |
|      "Enable hardware-accelerated mjpeg decode for captured frame where "
 | |
|      "available.";
 | |
| +#endif
 | |
|  
 | |
| +#if defined(OS_CHROMEOS)
 | |
|  const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
 | |
|  const char kAllowTouchpadThreeFingerClickDescription[] =
 | |
|      "Enables touchpad three-finger-click as middle button.";
 | |
| Index: chromium-66.0.3359.81/chrome/browser/flag_descriptions.h
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/chrome/browser/flag_descriptions.h
 | |
| +++ chromium-66.0.3359.81/chrome/browser/flag_descriptions.h
 | |
| @@ -37,6 +37,10 @@ namespace flag_descriptions {
 | |
|  extern const char kAccelerated2dCanvasName[];
 | |
|  extern const char kAccelerated2dCanvasDescription[];
 | |
|  
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +extern const char kAcceleratedVideoName[];
 | |
| +extern const char kAcceleratedVideoDescription[];
 | |
| +#endif
 | |
|  extern const char kAcceleratedVideoDecodeName[];
 | |
|  extern const char kAcceleratedVideoDecodeDescription[];
 | |
|  
 | |
| @@ -1561,13 +1565,17 @@ extern const char kPermissionPromptPersi
 | |
|  
 | |
|  #endif  // defined(OS_MACOSX)
 | |
|  
 | |
| -// Chrome OS ------------------------------------------------------------------
 | |
| -
 | |
| -#if defined(OS_CHROMEOS)
 | |
| +#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
 | |
|  
 | |
|  extern const char kAcceleratedMjpegDecodeName[];
 | |
|  extern const char kAcceleratedMjpegDecodeDescription[];
 | |
|  
 | |
| +#endif
 | |
| +
 | |
| +// Chrome OS ------------------------------------------------------------------
 | |
| +
 | |
| +#if defined(OS_CHROMEOS)
 | |
| +
 | |
|  extern const char kAllowTouchpadThreeFingerClickName[];
 | |
|  extern const char kAllowTouchpadThreeFingerClickDescription[];
 | |
|  
 | |
| Index: chromium-66.0.3359.81/content/browser/gpu/compositor_util.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/gpu/compositor_util.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/gpu/compositor_util.cc
 | |
| @@ -99,7 +99,11 @@ const GpuFeatureData GetGpuFeatureData(s
 | |
|        {"video_decode",
 | |
|         manager->GetFeatureStatus(
 | |
|             gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +       !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
 | |
| +#else
 | |
|         command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
 | |
| +#endif
 | |
|         "Accelerated video decode has been disabled, either via blacklist,"
 | |
|         " about:flags or the command line.",
 | |
|         true},
 | |
| Index: chromium-66.0.3359.81/content/browser/gpu/gpu_process_host.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/gpu/gpu_process_host.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/gpu/gpu_process_host.cc
 | |
| @@ -132,7 +132,7 @@ static const char* const kSwitchNames[]
 | |
|      switches::kDisableGLExtensions,
 | |
|      switches::kDisableLogging,
 | |
|      switches::kDisableShaderNameHashing,
 | |
| -#if BUILDFLAG(ENABLE_WEBRTC)
 | |
| +#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_LINUX)
 | |
|      switches::kDisableWebRtcHWEncoding,
 | |
|  #endif
 | |
|  #if defined(OS_WIN)
 | |
| Index: chromium-66.0.3359.81/content/browser/renderer_host/media/video_capture_browsertest.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/renderer_host/media/video_capture_browsertest.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/renderer_host/media/video_capture_browsertest.cc
 | |
| @@ -163,8 +163,13 @@ class VideoCaptureBrowserTest : public C
 | |
|        base::CommandLine::ForCurrentProcess()->AppendSwitch(
 | |
|            switches::kUseFakeJpegDecodeAccelerator);
 | |
|      } else {
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +      base::CommandLine::ForCurrentProcess()->AppendSwitch(
 | |
| +          switches::kEnableAcceleratedMjpegDecode);
 | |
| +#else
 | |
|        base::CommandLine::ForCurrentProcess()->AppendSwitch(
 | |
|            switches::kDisableAcceleratedMjpegDecode);
 | |
| +#endif
 | |
|      }
 | |
|    }
 | |
|  
 | |
| Index: chromium-66.0.3359.81/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
 | |
| @@ -65,15 +65,21 @@ void VideoCaptureGpuJpegDecoder::Initial
 | |
|    bool is_platform_supported =
 | |
|        base::CommandLine::ForCurrentProcess()->HasSwitch(
 | |
|            switches::kUseFakeJpegDecodeAccelerator);
 | |
| -#if defined(OS_CHROMEOS)
 | |
| -  // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish
 | |
| -  // gpu channel to avoid introducing overhead.
 | |
| +#if !defined(OS_ANDROID) && defined(OS_LINUX)
 | |
| +  // Non-ChromeOS or Non-Linux platforms do not support HW JPEG decode now. Do
 | |
| +  // not establish gpu channel to avoid introducing overhead.
 | |
|    is_platform_supported = true;
 | |
|  #endif
 | |
|  
 | |
|    if (!is_platform_supported ||
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +      !base::CommandLine::ForCurrentProcess()->HasSwitch(
 | |
| +          switches::kEnableAcceleratedMjpegDecode)
 | |
| +#else
 | |
|        base::CommandLine::ForCurrentProcess()->HasSwitch(
 | |
| -          switches::kDisableAcceleratedMjpegDecode)) {
 | |
| +          switches::kDisableAcceleratedMjpegDecode)
 | |
| +#endif
 | |
| +          ) {
 | |
|      decoder_status_ = FAILED;
 | |
|      RecordInitDecodeUMA_Locked();
 | |
|      return;
 | |
| Index: chromium-66.0.3359.81/content/browser/renderer_host/render_process_host_impl.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/renderer_host/render_process_host_impl.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/renderer_host/render_process_host_impl.cc
 | |
| @@ -2524,7 +2524,11 @@ void RenderProcessHostImpl::PropagateBro
 | |
|      switches::kDefaultTileHeight,
 | |
|      switches::kDisable2dCanvasImageChromium,
 | |
|      switches::kDisableAcceleratedJpegDecoding,
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +    switches::kEnableAcceleratedVideo,
 | |
| +#else
 | |
|      switches::kDisableAcceleratedVideoDecode,
 | |
| +#endif
 | |
|      switches::kDisableBackgroundTimerThrottling,
 | |
|      switches::kDisableBreakpad,
 | |
|      switches::kDisableCompositorUkmForTests,
 | |
| @@ -2658,8 +2662,10 @@ void RenderProcessHostImpl::PropagateBro
 | |
|      switches::kDisableMojoRenderer,
 | |
|  #endif
 | |
|  #if BUILDFLAG(ENABLE_WEBRTC)
 | |
| +#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
 | |
|      switches::kDisableWebRtcHWDecoding,
 | |
|      switches::kDisableWebRtcHWEncoding,
 | |
| +#endif
 | |
|      switches::kEnableWebRtcSrtpAesGcm,
 | |
|      switches::kEnableWebRtcSrtpEncryptedHeaders,
 | |
|      switches::kEnableWebRtcStunOrigin,
 | |
| Index: chromium-66.0.3359.81/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
 | |
| +++ chromium-66.0.3359.81/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
 | |
| @@ -58,7 +58,12 @@ class WebRtcMediaRecorderTest
 | |
|        return;
 | |
|      // This flag is also used for encoding, https://crbug.com/616640.
 | |
|      base::CommandLine::ForCurrentProcess()->AppendSwitch(
 | |
| -        switches::kDisableAcceleratedVideoDecode);
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +        switches::kEnableAcceleratedVideo
 | |
| +#else
 | |
| +        switches::kDisableAcceleratedVideoDecode
 | |
| +#endif
 | |
| +        );
 | |
|    }
 | |
|  
 | |
|   private:
 | |
| Index: chromium-66.0.3359.81/content/gpu/BUILD.gn
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/gpu/BUILD.gn
 | |
| +++ chromium-66.0.3359.81/content/gpu/BUILD.gn
 | |
| @@ -130,4 +130,8 @@ target(link_target_type, "gpu_sources")
 | |
|        (!is_chromecast || is_cast_desktop_build)) {
 | |
|      configs += [ "//build/config/linux/dri" ]
 | |
|    }
 | |
| +
 | |
| +  if (is_desktop_linux) {
 | |
| +    public_configs = [ "//media/gpu:libva_config" ]
 | |
| +  }
 | |
|  }
 | |
| Index: chromium-66.0.3359.81/content/gpu/gpu_main.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/gpu/gpu_main.cc
 | |
| +++ chromium-66.0.3359.81/content/gpu/gpu_main.cc
 | |
| @@ -286,7 +286,7 @@ int GpuMain(const MainFunctionParams& pa
 | |
|  
 | |
|    base::PlatformThread::SetName("CrGpuMain");
 | |
|  
 | |
| -#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
 | |
| +#if defined(OS_LINUX)
 | |
|    // Set thread priority before sandbox initialization.
 | |
|    base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
 | |
|  #endif
 | |
| @@ -315,7 +315,7 @@ int GpuMain(const MainFunctionParams& pa
 | |
|    GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
 | |
|  
 | |
|    base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
 | |
| -#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
 | |
| +#if defined(OS_LINUX)
 | |
|    io_thread_priority = base::ThreadPriority::DISPLAY;
 | |
|  #endif
 | |
|  
 | |
| Index: chromium-66.0.3359.81/content/public/browser/gpu_utils.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/public/browser/gpu_utils.cc
 | |
| +++ chromium-66.0.3359.81/content/public/browser/gpu_utils.cc
 | |
| @@ -7,6 +7,7 @@
 | |
|  #include "base/command_line.h"
 | |
|  #include "base/single_thread_task_runner.h"
 | |
|  #include "base/strings/string_number_conversions.h"
 | |
| +#include "build/build_config.h"
 | |
|  #include "content/browser/gpu/gpu_process_host.h"
 | |
|  #include "content/public/common/content_features.h"
 | |
|  #include "content/public/common/content_switches.h"
 | |
| @@ -55,9 +56,17 @@ const gpu::GpuPreferences GetGpuPreferen
 | |
|    gpu_preferences.in_process_gpu =
 | |
|        command_line->HasSwitch(switches::kInProcessGPU);
 | |
|    gpu_preferences.disable_accelerated_video_decode =
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +      !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
 | |
| +#else
 | |
|        command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
 | |
| +#endif
 | |
|    gpu_preferences.disable_accelerated_video_encode =
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +      !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
 | |
| +#else
 | |
|        command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode);
 | |
| +#endif
 | |
|  #if defined(OS_WIN)
 | |
|    uint32_t enable_accelerated_vpx_decode_val =
 | |
|        gpu::GpuPreferences::VPX_VENDOR_MICROSOFT;
 | |
| Index: chromium-66.0.3359.81/content/public/common/content_switches.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/public/common/content_switches.cc
 | |
| +++ chromium-66.0.3359.81/content/public/common/content_switches.cc
 | |
| @@ -78,12 +78,21 @@ const char kDisable3DAPIs[]
 | |
|  
 | |
|  // Disable gpu-accelerated 2d canvas.
 | |
|  const char kDisableAccelerated2dCanvas[]    = "disable-accelerated-2d-canvas";
 | |
| -
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +// Enable hardware accelerated mjpeg decode on linux
 | |
| +const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
 | |
| +#else
 | |
|  // Disable hardware acceleration of mjpeg decode for captured frame, where
 | |
|  // available.
 | |
|  const char kDisableAcceleratedMjpegDecode[] =
 | |
|      "disable-accelerated-mjpeg-decode";
 | |
| +#endif
 | |
|  
 | |
| +#if defined(OS_LINUX)
 | |
| +// Enables hardware acceleration of video for Linux only. VA-API driver
 | |
| +// is required to be present on the system installation.
 | |
| +const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
 | |
| +#endif
 | |
|  // Disables hardware acceleration of video decode, where available.
 | |
|  const char kDisableAcceleratedVideoDecode[] =
 | |
|      "disable-accelerated-video-decode";
 | |
| @@ -859,11 +868,13 @@ const char kZygoteProcess[]
 | |
|  // ignores this switch on its stable and beta channels.
 | |
|  const char kDisableWebRtcEncryption[]      = "disable-webrtc-encryption";
 | |
|  
 | |
| +#if defined(OS_CHROMEOS)
 | |
|  // Disables HW decode acceleration for WebRTC.
 | |
|  const char kDisableWebRtcHWDecoding[]       = "disable-webrtc-hw-decoding";
 | |
|  
 | |
|  // Disables HW encode acceleration for WebRTC.
 | |
|  const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
 | |
| +#endif
 | |
|  
 | |
|  // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
 | |
|  // See https://tools.ietf.org/html/rfc7714 for further information.
 | |
| Index: chromium-66.0.3359.81/content/public/common/content_switches.h
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/public/common/content_switches.h
 | |
| +++ chromium-66.0.3359.81/content/public/common/content_switches.h
 | |
| @@ -33,7 +33,11 @@ CONTENT_EXPORT extern const char kDisabl
 | |
|  CONTENT_EXPORT extern const char kDisable3DAPIs[];
 | |
|  CONTENT_EXPORT extern const char kDisableAccelerated2dCanvas[];
 | |
|  CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[];
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +CONTENT_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
 | |
| +#else
 | |
|  CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
 | |
| +#endif
 | |
|  CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[];
 | |
|  CONTENT_EXPORT extern const char kDisableAcceleratedVideoEncode[];
 | |
|  CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[];
 | |
| @@ -106,6 +110,9 @@ CONTENT_EXPORT extern const char kDisabl
 | |
|  CONTENT_EXPORT extern const char kDomAutomationController[];
 | |
|  extern const char kDisable2dCanvasClipAntialiasing[];
 | |
|  CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
 | |
| +CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
 | |
| +#endif
 | |
|  CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
 | |
|  CONTENT_EXPORT extern const char kEnableAutomation[];
 | |
|  CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[];
 | |
| @@ -240,8 +247,10 @@ CONTENT_EXPORT extern const char kZygote
 | |
|  
 | |
|  #if BUILDFLAG(ENABLE_WEBRTC)
 | |
|  CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
 | |
| +#if defined(OS_CHROMEOS)
 | |
|  CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
 | |
|  CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
 | |
| +#endif
 | |
|  CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
 | |
|  CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
 | |
|  CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
 | |
| Index: chromium-66.0.3359.81/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
 | |
| +++ chromium-66.0.3359.81/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
 | |
| @@ -282,10 +282,18 @@ void PeerConnectionDependencyFactory::In
 | |
|  
 | |
|    const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
 | |
|    if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +    if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
 | |
| +#else
 | |
|      if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
 | |
| +#endif
 | |
|        decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
 | |
|  
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +    if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
 | |
| +#else
 | |
|      if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
 | |
| +#endif
 | |
|        encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
 | |
|    }
 | |
|  
 | |
| Index: chromium-66.0.3359.81/content/renderer/render_thread_impl.cc
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/content/renderer/render_thread_impl.cc
 | |
| +++ chromium-66.0.3359.81/content/renderer/render_thread_impl.cc
 | |
| @@ -1581,7 +1581,11 @@ media::GpuVideoAcceleratorFactories* Ren
 | |
|    scoped_refptr<base::SingleThreadTaskRunner> media_task_runner =
 | |
|        GetMediaThreadTaskRunner();
 | |
|    const bool enable_video_accelerator =
 | |
| +#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
 | |
| +      cmd_line->HasSwitch(switches::kEnableAcceleratedVideo) &&
 | |
| +#else
 | |
|        !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
 | |
| +#endif
 | |
|        (gpu_channel_host->gpu_feature_info()
 | |
|             .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] ==
 | |
|         gpu::kGpuFeatureStatusEnabled);
 | |
| Index: chromium-66.0.3359.81/gpu/config/software_rendering_list.json
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/gpu/config/software_rendering_list.json
 | |
| +++ chromium-66.0.3359.81/gpu/config/software_rendering_list.json
 | |
| @@ -373,17 +373,6 @@
 | |
|        ]
 | |
|      },
 | |
|      {
 | |
| -      "id": 48,
 | |
| -      "description": "Accelerated video decode is unavailable on Linux",
 | |
| -      "cr_bugs": [137247],
 | |
| -      "os": {
 | |
| -        "type": "linux"
 | |
| -      },
 | |
| -      "features": [
 | |
| -        "accelerated_video_decode"
 | |
| -      ]
 | |
| -    },
 | |
| -    {
 | |
|        "id": 50,
 | |
|        "description": "Disable VMware software renderer on older Mesa",
 | |
|        "cr_bugs": [145531, 332596, 571899, 629434],
 | |
| Index: chromium-66.0.3359.81/media/gpu/BUILD.gn
 | |
| ===================================================================
 | |
| --- chromium-66.0.3359.81.orig/media/gpu/BUILD.gn
 | |
| +++ chromium-66.0.3359.81/media/gpu/BUILD.gn
 | |
| @@ -482,6 +482,14 @@ if (use_v4l2_codec || use_vaapi || is_ma
 | |
|    }
 | |
|  }
 | |
|  
 | |
| +if (is_desktop_linux && use_vaapi) {
 | |
| +  import("//build/config/linux/pkg_config.gni")
 | |
| +
 | |
| +  pkg_config("libva_config") {
 | |
| +    packages = [ "libva" ]
 | |
| +  }
 | |
| +}
 | |
| +
 | |
|  if (use_vaapi) {
 | |
|    test("jpeg_encode_accelerator_unittest") {
 | |
|      deps = [
 | |
| @@ -542,6 +550,10 @@ if (use_v4l2_codec || use_vaapi) {
 | |
|      if (use_ozone) {
 | |
|        deps += [ "//ui/ozone" ]
 | |
|      }
 | |
| +
 | |
| +    if (is_desktop_linux) {
 | |
| +      public_configs = [ ":libva_config" ]
 | |
| +    }
 | |
|    }
 | |
|  }
 | |
|  
 |