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

Unified Diff: ui/ozone/platform/drm/gpu/drm_device_manager.cc

Issue 1124063003: drm: GPU process manages VGEM fd. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use LazyInstance 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/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

Powered by Google App Engine
This is Rietveld 408576698