Hello community,

here is the log from the commit of package chromium for openSUSE:Factory 
checked in at 2019-09-23 12:35:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/chromium (Old)
 and      /work/SRC/openSUSE:Factory/.chromium.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "chromium"

Mon Sep 23 12:35:02 2019 rev:232 rq:732044 version:77.0.3865.90

Changes:
--------
--- /work/SRC/openSUSE:Factory/chromium/chromium.changes        2019-09-19 
15:52:43.711270286 +0200
+++ /work/SRC/openSUSE:Factory/.chromium.new.7948/chromium.changes      
2019-09-23 12:38:29.461599364 +0200
@@ -1,0 +2,5 @@
+Thu Sep 19 12:55:15 UTC 2019 - Jan Ritzerfeld <s...@bugs.jan.ritzerfeld.org>
+
+- Added patch chromium-vaapi-fix.patch again to fix boo#1146219
+
+-------------------------------------------------------------------

New:
----
  chromium-vaapi-fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ chromium.spec ++++++
--- /var/tmp/diff_new_pack.2Dt6O3/_old  2019-09-23 12:38:35.581598357 +0200
+++ /var/tmp/diff_new_pack.2Dt6O3/_new  2019-09-23 12:38:35.585598356 +0200
@@ -104,6 +104,7 @@
 #  (default on) compared to the PR
 Patch100:       chromium-vaapi.patch
 Patch101:       old-libva.patch
+Patch102:       chromium-vaapi-fix.patch
 # PATCH-FIX-SUSE: allow prop codecs to be set with chromium branding
 Patch200:       chromium-prop-codecs.patch
 BuildRequires:  SDL-devel

++++++ chromium-vaapi-fix.patch ++++++
>From fe61d25580bd22d68b20323e7cd684dcba0cd3f4 Mon Sep 17 00:00:00 2001
From: Akarshan Biswas <akarshanbis...@fedoraproject.org>
Date: Tue, 9 Jul 2019 18:39:54 +0530
Subject: [PATCH] Disable VAProfileNone on Linux and fix vaapi drm

---
 .../gpu_video_decode_accelerator_factory.cc   |  2 ++
 .../vaapi/vaapi_video_decode_accelerator.cc   | 21 ++++++++++++++++
 media/gpu/vaapi/vaapi_wrapper.cc              | 24 +++++++++++++++----
 3 files changed, 42 insertions(+), 5 deletions(-)

Index: chromium-77.0.3865.90/media/gpu/gpu_video_decode_accelerator_factory.cc
===================================================================
--- chromium-77.0.3865.90.orig/media/gpu/gpu_video_decode_accelerator_factory.cc
+++ chromium-77.0.3865.90/media/gpu/gpu_video_decode_accelerator_factory.cc
@@ -171,6 +171,8 @@ GpuVideoDecodeAcceleratorFactory::Create
     vda = (this->*create_vda_function)(workarounds, gpu_preferences, 
media_log);
     if (vda && vda->Initialize(config, client))
       return vda;
+      else
+      LOG(ERROR) << "Initialization of one or more VDAs failed.";
   }
 
   return nullptr;
Index: chromium-77.0.3865.90/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
===================================================================
--- chromium-77.0.3865.90.orig/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ chromium-77.0.3865.90/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -63,6 +63,9 @@ void ReportToUMA(VAVDADecoderFailure fai
                             VAVDA_DECODER_FAILURES_MAX + 1);
 }
 
+// Move this thing to chromeos only as build can fail if treat warnings as 
errors been set to true
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+
 // Returns true if the CPU is an Intel Gemini Lake or later (including Kaby
 // Lake) Cpu platform id's are referenced from the following file in kernel
 // source arch/x86/include/asm/intel-family.h
@@ -76,6 +79,8 @@ bool IsGeminiLakeOrLater() {
   return is_geminilake_or_later;
 }
 
+#endif
+
 }  // namespace
 
 #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \
@@ -631,6 +636,13 @@ void VaapiVideoDecodeAccelerator::Assign
   va_surface_format_ = GetVaFormatForVideoCodecProfile(profile_);
   std::vector<VASurfaceID> va_surface_ids;
 
+  // Nvidia doesn't support VAProfileNone, so don't try to create a temporary
+  // copy buffer there. It's not needed anyways for hardware video decoding
+  // to work.
+  
+  #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+
+
   // If we aren't in BufferAllocationMode::kNone, we have to allocate a
   // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
   // internal decoded frame.
@@ -644,15 +656,20 @@ void VaapiVideoDecodeAccelerator::Assign
       NotifyError(PLATFORM_FAILURE);
     }
   }
+  #endif
 
   for (size_t i = 0; i < buffers.size(); ++i) {
     // If we aren't in BufferAllocationMode::kNone, this |picture| is
     // only used as a copy destination. Therefore, the VaapiWrapper used and
     // owned by |picture| is |vpp_vaapi_wrapper_|.
     std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create(
+       #if defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+            vaapi_wrapper_,
+        #else
         (buffer_allocation_mode_ == BufferAllocationMode::kNone)
             ? vaapi_wrapper_
             : vpp_vaapi_wrapper_,
+        #endif
         make_context_current_cb_, bind_image_cb_, buffers[i]);
     RETURN_AND_NOTIFY_ON_FAILURE(picture, "Failed creating a VaapiPicture",
                                  PLATFORM_FAILURE, );
@@ -1077,6 +1094,9 @@ VaapiVideoDecodeAccelerator::GetSupporte
 
 VaapiVideoDecodeAccelerator::BufferAllocationMode
 VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+ #if defined(OS_LINUX) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+       return BufferAllocationMode::kNormal;
+ #else
   // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
   // |output_mode_| as well.
   if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
@@ -1112,6 +1132,7 @@ VaapiVideoDecodeAccelerator::DecideBuffe
     return BufferAllocationMode::kReduced;
 
   return BufferAllocationMode::kSuperReduced;
+  #endif
 }
 
 bool VaapiVideoDecodeAccelerator::IsBufferAllocationModeReducedOrSuperReduced()
Index: chromium-77.0.3865.90/media/gpu/vaapi/vaapi_wrapper.cc
===================================================================
--- chromium-77.0.3865.90.orig/media/gpu/vaapi/vaapi_wrapper.cc
+++ chromium-77.0.3865.90/media/gpu/vaapi/vaapi_wrapper.cc
@@ -327,6 +327,10 @@ void VADisplayState::PreSandboxInitializ
       base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
   if (drm_file.IsValid())
     VADisplayState::Get()->SetDrmFd(drm_file.GetPlatformFile());
+    const char kNvidiaPath[] = "/dev/dri/nvidiactl";
+    base::File nvidia_file = base::File(
+       base::FilePath::FromUTF8Unsafe(kNvidiaPath),
+       base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE);
 }
 
 VADisplayState::VADisplayState()
@@ -361,10 +365,11 @@ bool VADisplayState::InitializeOnce() {
     case gl::kGLImplementationDesktopGL:
 #if defined(USE_X11)
       va_display_ = vaGetDisplay(gfx::GetXDisplay());
-#else
-      LOG(WARNING) << "VAAPI video acceleration not available without "
-                      "DesktopGL (GLX).";
+       if (vaDisplayIsValid(va_display_))
+       break;
+
 #endif  // USE_X11
+      va_display_ = vaGetDisplayDRM(drm_fd_.get());
       break;
     // Cannot infer platform from GL, try all available displays
     case gl::kGLImplementationNone:
@@ -397,8 +402,17 @@ bool VADisplayState::InitializeOnce() {
   int major_version, minor_version;
   VAStatus va_res = vaInitialize(va_display_, &major_version, &minor_version);
   if (va_res != VA_STATUS_SUCCESS) {
-    LOG(ERROR) << "vaInitialize failed: " << vaErrorStr(va_res);
-    return false;
+    LOG(ERROR) << "vaInitialize failed (ignore if using Wayland desktop 
environment, refer:(Github)akarshanbiswas/chromium-vaapi/issues/7): " << 
vaErrorStr(va_res);
+     va_display_ = vaGetDisplayDRM(drm_fd_.get());
+     if (!vaDisplayIsValid(va_display_)) {
+       LOG(ERROR) << "Could not get a valid DRM VA display";
+       return false;
+     }
+      va_res = vaInitialize(va_display_, &major_version, &minor_version);
+      if (va_res != VA_STATUS_SUCCESS) {
+       LOG(ERROR) << "vaInitialize failed using DRM: " << vaErrorStr(va_res);
+       return false;
+      }
   }
 
   va_initialized_ = true;

Reply via email to