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

Unified Diff: ui/ozone/platform/dri/dri_wrapper.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/dri_wrapper.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_wrapper.cc
diff --git a/ui/ozone/platform/dri/dri_wrapper.cc b/ui/ozone/platform/dri/dri_wrapper.cc
index 0d395c87c3922685a68e7ff65427909e3c076e3f..9a9867ad66efe813561c64eb473d66afb70f1ef8 100644
--- a/ui/ozone/platform/dri/dri_wrapper.cc
+++ b/ui/ozone/platform/dri/dri_wrapper.cc
@@ -61,8 +61,8 @@ void DrmDestroyDumbBuffer(int fd, uint32_t handle) {
} // namespace
-DriWrapper::DriWrapper(const char* device_path) {
- fd_ = open(device_path, O_RDWR | O_CLOEXEC);
+DriWrapper::DriWrapper(const char* device_path)
+ : fd_(-1), device_path_(device_path) {
}
DriWrapper::~DriWrapper() {
@@ -70,6 +70,12 @@ DriWrapper::~DriWrapper() {
close(fd_);
}
+void DriWrapper::Initialize() {
+ fd_ = open(device_path_, O_RDWR | O_CLOEXEC);
+ if (fd_ < 0)
+ PLOG(FATAL) << "open: " << device_path_;
+}
+
ScopedDrmCrtcPtr DriWrapper::GetCrtc(uint32_t crtc_id) {
DCHECK(fd_ >= 0);
return ScopedDrmCrtcPtr(drmModeGetCrtc(fd_, crtc_id));
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698