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

Unified Diff: ui/ozone/platform/drm/host/drm_device_handle.cc

Issue 1124063003: drm: GPU process manages VGEM fd. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io code is moved to io thread Created 5 years, 7 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/host/drm_device_handle.cc
diff --git a/ui/ozone/platform/drm/host/drm_device_handle.cc b/ui/ozone/platform/drm/host/drm_device_handle.cc
index 36d5a8373099b551cb468478f2b2829343a7672f..1b7038082895903cf7df47ed4f1464bd2284c25a 100644
--- a/ui/ozone/platform/drm/host/drm_device_handle.cc
+++ b/ui/ozone/platform/drm/host/drm_device_handle.cc
@@ -26,16 +26,17 @@ bool Authenticate(int fd) {
} // namespace
-DrmDeviceHandle::DrmDeviceHandle() {
+DrmDeviceHandle::DrmDeviceHandle() : is_vgem_(false) {
}
DrmDeviceHandle::~DrmDeviceHandle() {
base::ThreadRestrictions::AssertIOAllowed();
}
-bool DrmDeviceHandle::Initialize(const base::FilePath& path) {
+bool DrmDeviceHandle::Initialize(const base::FilePath& path, bool is_vgem) {
CHECK(path.DirName() == base::FilePath("/dev/dri"));
base::ThreadRestrictions::AssertIOAllowed();
+ is_vgem_ = is_vgem;
bool print_warning = true;
while (true) {
file_.reset();
@@ -46,6 +47,8 @@ bool DrmDeviceHandle::Initialize(const base::FilePath& path) {
}
file_.reset(fd);
+ if (is_vgem_)
+ break;
if (Authenticate(file_.get()))
break;

Powered by Google App Engine
This is Rietveld 408576698