| 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/drm/gpu/crtc_controller.h" | 5 #include "ui/ozone/platform/drm/gpu/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/drm/gpu/drm_device.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
| 10 #include "ui/ozone/platform/drm/gpu/page_flip_observer.h" | 10 #include "ui/ozone/platform/drm/gpu/page_flip_observer.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 is_disabled_ = false; | 47 is_disabled_ = false; |
| 48 | 48 |
| 49 // drmModeSetCrtc has an immediate effect, so we can assume that the current | 49 // drmModeSetCrtc has an immediate effect, so we can assume that the current |
| 50 // planes have been updated. However if a page flip is still pending, set the | 50 // planes have been updated. However if a page flip is still pending, set the |
| 51 // pending planes to the same values so that the callback keeps the correct | 51 // pending planes to the same values so that the callback keeps the correct |
| 52 // state. | 52 // state. |
| 53 current_planes_ = std::vector<OverlayPlane>(1, plane); | 53 current_planes_ = std::vector<OverlayPlane>(1, plane); |
| 54 if (page_flip_pending_) | 54 if (page_flip_pending_) |
| 55 pending_planes_ = current_planes_; | 55 pending_planes_ = current_planes_; |
| 56 | 56 |
| 57 if (!ResetCursor()) | 57 ResetCursor(); |
| 58 return false; | |
| 59 | 58 |
| 60 return true; | 59 return true; |
| 61 } | 60 } |
| 62 | 61 |
| 63 bool CrtcController::Disable() { | 62 bool CrtcController::Disable() { |
| 64 if (is_disabled_) | 63 if (is_disabled_) |
| 65 return true; | 64 return true; |
| 66 | 65 |
| 67 is_disabled_ = true; | 66 is_disabled_ = true; |
| 68 return drm_->DisableCrtc(crtc_); | 67 return drm_->DisableCrtc(crtc_); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if (!status) { | 152 if (!status) { |
| 154 PLOG(ERROR) << "drmModeSetCursor: device " << drm_->device_path().value() | 153 PLOG(ERROR) << "drmModeSetCursor: device " << drm_->device_path().value() |
| 155 << " crtc " << crtc_ << " handle " << handle << " size " | 154 << " crtc " << crtc_ << " handle " << handle << " size " |
| 156 << size.ToString(); | 155 << size.ToString(); |
| 157 } | 156 } |
| 158 | 157 |
| 159 return status; | 158 return status; |
| 160 } | 159 } |
| 161 | 160 |
| 162 } // namespace ui | 161 } // namespace ui |
| OLD | NEW |