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/drm/gpu/hardware_display_controller.h" | 5 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <xf86drm.h> | 9 #include <xf86drm.h> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 if (HasPendingPageFlips()) | 64 if (HasPendingPageFlips()) |
65 requests_.push_back( | 65 requests_.push_back( |
66 PageFlipRequest(current_planes_, false, base::Bind(&base::DoNothing))); | 66 PageFlipRequest(current_planes_, false, base::Bind(&base::DoNothing))); |
67 | 67 |
68 return status; | 68 return status; |
69 } | 69 } |
70 | 70 |
71 bool HardwareDisplayController::Enable() { | 71 bool HardwareDisplayController::Enable() { |
72 TRACE_EVENT0("drm", "HDC::Enable"); | 72 TRACE_EVENT0("drm", "HDC::Enable"); |
73 DCHECK(!current_planes_.empty()); | 73 DCHECK(!current_planes_.empty()); |
74 const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(current_planes_); | 74 |
75 const OverlayPlane* primary = nullptr; | |
76 // Use the last scheduled buffer to modeset to preserve request order. | |
77 if (!requests_.empty()) | |
78 primary = OverlayPlane::GetPrimaryPlane(requests_.back().planes); | |
79 else if (!pending_planes_.empty()) | |
80 primary = OverlayPlane::GetPrimaryPlane(pending_planes_); | |
81 else | |
82 primary = OverlayPlane::GetPrimaryPlane(current_planes_); | |
spang
2015/03/27 21:26:11
I agree with Dominic.. is it really necessary to d
dnicoara
2015/03/27 21:28:21
The Browser treats display configuration and buffe
| |
75 | 83 |
76 return Modeset(*primary, mode_); | 84 return Modeset(*primary, mode_); |
77 } | 85 } |
78 | 86 |
79 void HardwareDisplayController::Disable() { | 87 void HardwareDisplayController::Disable() { |
80 TRACE_EVENT0("drm", "HDC::Disable"); | 88 TRACE_EVENT0("drm", "HDC::Disable"); |
81 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 89 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
82 crtc_controllers_[i]->Disable(); | 90 crtc_controllers_[i]->Disable(); |
83 | 91 |
84 is_disabled_ = true; | 92 is_disabled_ = true; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 | 326 |
319 void HardwareDisplayController::ClearPendingRequests() { | 327 void HardwareDisplayController::ClearPendingRequests() { |
320 while (!requests_.empty()) { | 328 while (!requests_.empty()) { |
321 PageFlipRequest request = requests_.front(); | 329 PageFlipRequest request = requests_.front(); |
322 requests_.pop_front(); | 330 requests_.pop_front(); |
323 request.callback.Run(); | 331 request.callback.Run(); |
324 } | 332 } |
325 } | 333 } |
326 | 334 |
327 } // namespace ui | 335 } // namespace ui |
OLD | NEW |