Commit 86f28deb authored by Khushal's avatar Khushal Committed by Commit Bot

viz: Defer BeginFrame throttling everywhere.

The initial change [1] restricted the delay in BeginFrame throttling to
SurfaceControl to allow the change to be merged to M76. But this
throttling policy is better in general so enable it everywhere.

[1]: https://chromium-review.googlesource.com/c/chromium/src/+/1675464
R=ericrk@chromium.org

Bug: 973703
Change-Id: Ia26c23786b1e827fa22126c06a474fca65d20280
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1684216
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673856}
parent 05e756c3
......@@ -140,12 +140,9 @@ bool BeginFrameSource::RequestCallbackOnGpuAvailable() {
switch (gpu_busy_response_state_) {
case GpuBusyThrottlingState::kIdle:
if (allow_one_begin_frame_after_gpu_busy_) {
gpu_busy_response_state_ =
GpuBusyThrottlingState::kOneBeginFrameAfterBusySent;
return false;
}
FALLTHROUGH;
case GpuBusyThrottlingState::kOneBeginFrameAfterBusySent:
gpu_busy_response_state_ = GpuBusyThrottlingState::kThrottled;
return true;
......
......@@ -159,11 +159,6 @@ class VIZ_COMMON_EXPORT BeginFrameSource {
virtual void AsValueInto(base::trace_event::TracedValue* state) const;
void AllowOneBeginFrameAfterGpuBusy() {
DCHECK(!is_gpu_busy_);
allow_one_begin_frame_after_gpu_busy_ = true;
}
protected:
// Returns whether begin-frames to clients should be withheld (because the gpu
// is still busy, for example). If this returns true, then OnGpuNoLongerBusy()
......@@ -197,8 +192,6 @@ class VIZ_COMMON_EXPORT BeginFrameSource {
GpuBusyThrottlingState gpu_busy_response_state_ =
GpuBusyThrottlingState::kIdle;
bool allow_one_begin_frame_after_gpu_busy_ = false;
DISALLOW_COPY_AND_ASSIGN(BeginFrameSource);
};
......
......@@ -796,8 +796,6 @@ TEST_F(DisplaySchedulerTest, SetNeedsOneBeginFrame) {
}
TEST_F(DisplaySchedulerTest, GpuBusyNotifications) {
fake_begin_frame_source_.AllowOneBeginFrameAfterGpuBusy();
SurfaceId root_surface_id(
kArbitraryFrameSinkId,
LocalSurfaceId(1, base::UnguessableToken::Create()));
......
......@@ -78,10 +78,6 @@ RootCompositorFrameSinkImpl::Create(
external_begin_frame_source =
std::make_unique<ExternalBeginFrameSourceAndroid>(restart_id,
params->refresh_rate);
if (output_surface->context_provider() &&
output_surface->context_provider()->ContextCapabilities().surfaceless) {
external_begin_frame_source->AllowOneBeginFrameAfterGpuBusy();
}
#else
if (params->disable_frame_rate_limit) {
synthetic_begin_frame_source =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment