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

Unified Diff: ui/ozone/platform/dri/ozone_platform_gbm.cc

Issue 532873002: ozone: gbm: Fail earlier if device can't be opened (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 years, 3 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 cf1027db81fa012288d055406534fdebb8202040..b23b2d49d932c30b2533f8fcfceba8051d7a7d3d 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -50,7 +50,10 @@ class GbmBufferGenerator : public ScanoutBufferGenerator {
GbmBufferGenerator(DriWrapper* dri)
: dri_(dri),
glapi_lib_(dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL)),
- device_(gbm_create_device(dri_->get_fd())) {}
+ device_(gbm_create_device(dri_->get_fd())) {
+ if (!device_)
+ LOG(FATAL) << "Unable to initialize gbm for " << kDefaultGraphicsCardPath;
+ }
virtual ~GbmBufferGenerator() {
gbm_device_destroy(device_);
if (glapi_lib_)
@@ -138,6 +141,7 @@ class OzonePlatformGbm : public OzonePlatform {
virtual void InitializeGPU() OVERRIDE {
dri_.reset(new DriWrapper(kDefaultGraphicsCardPath));
+ dri_->Initialize();
buffer_generator_.reset(new GbmBufferGenerator(dri_.get()));
screen_manager_.reset(new ScreenManager(dri_.get(),
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