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

Unified Diff: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc

Issue 1262043002: Implement DRM Native Pixmap using prime buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-master
Patch Set: ToT rebase Created 4 years, 11 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/client_native_pixmap_factory_gbm.cc
diff --git a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
index 27bb4a4ca1a62d43bb4dad8c9ca7936fb7184f07..5c67da6d305586d971fcc938690586d64bc142b0 100644
--- a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
+++ b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
@@ -6,9 +6,12 @@
#include <utility>
+#include "base/command_line.h"
#include "base/macros.h"
#include "ui/gfx/native_pixmap_handle_ozone.h"
+#include "ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h"
#include "ui/ozone/public/client_native_pixmap_factory.h" // nogncheck
+#include "ui/ozone/public/ozone_switches.h"
#if defined(USE_VGEM_MAP)
#include "ui/ozone/platform/drm/common/client_native_pixmap_vgem.h"
@@ -58,6 +61,9 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
format == gfx::BufferFormat::BGRX_8888;
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kOzoneUseDmaBufMmap))
spang 2016/03/21 23:24:20 Check the command line in the constructor or Initi
vignatti (out of this project) 2016/03/22 20:24:29 I was actually thinking about removing the cmd lin
+ return format == gfx::BufferFormat::BGRA_8888;
#if defined(USE_VGEM_MAP)
return vgem_fd_.is_valid() && format == gfx::BufferFormat::BGRA_8888;
#else
@@ -77,6 +83,10 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
switch (usage) {
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kOzoneUseDmaBufMmap))
+ return ClientNativePixmapDmaBuf::ImportFromDmabuf(
+ scoped_fd.get(), size, handle.stride);
#if defined(USE_VGEM_MAP)
// A valid |vgem_fd_| is required to acquire a VGEM bo. |vgem_fd_| is
// set before a widget is created.

Powered by Google App Engine
This is Rietveld 408576698