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

Unified Diff: ui/ozone/platform/dri/hardware_display_controller.cc

Issue 781683005: Ozone: Avoid blocking in Swapbuffer Call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiler warning. 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 side-by-side diff with in-line comments
Download patch
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 7ba5201fd3c87e7c856740be558039458855bdf3..395aa05f6fc1eb8ec4a14d591b12e9122622b14a 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -120,6 +120,9 @@ bool HardwareDisplayController::SchedulePageFlip() {
}
}
+ current_planes_.swap(pending_planes_);
+ pending_planes_.clear();
+
return status;
}
@@ -131,24 +134,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(

Powered by Google App Engine
This is Rietveld 408576698