Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | |
Ady Abraham | 9fc2805 | 2021-10-14 17:21:38 -0700 | [diff] [blame] | 17 | #pragma once |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 18 | |
Chia-I Wu | cd8d7f0 | 2016-11-16 11:02:31 +0800 | [diff] [blame] | 19 | #include <memory> |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 20 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 21 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 22 | #pragma clang diagnostic push |
| 23 | #pragma clang diagnostic ignored "-Wconversion" |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 24 | #pragma clang diagnostic ignored "-Wextra" |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 25 | |
Peiyong Lin | afa0f57 | 2020-01-13 16:35:02 -0800 | [diff] [blame] | 26 | #include <composer-command-buffer/2.4/ComposerCommandBuffer.h> |
Alec Mouri | e7cc1c2 | 2021-04-27 15:23:26 -0700 | [diff] [blame] | 27 | #include <gui/BufferQueue.h> |
Courtney Goeltzenleuchter | f9c98e5 | 2018-02-12 07:23:17 -0700 | [diff] [blame] | 28 | #include <gui/HdrMetadata.h> |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 29 | #include <math/mat4.h> |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 30 | #include <ui/DisplayedFrameStats.h> |
Lloyd Pique | d0094aa | 2017-12-20 16:43:28 -0800 | [diff] [blame] | 31 | #include <ui/GraphicBuffer.h> |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 32 | #include <utils/StrongPointer.h> |
| 33 | |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 34 | #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 35 | #include <aidl/android/hardware/graphics/composer3/Capability.h> |
Alec Mouri | 8506569 | 2022-03-18 00:58:26 +0000 | [diff] [blame] | 36 | #include <aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithBrightness.h> |
Ady Abraham | 6e60b14 | 2022-01-06 18:10:35 -0800 | [diff] [blame] | 37 | #include <aidl/android/hardware/graphics/composer3/Color.h> |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 38 | #include <aidl/android/hardware/graphics/composer3/Composition.h> |
Leon Scroggins III | 5967aec | 2021-12-29 11:14:22 -0500 | [diff] [blame] | 39 | #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 40 | #include <aidl/android/hardware/graphics/composer3/IComposerCallback.h> |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 41 | |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 42 | #include <aidl/android/hardware/graphics/common/Transform.h> |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 43 | #include <optional> |
| 44 | |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 45 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
Marin Shalamanov | bed7fd3 | 2020-12-21 20:02:20 +0100 | [diff] [blame] | 46 | #pragma clang diagnostic pop // ignored "-Wconversion -Wextra" |
Ady Abraham | 8a82ba6 | 2020-01-17 12:43:17 -0800 | [diff] [blame] | 47 | |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 48 | namespace android { |
| 49 | namespace HWC2 { |
| 50 | struct ComposerCallback; |
| 51 | } // namespace HWC2 |
| 52 | |
| 53 | namespace Hwc2 { |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 54 | |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 55 | namespace types = hardware::graphics::common; |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 56 | |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 57 | namespace V2_1 = hardware::graphics::composer::V2_1; |
| 58 | namespace V2_2 = hardware::graphics::composer::V2_2; |
Dominik Laskowski | e9ef7c4 | 2018-03-12 19:34:30 -0700 | [diff] [blame] | 59 | namespace V2_3 = hardware::graphics::composer::V2_3; |
Dominik Laskowski | 25a4e7d | 2019-09-20 14:50:10 -0700 | [diff] [blame] | 60 | namespace V2_4 = hardware::graphics::composer::V2_4; |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 61 | namespace V3_0 = ::aidl::android::hardware::graphics::composer3; |
Chia-I Wu | aab99f5 | 2016-10-05 12:59:58 +0800 | [diff] [blame] | 62 | |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 63 | using types::V1_0::ColorTransform; |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 64 | using types::V1_0::Transform; |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 65 | using types::V1_1::RenderIntent; |
Valerie Hau | 9758ae0 | 2018-10-09 16:05:09 -0700 | [diff] [blame] | 66 | using types::V1_2::ColorMode; |
| 67 | using types::V1_2::Dataspace; |
Valerie Hau | e9e843a | 2018-12-18 13:39:23 -0800 | [diff] [blame] | 68 | using types::V1_2::Hdr; |
Kevin DuBois | 73d0f48 | 2019-01-25 11:18:03 -0800 | [diff] [blame] | 69 | using types::V1_2::PixelFormat; |
Valerie Hau | e9e843a | 2018-12-18 13:39:23 -0800 | [diff] [blame] | 70 | |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 71 | using V2_1::Config; |
| 72 | using V2_1::Display; |
| 73 | using V2_1::Error; |
Dominik Laskowski | 6231aaf | 2018-04-02 17:10:23 -0700 | [diff] [blame] | 74 | using V2_1::Layer; |
Peiyong Lin | afa0f57 | 2020-01-13 16:35:02 -0800 | [diff] [blame] | 75 | using V2_4::CommandReaderBase; |
| 76 | using V2_4::CommandWriterBase; |
Dominik Laskowski | 25a4e7d | 2019-09-20 14:50:10 -0700 | [diff] [blame] | 77 | using V2_4::IComposer; |
Ady Abraham | 7159f57 | 2019-10-11 11:10:18 -0700 | [diff] [blame] | 78 | using V2_4::IComposerCallback; |
Dominik Laskowski | 25a4e7d | 2019-09-20 14:50:10 -0700 | [diff] [blame] | 79 | using V2_4::IComposerClient; |
Ady Abraham | 7159f57 | 2019-10-11 11:10:18 -0700 | [diff] [blame] | 80 | using V2_4::VsyncPeriodChangeTimeline; |
| 81 | using V2_4::VsyncPeriodNanos; |
Peiyong Lin | 0ac5f4e | 2018-04-19 22:06:34 -0700 | [diff] [blame] | 82 | using PerFrameMetadata = IComposerClient::PerFrameMetadata; |
| 83 | using PerFrameMetadataKey = IComposerClient::PerFrameMetadataKey; |
Valerie Hau | e9e843a | 2018-12-18 13:39:23 -0800 | [diff] [blame] | 84 | using PerFrameMetadataBlob = IComposerClient::PerFrameMetadataBlob; |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 85 | using AidlTransform = ::aidl::android::hardware::graphics::common::Transform; |
Peiyong Lin | 0ac5f4e | 2018-04-19 22:06:34 -0700 | [diff] [blame] | 86 | |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 87 | class Composer { |
| 88 | public: |
Ady Abraham | 9fc2805 | 2021-10-14 17:21:38 -0700 | [diff] [blame] | 89 | static std::unique_ptr<Composer> create(const std::string& serviceName); |
| 90 | |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 91 | virtual ~Composer() = 0; |
| 92 | |
Ady Abraham | 4d211cf | 2021-12-14 16:19:03 -0800 | [diff] [blame] | 93 | enum class OptionalFeature { |
| 94 | RefreshRateSwitching, |
Ady Abraham | 43065bd | 2021-12-10 17:22:15 -0800 | [diff] [blame] | 95 | ExpectedPresentTime, |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 96 | // Whether setDisplayBrightness is able to be applied as part of a display command. |
| 97 | DisplayBrightnessCommand, |
ramindani | 32cf060 | 2022-03-02 02:30:29 +0000 | [diff] [blame] | 98 | KernelIdleTimer, |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 99 | PhysicalDisplayOrientation, |
Ady Abraham | 4d211cf | 2021-12-14 16:19:03 -0800 | [diff] [blame] | 100 | }; |
| 101 | |
| 102 | virtual bool isSupported(OptionalFeature) const = 0; |
| 103 | |
Ady Abraham | de549d4 | 2022-01-26 19:19:17 -0800 | [diff] [blame] | 104 | virtual std::vector<aidl::android::hardware::graphics::composer3::Capability> |
| 105 | getCapabilities() = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 106 | virtual std::string dumpDebugInfo() = 0; |
| 107 | |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 108 | virtual void registerCallback(HWC2::ComposerCallback& callback) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 109 | |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 110 | // Reset all pending commands in the command buffer. Useful if you want to |
| 111 | // skip a frame but have already queued some commands. |
| 112 | virtual void resetCommands() = 0; |
| 113 | |
| 114 | // Explicitly flush all pending commands in the command buffer. |
| 115 | virtual Error executeCommands() = 0; |
| 116 | |
| 117 | virtual uint32_t getMaxVirtualDisplayCount() = 0; |
Dominik Laskowski | 1394860 | 2021-03-08 20:48:28 -0800 | [diff] [blame] | 118 | virtual Error createVirtualDisplay(uint32_t width, uint32_t height, PixelFormat*, |
Dominik Laskowski | 263eec4 | 2021-07-21 23:13:24 -0700 | [diff] [blame] | 119 | Display* outDisplay) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 120 | virtual Error destroyVirtualDisplay(Display display) = 0; |
| 121 | |
| 122 | virtual Error acceptDisplayChanges(Display display) = 0; |
| 123 | |
| 124 | virtual Error createLayer(Display display, Layer* outLayer) = 0; |
| 125 | virtual Error destroyLayer(Display display, Layer layer) = 0; |
| 126 | |
| 127 | virtual Error getActiveConfig(Display display, Config* outConfig) = 0; |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 128 | virtual Error getChangedCompositionTypes(Display display, std::vector<Layer>* outLayers, |
| 129 | std::vector<V3_0::Composition>* outTypes) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 130 | virtual Error getColorModes(Display display, std::vector<ColorMode>* outModes) = 0; |
| 131 | virtual Error getDisplayAttribute(Display display, Config config, |
| 132 | IComposerClient::Attribute attribute, int32_t* outValue) = 0; |
| 133 | virtual Error getDisplayConfigs(Display display, std::vector<Config>* outConfigs) = 0; |
| 134 | virtual Error getDisplayName(Display display, std::string* outName) = 0; |
| 135 | |
| 136 | virtual Error getDisplayRequests(Display display, uint32_t* outDisplayRequestMask, |
| 137 | std::vector<Layer>* outLayers, |
| 138 | std::vector<uint32_t>* outLayerRequestMasks) = 0; |
| 139 | |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 140 | virtual Error getDozeSupport(Display display, bool* outSupport) = 0; |
ramindani | 32cf060 | 2022-03-02 02:30:29 +0000 | [diff] [blame] | 141 | virtual Error hasDisplayIdleTimerCapability(Display display, bool* outSupport) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 142 | virtual Error getHdrCapabilities(Display display, std::vector<Hdr>* outTypes, |
| 143 | float* outMaxLuminance, float* outMaxAverageLuminance, |
| 144 | float* outMinLuminance) = 0; |
| 145 | |
| 146 | virtual Error getReleaseFences(Display display, std::vector<Layer>* outLayers, |
| 147 | std::vector<int>* outReleaseFences) = 0; |
| 148 | |
| 149 | virtual Error presentDisplay(Display display, int* outPresentFence) = 0; |
| 150 | |
| 151 | virtual Error setActiveConfig(Display display, Config config) = 0; |
| 152 | |
| 153 | /* |
| 154 | * The composer caches client targets internally. When target is nullptr, |
| 155 | * the composer uses slot to look up the client target from its cache. |
| 156 | * When target is not nullptr, the cache is updated with the new target. |
| 157 | */ |
| 158 | virtual Error setClientTarget(Display display, uint32_t slot, const sp<GraphicBuffer>& target, |
| 159 | int acquireFence, Dataspace dataspace, |
| 160 | const std::vector<IComposerClient::Rect>& damage) = 0; |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 161 | virtual Error setColorMode(Display display, ColorMode mode, RenderIntent renderIntent) = 0; |
Ady Abraham | dc011a9 | 2021-12-21 14:06:44 -0800 | [diff] [blame] | 162 | virtual Error setColorTransform(Display display, const float* matrix) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 163 | virtual Error setOutputBuffer(Display display, const native_handle_t* buffer, |
| 164 | int releaseFence) = 0; |
| 165 | virtual Error setPowerMode(Display display, IComposerClient::PowerMode mode) = 0; |
| 166 | virtual Error setVsyncEnabled(Display display, IComposerClient::Vsync enabled) = 0; |
| 167 | |
| 168 | virtual Error setClientTargetSlotCount(Display display) = 0; |
| 169 | |
Ady Abraham | 43065bd | 2021-12-10 17:22:15 -0800 | [diff] [blame] | 170 | virtual Error validateDisplay(Display display, nsecs_t expectedPresentTime, |
| 171 | uint32_t* outNumTypes, uint32_t* outNumRequests) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 172 | |
Ady Abraham | 43065bd | 2021-12-10 17:22:15 -0800 | [diff] [blame] | 173 | virtual Error presentOrValidateDisplay(Display display, nsecs_t expectedPresentTime, |
| 174 | uint32_t* outNumTypes, uint32_t* outNumRequests, |
| 175 | int* outPresentFence, uint32_t* state) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 176 | |
| 177 | virtual Error setCursorPosition(Display display, Layer layer, int32_t x, int32_t y) = 0; |
| 178 | /* see setClientTarget for the purpose of slot */ |
| 179 | virtual Error setLayerBuffer(Display display, Layer layer, uint32_t slot, |
| 180 | const sp<GraphicBuffer>& buffer, int acquireFence) = 0; |
| 181 | virtual Error setLayerSurfaceDamage(Display display, Layer layer, |
| 182 | const std::vector<IComposerClient::Rect>& damage) = 0; |
| 183 | virtual Error setLayerBlendMode(Display display, Layer layer, |
| 184 | IComposerClient::BlendMode mode) = 0; |
Ady Abraham | 6e60b14 | 2022-01-06 18:10:35 -0800 | [diff] [blame] | 185 | virtual Error setLayerColor( |
| 186 | Display display, Layer layer, |
| 187 | const aidl::android::hardware::graphics::composer3::Color& color) = 0; |
Leon Scroggins III | 2e1aa18 | 2021-12-01 17:33:12 -0500 | [diff] [blame] | 188 | virtual Error setLayerCompositionType( |
| 189 | Display display, Layer layer, |
| 190 | aidl::android::hardware::graphics::composer3::Composition type) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 191 | virtual Error setLayerDataspace(Display display, Layer layer, Dataspace dataspace) = 0; |
| 192 | virtual Error setLayerDisplayFrame(Display display, Layer layer, |
| 193 | const IComposerClient::Rect& frame) = 0; |
| 194 | virtual Error setLayerPlaneAlpha(Display display, Layer layer, float alpha) = 0; |
| 195 | virtual Error setLayerSidebandStream(Display display, Layer layer, |
| 196 | const native_handle_t* stream) = 0; |
| 197 | virtual Error setLayerSourceCrop(Display display, Layer layer, |
| 198 | const IComposerClient::FRect& crop) = 0; |
| 199 | virtual Error setLayerTransform(Display display, Layer layer, Transform transform) = 0; |
| 200 | virtual Error setLayerVisibleRegion(Display display, Layer layer, |
| 201 | const std::vector<IComposerClient::Rect>& visible) = 0; |
| 202 | virtual Error setLayerZOrder(Display display, Layer layer, uint32_t z) = 0; |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 203 | |
| 204 | // Composer HAL 2.2 |
Peiyong Lin | 0ac5f4e | 2018-04-19 22:06:34 -0700 | [diff] [blame] | 205 | virtual Error setLayerPerFrameMetadata( |
| 206 | Display display, Layer layer, |
| 207 | const std::vector<IComposerClient::PerFrameMetadata>& perFrameMetadatas) = 0; |
Chia-I Wu | d7e01d7 | 2018-06-21 13:39:09 +0800 | [diff] [blame] | 208 | virtual std::vector<IComposerClient::PerFrameMetadataKey> getPerFrameMetadataKeys( |
| 209 | Display display) = 0; |
Peiyong Lin | 0e7a791 | 2018-04-05 14:36:36 -0700 | [diff] [blame] | 210 | virtual Error getRenderIntents(Display display, ColorMode colorMode, |
| 211 | std::vector<RenderIntent>* outRenderIntents) = 0; |
| 212 | virtual Error getDataspaceSaturationMatrix(Dataspace dataspace, mat4* outMatrix) = 0; |
Dominik Laskowski | e9ef7c4 | 2018-03-12 19:34:30 -0700 | [diff] [blame] | 213 | |
| 214 | // Composer HAL 2.3 |
| 215 | virtual Error getDisplayIdentificationData(Display display, uint8_t* outPort, |
| 216 | std::vector<uint8_t>* outData) = 0; |
Peiyong Lin | 698147a | 2018-09-14 13:27:18 -0700 | [diff] [blame] | 217 | virtual Error setLayerColorTransform(Display display, Layer layer, |
| 218 | const float* matrix) = 0; |
Kevin DuBois | 9c0a176 | 2018-10-16 13:32:31 -0700 | [diff] [blame] | 219 | virtual Error getDisplayedContentSamplingAttributes(Display display, PixelFormat* outFormat, |
| 220 | Dataspace* outDataspace, |
| 221 | uint8_t* outComponentMask) = 0; |
Kevin DuBois | 74e5377 | 2018-11-19 10:52:38 -0800 | [diff] [blame] | 222 | virtual Error setDisplayContentSamplingEnabled(Display display, bool enabled, |
| 223 | uint8_t componentMask, uint64_t maxFrames) = 0; |
Kevin DuBois | 1d4249a | 2018-08-29 10:45:14 -0700 | [diff] [blame] | 224 | virtual Error getDisplayedContentSample(Display display, uint64_t maxFrames, uint64_t timestamp, |
| 225 | DisplayedFrameStats* outStats) = 0; |
Valerie Hau | e9e843a | 2018-12-18 13:39:23 -0800 | [diff] [blame] | 226 | virtual Error setLayerPerFrameMetadataBlobs( |
| 227 | Display display, Layer layer, const std::vector<PerFrameMetadataBlob>& metadata) = 0; |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 228 | // Options for setting the display brightness |
| 229 | struct DisplayBrightnessOptions { |
| 230 | // If true, then immediately submits a brightness change request to composer. Otherwise, |
| 231 | // submission of the brightness change may be deferred until presenting the next frame. |
| 232 | // applyImmediately should only be false if OptionalFeature::DisplayBrightnessCommand is |
| 233 | // supported. |
| 234 | bool applyImmediately = true; |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 235 | |
| 236 | bool operator==(const DisplayBrightnessOptions& other) const { |
Alec Mouri | 90a1927 | 2021-12-30 14:11:38 -0800 | [diff] [blame] | 237 | return applyImmediately == other.applyImmediately; |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 238 | } |
| 239 | }; |
Alec Mouri | 4d8a05d | 2022-03-23 18:14:26 +0000 | [diff] [blame^] | 240 | virtual Error setDisplayBrightness(Display display, float brightness, float brightnessNits, |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 241 | const DisplayBrightnessOptions& options) = 0; |
Dominik Laskowski | 25a4e7d | 2019-09-20 14:50:10 -0700 | [diff] [blame] | 242 | |
| 243 | // Composer HAL 2.4 |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 244 | virtual Error getDisplayCapabilities(Display display, |
| 245 | std::vector<V3_0::DisplayCapability>* outCapabilities) = 0; |
Ady Abraham | 7159f57 | 2019-10-11 11:10:18 -0700 | [diff] [blame] | 246 | virtual V2_4::Error getDisplayConnectionType( |
| 247 | Display display, IComposerClient::DisplayConnectionType* outType) = 0; |
| 248 | virtual V2_4::Error getDisplayVsyncPeriod(Display display, |
| 249 | VsyncPeriodNanos* outVsyncPeriod) = 0; |
| 250 | virtual V2_4::Error setActiveConfigWithConstraints( |
| 251 | Display display, Config config, |
| 252 | const IComposerClient::VsyncPeriodChangeConstraints& vsyncPeriodChangeConstraints, |
| 253 | VsyncPeriodChangeTimeline* outTimeline) = 0; |
Galia Peycheva | 5492cb5 | 2019-10-30 14:13:16 +0100 | [diff] [blame] | 254 | |
| 255 | virtual V2_4::Error setAutoLowLatencyMode(Display displayId, bool on) = 0; |
| 256 | virtual V2_4::Error getSupportedContentTypes( |
| 257 | Display displayId, |
| 258 | std::vector<IComposerClient::ContentType>* outSupportedContentTypes) = 0; |
| 259 | virtual V2_4::Error setContentType(Display displayId, |
| 260 | IComposerClient::ContentType contentType) = 0; |
Dan Stoza | 18d48cb | 2019-10-21 15:39:24 -0700 | [diff] [blame] | 261 | virtual V2_4::Error setLayerGenericMetadata(Display display, Layer layer, |
| 262 | const std::string& key, bool mandatory, |
| 263 | const std::vector<uint8_t>& value) = 0; |
| 264 | virtual V2_4::Error getLayerGenericMetadataKeys( |
| 265 | std::vector<IComposerClient::LayerGenericMetadataKey>* outKeys) = 0; |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 266 | |
Peiyong Lin | dfc3f7c | 2020-05-07 20:15:50 -0700 | [diff] [blame] | 267 | virtual Error getClientTargetProperty( |
Alec Mouri | 8506569 | 2022-03-18 00:58:26 +0000 | [diff] [blame] | 268 | Display display, V3_0::ClientTargetPropertyWithBrightness* outClientTargetProperty) = 0; |
Alec Mouri | cdf6cbc | 2021-11-01 17:21:15 -0700 | [diff] [blame] | 269 | |
| 270 | // AIDL Composer |
Alec Mouri | 6da0e27 | 2022-02-07 12:45:57 -0800 | [diff] [blame] | 271 | virtual Error setLayerBrightness(Display display, Layer layer, float brightness) = 0; |
Leon Scroggins III | d77d316 | 2022-01-05 10:42:28 -0500 | [diff] [blame] | 272 | virtual Error setLayerBlockingRegion(Display display, Layer layer, |
| 273 | const std::vector<IComposerClient::Rect>& blocking) = 0; |
Kriti Dang | 7defaf3 | 2021-11-15 11:55:43 +0100 | [diff] [blame] | 274 | virtual Error setBootDisplayConfig(Display displayId, Config) = 0; |
| 275 | virtual Error clearBootDisplayConfig(Display displayId) = 0; |
| 276 | virtual Error getPreferredBootDisplayConfig(Display displayId, Config*) = 0; |
Leon Scroggins III | e7c51c6 | 2022-02-01 15:53:54 -0500 | [diff] [blame] | 277 | virtual Error getDisplayDecorationSupport( |
| 278 | Display display, |
| 279 | std::optional<::aidl::android::hardware::graphics::common::DisplayDecorationSupport>* |
| 280 | support) = 0; |
ramindani | 32cf060 | 2022-03-02 02:30:29 +0000 | [diff] [blame] | 281 | virtual Error setIdleTimerEnabled(Display displayId, std::chrono::milliseconds timeout) = 0; |
ramindani | 06e518e | 2022-03-14 18:47:53 +0000 | [diff] [blame] | 282 | virtual Error getPhysicalDisplayOrientation(Display displayId, |
| 283 | AidlTransform* outDisplayOrientation) = 0; |
Lloyd Pique | a822d52 | 2017-12-20 16:42:57 -0800 | [diff] [blame] | 284 | }; |
| 285 | |
Yichi Chen | 3401b56 | 2022-01-17 15:42:35 +0800 | [diff] [blame] | 286 | } // namespace Hwc2 |
| 287 | } // namespace android |