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

Unified Diff: ui/ozone/platform/dri/ozone_platform_gbm.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, 10 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/dri/ozone_platform_dri.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/ozone_platform_gbm.cc
diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc
index fe728f041c3f813b63c0cc4ecdacdd3976699cbd..dcfbbcb8cb61dd811e11ac83a20014014e31c4a6 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -96,8 +96,10 @@ class GbmDeviceGenerator : public DrmDeviceGenerator {
scoped_refptr<DriWrapper> CreateDevice(const base::FilePath& path,
base::File file) override {
scoped_refptr<DriWrapper> drm = new GbmWrapper(path, file.Pass());
- drm->Initialize();
- return drm;
+ if (drm->Initialize())
+ return drm;
+
+ return nullptr;
}
private:
@@ -173,7 +175,9 @@ class OzonePlatformGbm : public OzonePlatform {
gl_api_loader_.reset(new GlApiLoader());
// Async page flips are supported only on surfaceless mode.
gbm_ = new GbmWrapper(GetFirstDisplayCardPath());
- gbm_->Initialize();
+ if (!gbm_->Initialize())
+ LOG(FATAL) << "Failed to initialize primary DRM device";
+
drm_device_manager_.reset(new DrmDeviceManager(gbm_));
buffer_generator_.reset(new GbmBufferGenerator());
screen_manager_.reset(new ScreenManager(buffer_generator_.get()));
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_dri.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698