#15 Update vaapi patch and a new patch to relax libva version checking
Merged 5 years ago by spot. Opened 5 years ago by akarshanbiswas.
https://pagure.io/chromium.git master  into  master

Add relax libva version check patch
Akarshan Biswas • 5 years ago  
Update vaapi patch for 71 and add to patch to relax the version check for vaapi
Akarshan Biswas • 5 years ago  
chromium.spec
file modified
+7 -2
@@ -297,7 +297,12 @@

  # NOTE: This patch will never land upstream

  Patch121:	enable-vaapi.patch

  Patch122:	chromium-70.0.3538.110-vaapi-i686-fpermissive.patch

- 

+ # Since the newer versions of VA-API are ABI compatible, relax the version checks for VA-API, by using VA_CHECK_VERSION().

+ # This will help in updating the libva to the latest releases,while still supporting the old versions, till the new version of

+ # libva is merged and picked by the builds. Thus ensuring that hardware accleration is not broken while updating the libva.

+ # Taken and rebased from https://chromium-review.googlesource.com/c/chromium/src/+/1352519

+ # The patch might land somewhere in the future and will be removed.

+ Patch123: relax-libva-version.patch

  

  # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:

  # http://build.chromium.org/buildbot/official/
@@ -849,7 +854,7 @@

  %ifarch i686

  %patch122 -p1 -b .i686permissive

  %endif

- 

+ %patch123 -p1 -b .relaxva

  

  # Change shebang in all relevant files in this directory and all subdirectories

  # See `man find` for how the `-exec command {} +` syntax works

enable-vaapi.patch
file modified
+28 -28
@@ -1,4 +1,4 @@

- From 9eef10b939b9eee6e7bb58c4ca3a8e119df518c1 Mon Sep 17 00:00:00 2001

+ From efdd5bdf093e9074c9eba73650ff5ad95b280ec8 Mon Sep 17 00:00:00 2001

  From: Akarshan Biswas <akarshan.biswas@gmail.com>

  Date: Sun, 4 Nov 2018 20:26:54 +0530

  Subject: [PATCH] Enable vaapi on Linux
@@ -17,10 +17,10 @@

   10 files changed, 52 insertions(+), 35 deletions(-)

  

  diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc

- index d029d0648..39df8d6cf 100644

+ index db54ccb61..f32075fb8 100644

  --- a/chrome/browser/about_flags.cc

  +++ b/chrome/browser/about_flags.cc

- @@ -1775,7 +1775,7 @@ const FeatureEntry kFeatureEntries[] = {

+ @@ -1797,7 +1797,7 @@ const FeatureEntry kFeatureEntries[] = {

           "disable-accelerated-video-decode",

           flag_descriptions::kAcceleratedVideoDecodeName,

           flag_descriptions::kAcceleratedVideoDecodeDescription,
@@ -29,9 +29,9 @@

           SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),

       },

   #if defined(OS_WIN)

- @@ -2457,12 +2457,12 @@ const FeatureEntry kFeatureEntries[] = {

-       FEATURE_VALUE_TYPE(features::kOpenVR)},

-  #endif  // ENABLE_OPENVR

+ @@ -2456,12 +2456,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)
@@ -45,7 +45,7 @@

       {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,

        flag_descriptions::kV8CacheOptionsDescription, kOsAll,

        MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},

- @@ -4444,12 +4444,14 @@ const FeatureEntry kFeatureEntries[] = {

+ @@ -4371,12 +4371,14 @@ const FeatureEntry kFeatureEntries[] = {

                                       "AutofillDropdownLayout")},

   #endif  // OS_ANDROID

   
@@ -63,10 +63,10 @@

        flag_descriptions::kEnableHomeLauncherGesturesName,

        flag_descriptions::kEnableHomeLauncherGesturesDescription, kOsCrOS,

  diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc

- index 0cb812619..df8ecb24e 100644

+ index 6cc51bbfb..3c4babe3d 100644

  --- a/chrome/browser/flag_descriptions.cc

  +++ b/chrome/browser/flag_descriptions.cc

- @@ -3053,9 +3053,9 @@ const char kTextSuggestionsTouchBarDescription[] =

+ @@ -2996,9 +2996,9 @@ const char kTextSuggestionsTouchBarDescription[] =

   

   #endif

   
@@ -78,7 +78,7 @@

   

   const char kAcceleratedMjpegDecodeName[] =

       "Hardware-accelerated mjpeg decode for captured frame";

- @@ -3063,6 +3063,18 @@ const char kAcceleratedMjpegDecodeDescription[] =

+ @@ -3006,6 +3006,18 @@ const char kAcceleratedMjpegDecodeDescription[] =

       "Enable hardware-accelerated mjpeg decode for captured frame where "

       "available.";

   
@@ -97,7 +97,7 @@

   const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";

   const char kAllowTouchpadThreeFingerClickDescription[] =

       "Enables touchpad three-finger-click as middle button.";

- @@ -3564,12 +3576,6 @@ const char kUseMonitorColorSpaceDescription[] =

+ @@ -3524,12 +3536,6 @@ const char kUseMonitorColorSpaceDescription[] =

       "Enables Chrome to use the  color space information provided by the monitor"

       " instead of the default sRGB color space.";

   
@@ -111,10 +111,10 @@

       "Experimental Chromecast support for Video Player";

   const char kVideoPlayerChromecastSupportDescription[] =

  diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h

- index b3c5e5691..14d7e33e9 100644

+ index 944695782..38d8fe144 100644

  --- a/chrome/browser/flag_descriptions.h

  +++ b/chrome/browser/flag_descriptions.h

- @@ -1846,13 +1846,22 @@ extern const char kPermissionPromptPersistenceToggleDescription[];

+ @@ -1824,13 +1824,22 @@ extern const char kPermissionPromptPersistenceToggleDescription[];

   

   #endif  // defined(OS_MACOSX)

   
@@ -139,7 +139,7 @@

   extern const char kAllowTouchpadThreeFingerClickName[];

   extern const char kAllowTouchpadThreeFingerClickDescription[];

   

- @@ -2158,9 +2167,6 @@ extern const char kUseMashDescription[];

+ @@ -2145,9 +2154,6 @@ extern const char kUseMashDescription[];

   extern const char kUseMonitorColorSpaceName[];

   extern const char kUseMonitorColorSpaceDescription[];

   
@@ -150,7 +150,7 @@

   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 2196abef4..b4e0a1ae1 100644

+ index 6f5f55de7..b90db3738 100644

  --- a/components/viz/service/main/viz_main_impl.cc

  +++ b/components/viz/service/main/viz_main_impl.cc

  @@ -41,7 +41,7 @@ std::unique_ptr<base::Thread> CreateAndStartIOThread() {
@@ -185,10 +185,10 @@

  +  }

   }

  diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc

- index f589d015d..03fd1b44a 100644

+ index 8397889b6..188d960a4 100644

  --- a/content/gpu/gpu_main.cc

  +++ b/content/gpu/gpu_main.cc

- @@ -283,7 +283,7 @@ int GpuMain(const MainFunctionParams& parameters) {

+ @@ -284,7 +284,7 @@ int GpuMain(const MainFunctionParams& parameters) {

   

     base::PlatformThread::SetName("CrGpuMain");

   
@@ -197,7 +197,7 @@

     // Set thread priority before sandbox initialization.

     base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);

   #endif

- @@ -316,7 +316,7 @@ int GpuMain(const MainFunctionParams& parameters) {

+ @@ -317,7 +317,7 @@ int GpuMain(const MainFunctionParams& parameters) {

     GetContentClient()->SetGpuInfo(gpu_init->gpu_info());

   

     base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
@@ -207,10 +207,10 @@

   #endif

   

  diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json

- index 445953a64..0aac9ddb6 100644

+ index cb6118b6a..7b8ea0f75 100644

  --- a/gpu/config/software_rendering_list.json

  +++ b/gpu/config/software_rendering_list.json

- @@ -373,17 +373,6 @@

+ @@ -369,17 +369,6 @@

           "all"

         ]

       },
@@ -229,10 +229,10 @@

         "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 684c1d5cf..e887e60bb 100644

+ index 41bfa9172..30ca4f40a 100644

  --- a/media/base/media_switches.cc

  +++ b/media/base/media_switches.cc

- @@ -468,7 +468,7 @@ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {

+ @@ -495,7 +495,7 @@ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {

             switches::kUseFakeJpegDecodeAccelerator)) {

       return true;

     }
@@ -242,7 +242,7 @@

   #endif

     return false;

  diff --git a/media/filters/BUILD.gn b/media/filters/BUILD.gn

- index ab6215152..b8d1ee896 100644

+ index d558b537a..9ad090e07 100644

  --- a/media/filters/BUILD.gn

  +++ b/media/filters/BUILD.gn

  @@ -5,6 +5,7 @@
@@ -253,7 +253,7 @@

   

   jumbo_source_set("filters") {

     # Do not expand the visibility here without double-checking with OWNERS, this

- @@ -198,7 +199,7 @@ jumbo_source_set("filters") {

+ @@ -200,7 +201,7 @@ jumbo_source_set("filters") {

       deps += [ "//media/base/android" ]

     }

   
@@ -263,10 +263,10 @@

         "h264_bitstream_buffer.cc",

         "h264_bitstream_buffer.h",

  diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn

- index 9ef4730a4..0c3a06c24 100644

+ index 07bfdefda..7e33cd747 100644

  --- a/media/gpu/BUILD.gn

  +++ b/media/gpu/BUILD.gn

- @@ -501,6 +501,12 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {

+ @@ -508,6 +508,12 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {

     }

   }

   
@@ -279,7 +279,7 @@

   if (use_vaapi) {

     test("jpeg_encode_accelerator_unittest") {

       deps = [

- @@ -571,6 +577,7 @@ if (use_v4l2_codec || use_vaapi) {

+ @@ -578,6 +584,7 @@ if (is_chromeos || is_linux) {

       if (use_ozone) {

         deps += [ "//ui/ozone" ]

       }
@@ -288,5 +288,5 @@

   }

   

  -- 

- 2.19.1

+ 2.19.2

  

relax-libva-version.patch
file added
+56
@@ -0,0 +1,56 @@

+ From 6f1309ef8fe10965e4d0018b4f1b80ac6deccdaa Mon Sep 17 00:00:00 2001

+ From: Azhar Shaikh <azhar.shaikh@intel.com>

+ Date: Fri, 30 Nov 2018 23:11:57 +0000

+ Subject: [PATCH] media/gpu/vaapi: Relax the version check for VA-API

+ 

+ Since the newer versions of VA-API are ABI compatible, relax the

+ version checks for VA-API, by using VA_CHECK_VERSION().

+ This will help in updating the libva to the latest releases,

+ while still supporting the old versions, till the new version of

+ libva is merged and picked by the builds. Thus ensuring that

+ hardware accleration is not broken while updating the libva.

+ 

+ Bug: 905814

+ TEST=libva-2.3.0 and libva-2.1.0 are able to do hardware acceleration.

+ 

+ Suggested-by: Alexandre Courbot <acourbot@chromium.org>

+ Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>

+ Change-Id: I510549f72290d20676927eeeeb89a87199c062af

+ Reviewed-on: https://chromium-review.googlesource.com/c/1352519

+ Reviewed-by: Alexandre Courbot <acourbot@chromium.org>

+ Reviewed-by: Hirokazu Honda <hiroh@chromium.org>

+ Commit-Queue: Miguel Casas <mcasas@chromium.org>

+ Cr-Commit-Position: refs/heads/master@{#612832}

+ ---

+ 

+ diff --git a/AUTHORS b/AUTHORS

+ index 567fe15..ff42fc5 100644

+ --- a/AUTHORS

+ +++ b/AUTHORS

+ @@ -103,6 +103,7 @@

+  Attila Dusnoki <dati91@gmail.com>

+  Avinaash Doreswamy <avi.nitk@samsung.com>

+  Ayush Khandelwal <k.ayush@samsung.com>

+ +Azhar Shaikh <azhar.shaikh@intel.com>

+  Balazs Kelemen <b.kelemen@samsung.com>

+  Baul Eun <baul.eun@samsung.com>

+  Behara Mani Shyam Patro <behara.ms@samsung.com>

+ diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc

+ index b415642..053384d 100644

+ --- a/media/gpu/vaapi/vaapi_wrapper.cc

+ +++ b/media/gpu/vaapi/vaapi_wrapper.cc

+ @@ -333,7 +333,13 @@

+    DVLOG(1) << "VAAPI version: " << major_version << "." << minor_version << " "

+             << va_vendor_string_;

+  

+ -  if (major_version != VA_MAJOR_VERSION || minor_version != VA_MINOR_VERSION) {

+ +  // The VAAPI version is determined from what is loaded on the system by

+ +  // calling vaInitialize(). We want a runtime evaluation of libva version,

+ +  // of what is loaded on the system, with, what browser is compiled with.

+ +  // Also since the libva is now ABI-compatible, relax the version check

+ +  // which helps in upgrading the libva, without breaking any existing

+ +  // functionality.

+ +  if (!VA_CHECK_VERSION(major_version, minor_version, 0)) {

+      LOG(ERROR) << "This build of Chromium requires VA-API version "

+                 << VA_MAJOR_VERSION << "." << VA_MINOR_VERSION

+                 << ", system version: " << major_version << "." << minor_version;

no initial comment

Pull-Request has been merged by spot

5 years ago