Index: ui/ozone/platform/drm/gpu/crtc_controller.cc |
diff --git a/ui/ozone/platform/drm/gpu/crtc_controller.cc b/ui/ozone/platform/drm/gpu/crtc_controller.cc |
index a8846210922eabc2880396d3eefb9bc13a1aea1c..6ca93b722afb5a713fcc46f8bd9b6ced50dbfceb 100644 |
--- a/ui/ozone/platform/drm/gpu/crtc_controller.cc |
+++ b/ui/ozone/platform/drm/gpu/crtc_controller.cc |
@@ -33,7 +33,7 @@ CrtcController::~CrtcController() { |
SetCursor(nullptr); |
drm_->DisableCrtc(crtc_); |
if (page_flip_request_) |
- SignalPageFlipRequest(); |
+ SignalPageFlipRequest(gfx::SwapResult::SWAP_ACK); |
} |
} |
@@ -119,11 +119,6 @@ std::vector<uint32_t> CrtcController::GetCompatibleHardwarePlaneIds( |
return drm_->plane_manager()->GetCompatibleHardwarePlaneIds(plane, crtc_); |
} |
-void CrtcController::PageFlipFailed() { |
- pending_planes_.clear(); |
- SignalPageFlipRequest(); |
-} |
- |
void CrtcController::OnPageFlipEvent(unsigned int frame, |
unsigned int seconds, |
unsigned int useconds) { |
@@ -131,10 +126,7 @@ void CrtcController::OnPageFlipEvent(unsigned int frame, |
static_cast<uint64_t>(seconds) * base::Time::kMicrosecondsPerSecond + |
useconds; |
- current_planes_.clear(); |
- current_planes_.swap(pending_planes_); |
- |
- SignalPageFlipRequest(); |
+ SignalPageFlipRequest(gfx::SwapResult::SWAP_ACK); |
} |
bool CrtcController::SetCursor(const scoped_refptr<ScanoutBuffer>& buffer) { |
@@ -168,7 +160,12 @@ bool CrtcController::ResetCursor() { |
return status; |
} |
-void CrtcController::SignalPageFlipRequest() { |
+void CrtcController::SignalPageFlipRequest(gfx::SwapResult result) { |
+ if (result == gfx::SwapResult::SWAP_ACK) |
+ current_planes_.swap(pending_planes_); |
+ |
+ pending_planes_.clear(); |
+ |
// The callback should be a posted task, thus there shouldn't be any |
// re-entrancy issues. |
page_flip_request_->Signal(gfx::SwapResult::SWAP_ACK); |