Commit 57254514 authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

cros/drm: Add RG and YUV formats for SCANOUT_CPU_READ_WRITE

On intel, we want to be able to use SCANOUT_CPU_READ_WRITE with
GMBs videoframes (cfr ).

This CL adds YUV_420_BIPLANAR and other supported formats to
SCANOUT_CPU_READ_WRITE.

Bug: b/71837407
Change-Id: I1fcb5148ce71c2eeb90feb8ccc0b7378e9f1b0b8
Reviewed-on: https://chromium-review.googlesource.com/889846Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532256}
parent 88cb4047
......@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "ui/gfx/native_pixmap_handle.h"
#if defined(OS_CHROMEOS)
......@@ -64,10 +65,19 @@ class ClientNativePixmapFactoryDmabuf : public ClientNativePixmapFactory {
return format == gfx::BufferFormat::BGRX_8888 ||
format == gfx::BufferFormat::RGBX_8888;
case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
return format == gfx::BufferFormat::BGRX_8888 ||
format == gfx::BufferFormat::BGRA_8888 ||
format == gfx::BufferFormat::RGBX_8888 ||
format == gfx::BufferFormat::RGBA_8888;
return
#if defined(ARCH_CPU_X86_FAMILY)
// Currently only Intel driver (i.e. minigbm and Mesa) supports R_8
// RG_88 and NV12. https://crbug.com/356871
format == gfx::BufferFormat::R_8 ||
format == gfx::BufferFormat::RG_88 ||
format == gfx::BufferFormat::YUV_420_BIPLANAR ||
#endif
format == gfx::BufferFormat::BGRX_8888 ||
format == gfx::BufferFormat::BGRA_8888 ||
format == gfx::BufferFormat::RGBX_8888 ||
format == gfx::BufferFormat::RGBA_8888;
case gfx::BufferUsage::SCANOUT_VDA_WRITE:
return false;
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment