| 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/crtc_controller.h" | 5 #include "ui/ozone/platform/drm/gpu/crtc_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
| 10 #include "ui/ozone/platform/drm/gpu/page_flip_request.h" | 10 #include "ui/ozone/platform/drm/gpu/page_flip_request.h" |
| 11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 CrtcController::CrtcController(const scoped_refptr<DrmDevice>& drm, | 15 CrtcController::CrtcController(const scoped_refptr<DrmDevice>& drm, |
| 16 uint32_t crtc, | 16 uint32_t crtc, |
| 17 uint32_t connector) | 17 uint32_t connector) |
| 18 : drm_(drm), | 18 : drm_(drm), |
| 19 crtc_(crtc), | 19 crtc_(crtc), |
| 20 connector_(connector) {} | 20 connector_(connector) {} |
| 21 | 21 |
| 22 CrtcController::~CrtcController() { | 22 CrtcController::~CrtcController() { |
| 23 if (!is_disabled_) { | 23 if (!is_disabled_) { |
| 24 const ScopedVector<HardwareDisplayPlane>& all_planes = | 24 const std::vector<scoped_ptr<HardwareDisplayPlane>>& all_planes = |
| 25 drm_->plane_manager()->planes(); | 25 drm_->plane_manager()->planes(); |
| 26 for (auto* plane : all_planes) { | 26 for (const auto& plane : all_planes) { |
| 27 if (plane->owning_crtc() == crtc_) { | 27 if (plane->owning_crtc() == crtc_) { |
| 28 plane->set_owning_crtc(0); | 28 plane->set_owning_crtc(0); |
| 29 plane->set_in_use(false); | 29 plane->set_in_use(false); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 SetCursor(nullptr); | 33 SetCursor(nullptr); |
| 34 drm_->DisableCrtc(crtc_); | 34 drm_->DisableCrtc(crtc_); |
| 35 if (page_flip_request_) | 35 if (page_flip_request_) |
| 36 SignalPageFlipRequest(gfx::SwapResult::SWAP_ACK); | 36 SignalPageFlipRequest(gfx::SwapResult::SWAP_ACK); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 current_planes_.swap(pending_planes_); | 165 current_planes_.swap(pending_planes_); |
| 166 | 166 |
| 167 pending_planes_.clear(); | 167 pending_planes_.clear(); |
| 168 | 168 |
| 169 scoped_refptr<PageFlipRequest> request; | 169 scoped_refptr<PageFlipRequest> request; |
| 170 request.swap(page_flip_request_); | 170 request.swap(page_flip_request_); |
| 171 request->Signal(result); | 171 request->Signal(result); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace ui | 174 } // namespace ui |
| OLD | NEW |