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_device.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 usleep(100000); | 226 usleep(100000); |
227 file_ = | 227 file_ = |
228 base::File(device_path_, base::File::FLAG_OPEN | base::File::FLAG_READ | | 228 base::File(device_path_, base::File::FLAG_OPEN | base::File::FLAG_READ | |
229 base::File::FLAG_WRITE); | 229 base::File::FLAG_WRITE); |
230 LOG_IF(FATAL, !file_.IsValid()) | 230 LOG_IF(FATAL, !file_.IsValid()) |
231 << "Failed to open '" << device_path_.value() | 231 << "Failed to open '" << device_path_.value() |
232 << "': " << base::File::ErrorToString(file_.error_details()); | 232 << "': " << base::File::ErrorToString(file_.error_details()); |
233 } | 233 } |
234 | 234 |
| 235 VLOG(1) << "Succeeded in taking master on " << device_path_.value(); |
| 236 |
235 #if defined(USE_DRM_ATOMIC) | 237 #if defined(USE_DRM_ATOMIC) |
236 plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic()); | 238 plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic()); |
237 #else | 239 #else |
238 plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy()); | 240 plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy()); |
239 #endif // defined(USE_DRM_ATOMIC) | 241 #endif // defined(USE_DRM_ATOMIC) |
240 if (!plane_manager_->Initialize(this)) { | 242 if (!plane_manager_->Initialize(this)) { |
241 LOG(ERROR) << "Failed to initialize the plane manager for " | 243 LOG(ERROR) << "Failed to initialize the plane manager for " |
242 << device_path_.value(); | 244 << device_path_.value(); |
243 plane_manager_.reset(); | 245 plane_manager_.reset(); |
244 return false; | 246 return false; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 DCHECK(file_.IsValid()); | 500 DCHECK(file_.IsValid()); |
499 return (drmSetMaster(file_.GetPlatformFile()) == 0); | 501 return (drmSetMaster(file_.GetPlatformFile()) == 0); |
500 } | 502 } |
501 | 503 |
502 bool DrmDevice::DropMaster() { | 504 bool DrmDevice::DropMaster() { |
503 DCHECK(file_.IsValid()); | 505 DCHECK(file_.IsValid()); |
504 return (drmDropMaster(file_.GetPlatformFile()) == 0); | 506 return (drmDropMaster(file_.GetPlatformFile()) == 0); |
505 } | 507 } |
506 | 508 |
507 } // namespace ui | 509 } // namespace ui |
OLD | NEW |