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

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

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not-leak USE_OZONE_GBM, GetSupportedGpuMemoryBufferConfigurations from ozone, return handle Created 5 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/gpu/gbm_buffer.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index 362f77c8dd6566ca08c6b26fea9341c950f3e8ff..d72806469750313e09697cc5864fb9b463763361 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
+#include "ui/gfx/gpu_memory_buffer.h"
reveman 2015/05/14 13:22:03 This code should not know about GpuMemoryBuffers.
#include "ui/ozone/platform/drm/gpu/gbm_device.h"
namespace ui {
@@ -51,8 +52,9 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer(
TRACE_EVENT2("drm", "GbmBuffer::CreateBuffer", "device",
gbm->device_path().value(), "size", size.ToString());
unsigned flags = GBM_BO_USE_RENDERING;
- if (scanout)
- flags |= GBM_BO_USE_SCANOUT;
+ // SCANOUT allocates continuous memory, so better for performance even if
+ // |scanout| is false.
+ flags |= GBM_BO_USE_SCANOUT;
gbm_bo* bo = gbm_bo_create(gbm->device(), size.width(), size.height(),
GetGbmFormatFromBufferFormat(format), flags);
if (!bo)
@@ -98,4 +100,8 @@ int GbmPixmap::GetDmaBufPitch() {
return gbm_bo_get_stride(buffer_->bo());
}
+NativePixmap::BufferUsage GbmPixmap::GetBufferUsage() const {
+ return buffer_->GetFramebufferId() ? SCANOUT : MAP;
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698