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

Side by Side Diff: ui/ozone/platform/dri/hardware_display_plane_manager.cc

Issue 947293002: [Ozone-Dri] Gracefully handle DRM devices with no resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make errors/warning to vlogs Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/dri/hardware_display_plane_manager.h" 5 #include "ui/ozone/platform/dri/hardware_display_plane_manager.h"
6 6
7 #include <drm.h> 7 #include <drm.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <xf86drm.h> 9 #include <xf86drm.h>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 HardwareDisplayPlaneManager::HardwareDisplayPlaneManager() : drm_(nullptr) { 62 HardwareDisplayPlaneManager::HardwareDisplayPlaneManager() : drm_(nullptr) {
63 } 63 }
64 64
65 HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() { 65 HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() {
66 } 66 }
67 67
68 bool HardwareDisplayPlaneManager::Initialize(DriWrapper* drm) { 68 bool HardwareDisplayPlaneManager::Initialize(DriWrapper* drm) {
69 drm_ = drm; 69 drm_ = drm;
70 ScopedDrmResourcesPtr resources(drmModeGetResources(drm->get_fd())); 70 ScopedDrmResourcesPtr resources(drmModeGetResources(drm->get_fd()));
71 if (!resources) { 71 if (!resources) {
72 LOG(ERROR) << "Failed to get resources."; 72 PLOG(ERROR) << "Failed to get resources";
73 return false; 73 return false;
74 } 74 }
75 75
76 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd())); 76 ScopedDrmPlaneResPtr plane_resources(drmModeGetPlaneResources(drm->get_fd()));
77 if (!plane_resources) { 77 if (!plane_resources) {
78 LOG(ERROR) << "Failed to get plane resources."; 78 LOG(ERROR) << "Failed to get plane resources.";
79 return false; 79 return false;
80 } 80 }
81 81
82 crtcs_.clear(); 82 crtcs_.clear();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (plane->owning_crtc() == crtc_id) { 205 if (plane->owning_crtc() == crtc_id) {
206 plane->set_owning_crtc(0); 206 plane->set_owning_crtc(0);
207 plane->set_in_use(false); 207 plane->set_in_use(false);
208 } else { 208 } else {
209 plane_list->old_plane_list.push_back(plane); 209 plane_list->old_plane_list.push_back(plane);
210 } 210 }
211 } 211 }
212 } 212 }
213 213
214 } // namespace ui 214 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/gbm_wrapper.cc ('k') | ui/ozone/platform/dri/native_display_delegate_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698