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 DCHECK(primary.buffer.get()); | 67 if (!primary) { |
| 68 LOG(ERROR) << "No primary plane to display on crtc " << crtc_; |
| 69 return true; |
| 70 } |
| 71 DCHECK(primary->buffer.get()); |
68 | 72 |
69 if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { | 73 if (primary->buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { |
70 LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " | 74 LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " |
71 << mode_.hdisplay << "x" << mode_.vdisplay << " got " | 75 << mode_.hdisplay << "x" << mode_.vdisplay << " got " |
72 << primary.buffer->GetSize().ToString() << " for" | 76 << primary->buffer->GetSize().ToString() << " for" |
73 << " crtc=" << crtc_ << " connector=" << connector_; | 77 << " crtc=" << crtc_ << " connector=" << connector_; |
74 return true; | 78 return true; |
75 } | 79 } |
76 | 80 |
77 if (!drm_->plane_manager()->AssignOverlayPlanes(plane_list, overlays, crtc_, | 81 if (!drm_->plane_manager()->AssignOverlayPlanes(plane_list, overlays, crtc_, |
78 this)) { | 82 this)) { |
79 LOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; | 83 LOG(ERROR) << "Failed to assign overlay planes for crtc " << crtc_; |
80 return false; | 84 return false; |
81 } | 85 } |
82 | 86 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 cursor_buffer_ = NULL; | 118 cursor_buffer_ = NULL; |
115 return state; | 119 return state; |
116 } | 120 } |
117 | 121 |
118 bool CrtcController::MoveCursor(const gfx::Point& location) { | 122 bool CrtcController::MoveCursor(const gfx::Point& location) { |
119 DCHECK(!is_disabled_); | 123 DCHECK(!is_disabled_); |
120 return drm_->MoveCursor(crtc_, location); | 124 return drm_->MoveCursor(crtc_, location); |
121 } | 125 } |
122 | 126 |
123 } // namespace ui | 127 } // namespace ui |
OLD | NEW |