Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1268)

Unified Diff: ui/ozone/platform/drm/common/drm_util.cc

Issue 1869793002: Ozone GBM: support R_8 format to GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Intel, not i915 Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/common/drm_util.cc
diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc
index dae5dd300150ccdc4977d2a677e63d466c0d8e16..b18f28956299d585ffec970f9ce8ca0c90ec0009 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -26,6 +26,11 @@
#define DRM_CAP_CURSOR_HEIGHT 0x9
#endif
+#if !defined(DRM_FORMAT_R8)
+// TODO(dshwang): after most linux and libdrm has this definition, remove it.
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
+#endif
+
namespace ui {
namespace {
@@ -318,6 +323,8 @@ DisplaySnapshot_Params CreateDisplaySnapshotParams(
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
switch (format) {
+ case gfx::BufferFormat::R_8:
+ return DRM_FORMAT_R8;
case gfx::BufferFormat::RGBA_8888:
return DRM_FORMAT_ABGR8888;
case gfx::BufferFormat::RGBX_8888:
@@ -336,6 +343,8 @@ int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
switch (format) {
+ case DRM_FORMAT_R8:
+ return gfx::BufferFormat::R_8;
case DRM_FORMAT_ABGR8888:
return gfx::BufferFormat::RGBA_8888;
case DRM_FORMAT_XBGR8888:

Powered by Google App Engine
This is Rietveld 408576698