[M108 Migration][VD] Avoid pending frame counter becoming negative 44/288644/2
authorlizhifan <lizhi.fan@samsung.com>
Tue, 21 Feb 2023 02:38:15 +0000 (10:38 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 23 Feb 2023 02:52:54 +0000 (02:52 +0000)
There should be only one frame rendering at one time,
this counter help scheduler accomplish this task.

But sometimes this counter could be notified to decrease
more times than it should be, so it becomes negative,
then scheduler is not working properly,
the FPS will go sky high.

From:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/262951/

Change-Id: Icb7ef4ae0c206a8764581cccb078bb57bbc0c432
Signed-off-by: lizhifan <lizhi.fan@samsung.com>
cc/scheduler/scheduler_state_machine.cc

index 35692af..6a1dd9f 100644 (file)
@@ -1465,7 +1465,8 @@ void SchedulerStateMachine::DidReceiveCompositorFrameAck() {
   TRACE_EVENT_NESTABLE_ASYNC_END1("cc", "Scheduler:pending_submit_frames",
                                   TRACE_ID_LOCAL(this), "pending_frames",
                                   pending_submit_frames_);
-  pending_submit_frames_--;
+  if (pending_submit_frames_ > 0)
+    pending_submit_frames_--;
 }
 
 void SchedulerStateMachine::SetTreePrioritiesAndScrollState(