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

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

Issue 535963002: ozone: Directly provide size of active mode from HardwareDisplayController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_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
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
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
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_controller.h ('k') | ui/ozone/platform/dri/screen_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698