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

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 comments. 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 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(
« content/browser/compositor/buffer_queue.cc ('K') | « ui/ozone/platform/dri/gbm_surfaceless.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698