summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/linux
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/gfx/linux
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/gfx/linux')
-rw-r--r--chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc34
-rw-r--r--chromium/ui/gfx/linux/drm_util_linux.cc9
-rw-r--r--chromium/ui/gfx/linux/gbm_util.cc3
3 files changed, 32 insertions, 14 deletions
diff --git a/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc b/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc
index 88c16776abd..ed404cd52f8 100644
--- a/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc
+++ b/chromium/ui/gfx/linux/client_native_pixmap_dmabuf.cc
@@ -14,6 +14,7 @@
#include <utility>
#include "base/command_line.h"
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
@@ -102,6 +103,20 @@ bool ClientNativePixmapDmaBuf::IsConfigurationSupported(
}
#endif
+ bool disable_yuv_biplanar = true;
+#if defined(OS_CHROMEOS)
+ // IsConfigurationSupported(SCANOUT_CPU_READ_WRITE) is used by the renderer
+ // to tell whether the platform supports sampling a given format. Zero-copy
+ // video capture and encoding requires gfx::BufferFormat::YUV_420_BIPLANAR to
+ // be supported by the renderer. Most of Chrome OS platforms support it, so
+ // enable it by default, with a switch that allows an explicit disable on
+ // platforms known to have problems, e.g. the Tegra-based nyan."
+ // TODO(crbug.com/982201): move gfx::BufferFormat::YUV_420_BIPLANAR out
+ // of if defined(ARCH_CPU_X86_FAMLIY) when Tegra is no longer supported.
+ disable_yuv_biplanar = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableYuv420Biplanar);
+#endif
+
switch (usage) {
case gfx::BufferUsage::GPU_READ:
return format == gfx::BufferFormat::BGR_565 ||
@@ -124,10 +139,15 @@ bool ClientNativePixmapDmaBuf::IsConfigurationSupported(
if (format == gfx::BufferFormat::RG_88 && !AllowCpuMappableBuffers())
return false;
+ if (!disable_yuv_biplanar &&
+ format == gfx::BufferFormat::YUV_420_BIPLANAR) {
+ return true;
+ }
+
return
#if defined(ARCH_CPU_X86_FAMILY)
- // Currently only Intel driver (i.e. minigbm and Mesa) supports
- // R_8 RG_88, NV12 and XB30/XR30.
+ // The minigbm backends and Mesa drivers commonly used on x86 systems
+ // support the following formats.
format == gfx::BufferFormat::R_8 ||
format == gfx::BufferFormat::RG_88 ||
format == gfx::BufferFormat::YUV_420_BIPLANAR ||
@@ -145,10 +165,16 @@ bool ClientNativePixmapDmaBuf::IsConfigurationSupported(
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
if (!AllowCpuMappableBuffers())
return false;
+
+ if (!disable_yuv_biplanar &&
+ format == gfx::BufferFormat::YUV_420_BIPLANAR) {
+ return true;
+ }
+
return
#if defined(ARCH_CPU_X86_FAMILY)
- // Only the Intel stack (i.e. minigbm and Mesa) supports the formats
- // below.
+ // The minigbm backends and Mesa drivers commonly used on x86 systems
+ // support the following formats.
format == gfx::BufferFormat::R_8 ||
format == gfx::BufferFormat::RG_88 ||
format == gfx::BufferFormat::YUV_420_BIPLANAR ||
diff --git a/chromium/ui/gfx/linux/drm_util_linux.cc b/chromium/ui/gfx/linux/drm_util_linux.cc
index 7482722b128..e1372b68092 100644
--- a/chromium/ui/gfx/linux/drm_util_linux.cc
+++ b/chromium/ui/gfx/linux/drm_util_linux.cc
@@ -8,15 +8,6 @@
#include "base/notreached.h"
-#ifndef DRM_FORMAT_INVALID
-// TODO(mcasas): Remove when uprevving //third_party/libdrm.
-#define DRM_FORMAT_INVALID 0
-#endif
-
-#ifndef DRM_FORMAT_P010
-#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0')
-#endif
-
namespace ui {
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
diff --git a/chromium/ui/gfx/linux/gbm_util.cc b/chromium/ui/gfx/linux/gbm_util.cc
index cd9d13b55df..c516c13fafa 100644
--- a/chromium/ui/gfx/linux/gbm_util.cc
+++ b/chromium/ui/gfx/linux/gbm_util.cc
@@ -28,7 +28,8 @@ uint32_t BufferUsageToGbmFlags(gfx::BufferUsage usage) {
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
return GBM_BO_USE_LINEAR | GBM_BO_USE_TEXTURING;
case gfx::BufferUsage::SCANOUT_VEA_READ_CAMERA_AND_CPU_READ_WRITE:
- return GBM_BO_USE_TEXTURING | GBM_BO_USE_HW_VIDEO_ENCODER;
+ return GBM_BO_USE_LINEAR | GBM_BO_USE_CAMERA_WRITE | GBM_BO_USE_SCANOUT |
+ GBM_BO_USE_TEXTURING | GBM_BO_USE_HW_VIDEO_ENCODER;
default:
NOTREACHED();
return 0;