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

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: Remove unintended changes. 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..d3a8a2f8011c1f3fdec954b437daf8c78a2733d5 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -102,38 +102,32 @@ bool HardwareDisplayController::SchedulePageFlip() {
return true;
bool status = true;
- for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ 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;
}
void HardwareDisplayController::WaitForPageFlipEvent() {
TRACE_EVENT0("dri", "HDC::WaitForPageFlipEvent");
-
drmEventContext drm_event;
drm_event.version = DRM_EVENT_CONTEXT_VERSION;
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