Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Unified Diff: ui/ozone/platform/drm/gpu/drm_device.cc

Issue 1100973002: [2/4]Allow hotplugging of primary DRM device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-hotplug
Patch Set: unittests Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/drm_device.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc
index 7b03b43036e61cde4942ab49d6b554791b8616e0..ed38a2c88a30fcf4277d598524d29a6962004e8d 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -100,14 +100,6 @@ bool CanQueryForResources(int fd) {
return !drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &resources);
}
-bool Authenticate(int fd) {
- drm_magic_t magic;
- memset(&magic, 0, sizeof(magic));
- // We need to make sure the DRM device has enough privilege. Use the DRM
- // authentication logic to figure out if the device has enough permissions.
- return !drmGetMagic(fd, &magic) && !drmAuthMagic(fd, magic);
-}
-
} // namespace
class DrmDevice::IOWatcher
@@ -212,28 +204,6 @@ bool DrmDevice::Initialize() {
return false;
}
- bool print_warning = true;
- // TODO(dnicoara) Ugly hack to block until getting master. This is needed
- // since DRM devices from an old GPU process may be getting deallocated while
- // the new GPU process tries to take them.
- // Move ownership of devices in the Browser process and just have the GPU
- // processes authenticate.
- while (!Authenticate(file_.GetPlatformFile())) {
- PLOG_IF(WARNING, print_warning) << "Failed to take master on "
- << device_path_.value();
- print_warning = false;
-
- usleep(100000);
- file_ =
- base::File(device_path_, base::File::FLAG_OPEN | base::File::FLAG_READ |
- base::File::FLAG_WRITE);
- LOG_IF(FATAL, !file_.IsValid())
- << "Failed to open '" << device_path_.value()
- << "': " << base::File::ErrorToString(file_.error_details());
- }
-
- VLOG(1) << "Succeeded in taking master on " << device_path_.value();
-
#if defined(USE_DRM_ATOMIC)
plane_manager_.reset(new HardwareDisplayPlaneManagerAtomic());
#else
« no previous file with comments | « ui/ozone/platform/drm/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698