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

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: rebase to new crrev.com/1128113011 Created 5 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
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 3f3704025072f00f6f917fe75d5adc9156dbf7c2..6809b487ae30da20ae68ad5e4f8f53fd42ef070f 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -51,8 +51,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)
@@ -97,4 +98,17 @@ int GbmPixmap::GetDmaBufPitch() {
return gbm_bo_get_stride(buffer_->bo());
}
+NativePixmap::BufferUsage GbmPixmap::GetBufferUsage() const {
+ return buffer_->GetFramebufferId() ? SCANOUT : MAP;
+}
+
+void* GbmPixmap::Map() {
+ NOTREACHED();
+ return nullptr;
+}
+
+void GbmPixmap::Unmap() {
+ NOTREACHED();
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698