| 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 |  | 
|  | 17 | #ifndef ANDROID_SF_HWCOMPOSER_H | 
|  | 18 | #define ANDROID_SF_HWCOMPOSER_H | 
|  | 19 |  | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 20 | #include <cstdint> | 
| Dominik Laskowski | 5690bde | 2020-04-23 19:04:22 -0700 | [diff] [blame] | 21 | #include <future> | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 22 | #include <memory> | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 23 | #include <mutex> | 
| Steven Thomas | 6e8f706 | 2017-11-22 14:15:29 -0800 | [diff] [blame] | 24 | #include <optional> | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 25 | #include <unordered_map> | 
|  | 26 | #include <unordered_set> | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 27 | #include <vector> | 
|  | 28 |  | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 29 | #include <android-base/thread_annotations.h> | 
|  | 30 | #include <ui/Fence.h> | 
| Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 31 |  | 
|  | 32 | // TODO(b/129481165): remove the #pragma below and fix conversion issues | 
|  | 33 | #pragma clang diagnostic push | 
|  | 34 | #pragma clang diagnostic ignored "-Wconversion" | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 35 | #include <ui/GraphicTypes.h> | 
| Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 36 | #pragma clang diagnostic pop | 
|  | 37 |  | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 38 | #include <utils/StrongPointer.h> | 
|  | 39 | #include <utils/Timers.h> | 
|  | 40 |  | 
| Dominik Laskowski | e9ef7c4 | 2018-03-12 19:34:30 -0700 | [diff] [blame] | 41 | #include "DisplayIdentification.h" | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 42 | #include "HWC2.h" | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 43 | #include "Hal.h" | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 44 |  | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 45 | namespace android { | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 46 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 47 | namespace hal = hardware::graphics::composer::hal; | 
|  | 48 |  | 
| Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 49 | struct DisplayedFrameStats; | 
| Jesse Hall | 399184a | 2014-03-03 15:42:54 -0800 | [diff] [blame] | 50 | class GraphicBuffer; | 
| Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 51 | class TestableSurfaceFlinger; | 
| David Sodman | fb95bcc | 2017-12-22 15:45:30 -0800 | [diff] [blame] | 52 | struct CompositionInfo; | 
| Mathias Agopian | 8372785 | 2010-09-23 18:13:21 -0700 | [diff] [blame] | 53 |  | 
| Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 54 | namespace Hwc2 { | 
|  | 55 | class Composer; | 
|  | 56 | } // namespace Hwc2 | 
|  | 57 |  | 
| Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 58 | namespace compositionengine { | 
|  | 59 | class Output; | 
|  | 60 | } // namespace compositionengine | 
|  | 61 |  | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 62 | struct KnownHWCGenericLayerMetadata { | 
|  | 63 | const char* name; | 
|  | 64 | const uint32_t id; | 
|  | 65 | }; | 
|  | 66 |  | 
| Marin Shalamanov | 1c43429 | 2020-06-12 01:47:29 +0200 | [diff] [blame] | 67 | // See the comment for SurfaceFlinger::getHwComposer for the thread safety rules for accessing | 
|  | 68 | // this class. | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 69 | class HWComposer { | 
|  | 70 | public: | 
| Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 71 | struct DeviceRequestedChanges { | 
|  | 72 | using ChangedTypes = std::unordered_map<HWC2::Layer*, hal::Composition>; | 
|  | 73 | using ClientTargetProperty = hal::ClientTargetProperty; | 
|  | 74 | using DisplayRequests = hal::DisplayRequest; | 
|  | 75 | using LayerRequests = std::unordered_map<HWC2::Layer*, hal::LayerRequest>; | 
|  | 76 |  | 
|  | 77 | ChangedTypes changedTypes; | 
|  | 78 | DisplayRequests displayRequests; | 
|  | 79 | LayerRequests layerRequests; | 
|  | 80 | ClientTargetProperty clientTargetProperty; | 
|  | 81 | }; | 
|  | 82 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 83 | virtual ~HWComposer(); | 
|  | 84 |  | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 85 | virtual void setConfiguration(HWC2::ComposerCallback* callback, int32_t sequenceId) = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 86 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 87 | virtual bool getDisplayIdentificationData(hal::HWDisplayId hwcDisplayId, uint8_t* outPort, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 88 | DisplayIdentificationData* outData) const = 0; | 
|  | 89 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 90 | virtual bool hasCapability(hal::Capability capability) const = 0; | 
| Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 91 | virtual bool hasDisplayCapability(DisplayId displayId, | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 92 | hal::DisplayCapability capability) const = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 93 |  | 
|  | 94 | // Attempts to allocate a virtual display and returns its ID if created on the HWC device. | 
|  | 95 | virtual std::optional<DisplayId> allocateVirtualDisplay(uint32_t width, uint32_t height, | 
|  | 96 | ui::PixelFormat* format) = 0; | 
|  | 97 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 98 | virtual void allocatePhysicalDisplay(hal::HWDisplayId hwcDisplayId, DisplayId displayId) = 0; | 
| Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 99 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 100 | // Attempts to create a new layer on this display | 
|  | 101 | virtual HWC2::Layer* createLayer(DisplayId displayId) = 0; | 
|  | 102 | // Destroy a previously created layer | 
|  | 103 | virtual void destroyLayer(DisplayId displayId, HWC2::Layer* layer) = 0; | 
|  | 104 |  | 
| Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 105 | // Gets any required composition change requests from the HWC device. | 
|  | 106 | // | 
|  | 107 | // Note that frameUsesClientComposition must be set correctly based on | 
|  | 108 | // whether the current frame appears to use client composition. If it is | 
|  | 109 | // false some internal optimizations are allowed to present the display | 
|  | 110 | // with fewer handshakes, but this does not work if client composition is | 
|  | 111 | // expected. | 
|  | 112 | virtual status_t getDeviceCompositionChanges( | 
|  | 113 | DisplayId, bool frameUsesClientComposition, | 
|  | 114 | std::optional<DeviceRequestedChanges>* outChanges) = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 115 |  | 
|  | 116 | virtual status_t setClientTarget(DisplayId displayId, uint32_t slot, | 
|  | 117 | const sp<Fence>& acquireFence, const sp<GraphicBuffer>& target, | 
|  | 118 | ui::Dataspace dataspace) = 0; | 
|  | 119 |  | 
|  | 120 | // Present layers to the display and read releaseFences. | 
|  | 121 | virtual status_t presentAndGetReleaseFences(DisplayId displayId) = 0; | 
|  | 122 |  | 
|  | 123 | // set power mode | 
| Peiyong Lin | 65248e0 | 2020-04-18 21:15:07 -0700 | [diff] [blame] | 124 | virtual status_t setPowerMode(DisplayId displayId, hal::PowerMode mode) = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 125 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 126 | // Sets a color transform to be applied to the result of composition | 
|  | 127 | virtual status_t setColorTransform(DisplayId displayId, const mat4& transform) = 0; | 
|  | 128 |  | 
|  | 129 | // reset state when an external, non-virtual display is disconnected | 
|  | 130 | virtual void disconnectDisplay(DisplayId displayId) = 0; | 
|  | 131 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 132 | // get the present fence received from the last call to present. | 
|  | 133 | virtual sp<Fence> getPresentFence(DisplayId displayId) const = 0; | 
|  | 134 |  | 
|  | 135 | // Get last release fence for the given layer | 
|  | 136 | virtual sp<Fence> getLayerReleaseFence(DisplayId displayId, HWC2::Layer* layer) const = 0; | 
|  | 137 |  | 
|  | 138 | // Set the output buffer and acquire fence for a virtual display. | 
|  | 139 | // Returns INVALID_OPERATION if displayId is not a virtual display. | 
|  | 140 | virtual status_t setOutputBuffer(DisplayId displayId, const sp<Fence>& acquireFence, | 
|  | 141 | const sp<GraphicBuffer>& buffer) = 0; | 
|  | 142 |  | 
|  | 143 | // After SurfaceFlinger has retrieved the release fences for all the frames, | 
|  | 144 | // it can call this to clear the shared pointers in the release fence map | 
|  | 145 | virtual void clearReleaseFences(DisplayId displayId) = 0; | 
|  | 146 |  | 
|  | 147 | // Fetches the HDR capabilities of the given display | 
|  | 148 | virtual status_t getHdrCapabilities(DisplayId displayId, HdrCapabilities* outCapabilities) = 0; | 
|  | 149 |  | 
|  | 150 | virtual int32_t getSupportedPerFrameMetadata(DisplayId displayId) const = 0; | 
|  | 151 |  | 
|  | 152 | // Returns the available RenderIntent of the given display. | 
|  | 153 | virtual std::vector<ui::RenderIntent> getRenderIntents(DisplayId displayId, | 
|  | 154 | ui::ColorMode colorMode) const = 0; | 
|  | 155 |  | 
|  | 156 | virtual mat4 getDataspaceSaturationMatrix(DisplayId displayId, ui::Dataspace dataspace) = 0; | 
|  | 157 |  | 
|  | 158 | // Returns the attributes of the color sampling engine. | 
|  | 159 | virtual status_t getDisplayedContentSamplingAttributes(DisplayId displayId, | 
|  | 160 | ui::PixelFormat* outFormat, | 
|  | 161 | ui::Dataspace* outDataspace, | 
|  | 162 | uint8_t* outComponentMask) = 0; | 
|  | 163 | virtual status_t setDisplayContentSamplingEnabled(DisplayId displayId, bool enabled, | 
|  | 164 | uint8_t componentMask, | 
|  | 165 | uint64_t maxFrames) = 0; | 
|  | 166 | virtual status_t getDisplayedContentSample(DisplayId displayId, uint64_t maxFrames, | 
|  | 167 | uint64_t timestamp, | 
|  | 168 | DisplayedFrameStats* outStats) = 0; | 
|  | 169 |  | 
| Dan Gittik | 57e63c5 | 2019-01-18 16:37:54 +0000 | [diff] [blame] | 170 | // Sets the brightness of a display. | 
| Dominik Laskowski | 5690bde | 2020-04-23 19:04:22 -0700 | [diff] [blame] | 171 | virtual std::future<status_t> setDisplayBrightness(DisplayId displayId, float brightness) = 0; | 
| Dan Gittik | 57e63c5 | 2019-01-18 16:37:54 +0000 | [diff] [blame] | 172 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 173 | // Events handling --------------------------------------------------------- | 
|  | 174 |  | 
|  | 175 | // Returns stable display ID (and display name on connection of new or previously disconnected | 
|  | 176 | // display), or std::nullopt if hotplug event was ignored. | 
| Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 177 | // This function is called from SurfaceFlinger. | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 178 | virtual std::optional<DisplayIdentificationInfo> onHotplug(hal::HWDisplayId hwcDisplayId, | 
|  | 179 | hal::Connection connection) = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 180 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 181 | virtual bool onVsync(hal::HWDisplayId hwcDisplayId, int64_t timestamp) = 0; | 
|  | 182 | virtual void setVsyncEnabled(DisplayId displayId, hal::Vsync enabled) = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 183 |  | 
|  | 184 | virtual nsecs_t getRefreshTimestamp(DisplayId displayId) const = 0; | 
|  | 185 | virtual bool isConnected(DisplayId displayId) const = 0; | 
|  | 186 |  | 
|  | 187 | // Non-const because it can update configMap inside of mDisplayData | 
|  | 188 | virtual std::vector<std::shared_ptr<const HWC2::Display::Config>> getConfigs( | 
|  | 189 | DisplayId displayId) const = 0; | 
|  | 190 |  | 
|  | 191 | virtual std::shared_ptr<const HWC2::Display::Config> getActiveConfig( | 
|  | 192 | DisplayId displayId) const = 0; | 
|  | 193 | virtual int getActiveConfigIndex(DisplayId displayId) const = 0; | 
|  | 194 |  | 
|  | 195 | virtual std::vector<ui::ColorMode> getColorModes(DisplayId displayId) const = 0; | 
|  | 196 |  | 
|  | 197 | virtual status_t setActiveColorMode(DisplayId displayId, ui::ColorMode mode, | 
|  | 198 | ui::RenderIntent renderIntent) = 0; | 
|  | 199 |  | 
|  | 200 | virtual bool isUsingVrComposer() const = 0; | 
|  | 201 |  | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 202 | // Composer 2.4 | 
| Dominik Laskowski | 55c8540 | 2020-01-21 16:25:47 -0800 | [diff] [blame] | 203 | virtual DisplayConnectionType getDisplayConnectionType(DisplayId) const = 0; | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 204 | virtual bool isVsyncPeriodSwitchSupported(DisplayId displayId) const = 0; | 
|  | 205 | virtual nsecs_t getDisplayVsyncPeriod(DisplayId displayId) const = 0; | 
|  | 206 | virtual status_t setActiveConfigWithConstraints( | 
|  | 207 | DisplayId displayId, size_t configId, | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 208 | const hal::VsyncPeriodChangeConstraints& constraints, | 
|  | 209 | hal::VsyncPeriodChangeTimeline* outTimeline) = 0; | 
| Galia Peycheva | 5492cb5 | 2019-10-30 14:13:16 +0100 | [diff] [blame] | 210 | virtual status_t setAutoLowLatencyMode(DisplayId displayId, bool on) = 0; | 
|  | 211 | virtual status_t getSupportedContentTypes( | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 212 | DisplayId displayId, std::vector<hal::ContentType>* outSupportedContentTypes) = 0; | 
|  | 213 | virtual status_t setContentType(DisplayId displayId, hal::ContentType contentType) = 0; | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 214 | virtual const std::unordered_map<std::string, bool>& getSupportedLayerGenericMetadata() | 
|  | 215 | const = 0; | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 216 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 217 | // for debugging ---------------------------------------------------------- | 
|  | 218 | virtual void dump(std::string& out) const = 0; | 
|  | 219 |  | 
|  | 220 | virtual Hwc2::Composer* getComposer() const = 0; | 
|  | 221 |  | 
|  | 222 | // TODO(b/74619554): Remove special cases for internal/external display. | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 223 | virtual std::optional<hal::HWDisplayId> getInternalHwcDisplayId() const = 0; | 
|  | 224 | virtual std::optional<hal::HWDisplayId> getExternalHwcDisplayId() const = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 225 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 226 | virtual std::optional<DisplayId> toPhysicalDisplayId(hal::HWDisplayId hwcDisplayId) const = 0; | 
|  | 227 | virtual std::optional<hal::HWDisplayId> fromPhysicalDisplayId(DisplayId displayId) const = 0; | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 228 | }; | 
|  | 229 |  | 
|  | 230 | namespace impl { | 
|  | 231 |  | 
|  | 232 | class HWComposer final : public android::HWComposer { | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 233 | public: | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 234 | explicit HWComposer(std::unique_ptr<Hwc2::Composer> composer); | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 235 | explicit HWComposer(const std::string& composerServiceName); | 
| Mathias Agopian | 8b736f1 | 2012-08-13 17:54:26 -0700 | [diff] [blame] | 236 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 237 | ~HWComposer() override; | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 238 |  | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 239 | void setConfiguration(HWC2::ComposerCallback* callback, int32_t sequenceId) override; | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 240 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 241 | bool getDisplayIdentificationData(hal::HWDisplayId hwcDisplayId, uint8_t* outPort, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 242 | DisplayIdentificationData* outData) const override; | 
| Dominik Laskowski | e9ef7c4 | 2018-03-12 19:34:30 -0700 | [diff] [blame] | 243 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 244 | bool hasCapability(hal::Capability capability) const override; | 
| Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 245 | bool hasDisplayCapability(DisplayId displayId, | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 246 | hal::DisplayCapability capability) const override; | 
| Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 247 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 248 | // Attempts to allocate a virtual display and returns its ID if created on the HWC device. | 
|  | 249 | std::optional<DisplayId> allocateVirtualDisplay(uint32_t width, uint32_t height, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 250 | ui::PixelFormat* format) override; | 
| Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 251 |  | 
| Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 252 | // Called from SurfaceFlinger, when the state for a new physical display needs to be recreated. | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 253 | void allocatePhysicalDisplay(hal::HWDisplayId hwcDisplayId, DisplayId displayId) override; | 
| Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 254 |  | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 255 | // Attempts to create a new layer on this display | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 256 | HWC2::Layer* createLayer(DisplayId displayId) override; | 
| Steven Thomas | 94e35b9 | 2017-07-26 18:48:28 -0700 | [diff] [blame] | 257 | // Destroy a previously created layer | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 258 | void destroyLayer(DisplayId displayId, HWC2::Layer* layer) override; | 
| Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 259 |  | 
| Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 260 | status_t getDeviceCompositionChanges( | 
|  | 261 | DisplayId, bool frameUsesClientComposition, | 
|  | 262 | std::optional<DeviceRequestedChanges>* outChanges) override; | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 263 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 264 | status_t setClientTarget(DisplayId displayId, uint32_t slot, const sp<Fence>& acquireFence, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 265 | const sp<GraphicBuffer>& target, ui::Dataspace dataspace) override; | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 266 |  | 
| Fabien Sanglard | a87aa7b | 2016-11-30 16:27:22 -0800 | [diff] [blame] | 267 | // Present layers to the display and read releaseFences. | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 268 | status_t presentAndGetReleaseFences(DisplayId displayId) override; | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 269 |  | 
| Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 270 | // set power mode | 
| Peiyong Lin | 65248e0 | 2020-04-18 21:15:07 -0700 | [diff] [blame] | 271 | status_t setPowerMode(DisplayId displayId, hal::PowerMode mode) override; | 
| Colin Cross | 10fbdb6 | 2012-07-12 17:56:34 -0700 | [diff] [blame] | 272 |  | 
| Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 273 | // Sets a color transform to be applied to the result of composition | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 274 | status_t setColorTransform(DisplayId displayId, const mat4& transform) override; | 
| Dan Stoza | 9f26a9c | 2016-06-22 14:51:09 -0700 | [diff] [blame] | 275 |  | 
| Andy McFadden | 27ec573 | 2012-10-02 19:04:45 -0700 | [diff] [blame] | 276 | // reset state when an external, non-virtual display is disconnected | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 277 | void disconnectDisplay(DisplayId displayId) override; | 
| Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 278 |  | 
| Fabien Sanglard | 11d0fc3 | 2016-12-01 15:43:01 -0800 | [diff] [blame] | 279 | // get the present fence received from the last call to present. | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 280 | sp<Fence> getPresentFence(DisplayId displayId) const override; | 
| Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 281 |  | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 282 | // Get last release fence for the given layer | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 283 | sp<Fence> getLayerReleaseFence(DisplayId displayId, HWC2::Layer* layer) const override; | 
| Andy McFadden | b0d1dd3 | 2012-09-10 14:08:09 -0700 | [diff] [blame] | 284 |  | 
| Jesse Hall | 851cfe8 | 2013-03-20 13:44:00 -0700 | [diff] [blame] | 285 | // Set the output buffer and acquire fence for a virtual display. | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 286 | // Returns INVALID_OPERATION if displayId is not a virtual display. | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 287 | status_t setOutputBuffer(DisplayId displayId, const sp<Fence>& acquireFence, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 288 | const sp<GraphicBuffer>& buffer) override; | 
| Jesse Hall | 851cfe8 | 2013-03-20 13:44:00 -0700 | [diff] [blame] | 289 |  | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 290 | // After SurfaceFlinger has retrieved the release fences for all the frames, | 
|  | 291 | // it can call this to clear the shared pointers in the release fence map | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 292 | void clearReleaseFences(DisplayId displayId) override; | 
| Mathias Agopian | 3e8b853 | 2012-05-13 20:42:01 -0700 | [diff] [blame] | 293 |  | 
| Peiyong Lin | 6266589 | 2018-04-16 11:07:44 -0700 | [diff] [blame] | 294 | // Fetches the HDR capabilities of the given display | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 295 | status_t getHdrCapabilities(DisplayId displayId, HdrCapabilities* outCapabilities) override; | 
| Dan Stoza | c4f471e | 2016-03-24 09:31:08 -0700 | [diff] [blame] | 296 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 297 | int32_t getSupportedPerFrameMetadata(DisplayId displayId) const override; | 
| Peiyong Lin | 0ac5f4e | 2018-04-19 22:06:34 -0700 | [diff] [blame] | 298 |  | 
| Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 299 | // Returns the available RenderIntent of the given display. | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 300 | std::vector<ui::RenderIntent> getRenderIntents(DisplayId displayId, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 301 | ui::ColorMode colorMode) const override; | 
| Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 302 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 303 | mat4 getDataspaceSaturationMatrix(DisplayId displayId, ui::Dataspace dataspace) override; | 
| Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 304 |  | 
| Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 305 | // Returns the attributes of the color sampling engine. | 
|  | 306 | status_t getDisplayedContentSamplingAttributes(DisplayId displayId, ui::PixelFormat* outFormat, | 
|  | 307 | ui::Dataspace* outDataspace, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 308 | uint8_t* outComponentMask) override; | 
| Kevin DuBois | 74e5377 | 2018-11-19 10:52:38 -0800 | [diff] [blame] | 309 | status_t setDisplayContentSamplingEnabled(DisplayId displayId, bool enabled, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 310 | uint8_t componentMask, uint64_t maxFrames) override; | 
| Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 311 | status_t getDisplayedContentSample(DisplayId displayId, uint64_t maxFrames, uint64_t timestamp, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 312 | DisplayedFrameStats* outStats) override; | 
| Dominik Laskowski | 5690bde | 2020-04-23 19:04:22 -0700 | [diff] [blame] | 313 | std::future<status_t> setDisplayBrightness(DisplayId displayId, float brightness) override; | 
| Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 314 |  | 
| Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 315 | // Events handling --------------------------------------------------------- | 
|  | 316 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 317 | // Returns stable display ID (and display name on connection of new or previously disconnected | 
|  | 318 | // display), or std::nullopt if hotplug event was ignored. | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 319 | std::optional<DisplayIdentificationInfo> onHotplug(hal::HWDisplayId hwcDisplayId, | 
|  | 320 | hal::Connection connection) override; | 
| Steven Thomas | 94e35b9 | 2017-07-26 18:48:28 -0700 | [diff] [blame] | 321 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 322 | bool onVsync(hal::HWDisplayId hwcDisplayId, int64_t timestamp) override; | 
|  | 323 | void setVsyncEnabled(DisplayId displayId, hal::Vsync enabled) override; | 
| Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 324 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 325 | nsecs_t getRefreshTimestamp(DisplayId displayId) const override; | 
|  | 326 | bool isConnected(DisplayId displayId) const override; | 
| Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 327 |  | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 328 | // Non-const because it can update configMap inside of mDisplayData | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 329 | std::vector<std::shared_ptr<const HWC2::Display::Config>> getConfigs( | 
|  | 330 | DisplayId displayId) const override; | 
| Dan Stoza | 7f7da32 | 2014-05-02 15:26:25 -0700 | [diff] [blame] | 331 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 332 | std::shared_ptr<const HWC2::Display::Config> getActiveConfig( | 
|  | 333 | DisplayId displayId) const override; | 
|  | 334 | int getActiveConfigIndex(DisplayId displayId) const override; | 
| Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 335 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 336 | std::vector<ui::ColorMode> getColorModes(DisplayId displayId) const override; | 
| Michael Wright | 28f24d0 | 2016-07-12 13:30:53 -0700 | [diff] [blame] | 337 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 338 | status_t setActiveColorMode(DisplayId displayId, ui::ColorMode mode, | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 339 | ui::RenderIntent renderIntent) override; | 
| Courtney Goeltzenleuchter | fad9d8c | 2016-06-23 11:49:50 -0600 | [diff] [blame] | 340 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 341 | bool isUsingVrComposer() const override; | 
| Hendrik Wagenaar | 87670ff | 2017-02-01 12:10:46 -0800 | [diff] [blame] | 342 |  | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 343 | // Composer 2.4 | 
| Dominik Laskowski | 55c8540 | 2020-01-21 16:25:47 -0800 | [diff] [blame] | 344 | DisplayConnectionType getDisplayConnectionType(DisplayId) const override; | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 345 | bool isVsyncPeriodSwitchSupported(DisplayId displayId) const override; | 
|  | 346 | nsecs_t getDisplayVsyncPeriod(DisplayId displayId) const override; | 
|  | 347 | status_t setActiveConfigWithConstraints(DisplayId displayId, size_t configId, | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 348 | const hal::VsyncPeriodChangeConstraints& constraints, | 
|  | 349 | hal::VsyncPeriodChangeTimeline* outTimeline) override; | 
| Galia Peycheva | 5492cb5 | 2019-10-30 14:13:16 +0100 | [diff] [blame] | 350 | status_t setAutoLowLatencyMode(DisplayId displayId, bool) override; | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 351 | status_t getSupportedContentTypes(DisplayId displayId, std::vector<hal::ContentType>*) override; | 
|  | 352 | status_t setContentType(DisplayId displayId, hal::ContentType) override; | 
| Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 353 |  | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 354 | const std::unordered_map<std::string, bool>& getSupportedLayerGenericMetadata() const override; | 
|  | 355 |  | 
| Mathias Agopian | 3eb38cb | 2012-04-03 22:09:52 -0700 | [diff] [blame] | 356 | // for debugging ---------------------------------------------------------- | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 357 | void dump(std::string& out) const override; | 
| Mathias Agopian | 8372785 | 2010-09-23 18:13:21 -0700 | [diff] [blame] | 358 |  | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 359 | Hwc2::Composer* getComposer() const override { return mComposer.get(); } | 
| Steven Thomas | 6e8f706 | 2017-11-22 14:15:29 -0800 | [diff] [blame] | 360 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 361 | // TODO(b/74619554): Remove special cases for internal/external display. | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 362 | std::optional<hal::HWDisplayId> getInternalHwcDisplayId() const override { | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 363 | return mInternalHwcDisplayId; | 
|  | 364 | } | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 365 | std::optional<hal::HWDisplayId> getExternalHwcDisplayId() const override { | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 366 | return mExternalHwcDisplayId; | 
|  | 367 | } | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 368 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 369 | std::optional<DisplayId> toPhysicalDisplayId(hal::HWDisplayId hwcDisplayId) const override; | 
|  | 370 | std::optional<hal::HWDisplayId> fromPhysicalDisplayId(DisplayId displayId) const override; | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 371 |  | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 372 | private: | 
| Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 373 | // For unit tests | 
|  | 374 | friend TestableSurfaceFlinger; | 
|  | 375 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 376 | std::optional<DisplayIdentificationInfo> onHotplugConnect(hal::HWDisplayId hwcDisplayId); | 
|  | 377 | std::optional<DisplayIdentificationInfo> onHotplugDisconnect(hal::HWDisplayId hwcDisplayId); | 
|  | 378 | bool shouldIgnoreHotplugConnect(hal::HWDisplayId hwcDisplayId, | 
| Marin Shalamanov | bdd5915 | 2020-02-14 15:30:06 +0100 | [diff] [blame] | 379 | bool hasDisplayIdentificationData) const; | 
|  | 380 |  | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 381 | void loadCapabilities(); | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 382 | void loadLayerMetadataSupport(); | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 383 | uint32_t getMaxVirtualDisplayCount() const; | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 384 |  | 
| Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 385 | struct DisplayData { | 
| Dominik Laskowski | c1f18f6 | 2018-06-13 15:17:55 -0700 | [diff] [blame] | 386 | bool isVirtual = false; | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 387 | std::unique_ptr<HWC2::Display> hwcDisplay; | 
| Dominik Laskowski | f9750f2 | 2018-06-06 12:24:53 -0700 | [diff] [blame] | 388 | sp<Fence> lastPresentFence = Fence::NO_FENCE; // signals when the last set op retires | 
| Steven Thomas | 94e35b9 | 2017-07-26 18:48:28 -0700 | [diff] [blame] | 389 | std::unordered_map<HWC2::Layer*, sp<Fence>> releaseFences; | 
| Dominik Laskowski | f9750f2 | 2018-06-06 12:24:53 -0700 | [diff] [blame] | 390 | buffer_handle_t outbufHandle = nullptr; | 
|  | 391 | sp<Fence> outbufAcquireFence = Fence::NO_FENCE; | 
| Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 392 | mutable std::unordered_map<int32_t, | 
|  | 393 | std::shared_ptr<const HWC2::Display::Config>> configMap; | 
| Jamie Gennis | 2ec3e07 | 2012-11-11 16:24:33 -0800 | [diff] [blame] | 394 |  | 
| Fabien Sanglard | 249c0ae | 2017-06-19 19:22:36 -0700 | [diff] [blame] | 395 | bool validateWasSkipped; | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 396 | hal::Error presentError; | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 397 |  | 
|  | 398 | bool vsyncTraceToggle = false; | 
|  | 399 |  | 
|  | 400 | std::mutex vsyncEnabledLock; | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 401 | hal::Vsync vsyncEnabled GUARDED_BY(vsyncEnabledLock) = hal::Vsync::DISABLE; | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 402 |  | 
|  | 403 | mutable std::mutex lastHwVsyncLock; | 
|  | 404 | nsecs_t lastHwVsync GUARDED_BY(lastHwVsyncLock) = 0; | 
| Mathias Agopian | e60b068 | 2012-08-21 23:34:09 -0700 | [diff] [blame] | 405 | }; | 
|  | 406 |  | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 407 | std::unordered_map<DisplayId, DisplayData> mDisplayData; | 
| Dominik Laskowski | b04f98a | 2018-11-07 21:07:16 -0800 | [diff] [blame] | 408 |  | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 409 | std::unique_ptr<android::Hwc2::Composer> mComposer; | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 410 | std::unordered_set<hal::Capability> mCapabilities; | 
| Lloyd Pique | 4603f3c | 2020-02-11 12:06:56 -0800 | [diff] [blame] | 411 | std::unordered_map<std::string, bool> mSupportedLayerGenericMetadata; | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 412 | bool mRegisteredCallback = false; | 
| Dominik Laskowski | b04f98a | 2018-11-07 21:07:16 -0800 | [diff] [blame] | 413 |  | 
| Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 414 | std::unordered_map<hal::HWDisplayId, DisplayId> mPhysicalDisplayIdMap; | 
|  | 415 | std::optional<hal::HWDisplayId> mInternalHwcDisplayId; | 
|  | 416 | std::optional<hal::HWDisplayId> mExternalHwcDisplayId; | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 417 | bool mHasMultiDisplaySupport = false; | 
|  | 418 |  | 
| Dominik Laskowski | 3415776 | 2018-10-31 13:07:19 -0700 | [diff] [blame] | 419 | std::unordered_set<DisplayId> mFreeVirtualDisplayIds; | 
| Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 420 | uint32_t mNextVirtualDisplayId = 0; | 
| Peiyong Lin | bdd08cc | 2019-12-17 21:35:14 -0800 | [diff] [blame] | 421 | uint32_t mRemainingHwcVirtualDisplays{getMaxVirtualDisplayCount()}; | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 422 | }; | 
|  | 423 |  | 
| Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 424 | } // namespace impl | 
| Dominik Laskowski | 1af4793 | 2018-11-12 10:20:46 -0800 | [diff] [blame] | 425 | } // namespace android | 
| Mathias Agopian | a350ff9 | 2010-08-10 17:14:02 -0700 | [diff] [blame] | 426 |  | 
|  | 427 | #endif // ANDROID_SF_HWCOMPOSER_H |