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

Side by Side Diff: ui/ozone/platform/dri/hardware_display_controller.cc

Issue 641173003: [Ozone-DRI] Fix waiting for page flips in mirror mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/dri/hardware_display_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/dri/hardware_display_controller.h" 5 #include "ui/ozone/platform/dri/hardware_display_controller.h"
6 6
7 #include <drm.h> 7 #include <drm.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <string.h> 9 #include <string.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 TRACE_EVENT0("dri", "HDC::WaitForPageFlipEvent"); 112 TRACE_EVENT0("dri", "HDC::WaitForPageFlipEvent");
113 113
114 drmEventContext drm_event; 114 drmEventContext drm_event;
115 drm_event.version = DRM_EVENT_CONTEXT_VERSION; 115 drm_event.version = DRM_EVENT_CONTEXT_VERSION;
116 drm_event.page_flip_handler = HandlePageFlipEvent; 116 drm_event.page_flip_handler = HandlePageFlipEvent;
117 drm_event.vblank_handler = NULL; 117 drm_event.vblank_handler = NULL;
118 118
119 bool has_pending_page_flips = false; 119 bool has_pending_page_flips = false;
120 // Wait for the page-flips to complete. 120 // Wait for the page-flips to complete.
121 for (size_t i = 0; i < crtc_controllers_.size(); ++i) { 121 for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
122 if (crtc_controllers_[i]->page_flip_pending()) { 122 // In mirror mode the page flip callbacks can happen in different order than
123 // scheduled, so we need to make sure that the event for the current CRTC is
124 // processed before moving to the next CRTC.
125 while (crtc_controllers_[i]->page_flip_pending()) {
123 has_pending_page_flips = true; 126 has_pending_page_flips = true;
124 crtc_controllers_[i]->drm()->HandleEvent(drm_event); 127 crtc_controllers_[i]->drm()->HandleEvent(drm_event);
125 } 128 }
126 } 129 }
127 130
128 // In case there are no pending pageflips do not replace the current planes 131 // In case there are no pending pageflips do not replace the current planes
129 // since they are still being used. 132 // since they are still being used.
130 if (has_pending_page_flips) 133 if (has_pending_page_flips)
131 current_planes_.swap(pending_planes_); 134 current_planes_.swap(pending_planes_);
132 135
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const { 210 uint64_t HardwareDisplayController::GetTimeOfLastFlip() const {
208 uint64_t time = 0; 211 uint64_t time = 0;
209 for (size_t i = 0; i < crtc_controllers_.size(); ++i) 212 for (size_t i = 0; i < crtc_controllers_.size(); ++i)
210 if (time < crtc_controllers_[i]->time_of_last_flip()) 213 if (time < crtc_controllers_[i]->time_of_last_flip())
211 time = crtc_controllers_[i]->time_of_last_flip(); 214 time = crtc_controllers_[i]->time_of_last_flip();
212 215
213 return time; 216 return time;
214 } 217 }
215 218
216 } // namespace ui 219 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/dri/hardware_display_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698