Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 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 | |
Roman Stratiienko | bde9566 | 2022-12-10 20:27:58 +0200 | [diff] [blame] | 17 | #pragma once |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 18 | |
| 19 | #include <hardware/hwcomposer2.h> |
| 20 | |
Roman Stratiienko | d2cc738 | 2022-12-28 18:51:59 +0200 | [diff] [blame] | 21 | #include <atomic> |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 22 | #include <optional> |
Roman Stratiienko | f818d4c | 2022-12-28 20:12:19 +0200 | [diff] [blame] | 23 | #include <sstream> |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 24 | |
Sasha McIntosh | 851ea4d | 2024-12-04 17:14:55 -0500 | [diff] [blame] | 25 | #include <ui/GraphicTypes.h> |
| 26 | |
Roman Stratiienko | 0137f86 | 2022-01-04 18:27:40 +0200 | [diff] [blame] | 27 | #include "HwcDisplayConfigs.h" |
Tim Van Patten | a2f3efa | 2024-10-15 17:44:54 -0600 | [diff] [blame] | 28 | #include "compositor/DisplayInfo.h" |
Roman Stratiienko | 22fe961 | 2023-01-17 21:22:29 +0200 | [diff] [blame] | 29 | #include "compositor/FlatteningController.h" |
Roman Stratiienko | 4b2cc48 | 2022-02-21 14:53:58 +0200 | [diff] [blame] | 30 | #include "compositor/LayerData.h" |
Roman Stratiienko | 4e99405 | 2022-02-09 17:40:35 +0200 | [diff] [blame] | 31 | #include "drm/DrmAtomicStateManager.h" |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 32 | #include "drm/ResourceManager.h" |
| 33 | #include "drm/VSyncWorker.h" |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 34 | #include "hwc2_device/HwcLayer.h" |
| 35 | |
| 36 | namespace android { |
| 37 | |
| 38 | class Backend; |
Drew Davenport | 9344318 | 2023-12-14 09:25:45 +0000 | [diff] [blame] | 39 | class DrmHwc; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 40 | |
Roman Stratiienko | 456e2d6 | 2022-01-29 01:17:39 +0200 | [diff] [blame] | 41 | inline constexpr uint32_t kPrimaryDisplay = 0; |
| 42 | |
Roman Stratiienko | 2a93e4c | 2022-12-19 18:24:47 +0200 | [diff] [blame] | 43 | // NOLINTNEXTLINE |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 44 | class HwcDisplay { |
| 45 | public: |
Drew Davenport | 8998f8b | 2024-10-24 10:15:12 -0600 | [diff] [blame] | 46 | enum ConfigError { |
| 47 | kNone, |
| 48 | kBadConfig, |
| 49 | kSeamlessNotAllowed, |
| 50 | kSeamlessNotPossible |
| 51 | }; |
| 52 | |
Drew Davenport | 9344318 | 2023-12-14 09:25:45 +0000 | [diff] [blame] | 53 | HwcDisplay(hwc2_display_t handle, HWC2::DisplayType type, DrmHwc *hwc); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 54 | HwcDisplay(const HwcDisplay &) = delete; |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 55 | ~HwcDisplay(); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 56 | |
Drew Davenport | 76c17a8 | 2025-01-15 15:02:45 -0700 | [diff] [blame] | 57 | void SetColorTransformMatrix( |
| 58 | const std::array<float, 16> &color_transform_matrix); |
| 59 | |
Roman Stratiienko | bb594ba | 2022-02-18 16:52:03 +0200 | [diff] [blame] | 60 | /* SetPipeline should be carefully used only by DrmHwcTwo hotplug handlers */ |
Roman Stratiienko | 63762a9 | 2023-09-18 22:33:45 +0300 | [diff] [blame] | 61 | void SetPipeline(std::shared_ptr<DrmDisplayPipeline> pipeline); |
Roman Stratiienko | bb594ba | 2022-02-18 16:52:03 +0200 | [diff] [blame] | 62 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 63 | HWC2::Error CreateComposition(AtomicCommitArgs &a_args); |
| 64 | std::vector<HwcLayer *> GetOrderLayersByZPos(); |
| 65 | |
| 66 | void ClearDisplay(); |
| 67 | |
| 68 | std::string Dump(); |
| 69 | |
Drew Davenport | f7e8833 | 2024-09-06 12:54:38 -0600 | [diff] [blame] | 70 | const HwcDisplayConfigs &GetDisplayConfigs() const { |
| 71 | return configs_; |
| 72 | } |
| 73 | |
Drew Davenport | 9799ab8 | 2024-10-23 10:15:45 -0600 | [diff] [blame] | 74 | // Get the config representing the mode that has been committed to KMS. |
Drew Davenport | 8998f8b | 2024-10-24 10:15:12 -0600 | [diff] [blame] | 75 | auto GetCurrentConfig() const -> const HwcDisplayConfig *; |
Drew Davenport | 9799ab8 | 2024-10-23 10:15:45 -0600 | [diff] [blame] | 76 | |
Drew Davenport | 85be25d | 2024-10-23 10:26:34 -0600 | [diff] [blame] | 77 | // Get the config that was last requested through SetActiveConfig and similar |
| 78 | // functions. This may differ from the GetCurrentConfig if the config change |
| 79 | // is queued up to take effect in the future. |
Drew Davenport | 8998f8b | 2024-10-24 10:15:12 -0600 | [diff] [blame] | 80 | auto GetLastRequestedConfig() const -> const HwcDisplayConfig *; |
| 81 | |
Drew Davenport | 97b5abc | 2024-11-07 10:43:54 -0700 | [diff] [blame] | 82 | // Set a config synchronously. If the requested config fails to be committed, |
| 83 | // this will return with an error. Otherwise, the config will have been |
| 84 | // committed to the kernel on successful return. |
| 85 | ConfigError SetConfig(hwc2_config_t config); |
| 86 | |
Drew Davenport | 8998f8b | 2024-10-24 10:15:12 -0600 | [diff] [blame] | 87 | // Queue a configuration change to take effect in the future. |
| 88 | auto QueueConfig(hwc2_config_t config, int64_t desired_time, bool seamless, |
| 89 | QueuedConfigTiming *out_timing) -> ConfigError; |
Drew Davenport | 85be25d | 2024-10-23 10:26:34 -0600 | [diff] [blame] | 90 | |
Drew Davenport | fe70c80 | 2024-11-07 13:02:21 -0700 | [diff] [blame] | 91 | // Get the HwcDisplayConfig, or nullptor if none. |
| 92 | auto GetConfig(hwc2_config_t config_id) const -> const HwcDisplayConfig *; |
| 93 | |
Drew Davenport | 7f356c8 | 2025-01-17 16:32:06 -0700 | [diff] [blame] | 94 | // To be called after SetDisplayProperties. Returns an empty vector if the |
| 95 | // requested layers have been validated, otherwise the vector describes |
| 96 | // the requested composition type changes. |
| 97 | using ChangedLayer = std::pair<hwc2_layer_t, HWC2::Composition>; |
| 98 | auto ValidateStagedComposition() -> std::vector<ChangedLayer>; |
| 99 | |
Drew Davenport | b864ccf | 2025-01-22 14:57:36 -0700 | [diff] [blame] | 100 | // Mark previously validated properties as ready to present. |
| 101 | auto AcceptValidatedComposition() -> void; |
| 102 | |
| 103 | // Present previously staged properties, and return fences to indicate when |
| 104 | // the new content has been presented, and when the previous buffers have |
| 105 | // been released. |
Roman Stratiienko | 16d3a2d | 2025-01-27 17:09:22 +0200 | [diff] [blame] | 106 | using ReleaseFence = std::pair<hwc2_layer_t, SharedFd>; |
| 107 | auto PresentStagedComposition(SharedFd &out_present_fence, |
| 108 | std::vector<ReleaseFence> &out_release_fences) |
| 109 | -> bool; |
Drew Davenport | b864ccf | 2025-01-22 14:57:36 -0700 | [diff] [blame] | 110 | |
Drew Davenport | a241a77 | 2024-09-24 11:26:30 -0600 | [diff] [blame] | 111 | // HWC2 Hooks - these should not be used outside of the hwc2 device. |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 112 | HWC2::Error AcceptDisplayChanges(); |
| 113 | HWC2::Error CreateLayer(hwc2_layer_t *layer); |
| 114 | HWC2::Error DestroyLayer(hwc2_layer_t layer); |
| 115 | HWC2::Error GetActiveConfig(hwc2_config_t *config) const; |
| 116 | HWC2::Error GetChangedCompositionTypes(uint32_t *num_elements, |
| 117 | hwc2_layer_t *layers, int32_t *types); |
| 118 | HWC2::Error GetClientTargetSupport(uint32_t width, uint32_t height, |
| 119 | int32_t format, int32_t dataspace); |
| 120 | HWC2::Error GetColorModes(uint32_t *num_modes, int32_t *modes); |
| 121 | HWC2::Error GetDisplayAttribute(hwc2_config_t config, int32_t attribute, |
| 122 | int32_t *value); |
Drew Davenport | f7e8833 | 2024-09-06 12:54:38 -0600 | [diff] [blame] | 123 | HWC2::Error LegacyGetDisplayConfigs(uint32_t *num_configs, |
| 124 | hwc2_config_t *configs); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 125 | HWC2::Error GetDisplayName(uint32_t *size, char *name); |
| 126 | HWC2::Error GetDisplayRequests(int32_t *display_requests, |
| 127 | uint32_t *num_elements, hwc2_layer_t *layers, |
| 128 | int32_t *layer_requests); |
| 129 | HWC2::Error GetDisplayType(int32_t *type); |
Roman Stratiienko | 6b40505 | 2022-12-10 19:09:10 +0200 | [diff] [blame] | 130 | #if __ANDROID_API__ > 27 |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 131 | HWC2::Error GetRenderIntents(int32_t mode, uint32_t *outNumIntents, |
| 132 | int32_t *outIntents); |
| 133 | HWC2::Error SetColorModeWithIntent(int32_t mode, int32_t intent); |
| 134 | #endif |
Roman Stratiienko | 6b40505 | 2022-12-10 19:09:10 +0200 | [diff] [blame] | 135 | #if __ANDROID_API__ > 28 |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 136 | HWC2::Error GetDisplayIdentificationData(uint8_t *outPort, |
| 137 | uint32_t *outDataSize, |
| 138 | uint8_t *outData); |
| 139 | HWC2::Error GetDisplayCapabilities(uint32_t *outNumCapabilities, |
| 140 | uint32_t *outCapabilities); |
| 141 | HWC2::Error GetDisplayBrightnessSupport(bool *supported); |
| 142 | HWC2::Error SetDisplayBrightness(float); |
| 143 | #endif |
Roman Stratiienko | 6b40505 | 2022-12-10 19:09:10 +0200 | [diff] [blame] | 144 | #if __ANDROID_API__ > 29 |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 145 | HWC2::Error GetDisplayConnectionType(uint32_t *outType); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 146 | |
| 147 | HWC2::Error SetActiveConfigWithConstraints( |
| 148 | hwc2_config_t config, |
| 149 | hwc_vsync_period_change_constraints_t *vsyncPeriodChangeConstraints, |
| 150 | hwc_vsync_period_change_timeline_t *outTimeline); |
| 151 | HWC2::Error SetAutoLowLatencyMode(bool on); |
| 152 | HWC2::Error GetSupportedContentTypes( |
| 153 | uint32_t *outNumSupportedContentTypes, |
| 154 | const uint32_t *outSupportedContentTypes); |
| 155 | |
| 156 | HWC2::Error SetContentType(int32_t contentType); |
| 157 | #endif |
Roman Stratiienko | 099c311 | 2022-01-20 11:50:54 +0200 | [diff] [blame] | 158 | HWC2::Error GetDisplayVsyncPeriod(uint32_t *outVsyncPeriod); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 159 | |
| 160 | HWC2::Error GetDozeSupport(int32_t *support); |
| 161 | HWC2::Error GetHdrCapabilities(uint32_t *num_types, int32_t *types, |
| 162 | float *max_luminance, |
| 163 | float *max_average_luminance, |
| 164 | float *min_luminance); |
| 165 | HWC2::Error GetReleaseFences(uint32_t *num_elements, hwc2_layer_t *layers, |
| 166 | int32_t *fences); |
Roman Stratiienko | dd21494 | 2022-05-03 18:24:49 +0300 | [diff] [blame] | 167 | HWC2::Error PresentDisplay(int32_t *out_present_fence); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 168 | HWC2::Error SetActiveConfig(hwc2_config_t config); |
| 169 | HWC2::Error ChosePreferredConfig(); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 170 | HWC2::Error SetColorMode(int32_t mode); |
| 171 | HWC2::Error SetColorTransform(const float *matrix, int32_t hint); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 172 | HWC2::Error SetPowerMode(int32_t mode); |
| 173 | HWC2::Error SetVsyncEnabled(int32_t enabled); |
| 174 | HWC2::Error ValidateDisplay(uint32_t *num_types, uint32_t *num_requests); |
| 175 | HwcLayer *get_layer(hwc2_layer_t layer) { |
| 176 | auto it = layers_.find(layer); |
| 177 | if (it == layers_.end()) |
| 178 | return nullptr; |
| 179 | return &it->second; |
| 180 | } |
| 181 | |
| 182 | /* Statistics */ |
| 183 | struct Stats { |
| 184 | Stats minus(Stats b) const { |
| 185 | return {total_frames_ - b.total_frames_, |
| 186 | total_pixops_ - b.total_pixops_, |
| 187 | gpu_pixops_ - b.gpu_pixops_, |
| 188 | failed_kms_validate_ - b.failed_kms_validate_, |
| 189 | failed_kms_present_ - b.failed_kms_present_, |
| 190 | frames_flattened_ - b.frames_flattened_}; |
| 191 | } |
| 192 | |
| 193 | uint32_t total_frames_ = 0; |
| 194 | uint64_t total_pixops_ = 0; |
| 195 | uint64_t gpu_pixops_ = 0; |
| 196 | uint32_t failed_kms_validate_ = 0; |
| 197 | uint32_t failed_kms_present_ = 0; |
| 198 | uint32_t frames_flattened_ = 0; |
| 199 | }; |
| 200 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 201 | const Backend *backend() const; |
| 202 | void set_backend(std::unique_ptr<Backend> backend); |
| 203 | |
Drew Davenport | 9344318 | 2023-12-14 09:25:45 +0000 | [diff] [blame] | 204 | auto GetHwc() { |
| 205 | return hwc_; |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 206 | } |
| 207 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 208 | std::map<hwc2_layer_t, HwcLayer> &layers() { |
| 209 | return layers_; |
| 210 | } |
| 211 | |
Roman Stratiienko | 19c162f | 2022-02-01 09:35:08 +0200 | [diff] [blame] | 212 | auto &GetPipe() { |
| 213 | return *pipeline_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 214 | } |
| 215 | |
Roman Stratiienko | 0da91bf | 2023-01-17 18:06:04 +0200 | [diff] [blame] | 216 | bool CtmByGpu(); |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 217 | |
| 218 | Stats &total_stats() { |
| 219 | return total_stats_; |
| 220 | } |
| 221 | |
Roman Stratiienko | f0c507f | 2022-01-17 18:29:24 +0200 | [diff] [blame] | 222 | /* Headless mode required to keep SurfaceFlinger alive when all display are |
| 223 | * disconnected, Without headless mode Android will continuously crash. |
| 224 | * Only single internal (primary) display is required to be in HEADLESS mode |
| 225 | * to prevent the crash. See: |
| 226 | * https://source.android.com/devices/graphics/hotplug#handling-common-scenarios |
| 227 | */ |
| 228 | bool IsInHeadlessMode() { |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 229 | return !pipeline_; |
Roman Stratiienko | f0c507f | 2022-01-17 18:29:24 +0200 | [diff] [blame] | 230 | } |
| 231 | |
Roman Stratiienko | d0494d9 | 2022-03-15 18:02:04 +0200 | [diff] [blame] | 232 | void Deinit(); |
| 233 | |
Roman Stratiienko | 22fe961 | 2023-01-17 21:22:29 +0200 | [diff] [blame] | 234 | auto GetFlatCon() { |
| 235 | return flatcon_; |
| 236 | } |
| 237 | |
Roman Stratiienko | 70ab939 | 2025-01-23 12:11:48 +0200 | [diff] [blame] | 238 | auto GetClientLayer() -> HwcLayer & { |
| 239 | return client_layer_; |
| 240 | } |
| 241 | |
Roman Stratiienko | f2c060f | 2023-09-18 22:46:08 +0300 | [diff] [blame] | 242 | auto &GetWritebackLayer() { |
| 243 | return writeback_layer_; |
| 244 | } |
| 245 | |
| 246 | void SetVirtualDisplayResolution(uint16_t width, uint16_t height) { |
| 247 | virtual_disp_width_ = width; |
| 248 | virtual_disp_height_ = height; |
| 249 | } |
| 250 | |
Tim Van Patten | a2f3efa | 2024-10-15 17:44:54 -0600 | [diff] [blame] | 251 | auto getDisplayPhysicalOrientation() -> std::optional<PanelOrientation>; |
| 252 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 253 | private: |
Drew Davenport | 97b5abc | 2024-11-07 10:43:54 -0700 | [diff] [blame] | 254 | AtomicCommitArgs CreateModesetCommit( |
| 255 | const HwcDisplayConfig *config, |
| 256 | const std::optional<LayerData> &modeset_layer); |
| 257 | |
Roman Stratiienko | 0137f86 | 2022-01-04 18:27:40 +0200 | [diff] [blame] | 258 | HwcDisplayConfigs configs_; |
| 259 | |
Drew Davenport | 9344318 | 2023-12-14 09:25:45 +0000 | [diff] [blame] | 260 | DrmHwc *const hwc_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 261 | |
Roman Stratiienko | 7689278 | 2023-01-16 17:15:53 +0200 | [diff] [blame] | 262 | SharedFd present_fence_; |
Roman Stratiienko | dd21494 | 2022-05-03 18:24:49 +0300 | [diff] [blame] | 263 | |
Roman Stratiienko | d0c035b | 2022-01-21 15:12:56 +0200 | [diff] [blame] | 264 | int64_t staged_mode_change_time_{}; |
Drew Davenport | fe70c80 | 2024-11-07 13:02:21 -0700 | [diff] [blame] | 265 | std::optional<uint32_t> staged_mode_config_id_{}; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 266 | |
Roman Stratiienko | 63762a9 | 2023-09-18 22:33:45 +0300 | [diff] [blame] | 267 | std::shared_ptr<DrmDisplayPipeline> pipeline_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 268 | |
| 269 | std::unique_ptr<Backend> backend_; |
Roman Stratiienko | 22fe961 | 2023-01-17 21:22:29 +0200 | [diff] [blame] | 270 | std::shared_ptr<FlatteningController> flatcon_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 271 | |
Drew Davenport | 30f4e9c | 2024-12-16 16:12:11 -0700 | [diff] [blame] | 272 | std::unique_ptr<VSyncWorker> vsync_worker_; |
Roman Stratiienko | 099c311 | 2022-01-20 11:50:54 +0200 | [diff] [blame] | 273 | bool vsync_event_en_{}; |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 274 | |
| 275 | const hwc2_display_t handle_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 276 | HWC2::DisplayType type_; |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 277 | |
Roman Stratiienko | bb594ba | 2022-02-18 16:52:03 +0200 | [diff] [blame] | 278 | uint32_t layer_idx_{}; |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 279 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 280 | std::map<hwc2_layer_t, HwcLayer> layers_; |
| 281 | HwcLayer client_layer_; |
Roman Stratiienko | f2c060f | 2023-09-18 22:46:08 +0300 | [diff] [blame] | 282 | std::unique_ptr<HwcLayer> writeback_layer_; |
| 283 | uint16_t virtual_disp_width_{}; |
| 284 | uint16_t virtual_disp_height_{}; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 285 | int32_t color_mode_{}; |
Roman Stratiienko | 0da91bf | 2023-01-17 18:06:04 +0200 | [diff] [blame] | 286 | std::shared_ptr<drm_color_ctm> color_matrix_; |
| 287 | android_color_transform_t color_transform_hint_{}; |
Sasha McIntosh | 173247b | 2024-09-18 18:06:52 -0400 | [diff] [blame] | 288 | int32_t content_type_{}; |
Sasha McIntosh | 5294f09 | 2024-09-18 18:14:54 -0400 | [diff] [blame] | 289 | Colorspace colorspace_{}; |
Sasha McIntosh | f9062b6 | 2024-11-12 10:55:06 -0500 | [diff] [blame] | 290 | std::shared_ptr<hdr_output_metadata> hdr_metadata_; |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 291 | |
Roman Stratiienko | 9362cef | 2022-02-02 09:53:50 +0200 | [diff] [blame] | 292 | std::shared_ptr<DrmKmsPlan> current_plan_; |
| 293 | |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 294 | uint32_t frame_no_ = 0; |
| 295 | Stats total_stats_; |
| 296 | Stats prev_stats_; |
| 297 | std::string DumpDelta(HwcDisplay::Stats delta); |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 298 | |
Sasha McIntosh | a37df7c | 2024-09-20 12:31:08 -0400 | [diff] [blame] | 299 | void SetColorMatrixToIdentity(); |
Roman Stratiienko | 0da91bf | 2023-01-17 18:06:04 +0200 | [diff] [blame] | 300 | |
Roman Stratiienko | 3dacd47 | 2022-01-11 19:18:34 +0200 | [diff] [blame] | 301 | HWC2::Error Init(); |
Roman Stratiienko | d0c035b | 2022-01-21 15:12:56 +0200 | [diff] [blame] | 302 | |
| 303 | HWC2::Error SetActiveConfigInternal(uint32_t config, int64_t change_time); |
Sasha McIntosh | f9062b6 | 2024-11-12 10:55:06 -0500 | [diff] [blame] | 304 | HWC2::Error SetHdrOutputMetadata(ui::Hdr hdrType); |
Sasha McIntosh | f8c1411 | 2024-12-11 12:03:32 -0500 | [diff] [blame] | 305 | auto GetEdid() -> EdidWrapperUnique & { |
| 306 | return GetPipe().connector->Get()->GetParsedEdid(); |
| 307 | } |
Roman Stratiienko | 3627beb | 2022-01-04 16:02:55 +0200 | [diff] [blame] | 308 | }; |
| 309 | |
| 310 | } // namespace android |