1# Copyright (C) 2019 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the License); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an AS IS BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15module: "android.sysprop.SurfaceFlingerProperties" 16owner: Platform 17 18# The following two properties define (respectively): 19# 20# - The phase offset between hardware vsync and when apps are woken up by the 21# Choreographer callback 22# - The phase offset between hardware vsync and when SurfaceFlinger wakes up 23# to consume input 24# Their values may be tuned to trade off between display pipeline latency (both 25# overall latency and the lengths of the app --> SF and SF --> display phases) 26# and frame delivery jitter (which typically manifests as "jank" or "jerkiness" 27# while interacting with the device). The default values must produce a 28# relatively low amount of jitter at the expense of roughly two frames of 29# app --> display latency, and unless significant testing is performed to avoid 30# increased display jitter (both manual investigation using systrace [1] and 31# automated testing using dumpsys gfxinfo [2] are recommended), they should not 32# be modified. 33# 34# [1] https://developer.android.com/studio/profile/systrace.html 35# [2] https://developer.android.com/training/testing/performance.html 36prop { 37 api_name: "vsync_event_phase_offset_ns" 38 type: Long 39 scope: Public 40 access: Readonly 41 prop_name: "ro.surface_flinger.vsync_event_phase_offset_ns" 42} 43 44prop { 45 api_name: "vsync_sf_event_phase_offset_ns" 46 type: Long 47 scope: Public 48 access: Readonly 49 prop_name: "ro.surface_flinger.vsync_sf_event_phase_offset_ns" 50} 51 52# Instruct the Render Engine to use EGL_IMG_context_priority hint if available. 53prop { 54 api_name: "use_context_priority" 55 type: Boolean 56 scope: Public 57 access: Readonly 58 prop_name: "ro.surface_flinger.use_context_priority" 59} 60 61# Controls the number of buffers SurfaceFlinger will allocate for use in FramebufferSurface. 62prop { 63 api_name: "max_frame_buffer_acquired_buffers" 64 type: Long 65 scope: Public 66 access: Readonly 67 prop_name: "ro.surface_flinger.max_frame_buffer_acquired_buffers" 68} 69 70# Controls the maximum width in pixels that the graphics pipeline can support for GPU fallback 71# composition. For example, 8k displays with 4k GPUs, or 4k displays with 2k GPUs. 72prop { 73 api_name: "max_graphics_width" 74 type: Integer 75 scope: Public 76 access: Readonly 77 prop_name: "ro.surface_flinger.max_graphics_width" 78} 79 80# Controls the maximum height in pixels that the graphics pipeline can support for GPU fallback 81# composition. For example, 8k displays with 4k GPUs, or 4k displays with 2k GPUs. 82prop { 83 api_name: "max_graphics_height" 84 type: Integer 85 scope: Public 86 access: Readonly 87 prop_name: "ro.surface_flinger.max_graphics_height" 88} 89 90# hasWideColorDisplay indicates that the device has 91# or can support a wide-color display, e.g. color space 92# greater than sRGB. Typical display may have same 93# color primaries as DCI-P3. 94# Indicate support for this feature by setting 95# TARGET_HAS_WIDE_COLOR_DISPLAY to true in BoardConfig.mk 96# This also means that the device is color managed. 97# A color managed device will use the appropriate 98# display mode depending on the content on the screen. 99# Default is sRGB. 100prop { 101 api_name: "has_wide_color_display" 102 type: Boolean 103 scope: Public 104 access: Readonly 105 prop_name: "ro.surface_flinger.has_wide_color_display" 106} 107 108# Indicates if Sync framework is available. Sync framework provides fence 109# mechanism which significantly reduces buffer processing latency. 110prop { 111 api_name: "running_without_sync_framework" 112 type: Boolean 113 scope: Public 114 access: Readonly 115 prop_name: "ro.surface_flinger.running_without_sync_framework" 116} 117 118# hwHDRDisplay indicates that the device has an High Dynamic Range display. 119# A display is considered High Dynamic Range if it 120# 121# 1. is a wide color gamut display, typically DCI-P3 or lager 122# 2. has high luminance capability, typically 540 nits or higher at 10% OPR 123# 124# Indicate support for this feature by setting 125# ro.surface_flinger.has_HDR_display to true in device.mk 126# ro.surface_flinger.has_wide_color_display must be set to true when 127# ro.surface_flinger.has_HDR_display is true. 128prop { 129 api_name: "has_HDR_display" 130 type: Boolean 131 scope: Public 132 access: Readonly 133 prop_name: "ro.surface_flinger.has_HDR_display" 134} 135 136# Specify the offset in nanoseconds to add to vsync time when timestamping present fences. 137prop { 138 api_name: "present_time_offset_from_vsync_ns" 139 type: Long 140 scope: Public 141 access: Readonly 142 prop_name: "ro.surface_flinger.present_time_offset_from_vsync_ns" 143} 144 145# Some hardware can do RGB->YUV conversion more efficiently in hardware 146# controlled by HWC than in hardware controlled by the video encoder. 147# This instruct VirtualDisplaySurface to use HWC for such conversion on 148# GL composition. 149prop { 150 api_name: "force_hwc_copy_for_virtual_displays" 151 type: Boolean 152 scope: Public 153 access: Readonly 154 prop_name: "ro.surface_flinger.force_hwc_copy_for_virtual_displays" 155} 156 157# Maximum dimension supported by HWC for virtual display. 158# Must be equals to min(max_width, max_height). 159prop { 160 api_name: "max_virtual_display_dimension" 161 type: Long 162 scope: Public 163 access: Readonly 164 prop_name: "ro.surface_flinger.max_virtual_display_dimension" 165} 166 167# Return true if surface flinger should use vr flinger for compatible vr 168# apps, false otherwise. Devices that will never be running vr apps should 169# return false to avoid extra resource usage. Daydream ready devices must 170# return true for full vr support. 171prop { 172 api_name: "use_vr_flinger" 173 type: Boolean 174 scope: Public 175 access: Readonly 176 prop_name: "ro.surface_flinger.use_vr_flinger" 177} 178 179# Returns true if surface flinger should start 180# hardware.graphics.allocator@2.0::IAllocator service. 181prop { 182 api_name: "start_graphics_allocator_service" 183 type: Boolean 184 scope: Public 185 access: Readonly 186 prop_name: "ro.surface_flinger.start_graphics_allocator_service" 187} 188 189# Returns the orientation of the primary display device. 190prop { 191 api_name: "primary_display_orientation" 192 type: Enum 193 enum_values: "ORIENTATION_0|ORIENTATION_90|ORIENTATION_180|ORIENTATION_270" 194 scope: Public 195 access: Readonly 196 prop_name: "ro.surface_flinger.primary_display_orientation" 197} 198 199# useColorManagement indicates whether SurfaceFlinger should manage color 200# by switching to appropriate color mode automatically depending on the 201# Dataspace of the surfaces on screen. 202# DEPRECATED: SurfaceFlinger is always color managed. 203prop { 204 api_name: "use_color_management" 205 type: Boolean 206 scope: Public 207 access: Readonly 208 prop_name: "ro.surface_flinger.use_color_management" 209} 210 211# The following four properties define: 212# Returns the default data space and pixel format that SurfaceFlinger 213# expects to receive and output as well as the wide color gamut data space 214# and pixel format for wide color gamut surfaces. 215# To determine the data space and pixel format, there are a few things 216# we recommend to consider: 217# 218# 1. Hardware composer's capability to composite contents with the chosen 219# data space and pixel format efficiently; 220# 2. Hardware composer's ability to composite contents when sRGB contents 221# and the chosen wide color gamut data space contents coexist; 222# 3. For better blending, consider using pixel format where the alpha 223# channel has as many bits as the RGB color channel. 224# 4. Memory consumption and efficient buffer compression when considering 225# more bits in pixel format. 226 227# dataspace is the default data space that SurfaceFlinger expects. 228# The data space must not be Dataspace::UNKNOWN, if unspecified, 229# the default data space is Dataspace::V0_SRGB; 230prop { 231 api_name: "default_composition_dataspace" 232 type: Long 233 scope: Public 234 access: Readonly 235 prop_name: "ro.surface_flinger.default_composition_dataspace" 236} 237 238# pixelFormat is the default pixel format that SurfaceFlinger 239# expects. If unspecified, the default pixel format is 240# PixelFormat::RGBA_8888. 241prop { 242 api_name: "default_composition_pixel_format" 243 type: Integer 244 scope: Public 245 access: Readonly 246 prop_name: "ro.surface_flinger.default_composition_pixel_format" 247} 248 249# wcgDataspace is the data space that SurfaceFlinger expects for 250# wide color gamut surfaces. 251# When hasWideColorDisplay returns true, this API must return a 252# valid wide color gamut data space. 253# The data space must not be UNKNOWN, if unspecified, the data space 254# is V0_SRGB by default, which essentially indicates there's no wide 255# color gamut, meaning hasWideColorDisplay returns false. 256prop { 257 api_name: "wcg_composition_dataspace" 258 type: Long 259 scope: Public 260 access: Readonly 261 prop_name: "ro.surface_flinger.wcg_composition_dataspace" 262} 263 264# wcgPixelFormat is the pixel format that SurfaceFlinger expects for 265# wide color gamut surfaces. If unspecified, the pixel format is 266# PixelFormat::RGBA_8888 by default. 267prop { 268 api_name: "wcg_composition_pixel_format" 269 type: Integer 270 scope: Public 271 access: Readonly 272 prop_name: "ro.surface_flinger.wcg_composition_pixel_format" 273} 274 275# colorSpaceAgnosticDataspace specifies the data space that 276# SurfaceFlinger expects for surfaces which are color space agnostic. 277# The variable works only when useColorManagement is specified. If 278# unspecified, the data space follows what SurfaceFlinger expects for 279# surfaces when useColorManagement is specified. 280# DEPRECATED: do not use 281prop { 282 api_name: "color_space_agnostic_dataspace" 283 type: Long 284 scope: Public 285 access: Readonly 286 prop_name: "ro.surface_flinger.color_space_agnostic_dataspace" 287} 288 289# Return the native panel primary data. The data includes red, green, 290# blue and white. The primary format is CIE 1931 XYZ color space. 291# If unspecified, the primaries is sRGB gamut by default. 292 293prop { 294 api_name: "display_primary_red" 295 type: DoubleList 296 scope: Public 297 access: Readonly 298 prop_name: "ro.surface_flinger.display_primary_red" 299} 300 301prop { 302 api_name: "display_primary_green" 303 type: DoubleList 304 scope: Public 305 access: Readonly 306 prop_name: "ro.surface_flinger.display_primary_green" 307} 308 309prop { 310 api_name: "display_primary_blue" 311 type: DoubleList 312 scope: Public 313 access: Readonly 314 prop_name: "ro.surface_flinger.display_primary_blue" 315} 316 317prop { 318 api_name: "display_primary_white" 319 type: DoubleList 320 scope: Public 321 access: Readonly 322 prop_name: "ro.surface_flinger.display_primary_white" 323} 324 325# refreshRateSwitching indicates whether SurfaceFlinger should use refresh rate 326# switching on the device, e.g. to switch between 60 and 90 Hz. The settings 327# below that are related to refresh rate switching will only have an effect if 328# refresh_rate_switching is enabled. 329prop { 330 api_name: "refresh_rate_switching" 331 type: Boolean 332 scope: Public 333 access: Readonly 334 prop_name: "ro.surface_flinger.refresh_rate_switching" 335 deprecated: true 336} 337 338prop { 339 api_name: "set_idle_timer_ms" 340 type: Integer 341 scope: Public 342 access: Readonly 343 prop_name: "ro.surface_flinger.set_idle_timer_ms" 344} 345 346# setTouchTimerMs indicates what is considered a timeout in milliseconds for Scheduler. 347# This value is used by the Scheduler to trigger touch inactivity callbacks that will switch the 348# display to a lower refresh rate. Setting this property to 0 means there is no timer. 349prop { 350 api_name: "set_touch_timer_ms" 351 type: Integer 352 scope: Public 353 access: Readonly 354 prop_name: "ro.surface_flinger.set_touch_timer_ms" 355} 356 357# setDisplayPowerTimerMs indicates what is considered a timeout in milliseconds for Scheduler. 358# This value is used by the Scheduler to trigger display power inactivity callbacks that will 359# keep the display in peak refresh rate as long as display power is not in normal mode. 360# Setting this property to 0 means there is no timer. 361prop { 362 api_name: "set_display_power_timer_ms" 363 type: Integer 364 scope: Public 365 access: Readonly 366 prop_name: "ro.surface_flinger.set_display_power_timer_ms" 367} 368 369# useContentDetectionForRefreshRate indicates whether Scheduler should detect content FPS, and try 370# to adjust the screen refresh rate based on that. 371prop { 372 api_name: "use_content_detection_for_refresh_rate" 373 type: Boolean 374 scope: Public 375 access: Readonly 376 prop_name: "ro.surface_flinger.use_content_detection_for_refresh_rate" 377} 378 379# useSmart90ForVideo indicates whether Scheduler should detect content FPS, and try to adjust the 380# screen refresh rate based on that. 381# Replaced by useContentDetectionForRefreshRate 382prop { 383 api_name: "use_smart_90_for_video" 384 type: Boolean 385 scope: Public 386 access: Readonly 387 prop_name: "ro.surface_flinger.use_smart_90_for_video" 388 deprecated: true 389} 390 391prop { 392 api_name: "enable_protected_contents" 393 type: Boolean 394 scope: Public 395 access: Readonly 396 prop_name: "ro.surface_flinger.protected_contents" 397} 398 399# Indicates whether Scheduler's idle timer should support a display driver timeout in the kernel. 400# The value of set_idle_timer_ms should be shorter in time than the timeout duration in the kernel. 401prop { 402 api_name: "support_kernel_idle_timer" 403 type: Boolean 404 scope: Public 405 access: Readonly 406 prop_name: "ro.surface_flinger.support_kernel_idle_timer" 407} 408 409# Indicates whether background blurs are supported. 410prop { 411 api_name: "supports_background_blur" 412 type: Boolean 413 scope: Public 414 access: Readonly 415 prop_name: "ro.surface_flinger.supports_background_blur" 416} 417 418# Sets the timeout used to rate limit DISPLAY_UPDATE_IMMINENT Power HAL notifications. 419# SurfaceFlinger wakeups will trigger this boost whenever they are separated by more than this 420# duration (specified in milliseconds). A value of 0 disables the rate limit, and will result in 421# Power HAL notifications every time SF wakes up. 422prop { 423 api_name: "display_update_imminent_timeout_ms" 424 type: Integer 425 scope: Public 426 access: Readonly 427 prop_name: "ro.surface_flinger.display_update_imminent_timeout_ms" 428} 429 430 431# Updates the DeviceProductInfo when a hoplug reconnect event is processed 432prop { 433 api_name: "update_device_product_info_on_hotplug_reconnect" 434 type: Boolean 435 scope: Public 436 access: Readonly 437 prop_name: "ro.surface_flinger.update_device_product_info_on_hotplug_reconnect" 438} 439 440# Enables the frame rate override feature 441prop { 442 api_name: "enable_frame_rate_override" 443 type: Boolean 444 scope: Public 445 access: Readonly 446 prop_name: "ro.surface_flinger.enable_frame_rate_override" 447} 448 449# Enables Layer Caching 450prop { 451 api_name: "enable_layer_caching" 452 type: Boolean 453 scope: Public 454 access: Readonly 455 prop_name: "ro.surface_flinger.enable_layer_caching" 456} 457 458# Enables SDR layer dimming 459prop { 460 api_name: "enable_sdr_dimming" 461 type: Boolean 462 scope: Public 463 access: Readonly 464 prop_name: "ro.surface_flinger.enable_sdr_dimming" 465} 466 467# Ignores Camera layers when calculating HDR coverage information 468prop { 469 api_name: "ignore_hdr_camera_layers" 470 type: Boolean 471 scope: Public 472 access: Readonly 473 prop_name: "ro.surface_flinger.ignore_hdr_camera_layers" 474} 475 476# Controls the minimum acquired buffers SurfaceFlinger will suggest via 477# ISurfaceComposer.getMaxAcquiredBufferCount(). 478prop { 479 api_name: "min_acquired_buffers" 480 type: Long 481 scope: Public 482 access: Readonly 483 prop_name: "ro.surface_flinger.min_acquired_buffers" 484} 485 486# When enabled, SurfaceFlinger will attempt to clear the per-layer HAL buffer cache slots for 487# buffers when they are evicted from the app cache by using additional setLayerBuffer commands. 488# Ideally, this behavior would always be enabled to reduce graphics memory consumption. However, 489# Some HAL implementations may not support the additional setLayerBuffer commands used to clear 490# the cache slots. 491prop { 492 api_name: "clear_slots_with_set_layer_buffer" 493 type: Boolean 494 scope: Public 495 access: Readonly 496 prop_name: "ro.surface_flinger.clear_slots_with_set_layer_buffer" 497} 498 499# Controls the default frame rate override of game applications. Ideally, game applications set 500# desired frame rate via setFrameRate() API. However, to cover the scenario when the game didn't 501# have a set frame rate, we introduce the default frame rate. The priority of this override is the 502# lowest among setFrameRate() and game intervention override. 503prop { 504 api_name: "game_default_frame_rate_override" 505 type: Integer 506 scope: Public 507 access: Readonly 508 prop_name: "ro.surface_flinger.game_default_frame_rate_override" 509} 510