| 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/drm_gpu_display_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 9 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
| 10 #include "ui/ozone/common/display_util.h" | 10 #include "ui/ozone/common/display_util.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 params_list.push_back( | 92 params_list.push_back( |
| 93 displays_.back()->Update(display_info, device_index)); | 93 displays_.back()->Update(display_info, device_index)); |
| 94 } | 94 } |
| 95 device_index++; | 95 device_index++; |
| 96 } | 96 } |
| 97 | 97 |
| 98 NotifyScreenManager(displays_, old_displays); | 98 NotifyScreenManager(displays_, old_displays); |
| 99 return params_list; | 99 return params_list; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void DrmGpuDisplayManager::GetScanoutFormats( |
| 103 gfx::AcceleratedWidget widget, |
| 104 std::vector<gfx::BufferFormat>* scanout_formats) { |
| 105 const std::vector<uint32_t>& fourcc_formats = |
| 106 drm_device_manager_->GetDrmDevice(widget) |
| 107 ->plane_manager() |
| 108 ->GetSupportedFormats(); |
| 109 for (auto& fourcc : fourcc_formats) |
| 110 scanout_formats->push_back(GetBufferFormatFromFourCCFormat(fourcc)); |
| 111 } |
| 112 |
| 102 bool DrmGpuDisplayManager::TakeDisplayControl() { | 113 bool DrmGpuDisplayManager::TakeDisplayControl() { |
| 103 const DrmDeviceVector& devices = drm_device_manager_->GetDrmDevices(); | 114 const DrmDeviceVector& devices = drm_device_manager_->GetDrmDevices(); |
| 104 bool status = true; | 115 bool status = true; |
| 105 for (const auto& drm : devices) | 116 for (const auto& drm : devices) |
| 106 status &= drm->SetMaster(); | 117 status &= drm->SetMaster(); |
| 107 | 118 |
| 108 // Roll-back any successful operation. | 119 // Roll-back any successful operation. |
| 109 if (!status) { | 120 if (!status) { |
| 110 LOG(ERROR) << "Failed to take control of the display"; | 121 LOG(ERROR) << "Failed to take control of the display"; |
| 111 RelinquishDisplayControl(); | 122 RelinquishDisplayControl(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 DisplayComparator(new_display.get())); | 234 DisplayComparator(new_display.get())); |
| 224 | 235 |
| 225 if (it == old_displays.end()) { | 236 if (it == old_displays.end()) { |
| 226 screen_manager_->AddDisplayController( | 237 screen_manager_->AddDisplayController( |
| 227 new_display->drm(), new_display->crtc(), new_display->connector()); | 238 new_display->drm(), new_display->crtc(), new_display->connector()); |
| 228 } | 239 } |
| 229 } | 240 } |
| 230 } | 241 } |
| 231 | 242 |
| 232 } // namespace ui | 243 } // namespace ui |
| OLD | NEW |