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/crtc_controller.h" | 5 #include "ui/ozone/platform/dri/crtc_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "ui/ozone/platform/dri/dri_wrapper.h" | 9 #include "ui/ozone/platform/dri/dri_wrapper.h" |
10 #include "ui/ozone/platform/dri/scanout_buffer.h" | 10 #include "ui/ozone/platform/dri/scanout_buffer.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 is_disabled_ = true; | 57 is_disabled_ = true; |
58 page_flip_pending_ = false; | 58 page_flip_pending_ = false; |
59 return drm_->DisableCrtc(crtc_); | 59 return drm_->DisableCrtc(crtc_); |
60 } | 60 } |
61 | 61 |
62 bool CrtcController::SchedulePageFlip(HardwareDisplayPlaneList* plane_list, | 62 bool CrtcController::SchedulePageFlip(HardwareDisplayPlaneList* plane_list, |
63 const OverlayPlaneList& overlays) { | 63 const OverlayPlaneList& overlays) { |
64 DCHECK(!page_flip_pending_); | 64 DCHECK(!page_flip_pending_); |
65 DCHECK(!is_disabled_); | 65 DCHECK(!is_disabled_); |
66 const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(overlays); | 66 const OverlayPlane& primary = OverlayPlane::GetPrimaryPlane(overlays); |
67 if (!primary) { | 67 DCHECK(primary.buffer.get()); |
68 LOG(ERROR) << "No primary plane to display on crtc " << crtc_; | |
69 return true; | |
70 } | |
71 DCHECK(primary->buffer.get()); | |
72 | 68 |
73 if (primary->buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { | 69 if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { |
74 LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " | 70 LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " |
75 << mode_.hdisplay << "x" << mode_.vdisplay << " got " | 71 << mode_.hdisplay << "x" << mode_.vdisplay << " got " |
76 << primary->buffer->GetSize().ToString() << " for" | 72 << primary.buffer->GetSize().ToString() << " for" |
77 << " crtc=" << crtc_ << " connector=" << connector_; | 73 << " crtc=" << crtc_ << " connector=" << connector_; |
78 return true; | 74 return true; |
79 } | 75 } |
80 | 76 |
81 if (!drm_->plane_manager()->AssignOverlayPlanes(plane_list, overlays, crtc_, | 77 if (!drm_->plane_manager()->AssignOverlayPlanes(plane_list, overlays, crtc_, |
82 this)) { | 78 this)) { |
83 LOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; | 79 LOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; |
84 return false; | 80 return false; |
85 } | 81 } |
86 | 82 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 cursor_buffer_ = NULL; | 114 cursor_buffer_ = NULL; |
119 return state; | 115 return state; |
120 } | 116 } |
121 | 117 |
122 bool CrtcController::MoveCursor(const gfx::Point& location) { | 118 bool CrtcController::MoveCursor(const gfx::Point& location) { |
123 DCHECK(!is_disabled_); | 119 DCHECK(!is_disabled_); |
124 return drm_->MoveCursor(crtc_, location); | 120 return drm_->MoveCursor(crtc_, location); |
125 } | 121 } |
126 | 122 |
127 } // namespace ui | 123 } // namespace ui |
OLD | NEW |