| Peiyong Lin | 6a043d5 | 2019-04-01 17:18:21 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright 2019 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 | */ | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 16 |  | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 17 | #include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h> | 
|  | 18 | #include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h> | 
|  | 19 | #include <android/hardware/configstore/1.1/types.h> | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 20 | #include <configstore/Utils.h> | 
| Ady Abraham | 48da070 | 2020-02-04 15:59:25 -0800 | [diff] [blame] | 21 | #include <utils/Log.h> | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 22 |  | 
| Ana Krulec | 3f6a206 | 2020-01-23 15:48:01 -0800 | [diff] [blame] | 23 | #include <log/log.h> | 
| Sundong Ahn | 85131bd | 2019-02-18 15:51:53 +0900 | [diff] [blame] | 24 | #include <cstdlib> | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 25 | #include <tuple> | 
|  | 26 |  | 
|  | 27 | #include "SurfaceFlingerProperties.h" | 
|  | 28 |  | 
|  | 29 | namespace android { | 
|  | 30 | namespace sysprop { | 
|  | 31 | using namespace android::hardware::configstore; | 
|  | 32 | using namespace android::hardware::configstore::V1_0; | 
| Sundong Ahn | cb20cca | 2019-02-22 11:57:38 +0900 | [diff] [blame] | 33 | using android::hardware::graphics::common::V1_2::Dataspace; | 
|  | 34 | using android::hardware::graphics::common::V1_2::PixelFormat; | 
|  | 35 | using android::ui::DisplayPrimaries; | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 36 |  | 
| Vishnu Nair | 8c8db54 | 2021-09-17 19:51:45 -0700 | [diff] [blame] | 37 | // Keep logic in sync with WindowManagerService functions that query SurfaceFlinger properties. | 
|  | 38 | // Consider exposing properties via ISurfaceComposer instead. | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 39 | int64_t vsync_event_phase_offset_ns(int64_t defaultValue) { | 
|  | 40 | auto temp = SurfaceFlingerProperties::vsync_event_phase_offset_ns(); | 
|  | 41 | if (temp.has_value()) { | 
|  | 42 | return *temp; | 
|  | 43 | } | 
|  | 44 | return getInt64<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::vsyncEventPhaseOffsetNs>( | 
|  | 45 | defaultValue); | 
|  | 46 | } | 
|  | 47 |  | 
|  | 48 | int64_t vsync_sf_event_phase_offset_ns(int64_t defaultValue) { | 
|  | 49 | auto temp = SurfaceFlingerProperties::vsync_sf_event_phase_offset_ns(); | 
|  | 50 | if (temp.has_value()) { | 
|  | 51 | return *temp; | 
|  | 52 | } | 
|  | 53 | return getInt64<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs>( | 
|  | 54 | defaultValue); | 
|  | 55 | } | 
|  | 56 |  | 
|  | 57 | bool use_context_priority(bool defaultValue) { | 
|  | 58 | auto temp = SurfaceFlingerProperties::use_context_priority(); | 
|  | 59 | if (temp.has_value()) { | 
|  | 60 | return *temp; | 
|  | 61 | } | 
|  | 62 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>( | 
|  | 63 | defaultValue); | 
|  | 64 | } | 
|  | 65 |  | 
|  | 66 | int64_t max_frame_buffer_acquired_buffers(int64_t defaultValue) { | 
|  | 67 | auto temp = SurfaceFlingerProperties::max_frame_buffer_acquired_buffers(); | 
|  | 68 | if (temp.has_value()) { | 
|  | 69 | return *temp; | 
|  | 70 | } | 
|  | 71 | return getInt64<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers>( | 
|  | 72 | defaultValue); | 
|  | 73 | } | 
|  | 74 |  | 
| Brian Lindahl | a13f2d5 | 2020-03-05 11:54:17 +0100 | [diff] [blame] | 75 | int32_t max_graphics_width(int32_t defaultValue) { | 
|  | 76 | auto temp = SurfaceFlingerProperties::max_graphics_width(); | 
|  | 77 | if (temp.has_value()) { | 
|  | 78 | return *temp; | 
|  | 79 | } | 
|  | 80 | return defaultValue; | 
|  | 81 | } | 
|  | 82 |  | 
|  | 83 | int32_t max_graphics_height(int32_t defaultValue) { | 
|  | 84 | auto temp = SurfaceFlingerProperties::max_graphics_height(); | 
|  | 85 | if (temp.has_value()) { | 
|  | 86 | return *temp; | 
|  | 87 | } | 
|  | 88 | return defaultValue; | 
|  | 89 | } | 
|  | 90 |  | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 91 | bool has_wide_color_display(bool defaultValue) { | 
|  | 92 | auto temp = SurfaceFlingerProperties::has_wide_color_display(); | 
|  | 93 | if (temp.has_value()) { | 
|  | 94 | return *temp; | 
|  | 95 | } | 
|  | 96 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::hasWideColorDisplay>( | 
|  | 97 | defaultValue); | 
|  | 98 | } | 
|  | 99 |  | 
|  | 100 | bool running_without_sync_framework(bool defaultValue) { | 
|  | 101 | auto temp = SurfaceFlingerProperties::running_without_sync_framework(); | 
|  | 102 | if (temp.has_value()) { | 
|  | 103 | return !(*temp); | 
|  | 104 | } | 
|  | 105 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::hasSyncFramework>(defaultValue); | 
|  | 106 | } | 
|  | 107 |  | 
|  | 108 | bool has_HDR_display(bool defaultValue) { | 
|  | 109 | auto temp = SurfaceFlingerProperties::has_HDR_display(); | 
|  | 110 | if (temp.has_value()) { | 
|  | 111 | return *temp; | 
|  | 112 | } | 
|  | 113 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::hasHDRDisplay>(defaultValue); | 
|  | 114 | } | 
|  | 115 |  | 
|  | 116 | int64_t present_time_offset_from_vsync_ns(int64_t defaultValue) { | 
|  | 117 | auto temp = SurfaceFlingerProperties::present_time_offset_from_vsync_ns(); | 
|  | 118 | if (temp.has_value()) { | 
|  | 119 | return *temp; | 
|  | 120 | } | 
|  | 121 | return getInt64<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs>( | 
|  | 122 | defaultValue); | 
|  | 123 | } | 
|  | 124 |  | 
|  | 125 | bool force_hwc_copy_for_virtual_displays(bool defaultValue) { | 
|  | 126 | auto temp = SurfaceFlingerProperties::force_hwc_copy_for_virtual_displays(); | 
|  | 127 | if (temp.has_value()) { | 
|  | 128 | return *temp; | 
|  | 129 | } | 
|  | 130 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useHwcForRGBtoYUV>( | 
|  | 131 | defaultValue); | 
|  | 132 | } | 
|  | 133 |  | 
|  | 134 | int64_t max_virtual_display_dimension(int64_t defaultValue) { | 
|  | 135 | auto temp = SurfaceFlingerProperties::max_virtual_display_dimension(); | 
|  | 136 | if (temp.has_value()) { | 
|  | 137 | return *temp; | 
|  | 138 | } | 
|  | 139 | return getUInt64<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::maxVirtualDisplaySize>( | 
|  | 140 | defaultValue); | 
|  | 141 | } | 
|  | 142 |  | 
|  | 143 | bool use_vr_flinger(bool defaultValue) { | 
|  | 144 | auto temp = SurfaceFlingerProperties::use_vr_flinger(); | 
|  | 145 | if (temp.has_value()) { | 
|  | 146 | return *temp; | 
|  | 147 | } | 
|  | 148 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useVrFlinger>(defaultValue); | 
|  | 149 | } | 
|  | 150 |  | 
|  | 151 | bool start_graphics_allocator_service(bool defaultValue) { | 
|  | 152 | auto temp = SurfaceFlingerProperties::start_graphics_allocator_service(); | 
|  | 153 | if (temp.has_value()) { | 
|  | 154 | return *temp; | 
|  | 155 | } | 
|  | 156 | return getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::startGraphicsAllocatorService>( | 
|  | 157 | defaultValue); | 
|  | 158 | } | 
|  | 159 |  | 
|  | 160 | SurfaceFlingerProperties::primary_display_orientation_values primary_display_orientation( | 
|  | 161 | SurfaceFlingerProperties::primary_display_orientation_values defaultValue) { | 
|  | 162 | auto temp = SurfaceFlingerProperties::primary_display_orientation(); | 
|  | 163 | if (temp.has_value()) { | 
|  | 164 | return *temp; | 
|  | 165 | } | 
|  | 166 | auto configDefault = DisplayOrientation::ORIENTATION_0; | 
|  | 167 | switch (defaultValue) { | 
|  | 168 | case SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_90: | 
|  | 169 | configDefault = DisplayOrientation::ORIENTATION_90; | 
|  | 170 | break; | 
|  | 171 | case SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_180: | 
|  | 172 | configDefault = DisplayOrientation::ORIENTATION_180; | 
|  | 173 | break; | 
|  | 174 | case SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_270: | 
|  | 175 | configDefault = DisplayOrientation::ORIENTATION_270; | 
|  | 176 | break; | 
|  | 177 | default: | 
|  | 178 | configDefault = DisplayOrientation::ORIENTATION_0; | 
|  | 179 | break; | 
|  | 180 | } | 
|  | 181 | DisplayOrientation result = | 
|  | 182 | getDisplayOrientation<V1_1::ISurfaceFlingerConfigs, | 
|  | 183 | &V1_1::ISurfaceFlingerConfigs::primaryDisplayOrientation>( | 
|  | 184 | configDefault); | 
|  | 185 | switch (result) { | 
|  | 186 | case DisplayOrientation::ORIENTATION_90: | 
|  | 187 | return SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_90; | 
|  | 188 | case DisplayOrientation::ORIENTATION_180: | 
|  | 189 | return SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_180; | 
|  | 190 | case DisplayOrientation::ORIENTATION_270: | 
|  | 191 | return SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_270; | 
|  | 192 | default: | 
|  | 193 | break; | 
|  | 194 | } | 
|  | 195 | return SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_0; | 
|  | 196 | } | 
|  | 197 |  | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 198 | int64_t default_composition_dataspace(Dataspace defaultValue) { | 
|  | 199 | auto temp = SurfaceFlingerProperties::default_composition_dataspace(); | 
|  | 200 | if (temp.has_value()) { | 
|  | 201 | return *temp; | 
|  | 202 | } | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 203 | return static_cast<int64_t>(defaultValue); | 
|  | 204 | } | 
|  | 205 |  | 
|  | 206 | int32_t default_composition_pixel_format(PixelFormat defaultValue) { | 
|  | 207 | auto temp = SurfaceFlingerProperties::default_composition_pixel_format(); | 
|  | 208 | if (temp.has_value()) { | 
|  | 209 | return *temp; | 
|  | 210 | } | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 211 | return static_cast<int32_t>(defaultValue); | 
|  | 212 | } | 
|  | 213 |  | 
|  | 214 | int64_t wcg_composition_dataspace(Dataspace defaultValue) { | 
|  | 215 | auto temp = SurfaceFlingerProperties::wcg_composition_dataspace(); | 
|  | 216 | if (temp.has_value()) { | 
|  | 217 | return *temp; | 
|  | 218 | } | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 219 | return static_cast<int64_t>(defaultValue); | 
|  | 220 | } | 
|  | 221 |  | 
|  | 222 | int32_t wcg_composition_pixel_format(PixelFormat defaultValue) { | 
|  | 223 | auto temp = SurfaceFlingerProperties::wcg_composition_pixel_format(); | 
|  | 224 | if (temp.has_value()) { | 
|  | 225 | return *temp; | 
|  | 226 | } | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 227 | return static_cast<int32_t>(defaultValue); | 
|  | 228 | } | 
|  | 229 |  | 
| Yichi Chen | da901bf | 2019-06-28 14:58:27 +0800 | [diff] [blame] | 230 | int64_t color_space_agnostic_dataspace(Dataspace defaultValue) { | 
|  | 231 | auto temp = SurfaceFlingerProperties::color_space_agnostic_dataspace(); | 
|  | 232 | if (temp.has_value()) { | 
|  | 233 | return *temp; | 
|  | 234 | } | 
|  | 235 | return static_cast<int64_t>(defaultValue); | 
|  | 236 | } | 
|  | 237 |  | 
| Ana Krulec | 10e0205 | 2020-02-04 17:16:10 +0000 | [diff] [blame] | 238 | bool refresh_rate_switching(bool defaultValue) { | 
| Ana Krulec | 3f6a206 | 2020-01-23 15:48:01 -0800 | [diff] [blame] | 239 | #pragma clang diagnostic push | 
|  | 240 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" | 
| Ana Krulec | 10e0205 | 2020-02-04 17:16:10 +0000 | [diff] [blame] | 241 | auto temp = SurfaceFlingerProperties::refresh_rate_switching(); | 
| Ana Krulec | 3f6a206 | 2020-01-23 15:48:01 -0800 | [diff] [blame] | 242 | #pragma clang diagnostic pop | 
| Ana Krulec | 10e0205 | 2020-02-04 17:16:10 +0000 | [diff] [blame] | 243 | if (temp.has_value()) { | 
| Ana Krulec | 3f6a206 | 2020-01-23 15:48:01 -0800 | [diff] [blame] | 244 | ALOGW("Using deprecated refresh_rate_switching sysprop. Value: %d", *temp); | 
| Ana Krulec | 10e0205 | 2020-02-04 17:16:10 +0000 | [diff] [blame] | 245 | return *temp; | 
|  | 246 | } | 
|  | 247 | return defaultValue; | 
|  | 248 | } | 
|  | 249 |  | 
| Ady Abraham | be59c0d | 2019-03-05 13:01:13 -0800 | [diff] [blame] | 250 | int32_t set_idle_timer_ms(int32_t defaultValue) { | 
|  | 251 | auto temp = SurfaceFlingerProperties::set_idle_timer_ms(); | 
|  | 252 | if (temp.has_value()) { | 
|  | 253 | return *temp; | 
|  | 254 | } | 
|  | 255 | return defaultValue; | 
|  | 256 | } | 
|  | 257 |  | 
| Ady Abraham | 8532d01 | 2019-05-08 14:50:56 -0700 | [diff] [blame] | 258 | int32_t set_touch_timer_ms(int32_t defaultValue) { | 
|  | 259 | auto temp = SurfaceFlingerProperties::set_touch_timer_ms(); | 
|  | 260 | if (temp.has_value()) { | 
|  | 261 | return *temp; | 
|  | 262 | } | 
|  | 263 | return defaultValue; | 
|  | 264 | } | 
|  | 265 |  | 
| Ady Abraham | 6fe2c17 | 2019-07-12 12:37:57 -0700 | [diff] [blame] | 266 | int32_t set_display_power_timer_ms(int32_t defaultValue) { | 
|  | 267 | auto temp = SurfaceFlingerProperties::set_display_power_timer_ms(); | 
|  | 268 | if (temp.has_value()) { | 
|  | 269 | return *temp; | 
|  | 270 | } | 
|  | 271 | return defaultValue; | 
|  | 272 | } | 
|  | 273 |  | 
| Ady Abraham | 48da070 | 2020-02-04 15:59:25 -0800 | [diff] [blame] | 274 | bool use_content_detection_for_refresh_rate(bool defaultValue) { | 
|  | 275 | #pragma clang diagnostic push | 
|  | 276 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" | 
|  | 277 | auto smart_90_deprecated = SurfaceFlingerProperties::use_smart_90_for_video(); | 
|  | 278 | #pragma clang diagnostic pop | 
|  | 279 | if (smart_90_deprecated.has_value()) { | 
|  | 280 | ALOGW("Using deprecated use_smart_90_for_video sysprop. Value: %d", *smart_90_deprecated); | 
|  | 281 | return *smart_90_deprecated; | 
|  | 282 | } | 
|  | 283 |  | 
|  | 284 | auto temp = SurfaceFlingerProperties::use_content_detection_for_refresh_rate(); | 
| Ana Krulec | e5a06e0 | 2019-03-06 17:09:03 -0800 | [diff] [blame] | 285 | if (temp.has_value()) { | 
|  | 286 | return *temp; | 
|  | 287 | } | 
|  | 288 | return defaultValue; | 
|  | 289 | } | 
|  | 290 |  | 
| Peiyong Lin | 6a043d5 | 2019-04-01 17:18:21 -0700 | [diff] [blame] | 291 | bool enable_protected_contents(bool defaultValue) { | 
|  | 292 | auto temp = SurfaceFlingerProperties::enable_protected_contents(); | 
|  | 293 | if (temp.has_value()) { | 
|  | 294 | return *temp; | 
|  | 295 | } | 
|  | 296 | return defaultValue; | 
|  | 297 | } | 
|  | 298 |  | 
| Alec Mouri | dc28b37 | 2019-04-18 21:17:13 -0700 | [diff] [blame] | 299 | bool support_kernel_idle_timer(bool defaultValue) { | 
|  | 300 | auto temp = SurfaceFlingerProperties::support_kernel_idle_timer(); | 
|  | 301 | if (temp.has_value()) { | 
|  | 302 | return *temp; | 
|  | 303 | } | 
|  | 304 | return defaultValue; | 
|  | 305 | } | 
|  | 306 |  | 
| John Reck | ac09e45 | 2021-04-07 16:35:37 -0400 | [diff] [blame] | 307 | bool enable_sdr_dimming(bool defaultValue) { | 
|  | 308 | return SurfaceFlingerProperties::enable_sdr_dimming().value_or(defaultValue); | 
|  | 309 | } | 
|  | 310 |  | 
| Dan Stoza | 030fbc1 | 2020-02-19 15:32:01 -0800 | [diff] [blame] | 311 | int32_t display_update_imminent_timeout_ms(int32_t defaultValue) { | 
|  | 312 | auto temp = SurfaceFlingerProperties::display_update_imminent_timeout_ms(); | 
|  | 313 | if (temp.has_value()) { | 
|  | 314 | return *temp; | 
|  | 315 | } | 
|  | 316 | return defaultValue; | 
|  | 317 | } | 
|  | 318 |  | 
| Sundong Ahn | 85131bd | 2019-02-18 15:51:53 +0900 | [diff] [blame] | 319 | #define DISPLAY_PRIMARY_SIZE 3 | 
|  | 320 |  | 
|  | 321 | constexpr float kSrgbRedX = 0.4123f; | 
|  | 322 | constexpr float kSrgbRedY = 0.2126f; | 
|  | 323 | constexpr float kSrgbRedZ = 0.0193f; | 
|  | 324 | constexpr float kSrgbGreenX = 0.3576f; | 
|  | 325 | constexpr float kSrgbGreenY = 0.7152f; | 
|  | 326 | constexpr float kSrgbGreenZ = 0.1192f; | 
|  | 327 | constexpr float kSrgbBlueX = 0.1805f; | 
|  | 328 | constexpr float kSrgbBlueY = 0.0722f; | 
|  | 329 | constexpr float kSrgbBlueZ = 0.9506f; | 
|  | 330 | constexpr float kSrgbWhiteX = 0.9505f; | 
|  | 331 | constexpr float kSrgbWhiteY = 1.0000f; | 
|  | 332 | constexpr float kSrgbWhiteZ = 1.0891f; | 
|  | 333 |  | 
|  | 334 | DisplayPrimaries getDisplayNativePrimaries() { | 
|  | 335 | auto mDisplay_primary_red = SurfaceFlingerProperties::display_primary_red(); | 
|  | 336 | auto mDisplay_primary_green = SurfaceFlingerProperties::display_primary_green(); | 
|  | 337 | auto mDisplay_primary_blue = SurfaceFlingerProperties::display_primary_blue(); | 
|  | 338 | auto mDisplay_primary_white = SurfaceFlingerProperties::display_primary_white(); | 
|  | 339 | // To avoid null point exception. | 
|  | 340 | mDisplay_primary_red.resize(DISPLAY_PRIMARY_SIZE); | 
|  | 341 | mDisplay_primary_green.resize(DISPLAY_PRIMARY_SIZE); | 
|  | 342 | mDisplay_primary_blue.resize(DISPLAY_PRIMARY_SIZE); | 
|  | 343 | mDisplay_primary_white.resize(DISPLAY_PRIMARY_SIZE); | 
|  | 344 | DisplayPrimaries primaries = | 
|  | 345 | {{static_cast<float>(mDisplay_primary_red[0].value_or(kSrgbRedX)), | 
|  | 346 | static_cast<float>(mDisplay_primary_red[1].value_or(kSrgbRedY)), | 
|  | 347 | static_cast<float>(mDisplay_primary_red[2].value_or(kSrgbRedZ))}, | 
|  | 348 | {static_cast<float>(mDisplay_primary_green[0].value_or(kSrgbGreenX)), | 
|  | 349 | static_cast<float>(mDisplay_primary_green[1].value_or(kSrgbGreenY)), | 
|  | 350 | static_cast<float>(mDisplay_primary_green[2].value_or(kSrgbGreenZ))}, | 
|  | 351 | {static_cast<float>(mDisplay_primary_blue[0].value_or(kSrgbBlueX)), | 
|  | 352 | static_cast<float>(mDisplay_primary_blue[1].value_or(kSrgbBlueY)), | 
|  | 353 | static_cast<float>(mDisplay_primary_blue[2].value_or(kSrgbBlueZ))}, | 
|  | 354 | {static_cast<float>(mDisplay_primary_white[0].value_or(kSrgbWhiteX)), | 
|  | 355 | static_cast<float>(mDisplay_primary_white[1].value_or(kSrgbWhiteY)), | 
|  | 356 | static_cast<float>(mDisplay_primary_white[2].value_or(kSrgbWhiteZ))}}; | 
|  | 357 |  | 
|  | 358 | return primaries; | 
|  | 359 | } | 
|  | 360 |  | 
| Marin Shalamanov | f8c6372 | 2020-10-06 13:11:21 +0200 | [diff] [blame] | 361 | bool update_device_product_info_on_hotplug_reconnect(bool defaultValue) { | 
|  | 362 | return SurfaceFlingerProperties::update_device_product_info_on_hotplug_reconnect().value_or( | 
|  | 363 | defaultValue); | 
|  | 364 | } | 
|  | 365 |  | 
| Ady Abraham | 4899ff8 | 2021-01-06 13:53:29 -0800 | [diff] [blame] | 366 | bool enable_frame_rate_override(bool defaultValue) { | 
|  | 367 | return SurfaceFlingerProperties::enable_frame_rate_override().value_or(defaultValue); | 
|  | 368 | } | 
|  | 369 |  | 
| Ady Abraham | 8ca643a | 2022-10-18 18:26:47 -0700 | [diff] [blame] | 370 | bool frame_rate_override_for_native_rates(bool defaultValue) { | 
|  | 371 | return SurfaceFlingerProperties::frame_rate_override_for_native_rates().value_or(defaultValue); | 
|  | 372 | } | 
|  | 373 |  | 
| Ady Abraham | 884bf01 | 2022-11-28 15:15:13 -0800 | [diff] [blame] | 374 | bool frame_rate_override_global(bool defaultValue) { | 
|  | 375 | return SurfaceFlingerProperties::frame_rate_override_global().value_or(defaultValue); | 
|  | 376 | } | 
|  | 377 |  | 
| Ady Abraham | 9c87def | 2021-02-18 11:25:28 -0800 | [diff] [blame] | 378 | bool enable_layer_caching(bool defaultValue) { | 
|  | 379 | return SurfaceFlingerProperties::enable_layer_caching().value_or(defaultValue); | 
|  | 380 | } | 
|  | 381 |  | 
| John Reck | 49d9ad3 | 2022-02-23 19:03:31 -0500 | [diff] [blame] | 382 | bool ignore_hdr_camera_layers(bool defaultValue) { | 
|  | 383 | return SurfaceFlingerProperties::ignore_hdr_camera_layers().value_or(defaultValue); | 
|  | 384 | } | 
|  | 385 |  | 
| Sundong Ahn | d5e08f6 | 2018-12-12 20:27:28 +0900 | [diff] [blame] | 386 | } // namespace sysprop | 
|  | 387 | } // namespace android |