Index: ui/ozone/platform/drm/gpu/hardware_display_controller.cc |
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc |
index 3f31b6ef962e7507af8b2ce0ecb58115cc4afbbc..43719632e6a4cac62e275de5cad7b1f6cb58d25b 100644 |
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc |
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc |
@@ -56,7 +56,6 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary, |
mode_ = mode; |
current_planes_ = std::vector<OverlayPlane>(1, primary); |
- pending_planes_.clear(); |
ClearPendingRequests(); |
// Because a page flip is pending we need to leave some state for the |
@@ -71,7 +70,13 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary, |
bool HardwareDisplayController::Enable() { |
TRACE_EVENT0("drm", "HDC::Enable"); |
DCHECK(!current_planes_.empty()); |
- const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(current_planes_); |
+ |
+ const OverlayPlane* primary = nullptr; |
+ // Use the last scheduled buffer to modeset to preserve request order. |
+ if (!requests_.empty()) |
+ primary = OverlayPlane::GetPrimaryPlane(requests_.back().planes); |
+ else |
+ primary = OverlayPlane::GetPrimaryPlane(current_planes_); |
return Modeset(*primary, mode_); |
} |