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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 127 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
128 status &= crtc_controllers_[i]->MoveCursor(location); | 128 status &= crtc_controllers_[i]->MoveCursor(location); |
129 | 129 |
130 return status; | 130 return status; |
131 } | 131 } |
132 | 132 |
133 void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) { | 133 void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) { |
134 owned_hardware_planes_.add( | 134 owned_hardware_planes_.add( |
135 controller->drm().get(), | 135 controller->drm().get(), |
136 scoped_ptr<HardwareDisplayPlaneList>(new HardwareDisplayPlaneList())); | 136 scoped_ptr<HardwareDisplayPlaneList>(new HardwareDisplayPlaneList())); |
137 crtc_controllers_.push_back(controller.release()); | 137 crtc_controllers_.push_back(controller.Pass()); |
138 } | 138 } |
139 | 139 |
140 scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc( | 140 scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc( |
141 const scoped_refptr<DrmDevice>& drm, | 141 const scoped_refptr<DrmDevice>& drm, |
142 uint32_t crtc) { | 142 uint32_t crtc) { |
143 for (ScopedVector<CrtcController>::iterator it = crtc_controllers_.begin(); | 143 for (ScopedVector<CrtcController>::iterator it = crtc_controllers_.begin(); |
144 it != crtc_controllers_.end(); ++it) { | 144 it != crtc_controllers_.end(); ++it) { |
145 if ((*it)->drm() == drm && (*it)->crtc() == crtc) { | 145 if ((*it)->drm() == drm && (*it)->crtc() == crtc) { |
146 scoped_ptr<CrtcController> controller(*it); | 146 scoped_ptr<CrtcController> controller(*it); |
147 crtc_controllers_.weak_erase(it); | 147 crtc_controllers_.weak_erase(it); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() | 199 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() |
200 const { | 200 const { |
201 DCHECK(!crtc_controllers_.empty()); | 201 DCHECK(!crtc_controllers_.empty()); |
202 // TODO(dnicoara) When we support mirroring across DRM devices, figure out | 202 // TODO(dnicoara) When we support mirroring across DRM devices, figure out |
203 // which device should be used for allocations. | 203 // which device should be used for allocations. |
204 return crtc_controllers_[0]->drm(); | 204 return crtc_controllers_[0]->drm(); |
205 } | 205 } |
206 | 206 |
207 } // namespace ui | 207 } // namespace ui |
OLD | NEW |