OLD | NEW |
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" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "ui/display/types/display_mode.h" |
15 #include "ui/ozone/platform/drm/common/drm_util.h" | 16 #include "ui/ozone/platform/drm/common/drm_util.h" |
16 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" | 17 #include "ui/ozone/platform/drm/gpu/drm_buffer.h" |
17 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" | 18 #include "ui/ozone/platform/drm/gpu/drm_device_generator.h" |
18 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" | 19 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h" |
19 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 20 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
20 #include "ui/ozone/platform/drm/gpu/drm_window.h" | 21 #include "ui/ozone/platform/drm/gpu/drm_window.h" |
21 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 22 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
22 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" | 23 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h" |
23 #include "ui/ozone/platform/drm/gpu/gbm_device.h" | 24 #include "ui/ozone/platform/drm/gpu/gbm_device.h" |
24 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" | 25 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 227 } |
227 | 228 |
228 void DrmThread::RefreshNativeDisplays( | 229 void DrmThread::RefreshNativeDisplays( |
229 base::OnceCallback<void(const std::vector<DisplaySnapshot_Params>&)> | 230 base::OnceCallback<void(const std::vector<DisplaySnapshot_Params>&)> |
230 callback) { | 231 callback) { |
231 std::move(callback).Run(display_manager_->GetDisplays()); | 232 std::move(callback).Run(display_manager_->GetDisplays()); |
232 } | 233 } |
233 | 234 |
234 void DrmThread::ConfigureNativeDisplay( | 235 void DrmThread::ConfigureNativeDisplay( |
235 int64_t id, | 236 int64_t id, |
236 const DisplayMode_Params& mode, | 237 std::unique_ptr<const display::DisplayMode> mode, |
237 const gfx::Point& origin, | 238 const gfx::Point& origin, |
238 base::OnceCallback<void(int64_t, bool)> callback) { | 239 base::OnceCallback<void(int64_t, bool)> callback) { |
239 std::move(callback).Run(id, | 240 std::move(callback).Run( |
240 display_manager_->ConfigureDisplay(id, mode, origin)); | 241 id, display_manager_->ConfigureDisplay(id, *mode, origin)); |
241 } | 242 } |
242 | 243 |
243 void DrmThread::DisableNativeDisplay( | 244 void DrmThread::DisableNativeDisplay( |
244 int64_t id, | 245 int64_t id, |
245 base::OnceCallback<void(int64_t, bool)> callback) { | 246 base::OnceCallback<void(int64_t, bool)> callback) { |
246 std::move(callback).Run(id, display_manager_->DisableDisplay(id)); | 247 std::move(callback).Run(id, display_manager_->DisableDisplay(id)); |
247 } | 248 } |
248 | 249 |
249 void DrmThread::TakeDisplayControl(base::OnceCallback<void(bool)> callback) { | 250 void DrmThread::TakeDisplayControl(base::OnceCallback<void(bool)> callback) { |
250 std::move(callback).Run(display_manager_->TakeDisplayControl()); | 251 std::move(callback).Run(display_manager_->TakeDisplayControl()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 correction_matrix); | 290 correction_matrix); |
290 } | 291 } |
291 | 292 |
292 // DrmThread requires a BindingSet instead of a simple Binding because it will | 293 // DrmThread requires a BindingSet instead of a simple Binding because it will |
293 // be used from multiple threads in multiple processes. | 294 // be used from multiple threads in multiple processes. |
294 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { | 295 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { |
295 bindings_.AddBinding(this, std::move(request)); | 296 bindings_.AddBinding(this, std::move(request)); |
296 } | 297 } |
297 | 298 |
298 } // namespace ui | 299 } // namespace ui |
OLD | NEW |