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

Side by Side Diff: ui/ozone/platform/dri/ozone_platform_dri.cc

Issue 956563004: [Ozone-Dri] Gracefully handle DRM devices with no resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/dri/ozone_platform_dri.h" 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" 9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
10 #include "ui/events/ozone/device/device_manager.h" 10 #include "ui/events/ozone/device/device_manager.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 window_manager_.get(), display_manager_.get())); 84 window_manager_.get(), display_manager_.get()));
85 platform_window->Initialize(); 85 platform_window->Initialize();
86 return platform_window.Pass(); 86 return platform_window.Pass();
87 } 87 }
88 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { 88 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
89 return make_scoped_ptr(new NativeDisplayDelegateProxy( 89 return make_scoped_ptr(new NativeDisplayDelegateProxy(
90 gpu_platform_support_host_.get(), device_manager_.get(), 90 gpu_platform_support_host_.get(), device_manager_.get(),
91 display_manager_.get())); 91 display_manager_.get()));
92 } 92 }
93 void InitializeUI() override { 93 void InitializeUI() override {
94 dri_->Initialize(); 94 if (!dri_->Initialize())
95 LOG(FATAL) << "Failed to initialize primary DRM device";
96
95 // This makes sure that simple targets that do not handle display 97 // This makes sure that simple targets that do not handle display
96 // configuration can still use the primary display. 98 // configuration can still use the primary display.
97 ForceInitializationOfPrimaryDisplay(dri_, screen_manager_.get()); 99 ForceInitializationOfPrimaryDisplay(dri_, screen_manager_.get());
98 drm_device_manager_.reset(new DrmDeviceManager(dri_)); 100 drm_device_manager_.reset(new DrmDeviceManager(dri_));
99 display_manager_.reset(new DisplayManager()); 101 display_manager_.reset(new DisplayManager());
100 surface_factory_ozone_.reset( 102 surface_factory_ozone_.reset(
101 new DriSurfaceFactory(&window_delegate_manager_)); 103 new DriSurfaceFactory(&window_delegate_manager_));
102 scoped_ptr<NativeDisplayDelegateDri> ndd(new NativeDisplayDelegateDri( 104 scoped_ptr<NativeDisplayDelegateDri> ndd(new NativeDisplayDelegateDri(
103 screen_manager_.get(), dri_, 105 screen_manager_.get(), dri_,
104 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator()))); 106 scoped_ptr<DrmDeviceGenerator>(new DrmDeviceGenerator())));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); 160 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
159 }; 161 };
160 162
161 } // namespace 163 } // namespace
162 164
163 OzonePlatform* CreateOzonePlatformDri() { 165 OzonePlatform* CreateOzonePlatformDri() {
164 return new OzonePlatformDri; 166 return new OzonePlatformDri;
165 } 167 }
166 168
167 } // namespace ui 169 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/native_display_delegate_dri.cc ('k') | ui/ozone/platform/dri/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698