summarylogtreecommitdiffstats
path: root/chromium-vaapi-fix-the-VA_CHECK_VERSION.patch
diff options
context:
space:
mode:
authorDaniel Playfair Cal2019-02-20 21:25:02 +1100
committerDaniel Playfair Cal2019-02-21 09:42:43 +1100
commita5bfa509125d36190b1e3e02411e8754d2850f24 (patch)
treea85daef4da083beb886f7c2332a4becf147c934d /chromium-vaapi-fix-the-VA_CHECK_VERSION.patch
downloadaur-a5bfa509125d36190b1e3e02411e8754d2850f24.tar.gz
Initialise based on chromium 72.0.3626.109-1
chromium-ozone 72.0.3626.81-1
Diffstat (limited to 'chromium-vaapi-fix-the-VA_CHECK_VERSION.patch')
-rw-r--r--chromium-vaapi-fix-the-VA_CHECK_VERSION.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/chromium-vaapi-fix-the-VA_CHECK_VERSION.patch b/chromium-vaapi-fix-the-VA_CHECK_VERSION.patch
new file mode 100644
index 000000000000..d82fa52fc1cc
--- /dev/null
+++ b/chromium-vaapi-fix-the-VA_CHECK_VERSION.patch
@@ -0,0 +1,74 @@
+From 674fb0486a1b525cb850530c4cdc79506338bd37 Mon Sep 17 00:00:00 2001
+From: Azhar Shaikh <azhar.shaikh@intel.com>
+Date: Fri, 11 Jan 2019 07:44:38 +0000
+Subject: [PATCH] media/gpu/vaapi: Fix the VA_CHECK_VERSION
+
+commit 6f1309ef8fe109 ("media/gpu/vaapi: Relax the version
+check for VA-API") added the VA_CHECK_VERSION to relax the
+VA-API version check. But it still does the same thing as
+the previous check. VA_CHECK_VERSION will return 'true', only
+when the VA-API version is greater than or equal to the
+parameters passed to it. So in this case when the major and
+minor version were passed from vaInitialize() output, it did
+the same strict check as earlier. When trying to update libva
+to a newer version, there will still be a mismatch, since
+vaInitialize() would return the updated/newer libva version
+installed on the system, but the chromium would still be built
+with older version (libva-2.1.0 as of now).
+To fix this and actually relax the check, make sure the system
+version of libva is greater than the libva version with which
+the browser is built, since libva is backward compatible. This
+will allow any future libva updates without breaking existing code.
+
+Fixes: 6f1309ef8fe109 ("media/gpu/vaapi: Relax the version check for VA-API")
+
+Bug: 905814
+TEST=Below scenarios were tested and h/w acceleration is working successfully.
+TEST=Build chromium with libva-2.3.0 and system version 2.3.0
+TEST=Build chromium with libva-2.1.0 and system version 2.3.0
+TEST=Build chromium with libva 2.1.0 and system version 2.1.0
+
+Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>
+Change-Id: I1ec14aabed21b7d6b6fc55080bbac17233c40ec0
+Reviewed-on: https://chromium-review.googlesource.com/c/1376716
+Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
+Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
+Reviewed-by: Miguel Casas <mcasas@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#621940}
+---
+ media/gpu/vaapi/vaapi_wrapper.cc | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 4921aabf64..93d7c98b80 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -337,15 +337,16 @@ bool VADisplayState::InitializeOnce() {
+ << va_vendor_string_;
+
+ // 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;
++ // calling vaInitialize(). Since the libva is now ABI-compatible, relax the
++ // version check which helps in upgrading the libva, without breaking any
++ // existing functionality. Make sure the system version is not older than
++ // the version with which the chromium is built since libva is only
++ // guaranteed to be backward (and not forward) compatible.
++ if (VA_MAJOR_VERSION > major_version ||
++ (VA_MAJOR_VERSION == major_version && VA_MINOR_VERSION > minor_version)) {
++ LOG(ERROR) << "The system version " << major_version << "." << minor_version
++ << " should be greater than or equal to "
++ << VA_MAJOR_VERSION << "." << VA_MINOR_VERSION;
+ return false;
+ }
+ return true;
+--
+2.20.1
+