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

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

Issue 698883008: [Ozone-DRI] Allow initialization with no displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/screen_manager.h" 5 #include "ui/ozone/platform/dri/screen_manager.h"
6 6
7 #include <xf86drmMode.h> 7 #include <xf86drmMode.h>
8 8
9 #include "ui/gfx/geometry/point.h" 9 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 return controllers_.end(); 149 return controllers_.end();
150 } 150 }
151 151
152 void ScreenManager::ForceInitializationOfPrimaryDisplay() { 152 void ScreenManager::ForceInitializationOfPrimaryDisplay() {
153 LOG(WARNING) << "Forcing initialization of primary display."; 153 LOG(WARNING) << "Forcing initialization of primary display.";
154 ScopedVector<HardwareDisplayControllerInfo> displays = 154 ScopedVector<HardwareDisplayControllerInfo> displays =
155 GetAvailableDisplayControllerInfos(dri_->get_fd()); 155 GetAvailableDisplayControllerInfos(dri_->get_fd());
156 156
157 DCHECK_NE(0u, displays.size()); 157 if (displays.empty())
158 return;
158 159
159 ScopedDrmPropertyPtr dpms( 160 ScopedDrmPropertyPtr dpms(
160 dri_->GetProperty(displays[0]->connector(), "DPMS")); 161 dri_->GetProperty(displays[0]->connector(), "DPMS"));
161 if (dpms) 162 if (dpms)
162 dri_->SetProperty(displays[0]->connector()->connector_id, 163 dri_->SetProperty(displays[0]->connector()->connector_id,
163 dpms->prop_id, 164 dpms->prop_id,
164 DRM_MODE_DPMS_ON); 165 DRM_MODE_DPMS_ON);
165 166
166 AddDisplayController(dri_, 167 AddDisplayController(dri_,
167 displays[0]->crtc()->crtc_id, 168 displays[0]->crtc()->crtc_id,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 // When things go wrong revert back to the previous configuration since 211 // When things go wrong revert back to the previous configuration since
211 // it is expected that the configuration would not have changed if 212 // it is expected that the configuration would not have changed if
212 // things fail. 213 // things fail.
213 (*original)->AddCrtc((*mirror)->RemoveCrtc(crtc)); 214 (*original)->AddCrtc((*mirror)->RemoveCrtc(crtc));
214 (*original)->Enable(); 215 (*original)->Enable();
215 return false; 216 return false;
216 } 217 }
217 218
218 } // namespace ui 219 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698