Dennis Tsiang | 33f0ece | 2023-11-29 12:45:04 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | #define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL) |
| 18 | |
| 19 | #include "ComposerClient.h" |
| 20 | |
| 21 | #include <android-base/logging.h> |
| 22 | #include <android/binder_ibinder_platform.h> |
| 23 | |
| 24 | #include "utils/log.h" |
| 25 | |
| 26 | namespace aidl::android::hardware::graphics::composer3::impl { |
| 27 | |
| 28 | // NOLINTNEXTLINE |
| 29 | #define DEBUG_FUNC() ALOGV("%s", __func__) |
| 30 | |
| 31 | ComposerClient::~ComposerClient() { |
| 32 | DEBUG_FUNC(); |
| 33 | |
| 34 | LOG(DEBUG) << "removed composer client"; |
| 35 | } |
| 36 | |
| 37 | // no need to check nullptr for output parameter, the aidl stub code won't pass |
| 38 | // nullptr |
| 39 | ndk::ScopedAStatus ComposerClient::createLayer(int64_t /*display*/, |
| 40 | int32_t /*bufferSlotCount*/, |
| 41 | int64_t* /*layer*/) { |
| 42 | DEBUG_FUNC(); |
| 43 | return ndk::ScopedAStatus::ok(); |
| 44 | } |
| 45 | |
| 46 | ndk::ScopedAStatus ComposerClient::createVirtualDisplay( |
| 47 | int32_t /*width*/, int32_t /*height*/, AidlPixelFormat /*formatHint*/, |
| 48 | int32_t /*outputBufferSlotCount*/, VirtualDisplay* /*display*/) { |
| 49 | DEBUG_FUNC(); |
| 50 | return ndk::ScopedAStatus::ok(); |
| 51 | } |
| 52 | |
| 53 | ndk::ScopedAStatus ComposerClient::destroyLayer(int64_t /*display*/, |
| 54 | int64_t /*layer*/) { |
| 55 | DEBUG_FUNC(); |
| 56 | return ndk::ScopedAStatus::ok(); |
| 57 | } |
| 58 | |
| 59 | ndk::ScopedAStatus ComposerClient::destroyVirtualDisplay(int64_t /*display*/) { |
| 60 | DEBUG_FUNC(); |
| 61 | return ndk::ScopedAStatus::ok(); |
| 62 | } |
| 63 | |
| 64 | ndk::ScopedAStatus ComposerClient::executeCommands( |
| 65 | const std::vector<DisplayCommand>& /*commands*/, |
| 66 | std::vector<CommandResultPayload>* /*results*/) { |
| 67 | DEBUG_FUNC(); |
| 68 | return ndk::ScopedAStatus::ok(); |
| 69 | } |
| 70 | |
| 71 | ndk::ScopedAStatus ComposerClient::getActiveConfig(int64_t /*display*/, |
| 72 | int32_t* /*config*/) { |
| 73 | DEBUG_FUNC(); |
| 74 | return ndk::ScopedAStatus::ok(); |
| 75 | } |
| 76 | |
| 77 | ndk::ScopedAStatus ComposerClient::getColorModes( |
| 78 | int64_t /*display*/, std::vector<ColorMode>* /*colorModes*/) { |
| 79 | DEBUG_FUNC(); |
| 80 | return ndk::ScopedAStatus::ok(); |
| 81 | } |
| 82 | |
| 83 | ndk::ScopedAStatus ComposerClient::getDataspaceSaturationMatrix( |
| 84 | common::Dataspace /*dataspace*/, std::vector<float>* /*matrix*/) { |
| 85 | DEBUG_FUNC(); |
| 86 | return ndk::ScopedAStatus::ok(); |
| 87 | } |
| 88 | |
| 89 | ndk::ScopedAStatus ComposerClient::getDisplayAttribute( |
| 90 | int64_t /*display*/, int32_t /*config*/, DisplayAttribute /*attribute*/, |
| 91 | int32_t* /*value*/) { |
| 92 | DEBUG_FUNC(); |
| 93 | return ndk::ScopedAStatus::ok(); |
| 94 | } |
| 95 | |
| 96 | ndk::ScopedAStatus ComposerClient::getDisplayCapabilities( |
| 97 | int64_t /*display*/, std::vector<DisplayCapability>* /*caps*/) { |
| 98 | DEBUG_FUNC(); |
| 99 | |
| 100 | return ndk::ScopedAStatus::ok(); |
| 101 | } |
| 102 | |
| 103 | ndk::ScopedAStatus ComposerClient::getDisplayConfigs( |
| 104 | int64_t /*display*/, std::vector<int32_t>* /*configs*/) { |
| 105 | DEBUG_FUNC(); |
| 106 | return ndk::ScopedAStatus::ok(); |
| 107 | } |
| 108 | |
| 109 | ndk::ScopedAStatus ComposerClient::getDisplayConnectionType( |
| 110 | int64_t /*display*/, DisplayConnectionType* /*type*/) { |
| 111 | DEBUG_FUNC(); |
| 112 | return ndk::ScopedAStatus::ok(); |
| 113 | } |
| 114 | |
| 115 | ndk::ScopedAStatus ComposerClient::getDisplayIdentificationData( |
| 116 | int64_t /*display*/, DisplayIdentification* /*id*/) { |
| 117 | DEBUG_FUNC(); |
| 118 | return ndk::ScopedAStatus::ok(); |
| 119 | } |
| 120 | |
| 121 | ndk::ScopedAStatus ComposerClient::getDisplayName(int64_t /*display*/, |
| 122 | std::string* /*name*/) { |
| 123 | DEBUG_FUNC(); |
| 124 | return ndk::ScopedAStatus::ok(); |
| 125 | } |
| 126 | |
| 127 | ndk::ScopedAStatus ComposerClient::getDisplayVsyncPeriod( |
| 128 | int64_t /*display*/, int32_t* /*vsyncPeriod*/) { |
| 129 | DEBUG_FUNC(); |
| 130 | return ndk::ScopedAStatus::ok(); |
| 131 | } |
| 132 | |
| 133 | ndk::ScopedAStatus ComposerClient::getDisplayedContentSample( |
| 134 | int64_t /*display*/, int64_t /*maxFrames*/, int64_t /*timestamp*/, |
| 135 | DisplayContentSample* /*samples*/) { |
| 136 | DEBUG_FUNC(); |
| 137 | return ndk::ScopedAStatus::ok(); |
| 138 | } |
| 139 | |
| 140 | ndk::ScopedAStatus ComposerClient::getDisplayedContentSamplingAttributes( |
| 141 | int64_t /*display*/, DisplayContentSamplingAttributes* /*attrs*/) { |
| 142 | DEBUG_FUNC(); |
| 143 | return ndk::ScopedAStatus::ok(); |
| 144 | } |
| 145 | |
| 146 | ndk::ScopedAStatus ComposerClient::getDisplayPhysicalOrientation( |
| 147 | int64_t /*display*/, common::Transform* /*orientation*/) { |
| 148 | DEBUG_FUNC(); |
| 149 | return ndk::ScopedAStatus::ok(); |
| 150 | } |
| 151 | |
| 152 | ndk::ScopedAStatus ComposerClient::getHdrCapabilities( |
| 153 | int64_t /*display*/, HdrCapabilities* /*caps*/) { |
| 154 | DEBUG_FUNC(); |
| 155 | return ndk::ScopedAStatus::ok(); |
| 156 | } |
| 157 | |
| 158 | ndk::ScopedAStatus ComposerClient::getMaxVirtualDisplayCount( |
| 159 | int32_t* /*count*/) { |
| 160 | DEBUG_FUNC(); |
| 161 | return ndk::ScopedAStatus::ok(); |
| 162 | } |
| 163 | |
| 164 | ndk::ScopedAStatus ComposerClient::getPerFrameMetadataKeys( |
| 165 | int64_t /*display*/, std::vector<PerFrameMetadataKey>* /*keys*/) { |
| 166 | DEBUG_FUNC(); |
| 167 | return ndk::ScopedAStatus::ok(); |
| 168 | } |
| 169 | |
| 170 | ndk::ScopedAStatus ComposerClient::getReadbackBufferAttributes( |
| 171 | int64_t /*display*/, ReadbackBufferAttributes* /*attrs*/) { |
| 172 | DEBUG_FUNC(); |
| 173 | return ndk::ScopedAStatus::ok(); |
| 174 | } |
| 175 | |
| 176 | ndk::ScopedAStatus ComposerClient::getReadbackBufferFence( |
| 177 | int64_t /*display*/, ndk::ScopedFileDescriptor* /*acquireFence*/) { |
| 178 | DEBUG_FUNC(); |
| 179 | return ndk::ScopedAStatus::ok(); |
| 180 | } |
| 181 | |
| 182 | ndk::ScopedAStatus ComposerClient::getRenderIntents( |
| 183 | int64_t /*display*/, ColorMode /*mode*/, |
| 184 | std::vector<RenderIntent>* /*intents*/) { |
| 185 | DEBUG_FUNC(); |
| 186 | return ndk::ScopedAStatus::ok(); |
| 187 | } |
| 188 | |
| 189 | ndk::ScopedAStatus ComposerClient::getSupportedContentTypes( |
| 190 | int64_t /*display*/, std::vector<ContentType>* /*types*/) { |
| 191 | DEBUG_FUNC(); |
| 192 | return ndk::ScopedAStatus::ok(); |
| 193 | } |
| 194 | |
| 195 | ndk::ScopedAStatus ComposerClient::getDisplayDecorationSupport( |
| 196 | int64_t /*display*/, |
| 197 | std::optional<common::DisplayDecorationSupport>* /*supportStruct*/) { |
| 198 | DEBUG_FUNC(); |
| 199 | return ndk::ScopedAStatus::ok(); |
| 200 | } |
| 201 | |
| 202 | ndk::ScopedAStatus ComposerClient::registerCallback( |
| 203 | const std::shared_ptr<IComposerCallback>& /*callback*/) { |
| 204 | DEBUG_FUNC(); |
| 205 | return ndk::ScopedAStatus::ok(); |
| 206 | } |
| 207 | |
| 208 | ndk::ScopedAStatus ComposerClient::setActiveConfig(int64_t /*display*/, |
| 209 | int32_t /*config*/) { |
| 210 | DEBUG_FUNC(); |
| 211 | return ndk::ScopedAStatus::ok(); |
| 212 | } |
| 213 | |
| 214 | ndk::ScopedAStatus ComposerClient::setActiveConfigWithConstraints( |
| 215 | int64_t /*display*/, int32_t /*config*/, |
| 216 | const VsyncPeriodChangeConstraints& /*constraints*/, |
| 217 | VsyncPeriodChangeTimeline* /*timeline*/) { |
| 218 | DEBUG_FUNC(); |
| 219 | return ndk::ScopedAStatus::ok(); |
| 220 | } |
| 221 | |
| 222 | ndk::ScopedAStatus ComposerClient::setBootDisplayConfig(int64_t /*display*/, |
| 223 | int32_t /*config*/) { |
| 224 | DEBUG_FUNC(); |
| 225 | return ndk::ScopedAStatus::ok(); |
| 226 | } |
| 227 | |
| 228 | ndk::ScopedAStatus ComposerClient::clearBootDisplayConfig(int64_t /*display*/) { |
| 229 | DEBUG_FUNC(); |
| 230 | return ndk::ScopedAStatus::ok(); |
| 231 | } |
| 232 | |
| 233 | ndk::ScopedAStatus ComposerClient::getPreferredBootDisplayConfig( |
| 234 | int64_t /*display*/, int32_t* /*config*/) { |
| 235 | DEBUG_FUNC(); |
| 236 | return ndk::ScopedAStatus::ok(); |
| 237 | } |
| 238 | |
| 239 | ndk::ScopedAStatus ComposerClient::setAutoLowLatencyMode(int64_t /*display*/, |
| 240 | bool /*on*/) { |
| 241 | DEBUG_FUNC(); |
| 242 | return ndk::ScopedAStatus::ok(); |
| 243 | } |
| 244 | |
| 245 | ndk::ScopedAStatus ComposerClient::setClientTargetSlotCount(int64_t /*display*/, |
| 246 | int32_t /*count*/) { |
| 247 | DEBUG_FUNC(); |
| 248 | return ndk::ScopedAStatus::ok(); |
| 249 | } |
| 250 | |
| 251 | ndk::ScopedAStatus ComposerClient::setColorMode(int64_t /*display*/, |
| 252 | ColorMode /*mode*/, |
| 253 | RenderIntent /*intent*/) { |
| 254 | DEBUG_FUNC(); |
| 255 | return ndk::ScopedAStatus::ok(); |
| 256 | } |
| 257 | |
| 258 | ndk::ScopedAStatus ComposerClient::setContentType(int64_t /*display*/, |
| 259 | ContentType /*type*/) { |
| 260 | DEBUG_FUNC(); |
| 261 | return ndk::ScopedAStatus::ok(); |
| 262 | } |
| 263 | |
| 264 | ndk::ScopedAStatus ComposerClient::setDisplayedContentSamplingEnabled( |
| 265 | int64_t /*display*/, bool /*enable*/, |
| 266 | FormatColorComponent /*componentMask*/, int64_t /*maxFrames*/) { |
| 267 | DEBUG_FUNC(); |
| 268 | return ndk::ScopedAStatus::ok(); |
| 269 | } |
| 270 | |
| 271 | ndk::ScopedAStatus ComposerClient::setPowerMode(int64_t /*display*/, |
| 272 | PowerMode /*mode*/) { |
| 273 | DEBUG_FUNC(); |
| 274 | return ndk::ScopedAStatus::ok(); |
| 275 | } |
| 276 | |
| 277 | ndk::ScopedAStatus ComposerClient::setReadbackBuffer( |
| 278 | int64_t /*display*/, const AidlNativeHandle& /*aidlBuffer*/, |
| 279 | const ndk::ScopedFileDescriptor& /*releaseFence*/) { |
| 280 | DEBUG_FUNC(); |
| 281 | return ndk::ScopedAStatus::ok(); |
| 282 | } |
| 283 | |
| 284 | ndk::ScopedAStatus ComposerClient::setVsyncEnabled(int64_t /*display*/, |
| 285 | bool /*enabled*/) { |
| 286 | DEBUG_FUNC(); |
| 287 | return ndk::ScopedAStatus::ok(); |
| 288 | } |
| 289 | |
| 290 | ndk::ScopedAStatus ComposerClient::setIdleTimerEnabled(int64_t /*display*/, |
| 291 | int32_t /*timeout*/) { |
| 292 | DEBUG_FUNC(); |
| 293 | return ndk::ScopedAStatus::ok(); |
| 294 | } |
| 295 | |
| 296 | ::ndk::SpAIBinder ComposerClient::createBinder() { |
| 297 | auto binder = BnComposerClient::createBinder(); |
| 298 | AIBinder_setInheritRt(binder.get(), true); |
| 299 | return binder; |
| 300 | } |
| 301 | |
| 302 | } // namespace aidl::android::hardware::graphics::composer3::impl |