Index: ui/ozone/platform/dri/hardware_display_controller.cc |
diff --git a/ui/ozone/platform/dri/hardware_display_controller.cc b/ui/ozone/platform/dri/hardware_display_controller.cc |
index 054e726a4474cf0542c6d1421e695c705969e445..f0b88bb5922c63da19cdd7e824de3cb729618695 100644 |
--- a/ui/ozone/platform/dri/hardware_display_controller.cc |
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc |
@@ -105,6 +105,9 @@ bool HardwareDisplayController::SchedulePageFlip() { |
for (size_t i = 0; i < crtc_controllers_.size(); ++i) |
status &= crtc_controllers_[i]->SchedulePageFlip(pending_planes_); |
+ current_planes_.swap(pending_planes_); |
+ pending_planes_.clear(); |
+ |
return status; |
} |
@@ -116,24 +119,15 @@ void HardwareDisplayController::WaitForPageFlipEvent() { |
drm_event.page_flip_handler = HandlePageFlipEvent; |
drm_event.vblank_handler = NULL; |
- bool has_pending_page_flips = false; |
// Wait for the page-flips to complete. |
for (size_t i = 0; i < crtc_controllers_.size(); ++i) { |
// In mirror mode the page flip callbacks can happen in different order than |
// scheduled, so we need to make sure that the event for the current CRTC is |
// processed before moving to the next CRTC. |
while (crtc_controllers_[i]->page_flip_pending()) { |
- has_pending_page_flips = true; |
crtc_controllers_[i]->drm()->HandleEvent(drm_event); |
} |
} |
- |
- // In case there are no pending pageflips do not replace the current planes |
- // since they are still being used. |
- if (has_pending_page_flips) |
- current_planes_.swap(pending_planes_); |
- |
- pending_planes_.clear(); |
} |
bool HardwareDisplayController::SetCursor( |