diff options
Diffstat (limited to 'ozone-add-va-api-support-to-wayland.patch')
-rw-r--r-- | ozone-add-va-api-support-to-wayland.patch | 58 |
1 files changed, 15 insertions, 43 deletions
diff --git a/ozone-add-va-api-support-to-wayland.patch b/ozone-add-va-api-support-to-wayland.patch index e2e055cc1e1e..abde3d5a4273 100644 --- a/ozone-add-va-api-support-to-wayland.patch +++ b/ozone-add-va-api-support-to-wayland.patch @@ -1,4 +1,3 @@ -From ddb186d8904d6ec80d1084a1cc495b824381a565 Mon Sep 17 00:00:00 2001 From: Maksim Sisov <msisov@igalia.com> Date: Wed, 20 Jan 2021 09:50:22 +0200 Subject: [PATCH] ozone/wayland: add VA-API support. @@ -16,18 +15,9 @@ The patch is based on the old va-api path. ChromeOS team is working on the new path, which will be also employed by Wayland later. -Signed-off-by: Maksim Sisov <msisov@igalia.com> --- - media/gpu/vaapi/vaapi_picture_factory.cc | 2 +- - media/gpu/vaapi/vaapi_picture_native_pixmap.cc | 17 ++++++++++++++++- - .../gpu/vaapi/vaapi_video_decode_accelerator.cc | 4 ++-- - .../platform/wayland/gpu/gbm_pixmap_wayland.cc | 14 ++++++++++++-- - .../platform/wayland/gpu/gbm_pixmap_wayland.h | 3 +++ - .../platform/wayland/ozone_platform_wayland.cc | 3 +++ - 6 files changed, 37 insertions(+), 6 deletions(-) - diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc -index 62e3a429239eb..df4905a10f68b 100644 +index 62e3a42..bde9c2d 100644 --- a/media/gpu/vaapi/vaapi_picture_factory.cc +++ b/media/gpu/vaapi/vaapi_picture_factory.cc @@ -105,7 +105,7 @@ uint32_t VaapiPictureFactory::GetGLTextureTarget() { @@ -35,12 +25,12 @@ index 62e3a429239eb..df4905a10f68b 100644 gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() { -#if BUILDFLAG(USE_VAAPI_X11) -+#if defined(OS_LINUX) ++#if BUILDFLAG(IS_LINUX) return gfx::BufferFormat::RGBX_8888; #else return gfx::BufferFormat::YUV_420_BIPLANAR; diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap.cc -index 941f24cc59590..a9c80356e7109 100644 +index 941f24c..a9c8035 100644 --- a/media/gpu/vaapi/vaapi_picture_native_pixmap.cc +++ b/media/gpu/vaapi/vaapi_picture_native_pixmap.cc @@ -4,6 +4,7 @@ @@ -75,10 +65,10 @@ index 941f24cc59590..a9c80356e7109 100644 bool VaapiPictureNativePixmap::AllowOverlay() const { diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -index baaf2ae468d36..4d6933d869933 100644 +index 3a07fa2..306313d 100644 --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -@@ -562,12 +562,12 @@ void VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange( +@@ -561,12 +561,12 @@ void VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange( requested_visible_rect_ = visible_rect; if (buffer_allocation_mode_ == BufferAllocationMode::kSuperReduced) { // Add one to the reference frames for the one being currently egressed. @@ -94,47 +84,28 @@ index baaf2ae468d36..4d6933d869933 100644 } else { requested_num_reference_frames_ = 0; diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc -index 2ec4e4e01729e..e73af1fe781c6 100644 +index 35378d1..68969d2 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc -@@ -33,8 +33,12 @@ GbmPixmapWayland::GbmPixmapWayland(WaylandBufferManagerGpu* buffer_manager) +@@ -32,7 +32,9 @@ GbmPixmapWayland::GbmPixmapWayland(WaylandBufferManagerGpu* buffer_manager) buffer_id_(buffer_manager->AllocateBufferID()) {} GbmPixmapWayland::~GbmPixmapWayland() { -- if (gbm_bo_ && widget_ != gfx::kNullAcceleratedWidget) +- if (created_wl_buffer_) + // gfx::BufferUsage::SCANOUT_VDA_WRITE doesn't result in creation of + // wl_buffers. -+ if (gbm_bo_ && usage_ != gfx::BufferUsage::SCANOUT_VDA_WRITE && -+ widget_ != gfx::kNullAcceleratedWidget) { ++ if (created_wl_buffer_ && usage_ != gfx::BufferUsage::SCANOUT_VDA_WRITE) buffer_manager_->DestroyBuffer(buffer_id_); -+ } - } - - bool GbmPixmapWayland::InitializeBuffer( -@@ -83,8 +87,14 @@ bool GbmPixmapWayland::InitializeBuffer( - << " usage=" << gfx::BufferUsageToString(usage); - - visible_area_size_ = visible_area_size ? visible_area_size.value() : size; -- if (widget_ != gfx::kNullAcceleratedWidget) -+ usage_ = usage; -+ // Do not create wl_buffers for SCANOUT_VDA_WRITE usages. These buffers are -+ // only used by video decoders and are not going to be requested to be -+ // attached to Wayland surfaces. -+ if (usage_ != gfx::BufferUsage::SCANOUT_VDA_WRITE && -+ widget_ != gfx::kNullAcceleratedWidget) { - CreateDmabufBasedBuffer(); -+ } - return true; } diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h -index e9b25a7452882..3eb91765eba30 100644 +index 06d0290..c217e91 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h -@@ -87,6 +87,9 @@ class GbmPixmapWayland : public gfx::NativePixmap { +@@ -91,6 +91,9 @@ class GbmPixmapWayland : public gfx::NativePixmap { - // Size of the visible area of the buffer. - gfx::Size visible_area_size_; + // Says a wl_buffer has been created and must removed. + bool created_wl_buffer_ = false; + + // Tells the usage of this pixmap. + gfx::BufferUsage usage_ = gfx::BufferUsage::SCANOUT; @@ -142,7 +113,7 @@ index e9b25a7452882..3eb91765eba30 100644 } // namespace ui diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc -index 661859754cd80..665e6de2616bb 100644 +index 8d8621b..a1ca29c 100644 --- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc +++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc @@ -289,6 +289,9 @@ class OzonePlatformWayland : public OzonePlatform, @@ -154,3 +125,4 @@ index 661859754cd80..665e6de2616bb 100644 + initialised = true; } + |