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

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

Issue 794323006: Re-upload - Fix crash when we don't have a plane to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « ui/ozone/platform/dri/crtc_controller.cc ('k') | ui/ozone/platform/dri/overlay_plane.h » ('j') | 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/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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 current_planes_ = std::vector<OverlayPlane>(1, primary); 67 current_planes_ = std::vector<OverlayPlane>(1, primary);
68 pending_planes_.clear(); 68 pending_planes_.clear();
69 is_disabled_ = false; 69 is_disabled_ = false;
70 mode_ = mode; 70 mode_ = mode;
71 return status; 71 return status;
72 } 72 }
73 73
74 bool HardwareDisplayController::Enable() { 74 bool HardwareDisplayController::Enable() {
75 TRACE_EVENT0("dri", "HDC::Enable"); 75 TRACE_EVENT0("dri", "HDC::Enable");
76 DCHECK(!current_planes_.empty()); 76 DCHECK(!current_planes_.empty());
77 OverlayPlane primary = OverlayPlane::GetPrimaryPlane(current_planes_); 77 const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(current_planes_);
78 DCHECK(primary.buffer.get()); 78 DCHECK(primary->buffer.get());
79 bool status = true; 79 bool status = true;
80 for (size_t i = 0; i < crtc_controllers_.size(); ++i) 80 for (size_t i = 0; i < crtc_controllers_.size(); ++i)
81 status &= crtc_controllers_[i]->Modeset(primary, mode_); 81 status &= crtc_controllers_[i]->Modeset(*primary, mode_);
82 82
83 return status; 83 return status;
84 } 84 }
85 85
86 void HardwareDisplayController::Disable() { 86 void HardwareDisplayController::Disable() {
87 TRACE_EVENT0("dri", "HDC::Disable"); 87 TRACE_EVENT0("dri", "HDC::Disable");
88 for (size_t i = 0; i < crtc_controllers_.size(); ++i) 88 for (size_t i = 0; i < crtc_controllers_.size(); ++i)
89 crtc_controllers_[i]->Disable(); 89 crtc_controllers_[i]->Disable();
90 90
91 is_disabled_ = true; 91 is_disabled_ = true;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { 239 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const {
240 uint64_t time = 0; 240 uint64_t time = 0;
241 for (size_t i = 0; i < crtc_controllers_.size(); ++i) 241 for (size_t i = 0; i < crtc_controllers_.size(); ++i)
242 if (time < crtc_controllers_[i]->time_of_last_flip()) 242 if (time < crtc_controllers_[i]->time_of_last_flip())
243 time = crtc_controllers_[i]->time_of_last_flip(); 243 time = crtc_controllers_[i]->time_of_last_flip();
244 244
245 return time; 245 return time;
246 } 246 }
247 247
248 } // namespace ui 248 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/crtc_controller.cc ('k') | ui/ozone/platform/dri/overlay_plane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698