summarylogtreecommitdiffstats
path: root/check-for-enable-accelerated-video-decode-on-Linux.patch
blob: a0d5468d19e45d26bab735dc760c3bddf8db347e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 54deb9811ca9bd2327def5c05ba6987b8c7a0897 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Tue, 29 Sep 2020 01:02:22 +0000
Subject: [PATCH] Check for enable-accelerated-video-decode on Linux

Video decoding was being accelerated on Linux even though the newly
added "enable-accelerated-video-decode" flag was not specified. The
chrome://gpu page was misleadingly showing this feature as disabled:

  > Video Decode: Software only. Hardware acceleration disabled

This change adds a check for --enable-accelerated-video-decode when
considering if video decoding should be activated. (Only on Linux.)

Extra context: https://crbug.com/1097029#c18 (and also comment 20).

Bug: 1066176, 1097029
Change-Id: I534115f5f6ceed0ee3511fcf5c2d0f1dd04b9b7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431434
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811480}
---
 content/renderer/render_thread_impl.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index f13c94ddab7..0352f127171 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1121,7 +1121,11 @@ media::GpuVideoAcceleratorFactories* RenderThreadImpl::GetGpuFactories() {
           kGpuStreamPriorityMedia);
 
   const bool enable_video_accelerator =
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+      cmd_line->HasSwitch(switches::kEnableAcceleratedVideoDecode) &&
+#else
       !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
+#endif  // defined(OS_LINUX) && !defined(OS_CHROMEOS)
       (gpu_channel_host->gpu_feature_info()
            .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] ==
        gpu::kGpuFeatureStatusEnabled);