Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 17 | #pragma once |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 18 | |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 19 | #include <cstdint> |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 20 | #include <memory> |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 21 | #include <mutex> |
Steven Thomas | 6e8f706 | 2017-11-22 14:15:29 -0800 | [diff] [blame] | 22 | #include <optional> |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 23 | #include <unordered_map> |
| 24 | #include <unordered_set> |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 25 | #include <vector> |
| 26 | |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 27 | #include <android-base/thread_annotations.h> |
Dominik Laskowski | d940a01 | 2024-01-28 13:25:44 -0500 | [diff] [blame] | 28 | #include <ftl/expected.h> |
Dominik Laskowski | b17c621 | 2022-05-09 09:36:19 -0700 | [diff] [blame] | 29 | #include <ftl/future.h> |
Alec Mouri | ff79387 | 2022-01-13 17:45:06 -0800 | [diff] [blame] | 30 | #include <ui/DisplayIdentification.h> |
Ady Abraham | ec7aa8a | 2021-06-28 12:37:09 -0700 | [diff] [blame] | 31 | #include <ui/FenceTime.h> |
Brian Lindahl | 7a4cb7e | 2024-10-30 10:42:21 -0600 | [diff] [blame] | 32 | #include <ui/PictureProfileHandle.h> |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 33 | |
| 34 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 35 | #pragma clang diagnostic push |
| 36 | #pragma clang diagnostic ignored "-Wconversion" |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 37 | #pragma clang diagnostic ignored "-Wextra" |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 38 | #include <ui/GraphicTypes.h> |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 39 | #pragma clang diagnostic pop // ignored "-Wconversion -Wextra" |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 40 | |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 41 | #include <utils/StrongPointer.h> |
| 42 | #include <utils/Timers.h> |
| 43 | |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 44 | #include "DisplayMode.h" |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 45 | #include "HWC2.h" |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 46 | #include "Hal.h" |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 47 | |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 48 | #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> |
Kriti Dang | d432bb5 | 2023-02-09 18:21:04 +0100 | [diff] [blame] | 49 | #include <aidl/android/hardware/graphics/common/Hdr.h> |
Kriti Dang | 674b937 | 2022-11-18 10:58:44 +0100 | [diff] [blame] | 50 | #include <aidl/android/hardware/graphics/common/HdrConversionCapability.h> |
| 51 | #include <aidl/android/hardware/graphics/common/HdrConversionStrategy.h> |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 52 | #include <aidl/android/hardware/graphics/composer3/Capability.h> |
Alec Mouri | 8506569 | 2022-03-18 00:58:26 +0000 | [diff] [blame] | 53 | #include <aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.h> |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 54 | #include <aidl/android/hardware/graphics/composer3/Composition.h> |
Leon Scroggins III | 5967aec | 2021-12-29 11:14:22 -0500 | [diff] [blame] | 55 | #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> |
Sally Qi | 11dcd58 | 2024-08-16 18:11:27 -0700 | [diff] [blame] | 56 | #include <aidl/android/hardware/graphics/composer3/DisplayLuts.h> |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 57 | #include <aidl/android/hardware/graphics/composer3/LutProperties.h> |
Sasha McIntosh | f08ed64 | 2024-10-24 15:43:07 -0400 | [diff] [blame] | 58 | #include <aidl/android/hardware/graphics/composer3/OutputType.h> |
Sally Qi | 0cbd08b | 2022-08-17 12:12:28 -0700 | [diff] [blame] | 59 | #include <aidl/android/hardware/graphics/composer3/OverlayProperties.h> |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 60 | |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 61 | namespace android { |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 62 | |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 63 | namespace hal = hardware::graphics::composer::hal; |
| 64 | |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 65 | struct DisplayedFrameStats; |
Jesse Hall | 399184a | 2014-03-03 15:42:54 -0800 | [diff] [blame] | 66 | class GraphicBuffer; |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 67 | class TestableSurfaceFlinger; |
ramindani | b90711b | 2023-10-02 15:13:19 -0700 | [diff] [blame] | 68 | struct HWComposerTest; |
David Sodman | fb95bcc | 2017-12-22 15:45:30 -0800 | [diff] [blame] | 69 | struct CompositionInfo; |
Brian Lindahl | 7a4cb7e | 2024-10-30 10:42:21 -0600 | [diff] [blame] | 70 | class PictureProfileHandle; |
Mathias Agopian | 8372785 | 2010-09-23 18:13:21 -0700 | [diff] [blame] | 71 | |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 72 | namespace Hwc2 { |
| 73 | class Composer; |
| 74 | } // namespace Hwc2 |
| 75 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 76 | namespace compositionengine { |
| 77 | class Output; |
| 78 | } // namespace compositionengine |
| 79 | |
Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 80 | struct KnownHWCGenericLayerMetadata { |
| 81 | const char* name; |
| 82 | const uint32_t id; |
| 83 | }; |
| 84 | |
Marin Shalamanov | 1c43429 | 2020-06-12 01:47:29 +0200 | [diff] [blame] | 85 | // See the comment for SurfaceFlinger::getHwComposer for the thread safety rules for accessing |
| 86 | // this class. |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 87 | class HWComposer { |
| 88 | public: |
Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 89 | struct DeviceRequestedChanges { |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 90 | using ChangedTypes = |
| 91 | std::unordered_map<HWC2::Layer*, |
| 92 | aidl::android::hardware::graphics::composer3::Composition>; |
Alec Mouri | 8506569 | 2022-03-18 00:58:26 +0000 | [diff] [blame] | 93 | using ClientTargetProperty = |
| 94 | aidl::android::hardware::graphics::composer3::ClientTargetPropertyWithBrightness; |
Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 95 | using DisplayRequests = hal::DisplayRequest; |
| 96 | using LayerRequests = std::unordered_map<HWC2::Layer*, hal::LayerRequest>; |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 97 | using LutProperties = aidl::android::hardware::graphics::composer3::LutProperties; |
| 98 | using LayerLuts = HWC2::Display::LayerLuts; |
Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 99 | |
| 100 | ChangedTypes changedTypes; |
| 101 | DisplayRequests displayRequests; |
| 102 | LayerRequests layerRequests; |
| 103 | ClientTargetProperty clientTargetProperty; |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 104 | LayerLuts layerLuts; |
Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 105 | }; |
| 106 | |
Marin Shalamanov | 045b700 | 2021-01-07 16:56:24 +0100 | [diff] [blame] | 107 | struct HWCDisplayMode { |
| 108 | hal::HWConfigId hwcId; |
| 109 | int32_t width = -1; |
| 110 | int32_t height = -1; |
| 111 | nsecs_t vsyncPeriod = -1; |
ramindani | 0cd1d8d | 2023-06-13 13:43:23 -0700 | [diff] [blame] | 112 | float dpiX = -1.f; |
| 113 | float dpiY = -1.f; |
Marin Shalamanov | 045b700 | 2021-01-07 16:56:24 +0100 | [diff] [blame] | 114 | int32_t configGroup = -1; |
ramindani | a04b8a5 | 2023-08-07 18:49:47 -0700 | [diff] [blame] | 115 | std::optional<hal::VrrConfig> vrrConfig; |
Sasha McIntosh | f08ed64 | 2024-10-24 15:43:07 -0400 | [diff] [blame] | 116 | OutputType hdrOutputType; |
Marin Shalamanov | d3b5c5d | 2021-02-11 18:26:14 +0100 | [diff] [blame] | 117 | |
| 118 | friend std::ostream& operator<<(std::ostream& os, const HWCDisplayMode& mode) { |
| 119 | return os << "id=" << mode.hwcId << " res=" << mode.width << "x" << mode.height |
| 120 | << " vsyncPeriod=" << mode.vsyncPeriod << " dpi=" << mode.dpiX << "x" |
ramindani | a04b8a5 | 2023-08-07 18:49:47 -0700 | [diff] [blame] | 121 | << mode.dpiY << " group=" << mode.configGroup |
Sasha McIntosh | f08ed64 | 2024-10-24 15:43:07 -0400 | [diff] [blame] | 122 | << " vrrConfig=" << to_string(mode.vrrConfig).c_str() |
| 123 | << " hdrOutputType=" << toString(mode.hdrOutputType); |
Marin Shalamanov | d3b5c5d | 2021-02-11 18:26:14 +0100 | [diff] [blame] | 124 | } |
Marin Shalamanov | 045b700 | 2021-01-07 16:56:24 +0100 | [diff] [blame] | 125 | }; |
| 126 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 127 | virtual ~HWComposer(); |
| 128 | |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 129 | virtual void setCallback(HWC2::ComposerCallback&) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 130 | |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 131 | virtual bool getDisplayIdentificationData(hal::HWDisplayId, uint8_t* outPort, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 132 | DisplayIdentificationData* outData) const = 0; |
| 133 | |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 134 | virtual bool hasCapability(aidl::android::hardware::graphics::composer3::Capability) const = 0; |
Leon Scroggins III | 5967aec | 2021-12-29 11:14:22 -0500 | [diff] [blame] | 135 | virtual bool hasDisplayCapability( |
| 136 | HalDisplayId, |
| 137 | aidl::android::hardware::graphics::composer3::DisplayCapability) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 138 | |
Dominik Laskowski | 1394860 | 2021-03-08 20:48:28 -0800 | [diff] [blame] | 139 | virtual size_t getMaxVirtualDisplayCount() const = 0; |
| 140 | virtual size_t getMaxVirtualDisplayDimension() const = 0; |
| 141 | |
| 142 | // Attempts to allocate a virtual display on the HWC. The maximum number of virtual displays |
| 143 | // supported by the HWC can be queried in advance, but allocation may fail for other reasons. |
Dominik Laskowski | 263eec4 | 2021-07-21 23:13:24 -0700 | [diff] [blame] | 144 | virtual bool allocateVirtualDisplay(HalVirtualDisplayId, ui::Size, ui::PixelFormat*) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 145 | |
Lucas Berthou | 8d0a0c4 | 2024-08-27 14:32:31 +0000 | [diff] [blame] | 146 | virtual void allocatePhysicalDisplay(hal::HWDisplayId, PhysicalDisplayId, |
| 147 | std::optional<ui::Size> physicalSize) = 0; |
Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 148 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 149 | // Attempts to create a new layer on this display |
Lloyd Pique | 1b33fc3 | 2021-05-07 14:36:58 -0700 | [diff] [blame] | 150 | virtual std::shared_ptr<HWC2::Layer> createLayer(HalDisplayId) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 151 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 152 | // Gets any required composition change requests from the HWC device. |
| 153 | // |
| 154 | // Note that frameUsesClientComposition must be set correctly based on |
| 155 | // whether the current frame appears to use client composition. If it is |
| 156 | // false some internal optimizations are allowed to present the display |
| 157 | // with fewer handshakes, but this does not work if client composition is |
| 158 | // expected. |
| 159 | virtual status_t getDeviceCompositionChanges( |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 160 | HalDisplayId, bool frameUsesClientComposition, |
Ady Abraham | f1db803 | 2023-03-24 17:52:34 -0700 | [diff] [blame] | 161 | std::optional<std::chrono::steady_clock::time_point> earliestPresentTime, |
ramindani | 4aac32c | 2023-10-30 14:13:30 -0700 | [diff] [blame] | 162 | nsecs_t expectedPresentTime, Fps frameInterval, |
| 163 | std::optional<DeviceRequestedChanges>* outChanges) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 164 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 165 | virtual status_t setClientTarget(HalDisplayId, uint32_t slot, const sp<Fence>& acquireFence, |
Alec Mouri | f97df4d | 2023-09-06 02:10:05 +0000 | [diff] [blame] | 166 | const sp<GraphicBuffer>& target, ui::Dataspace, |
| 167 | float hdrSdrRatio) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 168 | |
| 169 | // Present layers to the display and read releaseFences. |
Ady Abraham | b42cdc1 | 2021-05-11 14:31:26 -0700 | [diff] [blame] | 170 | virtual status_t presentAndGetReleaseFences( |
Ady Abraham | f1db803 | 2023-03-24 17:52:34 -0700 | [diff] [blame] | 171 | HalDisplayId, |
| 172 | std::optional<std::chrono::steady_clock::time_point> earliestPresentTime) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 173 | |
Leon Scroggins III | a3ba7fa | 2024-05-22 16:34:52 -0400 | [diff] [blame] | 174 | virtual status_t executeCommands(HalDisplayId) = 0; |
| 175 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 176 | // set power mode |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 177 | virtual status_t setPowerMode(PhysicalDisplayId, hal::PowerMode) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 178 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 179 | // Sets a color transform to be applied to the result of composition |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 180 | virtual status_t setColorTransform(HalDisplayId, const mat4& transform) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 181 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 182 | // reset state when a display is disconnected |
| 183 | virtual void disconnectDisplay(HalDisplayId) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 184 | |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 185 | // Get the present fence/timestamp received from the last call to present. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 186 | virtual sp<Fence> getPresentFence(HalDisplayId) const = 0; |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 187 | virtual nsecs_t getPresentTimestamp(PhysicalDisplayId) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 188 | |
| 189 | // Get last release fence for the given layer |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 190 | virtual sp<Fence> getLayerReleaseFence(HalDisplayId, HWC2::Layer*) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 191 | |
| 192 | // Set the output buffer and acquire fence for a virtual display. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 193 | virtual status_t setOutputBuffer(HalVirtualDisplayId, const sp<Fence>& acquireFence, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 194 | const sp<GraphicBuffer>& buffer) = 0; |
| 195 | |
| 196 | // After SurfaceFlinger has retrieved the release fences for all the frames, |
| 197 | // it can call this to clear the shared pointers in the release fence map |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 198 | virtual void clearReleaseFences(HalDisplayId) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 199 | |
| 200 | // Fetches the HDR capabilities of the given display |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 201 | virtual status_t getHdrCapabilities(HalDisplayId, HdrCapabilities* outCapabilities) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 202 | |
Sally Qi | bb866c1 | 2022-10-17 11:31:20 -0700 | [diff] [blame] | 203 | virtual const aidl::android::hardware::graphics::composer3::OverlayProperties& |
| 204 | getOverlaySupport() const = 0; |
Sally Qi | 0cbd08b | 2022-08-17 12:12:28 -0700 | [diff] [blame] | 205 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 206 | virtual int32_t getSupportedPerFrameMetadata(HalDisplayId) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 207 | |
| 208 | // Returns the available RenderIntent of the given display. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 209 | virtual std::vector<ui::RenderIntent> getRenderIntents(HalDisplayId, ui::ColorMode) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 210 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 211 | virtual mat4 getDataspaceSaturationMatrix(HalDisplayId, ui::Dataspace) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 212 | |
| 213 | // Returns the attributes of the color sampling engine. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 214 | virtual status_t getDisplayedContentSamplingAttributes(HalDisplayId, ui::PixelFormat* outFormat, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 215 | ui::Dataspace* outDataspace, |
| 216 | uint8_t* outComponentMask) = 0; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 217 | virtual status_t setDisplayContentSamplingEnabled(HalDisplayId, bool enabled, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 218 | uint8_t componentMask, |
| 219 | uint64_t maxFrames) = 0; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 220 | virtual status_t getDisplayedContentSample(HalDisplayId, uint64_t maxFrames, uint64_t timestamp, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 221 | DisplayedFrameStats* outStats) = 0; |
| 222 | |
Dan Gittik | 57e63c5 | 2019-01-18 16:37:54 +0000 | [diff] [blame] | 223 | // Sets the brightness of a display. |
Dominik Laskowski | b17c621 | 2022-05-09 09:36:19 -0700 | [diff] [blame] | 224 | virtual ftl::Future<status_t> setDisplayBrightness( |
Alec Mouri | 4d8a05d | 2022-03-23 18:14:26 +0000 | [diff] [blame] | 225 | PhysicalDisplayId, float brightness, float brightnessNits, |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 226 | const Hwc2::Composer::DisplayBrightnessOptions&) = 0; |
Dan Gittik | 57e63c5 | 2019-01-18 16:37:54 +0000 | [diff] [blame] | 227 | |
Matt Buckley | 50c4406 | 2022-01-17 20:48:10 +0000 | [diff] [blame] | 228 | // Get whether the display skipped validation on the latest present |
| 229 | virtual bool getValidateSkipped(HalDisplayId displayId) const = 0; |
| 230 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 231 | // Events handling --------------------------------------------------------- |
| 232 | |
| 233 | // Returns stable display ID (and display name on connection of new or previously disconnected |
| 234 | // display), or std::nullopt if hotplug event was ignored. |
Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 235 | // This function is called from SurfaceFlinger. |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 236 | virtual std::optional<DisplayIdentificationInfo> onHotplug(hal::HWDisplayId, |
| 237 | hal::Connection) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 238 | |
Marin Shalamanov | f8c6372 | 2020-10-06 13:11:21 +0200 | [diff] [blame] | 239 | // If true we'll update the DeviceProductInfo on subsequent hotplug connected events. |
| 240 | // TODO(b/157555476): Remove when the framework has proper support for headless mode |
| 241 | virtual bool updatesDeviceProductInfoOnHotplugReconnect() const = 0; |
| 242 | |
Leon Scroggins III | 959a7ff | 2023-02-07 11:24:25 -0500 | [diff] [blame] | 243 | // Called when a vsync happens. If the vsync is valid, returns the |
| 244 | // corresponding PhysicalDisplayId. Otherwise returns nullopt. |
| 245 | virtual std::optional<PhysicalDisplayId> onVsync(hal::HWDisplayId, nsecs_t timestamp) = 0; |
| 246 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 247 | virtual void setVsyncEnabled(PhysicalDisplayId, hal::Vsync enabled) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 248 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 249 | virtual bool isConnected(PhysicalDisplayId) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 250 | |
ramindani | 263a3f1 | 2023-07-18 20:44:49 -0700 | [diff] [blame] | 251 | virtual std::vector<HWCDisplayMode> getModes(PhysicalDisplayId, |
| 252 | int32_t maxFrameIntervalNs) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 253 | |
Dominik Laskowski | d940a01 | 2024-01-28 13:25:44 -0500 | [diff] [blame] | 254 | virtual ftl::Expected<hal::HWConfigId, status_t> getActiveMode(PhysicalDisplayId) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 255 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 256 | virtual std::vector<ui::ColorMode> getColorModes(PhysicalDisplayId) const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 257 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 258 | virtual status_t setActiveColorMode(PhysicalDisplayId, ui::ColorMode mode, |
| 259 | ui::RenderIntent) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 260 | |
Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 261 | // Composer 2.4 |
Marin Shalamanov | 228f46b | 2021-01-28 21:11:45 +0100 | [diff] [blame] | 262 | virtual ui::DisplayConnectionType getDisplayConnectionType(PhysicalDisplayId) const = 0; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 263 | virtual bool isVsyncPeriodSwitchSupported(PhysicalDisplayId) const = 0; |
Dominik Laskowski | a109bb2 | 2024-01-28 13:33:51 -0500 | [diff] [blame] | 264 | virtual ftl::Expected<nsecs_t, status_t> getDisplayVsyncPeriod(PhysicalDisplayId) const = 0; |
Marin Shalamanov | 12c9e5a | 2021-01-07 00:25:35 +0100 | [diff] [blame] | 265 | virtual status_t setActiveModeWithConstraints(PhysicalDisplayId, hal::HWConfigId, |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 266 | const hal::VsyncPeriodChangeConstraints&, |
| 267 | hal::VsyncPeriodChangeTimeline* outTimeline) = 0; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 268 | virtual status_t setAutoLowLatencyMode(PhysicalDisplayId, bool on) = 0; |
Galia Peycheva | 5492cb5 | 2019-10-30 14:13:16 +0100 | [diff] [blame] | 269 | virtual status_t getSupportedContentTypes( |
Dominik Laskowski | 6c7b36e | 2022-03-03 08:27:58 -0800 | [diff] [blame] | 270 | PhysicalDisplayId, std::vector<hal::ContentType>* outSupportedContentTypes) const = 0; |
| 271 | |
| 272 | bool supportsContentType(PhysicalDisplayId displayId, hal::ContentType type) const { |
| 273 | std::vector<hal::ContentType> types; |
| 274 | return getSupportedContentTypes(displayId, &types) == NO_ERROR && |
| 275 | std::find(types.begin(), types.end(), type) != types.end(); |
| 276 | } |
| 277 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 278 | virtual status_t setContentType(PhysicalDisplayId, hal::ContentType) = 0; |
Dominik Laskowski | 6c7b36e | 2022-03-03 08:27:58 -0800 | [diff] [blame] | 279 | |
Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 280 | virtual const std::unordered_map<std::string, bool>& getSupportedLayerGenericMetadata() |
| 281 | const = 0; |
Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 282 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 283 | virtual void dump(std::string& out) const = 0; |
| 284 | |
Sally Qi | 254ef49 | 2024-04-08 15:01:28 -0700 | [diff] [blame] | 285 | virtual void dumpOverlayProperties(std::string& out) const = 0; |
| 286 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 287 | virtual Hwc2::Composer* getComposer() const = 0; |
| 288 | |
Marin Shalamanov | 8b19659 | 2021-08-09 16:24:42 +0200 | [diff] [blame] | 289 | // Returns the first display connected at boot. Its connection via HWComposer::onHotplug, |
| 290 | // which in practice is immediately after HWComposer construction, must occur before any |
| 291 | // call to this function. |
| 292 | // The primary display can be temporarily disconnected from the perspective |
| 293 | // of this class. Callers must not call getPrimaryHwcDisplayId() or getPrimaryDisplayId() |
| 294 | // if isHeadless(). |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 295 | // |
| 296 | // TODO(b/182939859): Remove special cases for primary display. |
| 297 | virtual hal::HWDisplayId getPrimaryHwcDisplayId() const = 0; |
| 298 | virtual PhysicalDisplayId getPrimaryDisplayId() const = 0; |
| 299 | virtual bool isHeadless() const = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 300 | |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 301 | virtual std::optional<PhysicalDisplayId> toPhysicalDisplayId(hal::HWDisplayId) const = 0; |
| 302 | virtual std::optional<hal::HWDisplayId> fromPhysicalDisplayId(PhysicalDisplayId) const = 0; |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 303 | |
Brian Lindahl | 7a4cb7e | 2024-10-30 10:42:21 -0600 | [diff] [blame] | 304 | // AIDL Composer |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 305 | virtual status_t setBootDisplayMode(PhysicalDisplayId, hal::HWConfigId) = 0; |
| 306 | virtual status_t clearBootDisplayMode(PhysicalDisplayId) = 0; |
Kriti Dang | 16ca297 | 2022-02-01 20:07:03 +0100 | [diff] [blame] | 307 | virtual std::optional<hal::HWConfigId> getPreferredBootDisplayMode(PhysicalDisplayId) = 0; |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 308 | virtual status_t getDisplayDecorationSupport( |
| 309 | PhysicalDisplayId, |
| 310 | std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* |
| 311 | support) = 0; |
ramindani | 32cf060 | 2022-03-02 02:30:29 +0000 | [diff] [blame] | 312 | virtual status_t setIdleTimerEnabled(PhysicalDisplayId, std::chrono::milliseconds timeout) = 0; |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 313 | virtual bool hasDisplayIdleTimerCapability(PhysicalDisplayId) const = 0; |
| 314 | virtual Hwc2::AidlTransform getPhysicalDisplayOrientation(PhysicalDisplayId) const = 0; |
Kriti Dang | 674b937 | 2022-11-18 10:58:44 +0100 | [diff] [blame] | 315 | virtual std::vector<aidl::android::hardware::graphics::common::HdrConversionCapability> |
| 316 | getHdrConversionCapabilities() const = 0; |
| 317 | virtual status_t setHdrConversionStrategy( |
Kriti Dang | d432bb5 | 2023-02-09 18:21:04 +0100 | [diff] [blame] | 318 | aidl::android::hardware::graphics::common::HdrConversionStrategy, |
| 319 | aidl::android::hardware::graphics::common::Hdr*) = 0; |
ramindani | b2158ee | 2023-02-13 20:29:59 -0800 | [diff] [blame] | 320 | virtual status_t setRefreshRateChangedCallbackDebugEnabled(PhysicalDisplayId, bool enabled) = 0; |
ramindani | c67d22c | 2023-11-28 14:58:47 -0800 | [diff] [blame] | 321 | virtual status_t notifyExpectedPresent(PhysicalDisplayId, TimePoint expectedPresentTime, |
| 322 | Fps frameInterval) = 0; |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 323 | virtual HWC2::Display::LutFileDescriptorMapper& getLutFileDescriptorMapper() = 0; |
Brian Lindahl | 7a4cb7e | 2024-10-30 10:42:21 -0600 | [diff] [blame] | 324 | virtual int32_t getMaxLayerPictureProfiles(PhysicalDisplayId) = 0; |
| 325 | virtual status_t setDisplayPictureProfileHandle(PhysicalDisplayId, |
| 326 | const PictureProfileHandle& handle) = 0; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 327 | }; |
| 328 | |
Vishnu Nair | a314038 | 2022-02-24 14:07:11 -0800 | [diff] [blame] | 329 | static inline bool operator==(const android::HWComposer::DeviceRequestedChanges& lhs, |
| 330 | const android::HWComposer::DeviceRequestedChanges& rhs) { |
| 331 | return lhs.changedTypes == rhs.changedTypes && lhs.displayRequests == rhs.displayRequests && |
| 332 | lhs.layerRequests == rhs.layerRequests && |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 333 | lhs.clientTargetProperty == rhs.clientTargetProperty && lhs.layerLuts == rhs.layerLuts; |
Vishnu Nair | a314038 | 2022-02-24 14:07:11 -0800 | [diff] [blame] | 334 | } |
| 335 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 336 | namespace impl { |
| 337 | |
| 338 | class HWComposer final : public android::HWComposer { |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 339 | public: |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 340 | explicit HWComposer(std::unique_ptr<Hwc2::Composer> composer); |
Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 341 | explicit HWComposer(const std::string& composerServiceName); |
Mathias Agopian | 8b736f1 | 2012-08-13 17:54:26 -0700 | [diff] [blame] | 342 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 343 | ~HWComposer() override; |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 344 | |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 345 | void setCallback(HWC2::ComposerCallback&) override; |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 346 | |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 347 | bool getDisplayIdentificationData(hal::HWDisplayId, uint8_t* outPort, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 348 | DisplayIdentificationData* outData) const override; |
Dominik Laskowski | e9ef7c4 | 2018-03-12 19:34:30 -0700 | [diff] [blame] | 349 | |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 350 | bool hasCapability(aidl::android::hardware::graphics::composer3::Capability) const override; |
Leon Scroggins III | 5967aec | 2021-12-29 11:14:22 -0500 | [diff] [blame] | 351 | bool hasDisplayCapability( |
| 352 | HalDisplayId, |
| 353 | aidl::android::hardware::graphics::composer3::DisplayCapability) const override; |
Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 354 | |
Dominik Laskowski | 1394860 | 2021-03-08 20:48:28 -0800 | [diff] [blame] | 355 | size_t getMaxVirtualDisplayCount() const override; |
| 356 | size_t getMaxVirtualDisplayDimension() const override; |
| 357 | |
Dominik Laskowski | 263eec4 | 2021-07-21 23:13:24 -0700 | [diff] [blame] | 358 | bool allocateVirtualDisplay(HalVirtualDisplayId, ui::Size, ui::PixelFormat*) override; |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 359 | |
Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 360 | // Called from SurfaceFlinger, when the state for a new physical display needs to be recreated. |
Lucas Berthou | 8d0a0c4 | 2024-08-27 14:32:31 +0000 | [diff] [blame] | 361 | void allocatePhysicalDisplay(hal::HWDisplayId, PhysicalDisplayId, |
| 362 | std::optional<ui::Size> physicalSize) override; |
Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 363 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 364 | // Attempts to create a new layer on this display |
Lloyd Pique | 1b33fc3 | 2021-05-07 14:36:58 -0700 | [diff] [blame] | 365 | std::shared_ptr<HWC2::Layer> createLayer(HalDisplayId) override; |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 366 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 367 | status_t getDeviceCompositionChanges( |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 368 | HalDisplayId, bool frameUsesClientComposition, |
Ady Abraham | f1db803 | 2023-03-24 17:52:34 -0700 | [diff] [blame] | 369 | std::optional<std::chrono::steady_clock::time_point> earliestPresentTime, |
ramindani | 4aac32c | 2023-10-30 14:13:30 -0700 | [diff] [blame] | 370 | nsecs_t expectedPresentTime, Fps frameInterval, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 371 | std::optional<DeviceRequestedChanges>* outChanges) override; |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 372 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 373 | status_t setClientTarget(HalDisplayId, uint32_t slot, const sp<Fence>& acquireFence, |
Alec Mouri | f97df4d | 2023-09-06 02:10:05 +0000 | [diff] [blame] | 374 | const sp<GraphicBuffer>& target, ui::Dataspace, |
| 375 | float hdrSdrRatio) override; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 376 | |
Fabien Sanglard | a87aa7b | 2016-11-30 16:27:22 -0800 | [diff] [blame] | 377 | // Present layers to the display and read releaseFences. |
Ady Abraham | b42cdc1 | 2021-05-11 14:31:26 -0700 | [diff] [blame] | 378 | status_t presentAndGetReleaseFences( |
Ady Abraham | f1db803 | 2023-03-24 17:52:34 -0700 | [diff] [blame] | 379 | HalDisplayId, |
| 380 | std::optional<std::chrono::steady_clock::time_point> earliestPresentTime) override; |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 381 | |
Leon Scroggins III | a3ba7fa | 2024-05-22 16:34:52 -0400 | [diff] [blame] | 382 | status_t executeCommands(HalDisplayId) override; |
| 383 | |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 384 | // set power mode |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 385 | status_t setPowerMode(PhysicalDisplayId, hal::PowerMode mode) override; |
Colin Cross | 10fbdb6 | 2012-07-12 17:56:34 -0700 | [diff] [blame] | 386 | |
Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 387 | // Sets a color transform to be applied to the result of composition |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 388 | status_t setColorTransform(HalDisplayId, const mat4& transform) override; |
Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 389 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 390 | // reset state when a display is disconnected |
| 391 | void disconnectDisplay(HalDisplayId) override; |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 392 | |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 393 | // Get the present fence/timestamp received from the last call to present. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 394 | sp<Fence> getPresentFence(HalDisplayId) const override; |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 395 | nsecs_t getPresentTimestamp(PhysicalDisplayId) const override; |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 396 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 397 | // Get last release fence for the given layer |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 398 | sp<Fence> getLayerReleaseFence(HalDisplayId, HWC2::Layer*) const override; |
Andy McFadden | b0d1dd3 | 2012-09-10 14:08:09 -0700 | [diff] [blame] | 399 | |
Jesse Hall | 851cfe8 | 2013-03-20 13:44:00 -0700 | [diff] [blame] | 400 | // Set the output buffer and acquire fence for a virtual display. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 401 | status_t setOutputBuffer(HalVirtualDisplayId, const sp<Fence>& acquireFence, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 402 | const sp<GraphicBuffer>& buffer) override; |
Jesse Hall | 851cfe8 | 2013-03-20 13:44:00 -0700 | [diff] [blame] | 403 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 404 | // After SurfaceFlinger has retrieved the release fences for all the frames, |
| 405 | // it can call this to clear the shared pointers in the release fence map |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 406 | void clearReleaseFences(HalDisplayId) override; |
Mathias Agopian | 3e8b853 | 2012-05-13 20:42:01 -0700 | [diff] [blame] | 407 | |
Peiyong Lin | 6266589 | 2018-04-16 11:07:44 -0700 | [diff] [blame] | 408 | // Fetches the HDR capabilities of the given display |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 409 | status_t getHdrCapabilities(HalDisplayId, HdrCapabilities* outCapabilities) override; |
Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 410 | |
Sally Qi | bb866c1 | 2022-10-17 11:31:20 -0700 | [diff] [blame] | 411 | const aidl::android::hardware::graphics::composer3::OverlayProperties& getOverlaySupport() |
| 412 | const override; |
Sally Qi | 0cbd08b | 2022-08-17 12:12:28 -0700 | [diff] [blame] | 413 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 414 | int32_t getSupportedPerFrameMetadata(HalDisplayId) const override; |
Peiyong Lin | 0ac5f4e | 2018-04-19 22:06:34 -0700 | [diff] [blame] | 415 | |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 416 | // Returns the available RenderIntent of the given display. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 417 | std::vector<ui::RenderIntent> getRenderIntents(HalDisplayId, ui::ColorMode) const override; |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 418 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 419 | mat4 getDataspaceSaturationMatrix(HalDisplayId, ui::Dataspace) override; |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 420 | |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 421 | // Returns the attributes of the color sampling engine. |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 422 | status_t getDisplayedContentSamplingAttributes(HalDisplayId, ui::PixelFormat* outFormat, |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 423 | ui::Dataspace* outDataspace, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 424 | uint8_t* outComponentMask) override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 425 | status_t setDisplayContentSamplingEnabled(HalDisplayId, bool enabled, uint8_t componentMask, |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 426 | uint64_t maxFrames) override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 427 | status_t getDisplayedContentSample(HalDisplayId, uint64_t maxFrames, uint64_t timestamp, |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 428 | DisplayedFrameStats* outStats) override; |
Dominik Laskowski | b17c621 | 2022-05-09 09:36:19 -0700 | [diff] [blame] | 429 | ftl::Future<status_t> setDisplayBrightness( |
Alec Mouri | 4d8a05d | 2022-03-23 18:14:26 +0000 | [diff] [blame] | 430 | PhysicalDisplayId, float brightness, float brightnessNits, |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 431 | const Hwc2::Composer::DisplayBrightnessOptions&) override; |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 432 | |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 433 | // Events handling --------------------------------------------------------- |
| 434 | |
Marin Shalamanov | f8c6372 | 2020-10-06 13:11:21 +0200 | [diff] [blame] | 435 | // Returns PhysicalDisplayId (and display name on connection of new or previously disconnected |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 436 | // display), or std::nullopt if hotplug event was ignored. |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 437 | std::optional<DisplayIdentificationInfo> onHotplug(hal::HWDisplayId, hal::Connection) override; |
Steven Thomas | 94e35b9 | 2017-07-26 18:48:28 -0700 | [diff] [blame] | 438 | |
Marin Shalamanov | f8c6372 | 2020-10-06 13:11:21 +0200 | [diff] [blame] | 439 | bool updatesDeviceProductInfoOnHotplugReconnect() const override; |
| 440 | |
Leon Scroggins III | 959a7ff | 2023-02-07 11:24:25 -0500 | [diff] [blame] | 441 | std::optional<PhysicalDisplayId> onVsync(hal::HWDisplayId, nsecs_t timestamp) override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 442 | void setVsyncEnabled(PhysicalDisplayId, hal::Vsync enabled) override; |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 443 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 444 | bool isConnected(PhysicalDisplayId) const override; |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 445 | |
ramindani | 263a3f1 | 2023-07-18 20:44:49 -0700 | [diff] [blame] | 446 | std::vector<HWCDisplayMode> getModes(PhysicalDisplayId, |
| 447 | int32_t maxFrameIntervalNs) const override; |
Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 448 | |
Dominik Laskowski | d940a01 | 2024-01-28 13:25:44 -0500 | [diff] [blame] | 449 | ftl::Expected<hal::HWConfigId, status_t> getActiveMode(PhysicalDisplayId) const override; |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 450 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 451 | std::vector<ui::ColorMode> getColorModes(PhysicalDisplayId) const override; |
Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 452 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 453 | status_t setActiveColorMode(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent) override; |
Courtney Goeltzenleuchter | fad9d8c | 2016-06-23 11:49:50 -0600 | [diff] [blame] | 454 | |
Matt Buckley | 50c4406 | 2022-01-17 20:48:10 +0000 | [diff] [blame] | 455 | bool getValidateSkipped(HalDisplayId displayId) const override; |
| 456 | |
Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 457 | // Composer 2.4 |
Marin Shalamanov | 228f46b | 2021-01-28 21:11:45 +0100 | [diff] [blame] | 458 | ui::DisplayConnectionType getDisplayConnectionType(PhysicalDisplayId) const override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 459 | bool isVsyncPeriodSwitchSupported(PhysicalDisplayId) const override; |
Dominik Laskowski | a109bb2 | 2024-01-28 13:33:51 -0500 | [diff] [blame] | 460 | ftl::Expected<nsecs_t, status_t> getDisplayVsyncPeriod(PhysicalDisplayId) const override; |
Marin Shalamanov | 12c9e5a | 2021-01-07 00:25:35 +0100 | [diff] [blame] | 461 | status_t setActiveModeWithConstraints(PhysicalDisplayId, hal::HWConfigId, |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 462 | const hal::VsyncPeriodChangeConstraints&, |
| 463 | hal::VsyncPeriodChangeTimeline* outTimeline) override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 464 | status_t setAutoLowLatencyMode(PhysicalDisplayId, bool) override; |
Dominik Laskowski | 6c7b36e | 2022-03-03 08:27:58 -0800 | [diff] [blame] | 465 | status_t getSupportedContentTypes(PhysicalDisplayId, |
| 466 | std::vector<hal::ContentType>*) const override; |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 467 | status_t setContentType(PhysicalDisplayId, hal::ContentType) override; |
Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 468 | |
Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 469 | const std::unordered_map<std::string, bool>& getSupportedLayerGenericMetadata() const override; |
| 470 | |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 471 | // Composer 3.0 |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 472 | status_t setBootDisplayMode(PhysicalDisplayId, hal::HWConfigId) override; |
| 473 | status_t clearBootDisplayMode(PhysicalDisplayId) override; |
Kriti Dang | 16ca297 | 2022-02-01 20:07:03 +0100 | [diff] [blame] | 474 | std::optional<hal::HWConfigId> getPreferredBootDisplayMode(PhysicalDisplayId) override; |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 475 | status_t getDisplayDecorationSupport( |
| 476 | PhysicalDisplayId, |
| 477 | std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* |
| 478 | support) override; |
ramindani | 32cf060 | 2022-03-02 02:30:29 +0000 | [diff] [blame] | 479 | status_t setIdleTimerEnabled(PhysicalDisplayId, std::chrono::milliseconds timeout) override; |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 480 | bool hasDisplayIdleTimerCapability(PhysicalDisplayId) const override; |
| 481 | Hwc2::AidlTransform getPhysicalDisplayOrientation(PhysicalDisplayId) const override; |
Kriti Dang | 674b937 | 2022-11-18 10:58:44 +0100 | [diff] [blame] | 482 | std::vector<aidl::android::hardware::graphics::common::HdrConversionCapability> |
| 483 | getHdrConversionCapabilities() const override; |
| 484 | status_t setHdrConversionStrategy( |
Kriti Dang | d432bb5 | 2023-02-09 18:21:04 +0100 | [diff] [blame] | 485 | aidl::android::hardware::graphics::common::HdrConversionStrategy, |
| 486 | aidl::android::hardware::graphics::common::Hdr*) override; |
ramindani | b2158ee | 2023-02-13 20:29:59 -0800 | [diff] [blame] | 487 | status_t setRefreshRateChangedCallbackDebugEnabled(PhysicalDisplayId, bool enabled) override; |
ramindani | c67d22c | 2023-11-28 14:58:47 -0800 | [diff] [blame] | 488 | status_t notifyExpectedPresent(PhysicalDisplayId, TimePoint expectedPresentTime, |
| 489 | Fps frameInterval) override; |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 490 | HWC2::Display::LutFileDescriptorMapper& getLutFileDescriptorMapper() override; |
Brian Lindahl | 7a4cb7e | 2024-10-30 10:42:21 -0600 | [diff] [blame] | 491 | int32_t getMaxLayerPictureProfiles(PhysicalDisplayId) override; |
| 492 | status_t setDisplayPictureProfileHandle(PhysicalDisplayId, |
| 493 | const android::PictureProfileHandle& profile) override; |
Sally Qi | 11dcd58 | 2024-08-16 18:11:27 -0700 | [diff] [blame] | 494 | |
Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 495 | // for debugging ---------------------------------------------------------- |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 496 | void dump(std::string& out) const override; |
Sally Qi | 254ef49 | 2024-04-08 15:01:28 -0700 | [diff] [blame] | 497 | void dumpOverlayProperties(std::string& out) const override; |
Mathias Agopian | 8372785 | 2010-09-23 18:13:21 -0700 | [diff] [blame] | 498 | |
Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 499 | Hwc2::Composer* getComposer() const override { return mComposer.get(); } |
Steven Thomas | 6e8f706 | 2017-11-22 14:15:29 -0800 | [diff] [blame] | 500 | |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 501 | hal::HWDisplayId getPrimaryHwcDisplayId() const override { |
| 502 | LOG_ALWAYS_FATAL_IF(!mPrimaryHwcDisplayId, "Missing HWC primary display"); |
| 503 | return *mPrimaryHwcDisplayId; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 504 | } |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 505 | |
| 506 | PhysicalDisplayId getPrimaryDisplayId() const override { |
| 507 | const auto id = toPhysicalDisplayId(getPrimaryHwcDisplayId()); |
| 508 | LOG_ALWAYS_FATAL_IF(!id, "Missing primary display"); |
| 509 | return *id; |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 510 | } |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 511 | |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 512 | virtual bool isHeadless() const override { return !mPrimaryHwcDisplayId; } |
| 513 | |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 514 | std::optional<PhysicalDisplayId> toPhysicalDisplayId(hal::HWDisplayId) const override; |
| 515 | std::optional<hal::HWDisplayId> fromPhysicalDisplayId(PhysicalDisplayId) const override; |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 516 | |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 517 | private: |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 518 | // For unit tests |
| 519 | friend TestableSurfaceFlinger; |
ramindani | 355fca8 | 2023-12-18 12:07:34 -0800 | [diff] [blame] | 520 | friend HWComposerTest; |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 521 | |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 522 | struct DisplayData { |
Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 523 | std::unique_ptr<HWC2::Display> hwcDisplay; |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 524 | |
Dominik Laskowski | f9750f2 | 2018-06-06 12:24:53 -0700 | [diff] [blame] | 525 | sp<Fence> lastPresentFence = Fence::NO_FENCE; // signals when the last set op retires |
Dominik Laskowski | dc2bb80 | 2022-09-28 16:02:59 -0400 | [diff] [blame] | 526 | nsecs_t lastPresentTimestamp = 0; |
| 527 | |
Steven Thomas | 94e35b9 | 2017-07-26 18:48:28 -0700 | [diff] [blame] | 528 | std::unordered_map<HWC2::Layer*, sp<Fence>> releaseFences; |
Jamie Gennis | 2ec3e07 | 2012-11-11 16:24:33 -0800 | [diff] [blame] | 529 | |
Fabien Sanglard | 249c0ae | 2017-06-19 19:22:36 -0700 | [diff] [blame] | 530 | bool validateWasSkipped; |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 531 | hal::Error presentError; |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 532 | |
| 533 | bool vsyncTraceToggle = false; |
| 534 | |
| 535 | std::mutex vsyncEnabledLock; |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 536 | hal::Vsync vsyncEnabled GUARDED_BY(vsyncEnabledLock) = hal::Vsync::DISABLE; |
Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 537 | }; |
| 538 | |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 539 | std::optional<DisplayIdentificationInfo> onHotplugConnect(hal::HWDisplayId); |
| 540 | std::optional<DisplayIdentificationInfo> onHotplugDisconnect(hal::HWDisplayId); |
| 541 | bool shouldIgnoreHotplugConnect(hal::HWDisplayId, bool hasDisplayIdentificationData) const; |
| 542 | |
Lucas Berthou | 8d0a0c4 | 2024-08-27 14:32:31 +0000 | [diff] [blame] | 543 | aidl::android::hardware::graphics::composer3::DisplayConfiguration::Dpi |
| 544 | getEstimatedDotsPerInchFromSize(uint64_t hwcDisplayId, const HWCDisplayMode& hwcMode) const; |
| 545 | |
| 546 | aidl::android::hardware::graphics::composer3::DisplayConfiguration::Dpi correctedDpiIfneeded( |
| 547 | aidl::android::hardware::graphics::composer3::DisplayConfiguration::Dpi dpi, |
| 548 | aidl::android::hardware::graphics::composer3::DisplayConfiguration::Dpi estimatedDpi) |
| 549 | const; |
ramindani | 263a3f1 | 2023-07-18 20:44:49 -0700 | [diff] [blame] | 550 | std::vector<HWCDisplayMode> getModesFromDisplayConfigurations(uint64_t hwcDisplayId, |
| 551 | int32_t maxFrameIntervalNs) const; |
ramindani | 0cd1d8d | 2023-06-13 13:43:23 -0700 | [diff] [blame] | 552 | std::vector<HWCDisplayMode> getModesFromLegacyDisplayConfigs(uint64_t hwcDisplayId) const; |
| 553 | |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 554 | int32_t getAttribute(hal::HWDisplayId hwcDisplayId, hal::HWConfigId configId, |
Marin Shalamanov | 045b700 | 2021-01-07 16:56:24 +0100 | [diff] [blame] | 555 | hal::Attribute attribute) const; |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 556 | |
| 557 | void loadCapabilities(); |
| 558 | void loadLayerMetadataSupport(); |
Sally Qi | bb866c1 | 2022-10-17 11:31:20 -0700 | [diff] [blame] | 559 | void loadOverlayProperties(); |
Kriti Dang | 674b937 | 2022-11-18 10:58:44 +0100 | [diff] [blame] | 560 | void loadHdrConversionCapabilities(); |
Marin Shalamanov | 3ea1d60 | 2020-12-16 19:59:39 +0100 | [diff] [blame] | 561 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 562 | std::unordered_map<HalDisplayId, DisplayData> mDisplayData; |
Dominik Laskowski | b04f98a | 2018-11-07 21:07:16 -0800 | [diff] [blame] | 563 | |
Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 564 | std::unique_ptr<android::Hwc2::Composer> mComposer; |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 565 | std::unordered_set<aidl::android::hardware::graphics::composer3::Capability> mCapabilities; |
Sally Qi | bb866c1 | 2022-10-17 11:31:20 -0700 | [diff] [blame] | 566 | aidl::android::hardware::graphics::composer3::OverlayProperties mOverlayProperties; |
Kriti Dang | 674b937 | 2022-11-18 10:58:44 +0100 | [diff] [blame] | 567 | std::vector<aidl::android::hardware::graphics::common::HdrConversionCapability> |
| 568 | mHdrConversionCapabilities = {}; |
| 569 | |
Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 570 | std::unordered_map<std::string, bool> mSupportedLayerGenericMetadata; |
Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 571 | bool mRegisteredCallback = false; |
Dominik Laskowski | b04f98a | 2018-11-07 21:07:16 -0800 | [diff] [blame] | 572 | |
Marin Shalamanov | a524a09 | 2020-07-27 21:39:55 +0200 | [diff] [blame] | 573 | std::unordered_map<hal::HWDisplayId, PhysicalDisplayId> mPhysicalDisplayIdMap; |
Dominik Laskowski | f8db0f0 | 2021-04-19 11:05:25 -0700 | [diff] [blame] | 574 | std::optional<hal::HWDisplayId> mPrimaryHwcDisplayId; |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 575 | bool mHasMultiDisplaySupport = false; |
| 576 | |
Dominik Laskowski | 1394860 | 2021-03-08 20:48:28 -0800 | [diff] [blame] | 577 | const size_t mMaxVirtualDisplayDimension; |
Marin Shalamanov | f8c6372 | 2020-10-06 13:11:21 +0200 | [diff] [blame] | 578 | const bool mUpdateDeviceProductInfoOnHotplugReconnect; |
ramindani | 355fca8 | 2023-12-18 12:07:34 -0800 | [diff] [blame] | 579 | bool mEnableVrrTimeout; |
Sally Qi | 95f669a | 2024-08-27 11:31:42 -0700 | [diff] [blame] | 580 | |
| 581 | HWC2::Display::LutFileDescriptorMapper mLutFileDescriptorMapper; |
Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 582 | }; |
| 583 | |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 584 | } // namespace impl |
Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 585 | } // namespace android |