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