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

Unified Diff: ui/ozone/platform/drm/gpu/screen_manager.cc

Issue 1327413003: [Ozone-DRM] Modeset when re-mapping windows to controllers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-scanout2
Patch Set: fixed unittests Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/screen_manager.cc
diff --git a/ui/ozone/platform/drm/gpu/screen_manager.cc b/ui/ozone/platform/drm/gpu/screen_manager.cc
index 4b4d3f13d75a1e813425e82198ceaa5b333a542a..72a14a1f17f7a65de3e9fb9a7a7a5bbadcbd7e61 100644
--- a/ui/ozone/platform/drm/gpu/screen_manager.cc
+++ b/ui/ozone/platform/drm/gpu/screen_manager.cc
@@ -292,10 +292,20 @@ void ScreenManager::UpdateControllerToWindowMapping() {
// Apply the new mapping to all windows.
for (auto pair : window_map_) {
auto it = window_to_controller_map.find(pair.second);
+ HardwareDisplayController* controller = nullptr;
if (it != window_to_controller_map.end())
- pair.second->SetController(it->second);
- else
- pair.second->SetController(nullptr);
+ controller = it->second;
+
+ bool should_enable =
+ controller && pair.second->GetController() != controller;
+ pair.second->SetController(controller);
+
+ // If we're moving windows between controllers modeset the controller
+ // otherwise the controller may be waiting for a page flip while the window
+ // tries to schedule another buffer.
+ if (should_enable)
+ EnableController(controller, controller->origin(),
+ controller->get_mode());
}
}
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698