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

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

Issue 2678343011: chromeos: decode video into NV12 format instead of RGBA in vaapi decoder (Closed)
Patch Set: decide scanout in runtime Created 3 years, 6 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
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.h ('k') | ui/ozone/platform/drm/gpu/drm_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 97130378d930cbde9ac373a47185b4cdd6718632..21cfc1a72e2e0e85f24c79a3e4dc1da517cf19e2 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -5,6 +5,7 @@
#include "ui/ozone/platform/drm/common/drm_util.h"
#include <drm_fourcc.h>
+#include <gbm.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/mman.h>
@@ -518,6 +519,36 @@ int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format) {
}
}
+uint32_t GetGbmFlagsFromBufferUsage(gfx::BufferUsage usage) {
+ switch (usage) {
+ case gfx::BufferUsage::GPU_READ:
+ return GBM_BO_USE_TEXTURING;
+ case gfx::BufferUsage::SCANOUT:
+ return GBM_BO_USE_SCANOUT;
+ case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
+ return GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR;
+ case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
+ case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
+ return GBM_BO_USE_TEXTURING | GBM_BO_USE_LINEAR;
+ }
+}
+
+gfx::BufferUsage GetBufferUsageFromGbmFlags(int flags) {
+ switch (flags) {
+ case GBM_BO_USE_TEXTURING:
gurchetansingh 2017/06/28 20:59:18 After the gbm.h change lands, you still have to ro
+ return gfx::BufferUsage::GPU_READ;
+ case GBM_BO_USE_SCANOUT:
+ return gfx::BufferUsage::SCANOUT;
+ case GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR:
+ return gfx::BufferUsage::SCANOUT_CPU_READ_WRITE;
+ case GBM_BO_USE_TEXTURING | GBM_BO_USE_LINEAR:
+ return gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
+ default:
+ NOTREACHED();
+ return gfx::BufferUsage::SCANOUT;
+ }
+}
+
MovableDisplaySnapshots CreateMovableDisplaySnapshotsFromParams(
const std::vector<DisplaySnapshot_Params>& displays) {
MovableDisplaySnapshots snapshots;
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.h ('k') | ui/ozone/platform/drm/gpu/drm_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698