OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/dri/hardware_display_controller.h" | 5 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 current_planes_ = std::vector<OverlayPlane>(1, primary); | 67 current_planes_ = std::vector<OverlayPlane>(1, primary); |
68 pending_planes_.clear(); | 68 pending_planes_.clear(); |
69 is_disabled_ = false; | 69 is_disabled_ = false; |
70 mode_ = mode; | 70 mode_ = mode; |
71 return status; | 71 return status; |
72 } | 72 } |
73 | 73 |
74 bool HardwareDisplayController::Enable() { | 74 bool HardwareDisplayController::Enable() { |
75 TRACE_EVENT0("dri", "HDC::Enable"); | 75 TRACE_EVENT0("dri", "HDC::Enable"); |
76 DCHECK(!current_planes_.empty()); | 76 DCHECK(!current_planes_.empty()); |
77 OverlayPlane primary = OverlayPlane::GetPrimaryPlane(current_planes_); | 77 const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(current_planes_); |
78 DCHECK(primary.buffer.get()); | 78 DCHECK(primary->buffer.get()); |
79 bool status = true; | 79 bool status = true; |
80 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 80 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
81 status &= crtc_controllers_[i]->Modeset(primary, mode_); | 81 status &= crtc_controllers_[i]->Modeset(*primary, mode_); |
82 | 82 |
83 return status; | 83 return status; |
84 } | 84 } |
85 | 85 |
86 void HardwareDisplayController::Disable() { | 86 void HardwareDisplayController::Disable() { |
87 TRACE_EVENT0("dri", "HDC::Disable"); | 87 TRACE_EVENT0("dri", "HDC::Disable"); |
88 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 88 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
89 crtc_controllers_[i]->Disable(); | 89 crtc_controllers_[i]->Disable(); |
90 | 90 |
91 is_disabled_ = true; | 91 is_disabled_ = true; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { | 239 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { |
240 uint64_t time = 0; | 240 uint64_t time = 0; |
241 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 241 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
242 if (time < crtc_controllers_[i]->time_of_last_flip()) | 242 if (time < crtc_controllers_[i]->time_of_last_flip()) |
243 time = crtc_controllers_[i]->time_of_last_flip(); | 243 time = crtc_controllers_[i]->time_of_last_flip(); |
244 | 244 |
245 return time; | 245 return time; |
246 } | 246 } |
247 | 247 |
248 } // namespace ui | 248 } // namespace ui |
OLD | NEW |