| OLD | NEW |
| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 bool ScreenManager::ModesetDisplayController( | 169 bool ScreenManager::ModesetDisplayController( |
| 170 HardwareDisplayController* controller, | 170 HardwareDisplayController* controller, |
| 171 const gfx::Point& origin, | 171 const gfx::Point& origin, |
| 172 const drmModeModeInfo& mode) { | 172 const drmModeModeInfo& mode) { |
| 173 controller->set_origin(origin); | 173 controller->set_origin(origin); |
| 174 // Create a surface suitable for the current controller. | 174 // Create a surface suitable for the current controller. |
| 175 scoped_refptr<ScanoutBuffer> buffer = | 175 scoped_refptr<ScanoutBuffer> buffer = |
| 176 buffer_generator_->Create(gfx::Size(mode.hdisplay, mode.vdisplay)); | 176 buffer_generator_->Create(gfx::Size(mode.hdisplay, mode.vdisplay)); |
| 177 | 177 |
| 178 if (!buffer) { | 178 if (!buffer.get()) { |
| 179 LOG(ERROR) << "Failed to create scanout buffer"; | 179 LOG(ERROR) << "Failed to create scanout buffer"; |
| 180 return false; | 180 return false; |
| 181 } | 181 } |
| 182 | 182 |
| 183 if (!controller->Modeset(OverlayPlane(buffer), mode)) { | 183 if (!controller->Modeset(OverlayPlane(buffer), mode)) { |
| 184 LOG(ERROR) << "Failed to modeset controller"; | 184 LOG(ERROR) << "Failed to modeset controller"; |
| 185 return false; | 185 return false; |
| 186 } | 186 } |
| 187 | 187 |
| 188 return true; | 188 return true; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 203 | 203 |
| 204 // When things go wrong revert back to the previous configuration since | 204 // When things go wrong revert back to the previous configuration since |
| 205 // it is expected that the configuration would not have changed if | 205 // it is expected that the configuration would not have changed if |
| 206 // things fail. | 206 // things fail. |
| 207 (*original)->AddCrtc((*mirror)->RemoveCrtc(crtc)); | 207 (*original)->AddCrtc((*mirror)->RemoveCrtc(crtc)); |
| 208 (*original)->Enable(); | 208 (*original)->Enable(); |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace ui | 212 } // namespace ui |
| OLD | NEW |