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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc

Issue 1071273002: NotForReview: Implement zero/one-copy texture for ozone freon using Intel DRM Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after ClientNativePixmap is introduced Created 5 years, 4 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/gbm.gypi ('k') | ui/ozone/platform/drm/gpu/intel_drm_pixmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
index c3952bddc6c3ead34a6e08b1b9e7cd2abb0ba722..c4d41b6fe8cbffa0c58d006d15498b4a39824149 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -21,6 +21,12 @@
#include "ui/ozone/public/surface_ozone_canvas.h"
#include "ui/ozone/public/surface_ozone_egl.h"
+#if defined(OZONE_USE_VGEM_MAP)
+#include "base/command_line.h"
+#include "ui/ozone/platform/drm/gpu/intel_drm_pixmap.h"
+#include "ui/ozone/public/ozone_switches.h"
+#endif
+
namespace ui {
GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless)
@@ -118,6 +124,18 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget);
DCHECK(gbm);
+#if defined(OZONE_USE_VGEM_MAP)
+ bool enable_intel_drm = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kOzoneUseIntelDrm);
+ if (enable_intel_drm && usage == gfx::BufferUsage::MAP) {
+ scoped_refptr<IntelDrmPixmap> pixmap = IntelDrmPixmap::Create(
+ base::FileDescriptor(gbm->get_fd(), false), format, size);
+ if (!pixmap.get())
+ return nullptr;
+ return pixmap;
+ }
+#endif
+
scoped_refptr<GbmBuffer> buffer =
GbmBuffer::CreateBuffer(gbm, format, size, usage);
if (!buffer.get())
« no previous file with comments | « ui/ozone/platform/drm/gbm.gypi ('k') | ui/ozone/platform/drm/gpu/intel_drm_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698