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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread.cc

Issue 2717963002: ui: Add gfx::BufferUsage::SCANOUT_CPU_READ_WRITE. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/gpu/drm_thread.h" 5 #include "ui/ozone/platform/drm/gpu/drm_thread.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); 110 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get());
111 DCHECK(gbm); 111 DCHECK(gbm);
112 112
113 uint32_t flags = 0; 113 uint32_t flags = 0;
114 switch (usage) { 114 switch (usage) {
115 case gfx::BufferUsage::GPU_READ: 115 case gfx::BufferUsage::GPU_READ:
116 break; 116 break;
117 case gfx::BufferUsage::SCANOUT: 117 case gfx::BufferUsage::SCANOUT:
118 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; 118 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
119 break; 119 break;
120 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
121 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR;
122 break;
120 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 123 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
121 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 124 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
122 flags = GBM_BO_USE_LINEAR; 125 flags = GBM_BO_USE_LINEAR;
123 break; 126 break;
124 } 127 }
125 128
126 DrmWindow* window = screen_manager_->GetWindow(widget); 129 DrmWindow* window = screen_manager_->GetWindow(widget);
127 std::vector<uint64_t> modifiers; 130 std::vector<uint64_t> modifiers;
128 131
129 uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format); 132 uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 correction_matrix); 288 correction_matrix);
286 } 289 }
287 290
288 // DrmThread requires a BindingSet instead of a simple Binding because it will 291 // DrmThread requires a BindingSet instead of a simple Binding because it will
289 // be used from multiple threads in multiple processes. 292 // be used from multiple threads in multiple processes.
290 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { 293 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) {
291 bindings_.AddBinding(this, std::move(request)); 294 bindings_.AddBinding(this, std::move(request));
292 } 295 }
293 296
294 } // namespace ui 297 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698