• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 namespace android {
20 
21 // Jank information tracked by SurfaceFlinger(SF) for perfetto tracing and telemetry.
22 enum JankType {
23     // No Jank
24     None = 0x0,
25     // Jank that occurs in the layers below SurfaceFlinger
26     DisplayHAL = 0x1,
27     // SF took too long on the CPU
28     SurfaceFlingerCpuDeadlineMissed = 0x2,
29     // SF took too long on the GPU
30     SurfaceFlingerGpuDeadlineMissed = 0x4,
31     // Either App or GPU took too long on the frame
32     AppDeadlineMissed = 0x8,
33     // Vsync predictions have drifted beyond the threshold from the actual HWVsync
34     PredictionError = 0x10,
35     // Janks caused due to the time SF was scheduled to work on the frame
36     // Example: SF woke up too early and latched a buffer resulting in an early present
37     SurfaceFlingerScheduling = 0x20,
38     // A buffer is said to be stuffed if it was expected to be presented on a vsync but was
39     // presented later because the previous buffer was presented in its expected vsync. This
40     // usually happens if there is an unexpectedly long frame causing the rest of the buffers
41     // to enter a stuffed state.
42     BufferStuffing = 0x40,
43     // Jank due to unknown reasons.
44     Unknown = 0x80,
45     // SF is said to be stuffed if the previous frame ran longer than expected resulting in the case
46     // where the previous frame was presented in the current frame's expected vsync. This pushes the
47     // current frame to the next vsync. The behavior is similar to BufferStuffing.
48     SurfaceFlingerStuffing = 0x100,
49 };
50 
51 } // namespace android
52