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

Unified Diff: ui/ozone/platform/drm/ozone_platform_drm.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
Index: ui/ozone/platform/drm/ozone_platform_drm.cc
diff --git a/ui/ozone/platform/drm/ozone_platform_drm.cc b/ui/ozone/platform/drm/ozone_platform_drm.cc
index 5b6e32c1344db529059e8ba9c678812387c199e1..38030313331e1bec9ac4593fd2fd80b6b7249a48 100644
--- a/ui/ozone/platform/drm/ozone_platform_drm.cc
+++ b/ui/ozone/platform/drm/ozone_platform_drm.cc
@@ -49,8 +49,7 @@ namespace {
class OzonePlatformDrm : public OzonePlatform {
public:
OzonePlatformDrm()
- : drm_(new DrmDevice(GetPrimaryDisplayCardPath())),
- buffer_generator_(new DrmBufferGenerator()),
+ : buffer_generator_(new DrmBufferGenerator()),
screen_manager_(new ScreenManager(buffer_generator_.get())),
device_manager_(CreateDeviceManager()) {}
~OzonePlatformDrm() override {}
@@ -87,26 +86,20 @@ class OzonePlatformDrm : public OzonePlatform {
scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
return make_scoped_ptr(new DrmNativeDisplayDelegate(
gpu_platform_support_host_.get(), device_manager_.get(),
- display_manager_.get(), drm_->device_path()));
+ display_manager_.get(), GetPrimaryDisplayCardPath()));
}
void InitializeUI() override {
#if defined(OS_CHROMEOS)
gpu_lock_.reset(new GpuLock());
#endif
- if (!drm_->Initialize())
- LOG(FATAL) << "Failed to initialize primary DRM device";
-
- // This makes sure that simple targets that do not handle display
- // configuration can still use the primary display.
- ForceInitializationOfPrimaryDisplay(drm_, screen_manager_.get());
- drm_device_manager_.reset(new DrmDeviceManager(drm_));
+ drm_device_manager_.reset(new DrmDeviceManager(
+ scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator())));
display_manager_.reset(new DisplayManager());
window_manager_.reset(new DrmWindowHostManager());
cursor_.reset(new DrmCursor(window_manager_.get()));
surface_factory_ozone_.reset(new DrmSurfaceFactory(screen_manager_.get()));
scoped_ptr<DrmGpuDisplayManager> ndd(new DrmGpuDisplayManager(
- screen_manager_.get(), drm_,
- scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator())));
+ screen_manager_.get(), drm_device_manager_.get()));
gpu_platform_support_.reset(new DrmGpuPlatformSupport(
drm_device_manager_.get(), screen_manager_.get(), ndd.Pass()));
gpu_platform_support_host_.reset(
@@ -133,7 +126,6 @@ class OzonePlatformDrm : public OzonePlatform {
private:
// Objects in the "GPU" process.
scoped_ptr<GpuLock> gpu_lock_;
- scoped_refptr<DrmDevice> drm_;
scoped_ptr<DrmDeviceManager> drm_device_manager_;
scoped_ptr<DrmBufferGenerator> buffer_generator_;
scoped_ptr<ScreenManager> screen_manager_;
« no previous file with comments | « ui/ozone/platform/drm/host/drm_native_display_delegate.cc ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698