Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37037656
en ru br
Репозитории ALT
S:117.0.5938.132-alt1
3.0: 0.9.12-alt7
www.altlinux.org/Changes

Группа :: Сети/WWW
Пакет: chromium

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 0012-Move-offending-function-to-chromeos-only.patch
Скачать


From 0c73ea30282f554826b5e7a833fa6ee56c9e6c34 Mon Sep 17 00:00:00 2001
From: Akarshan Biswas <akarshanbiswas@fedoraproject.org>
Date: Sat, 26 Oct 2019 10:06:30 +0530
Subject: [PATCH] Move offending function to chromeos only
---
 media/gpu/vaapi/vaapi_video_decode_accelerator.cc | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
index 0dc47d88016..fbc164e28f4 100644
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -53,32 +53,34 @@ namespace media {
 
 namespace {
 
 // Returns the preferred VA_RT_FORMAT for the given |profile|.
 unsigned int GetVaFormatForVideoCodecProfile(VideoCodecProfile profile) {
   if (profile == VP9PROFILE_PROFILE2 || profile == VP9PROFILE_PROFILE3)
     return VA_RT_FORMAT_YUV420_10BPP;
   return VA_RT_FORMAT_YUV420;
 }
 
+#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
 bool IsGeminiLakeOrLater() {
   constexpr int kPentiumAndLaterFamily = 0x06;
   constexpr int kGeminiLakeModelId = 0x7A;
   static base::CPU cpuid;
   static bool is_geminilake_or_later =
       cpuid.family() == kPentiumAndLaterFamily &&
       cpuid.model() >= kGeminiLakeModelId;
   return is_geminilake_or_later;
 }
+#endif
 
 }  // namespace
 
 #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \
   do {                                                             \
     if (!(result)) {                                               \
       LOG(ERROR) << log;                                           \
       NotifyError(error_code);                                     \
       return ret;                                                  \
     }                                                              \
@@ -1225,35 +1227,38 @@ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
   // http://crrev.com/c/1363807/9/media/gpu/h264_decoder.cc#1449.
   if (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX)
     return BufferAllocationMode::kReduced;
   return BufferAllocationMode::kSuperReduced;
 #else
   // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT
   // |output_mode_| as well.
   if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT)
     return BufferAllocationMode::kNormal;
 
+#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
+  // Move this to chromeOs only as it is causing problem in some intel linux drivers
   // On Gemini Lake, Kaby Lake and later we can pass to libva the client's
   // PictureBuffers to decode onto, which skips the use of the Vpp unit and its
   // associated format reconciliation copy, avoiding all internal buffer
   // allocations.
   // TODO(crbug.com/911754): Enable for VP9 Profile 2.
   if (IsGeminiLakeOrLater() &&
       (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY ||
        (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX))) {
     // Add one to the reference frames for the one being currently egressed, and
     // an extra allocation for both |client_| and |decoder_|, see
     // crrev.com/c/1576560.
     if (profile_ == VP8PROFILE_ANY)
       num_extra_pics_ = 3;
     return BufferAllocationMode::kNone;
   }
+#endif
 
   // For H.264 on older devices, another +1 is experimentally needed for
   // high-to-high resolution changes.
   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
   // http://crrev.com/c/1363807/9/media/gpu/h264_decoder.cc#1449.
   if (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX)
     return BufferAllocationMode::kReduced;
 
   // If we're here, we have to use the Vpp unit and allocate buffers for
   // |decoder_|; usually we'd have to allocate the |decoder_|s
-- 
2.25.4
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin