Index: ui/ozone/platform/drm/gpu/drm_device_manager.cc |
diff --git a/ui/ozone/platform/drm/gpu/drm_device_manager.cc b/ui/ozone/platform/drm/gpu/drm_device_manager.cc |
index b01664abb706586b1332aee3d22d82fa6f87a5f0..4f1dc0f8849929fd022b39c190fd567dd6223344 100644 |
--- a/ui/ozone/platform/drm/gpu/drm_device_manager.cc |
+++ b/ui/ozone/platform/drm/gpu/drm_device_manager.cc |
@@ -38,8 +38,16 @@ DrmDeviceManager::~DrmDeviceManager() { |
} |
bool DrmDeviceManager::AddDrmDevice(const base::FilePath& path, |
- const base::FileDescriptor& fd) { |
+ const base::FileDescriptor& fd, |
+ bool is_vgem) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ if (is_vgem) { |
+ vgem_device_.reset(fd.fd); |
+ vgem_path_ = path; |
+ return true; |
+ } |
+ |
base::File file(fd.fd); |
auto it = |
std::find_if(devices_.begin(), devices_.end(), FindByDevicePath(path)); |
@@ -67,6 +75,12 @@ bool DrmDeviceManager::AddDrmDevice(const base::FilePath& path, |
void DrmDeviceManager::RemoveDrmDevice(const base::FilePath& path) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
+ if (vgem_path_ == path) { |
dnicoara
2015/05/12 15:41:22
Should it be possible to remove the VGEM device? I
dshwang
2015/05/12 16:18:57
What's mean? IMO it's impossible for chromium to d
|
+ vgem_device_.reset(); |
+ vgem_path_ = base::FilePath(); |
+ return; |
+ } |
+ |
auto it = |
std::find_if(devices_.begin(), devices_.end(), FindByDevicePath(path)); |
if (it == devices_.end()) { |
@@ -123,4 +137,9 @@ const DrmDeviceVector& DrmDeviceManager::GetDrmDevices() const { |
return devices_; |
} |
+int DrmDeviceManager::GetVgemDevice() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ return vgem_device_.get(); |
+} |
+ |
} // namespace ui |