diff options
-rw-r--r-- | chromium/media/gpu/chromeos/oop_video_decoder.cc | 5 | ||||
-rw-r--r-- | chromium/media/gpu/vaapi/vaapi_wrapper.cc | 7 | ||||
-rw-r--r-- | chromium/ui/gfx/native_pixmap_handle.cc | 4 | ||||
-rw-r--r-- | chromium/ui/ozone/platform/x11/BUILD.gn | 10 | ||||
-rw-r--r-- | chromium/ui/ozone/platform/x11/ozone_platform_x11.cc | 2 | ||||
-rw-r--r-- | chromium/ui/ozone/platform/x11/x11_surface_factory.cc | 3 |
6 files changed, 24 insertions, 7 deletions
diff --git a/chromium/media/gpu/chromeos/oop_video_decoder.cc b/chromium/media/gpu/chromeos/oop_video_decoder.cc index 2b939e3b1e5..a9d1cad1369 100644 --- a/chromium/media/gpu/chromeos/oop_video_decoder.cc +++ b/chromium/media/gpu/chromeos/oop_video_decoder.cc @@ -6,7 +6,6 @@ #include "base/memory/ptr_util.h" #include "build/chromeos_buildflags.h" -#include "chromeos/components/cdm_factory_daemon/stable_cdm_context_impl.h" #include "media/base/bind_to_current_loop.h" #include "media/gpu/macros.h" #include "media/mojo/common/mojo_decoder_buffer_converter.h" @@ -14,6 +13,10 @@ #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" +#if BUILDFLAG(IS_CHROMEOS) +#include "chromeos/components/cdm_factory_daemon/stable_cdm_context_impl.h" +#endif + #if BUILDFLAG(USE_VAAPI) #include "media/gpu/vaapi/vaapi_wrapper.h" #endif // BUILDFLAG(USE_VAAPI) diff --git a/chromium/media/gpu/vaapi/vaapi_wrapper.cc b/chromium/media/gpu/vaapi/vaapi_wrapper.cc index cc1c86fde9f..bc6dd463e25 100644 --- a/chromium/media/gpu/vaapi/vaapi_wrapper.cc +++ b/chromium/media/gpu/vaapi/vaapi_wrapper.cc @@ -740,7 +740,7 @@ VADisplayState::VADisplayState() bool VADisplayState::Initialize() { base::AutoLock auto_lock(va_lock_); -#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX) +#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX) && !defined(TOOLKIT_QT) // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi // for more details. This will also require revisiting everything that's @@ -755,8 +755,10 @@ bool VADisplayState::Initialize() { #if BUILDFLAG(USE_VAAPI_X11) libraries_initialized = libraries_initialized && IsVa_x11Initialized(); #endif - if (!libraries_initialized) + if (!libraries_initialized) { + LOG(WARNING) << "libva failed to initialize"; return false; + } // Manual refcounting to ensure the rest of the method is called only once. if (refcount_++ > 0) @@ -802,6 +804,7 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) { switch (gl::GetGLImplementation()) { case gl::kGLImplementationEGLGLES2: case gl::kGLImplementationEGLANGLE: + case gl::kGLImplementationDesktopGL: case gl::kGLImplementationNone: return vaGetDisplayDRM(drm_fd.get()); default: diff --git a/chromium/ui/gfx/native_pixmap_handle.cc b/chromium/ui/gfx/native_pixmap_handle.cc index 73574c164d5..7807461ab07 100644 --- a/chromium/ui/gfx/native_pixmap_handle.cc +++ b/chromium/ui/gfx/native_pixmap_handle.cc @@ -12,7 +12,11 @@ #include "ui/gfx/geometry/size.h" #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +#if __has_include(<drm_fourcc.h>) #include <drm_fourcc.h> +#else +#include <libdrm/drm_fourcc.h> +#endif #include <unistd.h> #include "base/posix/eintr_wrapper.h" diff --git a/chromium/ui/ozone/platform/x11/BUILD.gn b/chromium/ui/ozone/platform/x11/BUILD.gn index 898f285e72b..87fb63785d6 100644 --- a/chromium/ui/ozone/platform/x11/BUILD.gn +++ b/chromium/ui/ozone/platform/x11/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/chromeos/ui_mode.gni") import("//gpu/vulkan/features.gni") +import("//media/gpu/args.gni") import("//ui/base/ui_features.gni") visibility = [ "//ui/ozone/*" ] @@ -85,8 +86,6 @@ source_set("x11") { "//ui/events/x", "//ui/gfx", "//ui/gfx/geometry", - "//ui/gfx/linux:gbm", - "//ui/gfx/linux:gpu_memory_buffer_support_x11", "//ui/gfx/x", "//ui/gl", "//ui/ozone:ozone_base", @@ -103,7 +102,12 @@ source_set("x11") { ] deps += [ "//ui/linux:linux_ui" ] } - + if (use_vaapi) { + deps += [ + "//ui/gfx/linux:gbm", + "//ui/gfx/linux:gpu_memory_buffer_support_x11", + ] + } if (is_chromeos_ash) { deps += [ "//ui/base/ime/ash" ] } else { diff --git a/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc b/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc index 8743c12ee7c..d4fb2ba6aa1 100644 --- a/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc +++ b/chromium/ui/ozone/platform/x11/ozone_platform_x11.cc @@ -268,6 +268,7 @@ class OzonePlatformX11 : public OzonePlatform, void InitializeGPU(const InitParams& params) override { InitializeCommon(params); +#if BUILDFLAG(USE_VAAPI) if (params.enable_native_gpu_memory_buffers) { base::ThreadPool::PostTask( FROM_HERE, base::BindOnce([]() { @@ -275,6 +276,7 @@ class OzonePlatformX11 : public OzonePlatform, ui::GpuMemoryBufferSupportX11::GetInstance(); })); } +#endif // In single process mode either the UI thread will create an event source // or it's a test and an event source isn't desired. if (!params.single_process) diff --git a/chromium/ui/ozone/platform/x11/x11_surface_factory.cc b/chromium/ui/ozone/platform/x11/x11_surface_factory.cc index d38941def55..e320e21603e 100644 --- a/chromium/ui/ozone/platform/x11/x11_surface_factory.cc +++ b/chromium/ui/ozone/platform/x11/x11_surface_factory.cc @@ -180,6 +180,7 @@ scoped_refptr<gfx::NativePixmap> X11SurfaceFactory::CreateNativePixmap( gfx::BufferUsage usage, absl::optional<gfx::Size> framebuffer_size) { scoped_refptr<gfx::NativePixmapDmaBuf> pixmap; +#if BUILDFLAG(USE_VAAPI) auto buffer = ui::GpuMemoryBufferSupportX11::GetInstance()->CreateBuffer( format, size, usage); if (buffer) { @@ -187,7 +188,7 @@ scoped_refptr<gfx::NativePixmap> X11SurfaceFactory::CreateNativePixmap( pixmap = base::MakeRefCounted<gfx::NativePixmapDmaBuf>(size, format, std::move(handle)); } - +#endif // CreateNativePixmap is non-blocking operation. Thus, it is safe to call it // and return the result with the provided callback. return pixmap; |