1/*
2 * Copyright (C) 2017 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 */
16package android.hardware.configstore@1.0;
17
18interface ISurfaceFlingerConfigs {
19    /**
20     * The following two methods define (respectively):
21     *
22     * - The phase offset between hardware vsync and when apps are woken up by the
23     *   Choreographer callback
24     * - The phase offset between hardware vsync and when SurfaceFlinger wakes up
25     *   to consume input
26     *
27     * Their values may be tuned to trade off between display pipeline latency (both
28     * overall latency and the lengths of the app --> SF and SF --> display phases)
29     * and frame delivery jitter (which typically manifests as "jank" or "jerkiness"
30     * while interacting with the device). The default values must produce a
31     * relatively low amount of jitter at the expense of roughly two frames of
32     * app --> display latency, and unless significant testing is performed to avoid
33     * increased display jitter (both manual investigation using systrace [1] and
34     * automated testing using dumpsys gfxinfo [2] are recommended), they should not
35     * be modified.
36     *
37     * [1] https://developer.android.com/studio/profile/systrace.html
38     * [2] https://developer.android.com/training/testing/performance.html
39     */
40    vsyncEventPhaseOffsetNs() generates (OptionalInt64 value);
41    vsyncSfEventPhaseOffsetNs() generates (OptionalInt64 value);
42
43    /**
44     * Instruct the Render Engine to use EGL_IMG_context_priority hint if
45     * availabe.
46     */
47    useContextPriority() generates(OptionalBool value);
48
49    /**
50     * hasWideColorDisplay indicates that the device has
51     * or can support a wide-color display, e.g. color space
52     * greater than sRGB. Typical display may have same
53     * color primaries as DCI-P3.
54     * Indicate support for this feature by setting
55     * TARGET_HAS_WIDE_COLOR_DISPLAY to true in BoardConfig.mk
56     * This also means that the device is color managed.
57     * A color managed device will use the appropriate
58     * display mode depending on the content on the screen.
59     * Default is sRGB.
60     */
61    hasWideColorDisplay() generates (OptionalBool value);
62
63    /**
64     * hwHdrDisplay indicates that the device has
65     * or can support an HDR (High Dynamic Range) display.
66     * Typically an HDR display is also wide-color.
67     * Indicate support for this feature by setting
68     * TARGET_HAS_HDR_DISPLAY to true in BoardConfig.mk
69     */
70    hasHDRDisplay() generates (OptionalBool value);
71
72    /**
73     * Specify the offset in nanoseconds to add to vsync time when timestamping
74     * present fences.
75     */
76    presentTimeOffsetFromVSyncNs() generates(OptionalInt64 value);
77
78    /**
79     * Some hardware can do RGB->YUV conversion more efficiently in hardware
80     * controlled by HWC than in hardware controlled by the video encoder.
81     * This instruct VirtualDisplaySurface to use HWC for such conversion on
82     * GL composition.
83     */
84    useHwcForRGBtoYUV() generates(OptionalBool value);
85
86    /**
87     *  Maximum dimension supported by HWC for virtual display.
88     *  Must be equals to min(max_width, max_height).
89     */
90    maxVirtualDisplaySize() generates (OptionalUInt64 value);
91
92    /**
93     * Indicates if Sync framework is available. Sync framework provides fence
94     * mechanism which significantly reduces buffer processing latency.
95     */
96    hasSyncFramework() generates(OptionalBool value);
97
98    /**
99     * Return true if surface flinger should use vr flinger for compatible vr
100     * apps, false otherwise. Devices that will never be running vr apps should
101     * return false to avoid extra resource usage. Daydream ready devices must
102     * return true for full vr support.
103     */
104    useVrFlinger() generates (OptionalBool value);
105
106    /**
107     * Controls the number of buffers SurfaceFlinger will allocate for use in
108     * FramebufferSurface.
109     */
110    maxFrameBufferAcquiredBuffers() generates(OptionalInt64 value);
111
112    /**
113     * Returns true if surface flinger should start
114     * hardware.graphics.allocator@2.0::IAllocator service.
115     */
116    startGraphicsAllocatorService() generates(OptionalBool value);
117};
118