Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 // plane. | 149 // plane. |
| 150 if (crtc_controllers_[i]->GetCompatibleHardwarePlaneIds(plane).empty()) | 150 if (crtc_controllers_[i]->GetCompatibleHardwarePlaneIds(plane).empty()) |
| 151 return std::vector<uint32_t>(); | 151 return std::vector<uint32_t>(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // TODO(kalyank): We Should ensure that this list doesn't contain any planes | 154 // TODO(kalyank): We Should ensure that this list doesn't contain any planes |
| 155 // which mirrored displays share with primary. | 155 // which mirrored displays share with primary. |
| 156 return plane_ids; | 156 return plane_ids; |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool HardwareDisplayController::IsFormatSupported(uint32_t fourcc_format, | |
| 160 uint32_t z_order) const { | |
| 161 if (!crtc_controllers_[0]->IsFormatSupported(fourcc_format, z_order)) | |
|
dnicoara
2015/11/09 20:53:23
This can be handled in the for-loop.
| |
| 162 return false; | |
| 163 | |
| 164 for (size_t i = 1; i < crtc_controllers_.size(); ++i) { | |
| 165 // Make sure all mirrored displays have overlays to support this | |
| 166 // plane. | |
| 167 if (!crtc_controllers_[i]->IsFormatSupported(fourcc_format, z_order)) | |
| 168 return false; | |
| 169 } | |
| 170 | |
| 171 return true; | |
| 172 } | |
| 173 | |
| 159 bool HardwareDisplayController::SetCursor( | 174 bool HardwareDisplayController::SetCursor( |
| 160 const scoped_refptr<ScanoutBuffer>& buffer) { | 175 const scoped_refptr<ScanoutBuffer>& buffer) { |
| 161 bool status = true; | 176 bool status = true; |
| 162 | 177 |
| 163 if (is_disabled_) | 178 if (is_disabled_) |
| 164 return true; | 179 return true; |
| 165 | 180 |
| 166 for (size_t i = 0; i < crtc_controllers_.size(); ++i) | 181 for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
| 167 status &= crtc_controllers_[i]->SetCursor(buffer); | 182 status &= crtc_controllers_[i]->SetCursor(buffer); |
| 168 | 183 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 | 295 |
| 281 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() | 296 scoped_refptr<DrmDevice> HardwareDisplayController::GetAllocationDrmDevice() |
| 282 const { | 297 const { |
| 283 DCHECK(!crtc_controllers_.empty()); | 298 DCHECK(!crtc_controllers_.empty()); |
| 284 // TODO(dnicoara) When we support mirroring across DRM devices, figure out | 299 // TODO(dnicoara) When we support mirroring across DRM devices, figure out |
| 285 // which device should be used for allocations. | 300 // which device should be used for allocations. |
| 286 return crtc_controllers_[0]->drm(); | 301 return crtc_controllers_[0]->drm(); |
| 287 } | 302 } |
| 288 | 303 |
| 289 } // namespace ui | 304 } // namespace ui |
| OLD | NEW |