diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index cb04c939a..dc1a995a6 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1434,7 +1434,7 @@ const FeatureEntry kFeatureEntries[] = {
"disable-accelerated-video-decode",
flag_descriptions::kAcceleratedVideoDecodeName,
flag_descriptions::kAcceleratedVideoDecodeDescription,
- kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+ kOsMac | kOsWin | kOsCrOS | kOsAndroid | kOsLinux,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
},
#if defined(OS_WIN)
@@ -1980,12 +1980,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(service_manager::features::kXRSandbox)},
#endif // ENABLE_ISOLATED_XR_SERVICE
#endif // ENABLE_VR
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
{"disable-accelerated-mjpeg-decode",
flag_descriptions::kAcceleratedMjpegDecodeName,
- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux,
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
-#endif // OS_CHROMEOS
+#endif // OS_CHROMEOS OS_LINUX
{"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
flag_descriptions::kV8CacheOptionsDescription, kOsAll,
MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
@@ -3696,10 +3696,10 @@ const FeatureEntry kFeatureEntries[] = {
"AutofillDropdownLayout")},
#endif // OS_ANDROID
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
{"enable-vaapi-jpeg-image-decode-acceleration",
flag_descriptions::kVaapiJpegImageDecodeAccelerationName,
- flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS,
+ flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS | kOsLinux,
FEATURE_VALUE_TYPE(features::kVaapiJpegImageDecodeAcceleration)},
#endif
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 7457414f6..5c84e90f6 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2991,13 +2991,22 @@ const char kMacViewsTaskManagerDescription[] =
// 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.";
+const char kVaapiJpegImageDecodeAccelerationName[] =
+ "VA-API JPEG decode acceleration for images";
+const char kVaapiJpegImageDecodeAccelerationDescription[] =
+ "Enable or disable decode acceleration of JPEG images (as opposed to camera"
+ " captures) using the VA-API.";
+
+#endif // defined(OS_CHROMEOS) defined(OS_LINUX) and !defined(OS_ANDROID)
+
+#if defined(OS_CHROMEOS)
const char kAppServiceAshName[] = "App Service Ash";
const char kAppServiceAshDescription[] =
@@ -3437,12 +3446,6 @@ const char kUserActivityPredictionMlServiceName[] =
const char kUserActivityPredictionMlServiceDescription[] =
"Uses the new ML Service model for user activity prediction (Smart Dim).";
-const char kVaapiJpegImageDecodeAccelerationName[] =
- "VA-API JPEG decode acceleration for images";
-const char kVaapiJpegImageDecodeAccelerationDescription[] =
- "Enable or disable decode acceleration of JPEG images (as opposed to camera"
- " captures) using the VA-API.";
-
const char kVideoPlayerChromecastSupportName[] =
"Experimental Chromecast support for Video Player";
const char kVideoPlayerChromecastSupportDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 11e45a0ac..d7cbf8394 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1779,11 +1779,17 @@ extern const char kPermissionPromptPersistenceToggleDescription[];
// Chrome OS ------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
extern const char kAcceleratedMjpegDecodeName[];
extern const char kAcceleratedMjpegDecodeDescription[];
+extern const char kVaapiJpegImageDecodeAccelerationName[];
+extern const char kVaapiJpegImageDecodeAccelerationDescription[];
+
+#endif
+
+#if defined(OS_CHROMEOS)
extern const char kAppServiceAshName[];
extern const char kAppServiceAshDescription[];
@@ -2059,9 +2065,6 @@ extern const char kUseMonitorColorSpaceDescription[];
extern const char kUserActivityPredictionMlServiceName[];
extern const char kUserActivityPredictionMlServiceDescription[];
-extern const char kVaapiJpegImageDecodeAccelerationName[];
-extern const char kVaapiJpegImageDecodeAccelerationDescription[];
-
extern const char kVideoPlayerChromecastSupportName[];
extern const char kVideoPlayerChromecastSupportDescription[];
diff --git a/components/viz/service/main/viz_main_impl.cc b/components/viz/service/main/viz_main_impl.cc
index 284d0167d..87d5e14c5 100644
--- a/components/viz/service/main/viz_main_impl.cc
+++ b/components/viz/service/main/viz_main_impl.cc
@@ -36,7 +36,7 @@ std::unique_ptr<base::Thread> CreateAndStartIOThread() {
// It should be possible to use |main_task_runner_| for doing IO tasks.
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
thread_options.priority = base::ThreadPriority::NORMAL;
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE)
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE) || defined(OS_LINUX)
// TODO(reveman): Remove this in favor of setting it explicitly for each
// type of process.
thread_options.priority = base::ThreadPriority::DISPLAY;
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
index 2b1165264..fec963bd9 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//gpu/vulkan/features.gni")
import("//media/media_options.gni")
+import("//media/gpu/args.gni")
import("//ui/ozone/ozone.gni")
# See //content/BUILD.gn for how this works.
@@ -127,4 +128,8 @@ target(link_target_type, "gpu_sources") {
(!is_chromecast || is_cast_desktop_build)) {
configs += [ "//build/config/linux/dri" ]
}
+ # Use vaapi on desktop Linux builds when use_vaapi is set
+ if (is_desktop_linux && use_vaapi) {
+ public_configs = [ "//media/gpu:libva_config" ]
+ }
}
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index a838f0ccf..4c891fb92 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -288,7 +288,7 @@ int GpuMain(const MainFunctionParams& parameters) {
base::PlatformThread::SetName("CrGpuMain");
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE)
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE) || defined(OS_LINUX)
// Set thread priority before sandbox initialization.
base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
#endif
@@ -321,7 +321,7 @@ int GpuMain(const MainFunctionParams& parameters) {
GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
-#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE)
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(USE_OZONE) || defined(OS_LINUX)
io_thread_priority = base::ThreadPriority::DISPLAY;
#endif
diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json
index d4c3b4364..935fdeb86 100644
--- a/gpu/config/software_rendering_list.json
+++ b/gpu/config/software_rendering_list.json
@@ -369,17 +369,6 @@
"all"
]
},
- {
- "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",
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index b3477148d..477caecdb 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -517,7 +517,7 @@ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {
switches::kUseFakeJpegDecodeAccelerator)) {
return true;
}
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || defined(OS_LINUX)
return true;
#endif
return false;
diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn
index 81c1e4fca..81996bc56 100644
--- a/media/filters/BUILD.gn
+++ b/media/filters/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/jumbo.gni")
import("//media/media_options.gni")
import("//third_party/libaom/options.gni")
+import("//media/gpu/args.gni")
jumbo_source_set("filters") {
# Do not expand the visibility here without double-checking with OWNERS, this
@@ -212,7 +213,7 @@ jumbo_source_set("filters") {
deps += [ "//media/base/android" ]
}
- if (current_cpu != "arm" && is_linux) {
+ if (use_vaapi && is_linux) {
sources += [
"h264_bitstream_buffer.cc",
"h264_bitstream_buffer.h",
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
index b1750d527..cc1ad45af 100644
--- a/media/gpu/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -512,6 +512,13 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
}
}
+import("//build/config/linux/pkg_config.gni")
+
+pkg_config("libva_config") {
+ packages = [ "libva" ]
+}
+
+
if (use_v4l2_codec || use_vaapi) {
test("jpeg_encode_accelerator_unittest") {
deps = [
@@ -582,6 +589,7 @@ if (is_chromeos || is_linux) {
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
+ public_configs = [ ":libva_config" ]
}
}