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

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

Issue 2148983002: gpu: Take surface handle into account when importing buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid crash in DrmDeviceManager::GetDrmDevice when passed invalid widget Created 4 years, 5 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/gl/gl_image_ozone_native_pixmap_drm_unittest.cc ('k') | ui/ozone/platform/drm/gpu/drm_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27d98f926fc0332fb46b361ea8d2182570cd1541..afd6660d34b622ecefc29d1590d56652e1fc1db5 100644
--- a/ui/ozone/platform/drm/gpu/drm_device_manager.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device_manager.cc
@@ -90,12 +90,12 @@ scoped_refptr<DrmDevice> DrmDeviceManager::GetDrmDevice(
return primary_device_;
auto it = drm_device_map_.find(widget);
- DCHECK(it != drm_device_map_.end())
+ DLOG_IF(WARNING, it == drm_device_map_.end())
<< "Attempting to get device for unknown widget " << widget;
// If the widget isn't associated with a display (headless mode) we can
// allocate buffers from any controller since they will never be scanned out.
// Use the primary DRM device as a fallback when allocating these buffers.
- if (!it->second)
+ if (it == drm_device_map_.end() || !it->second)
return primary_device_;
return it->second;
« no previous file with comments | « ui/gl/gl_image_ozone_native_pixmap_drm_unittest.cc ('k') | ui/ozone/platform/drm/gpu/drm_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698