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/host/drm_display_host_manager.h" | 5 #include "ui/ozone/platform/drm/host/drm_display_host_manager.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <xf86drm.h> | 8 #include <xf86drm.h> |
9 | 9 |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 has_dummy_display_ = !display_infos.empty(); | 148 has_dummy_display_ = !display_infos.empty(); |
149 for (size_t i = 0; i < display_infos.size(); ++i) { | 149 for (size_t i = 0; i < display_infos.size(); ++i) { |
150 displays_.push_back(new DrmDisplayHost( | 150 displays_.push_back(new DrmDisplayHost( |
151 proxy_, CreateDisplaySnapshotParams(display_infos[i], | 151 proxy_, CreateDisplaySnapshotParams(display_infos[i], |
152 primary_drm_device_handle_->fd(), i, | 152 primary_drm_device_handle_->fd(), i, |
153 gfx::Point()), | 153 gfx::Point()), |
154 true /* is_dummy */)); | 154 true /* is_dummy */)); |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
| 158 base::FileDescriptor DrmDisplayHostManager::GetVgemFd() { |
| 159 if (vgem_card_path_.empty()) |
| 160 return base::FileDescriptor(); |
| 161 return base::FileDescriptor(vgem_card_device_file_.get(), false); |
| 162 } |
| 163 |
158 DrmDisplayHostManager::~DrmDisplayHostManager() { | 164 DrmDisplayHostManager::~DrmDisplayHostManager() { |
159 device_manager_->RemoveObserver(this); | 165 device_manager_->RemoveObserver(this); |
160 proxy_->UnregisterHandler(this); | 166 proxy_->UnregisterHandler(this); |
161 } | 167 } |
162 | 168 |
163 DrmDisplayHost* DrmDisplayHostManager::GetDisplay(int64_t display_id) { | 169 DrmDisplayHost* DrmDisplayHostManager::GetDisplay(int64_t display_id) { |
164 auto it = std::find_if(displays_.begin(), displays_.end(), | 170 auto it = std::find_if(displays_.begin(), displays_.end(), |
165 FindDrmDisplayHostById(display_id)); | 171 FindDrmDisplayHostById(display_id)); |
166 if (it == displays_.end()) | 172 if (it == displays_.end()) |
167 return nullptr; | 173 return nullptr; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 480 |
475 callback.Run(snapshots); | 481 callback.Run(snapshots); |
476 } | 482 } |
477 | 483 |
478 void DrmDisplayHostManager::NotifyDisplayDelegate() const { | 484 void DrmDisplayHostManager::NotifyDisplayDelegate() const { |
479 if (delegate_) | 485 if (delegate_) |
480 delegate_->OnConfigurationChanged(); | 486 delegate_->OnConfigurationChanged(); |
481 } | 487 } |
482 | 488 |
483 } // namespace ui | 489 } // namespace ui |
OLD | NEW |