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/hardware_display_controller.h" | 5 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
6 | 6 |
7 #include <drm.h> | 7 #include <drm.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 | 252 |
253 bool HardwareDisplayController::IsMirrored() const { | 253 bool HardwareDisplayController::IsMirrored() const { |
254 return crtc_states_.size() > 1; | 254 return crtc_states_.size() > 1; |
255 } | 255 } |
256 | 256 |
257 bool HardwareDisplayController::IsDisabled() const { | 257 bool HardwareDisplayController::IsDisabled() const { |
258 return is_disabled_; | 258 return is_disabled_; |
259 } | 259 } |
260 | 260 |
| 261 gfx::Size HardwareDisplayController::GetModeSize() const { |
| 262 return gfx::Size(mode_.hdisplay, mode_.vdisplay); |
| 263 } |
| 264 |
261 bool HardwareDisplayController::ModesetCrtc( | 265 bool HardwareDisplayController::ModesetCrtc( |
262 const scoped_refptr<ScanoutBuffer>& buffer, | 266 const scoped_refptr<ScanoutBuffer>& buffer, |
263 drmModeModeInfo mode, | 267 drmModeModeInfo mode, |
264 CrtcState* state) { | 268 CrtcState* state) { |
265 if (!drm_->SetCrtc(state->crtc(), | 269 if (!drm_->SetCrtc(state->crtc(), |
266 buffer->GetFramebufferId(), | 270 buffer->GetFramebufferId(), |
267 std::vector<uint32_t>(1, state->connector()), | 271 std::vector<uint32_t>(1, state->connector()), |
268 &mode)) { | 272 &mode)) { |
269 LOG(ERROR) << "Failed to modeset: error='" << strerror(errno) | 273 LOG(ERROR) << "Failed to modeset: error='" << strerror(errno) |
270 << "' crtc=" << state->crtc() | 274 << "' crtc=" << state->crtc() |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 plane.overlay_plane)) { | 324 plane.overlay_plane)) { |
321 LOG(ERROR) << "Cannot display on overlay: " << strerror(errno); | 325 LOG(ERROR) << "Cannot display on overlay: " << strerror(errno); |
322 return false; | 326 return false; |
323 } | 327 } |
324 } | 328 } |
325 | 329 |
326 return true; | 330 return true; |
327 } | 331 } |
328 | 332 |
329 } // namespace ui | 333 } // namespace ui |
OLD | NEW |