Jiyong Park | 200825e | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 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 | */ |
| 16 | package android.hardware.configstore@1.0; |
| 17 | |
| 18 | interface ISurfaceFlingerConfigs { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 19 | /** |
Fabien Sanglard | eebc925 | 2017-03-06 11:46:36 -0800 | [diff] [blame] | 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 | */ |
Jiyong Park | 200825e | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 40 | vsyncEventPhaseOffsetNs() generates (OptionalInt64 value); |
Fabien Sanglard | eebc925 | 2017-03-06 11:46:36 -0800 | [diff] [blame] | 41 | vsyncSfEventPhaseOffsetNs() generates (OptionalInt64 value); |
| 42 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 43 | /** |
Fabien Sanglard | cbece28 | 2017-03-13 13:03:04 -0700 | [diff] [blame] | 44 | * Instruct the Render Engine to use EGL_IMG_context_priority hint if |
| 45 | * availabe. |
| 46 | */ |
| 47 | useContextPriority() generates(OptionalBool value); |
Courtney Goeltzenleuchter | 3670b44 | 2017-03-09 09:04:29 -0700 | [diff] [blame] | 48 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 49 | /** |
Courtney Goeltzenleuchter | 3670b44 | 2017-03-09 09:04:29 -0700 | [diff] [blame] | 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 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 63 | /** |
Courtney Goeltzenleuchter | 3670b44 | 2017-03-09 09:04:29 -0700 | [diff] [blame] | 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); |
Fabien Sanglard | 8d7e31e | 2017-03-14 13:16:30 -0700 | [diff] [blame] | 71 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 72 | /** |
Fabien Sanglard | 8d7e31e | 2017-03-14 13:16:30 -0700 | [diff] [blame] | 73 | * Specify the offset in nanoseconds to add to vsync time when timestamping |
| 74 | * present fences. |
| 75 | */ |
| 76 | presentTimeOffsetFromVSyncNs() generates(OptionalInt64 value); |
Fabien Sanglard | 38295e7 | 2017-03-14 11:43:18 -0700 | [diff] [blame] | 77 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 78 | /** |
Fabien Sanglard | 38295e7 | 2017-03-14 11:43:18 -0700 | [diff] [blame] | 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); |
Fabien Sanglard | a33c7e4 | 2017-03-10 10:31:14 -0800 | [diff] [blame] | 85 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 86 | /** |
Fabien Sanglard | a33c7e4 | 2017-03-10 10:31:14 -0800 | [diff] [blame] | 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); |
Fabien Sanglard | bf4da3d | 2017-03-10 17:15:43 -0800 | [diff] [blame] | 91 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 92 | /** |
Fabien Sanglard | bf4da3d | 2017-03-10 17:15:43 -0800 | [diff] [blame] | 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); |
Steven Thomas | cb4172a | 2017-03-13 17:42:18 -0700 | [diff] [blame] | 97 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 98 | /** |
Steven Thomas | cb4172a | 2017-03-13 17:42:18 -0700 | [diff] [blame] | 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); |
Fabien Sanglard | 3d9f5ad | 2017-03-10 15:37:07 -0800 | [diff] [blame] | 105 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 106 | /** |
Fabien Sanglard | 3d9f5ad | 2017-03-10 15:37:07 -0800 | [diff] [blame] | 107 | * Controls the number of buffers SurfaceFlinger will allocate for use in |
| 108 | * FramebufferSurface. |
| 109 | */ |
| 110 | maxFrameBufferAcquiredBuffers() generates(OptionalInt64 value); |
Chia-I Wu | 1224640 | 2017-04-11 15:17:24 -0700 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * Returns true if surface flinger should start |
| 114 | * hardware.graphics.allocator@2.0::IAllocator service. |
| 115 | */ |
| 116 | startGraphicsAllocatorService() generates(OptionalBool value); |
Jiyong Park | 200825e | 2017-01-14 19:40:33 +0900 | [diff] [blame] | 117 | }; |