The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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 | b0dbdaa | 2020-01-06 16:19:42 -0800 | [diff] [blame] | 17 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 18 | #pragma clang diagnostic push |
| 19 | #pragma clang diagnostic ignored "-Wconversion" |
| 20 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame] | 21 | // #define LOG_NDEBUG 0 |
| 22 | #undef LOG_TAG |
| 23 | #define LOG_TAG "DisplayDevice" |
| 24 | |
Ady Abraham | 690f461 | 2021-07-01 23:24:03 -0700 | [diff] [blame] | 25 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
| 26 | |
Vishnu Nair | be0ad90 | 2024-06-27 23:38:43 +0000 | [diff] [blame] | 27 | #include <common/trace.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 28 | #include <compositionengine/CompositionEngine.h> |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 29 | #include <compositionengine/DisplayColorProfile.h> |
| 30 | #include <compositionengine/DisplayColorProfileCreationArgs.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 31 | #include <compositionengine/DisplayCreationArgs.h> |
Lloyd Pique | 542307f | 2018-10-19 13:24:08 -0700 | [diff] [blame] | 32 | #include <compositionengine/DisplaySurface.h> |
Marin Shalamanov | 6ad317c | 2020-07-29 23:34:07 +0200 | [diff] [blame] | 33 | #include <compositionengine/ProjectionSpace.h> |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 34 | #include <compositionengine/RenderSurface.h> |
| 35 | #include <compositionengine/RenderSurfaceCreationArgs.h> |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 36 | #include <compositionengine/impl/OutputCompositionState.h> |
Peiyong Lin | cbc184f | 2018-08-22 13:24:10 -0700 | [diff] [blame] | 37 | #include <configstore/Utils.h> |
Dominik Laskowski | 5c989f5 | 2024-04-11 13:57:14 -0400 | [diff] [blame] | 38 | #include <ftl/concat.h> |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 39 | #include <log/log.h> |
Alec Mouri | 0a9c7b8 | 2018-11-16 13:05:25 -0800 | [diff] [blame] | 40 | #include <system/window.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 42 | #include "DisplayDevice.h" |
Vishnu Nair | af6d297 | 2022-11-18 06:26:38 +0000 | [diff] [blame] | 43 | #include "FrontEnd/DisplayInfo.h" |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 44 | #include "HdrSdrRatioOverlay.h" |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 45 | #include "Layer.h" |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 46 | #include "RefreshRateOverlay.h" |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 47 | #include "SurfaceFlinger.h" |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame] | 48 | |
Peiyong Lin | fd997e0 | 2018-03-28 15:29:00 -0700 | [diff] [blame] | 49 | namespace android { |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | |
Peiyong Lin | 65248e0 | 2020-04-18 21:15:07 -0700 | [diff] [blame] | 51 | namespace hal = hardware::graphics::composer::hal; |
| 52 | |
ELIYAZ MOMIN (xWF) | 92bf32a | 2025-03-20 05:50:13 -0700 | [diff] [blame] | 53 | namespace gui { |
| 54 | inline std::string_view to_string(ISurfaceComposer::OptimizationPolicy optimizationPolicy) { |
| 55 | switch (optimizationPolicy) { |
| 56 | case ISurfaceComposer::OptimizationPolicy::optimizeForPower: |
| 57 | return "optimizeForPower"; |
| 58 | case ISurfaceComposer::OptimizationPolicy::optimizeForPerformance: |
| 59 | return "optimizeForPerformance"; |
| 60 | } |
| 61 | } |
| 62 | } // namespace gui |
| 63 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 64 | DisplayDeviceCreationArgs::DisplayDeviceCreationArgs( |
Marin Shalamanov | 12c9e5a | 2021-01-07 00:25:35 +0100 | [diff] [blame] | 65 | const sp<SurfaceFlinger>& flinger, HWComposer& hwComposer, const wp<IBinder>& displayToken, |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 66 | std::shared_ptr<compositionengine::Display> compositionDisplay) |
Marin Shalamanov | 12c9e5a | 2021-01-07 00:25:35 +0100 | [diff] [blame] | 67 | : flinger(flinger), |
| 68 | hwComposer(hwComposer), |
| 69 | displayToken(displayToken), |
| 70 | compositionDisplay(compositionDisplay) {} |
Chia-I Wu | be02ec0 | 2018-05-18 10:59:36 -0700 | [diff] [blame] | 71 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 72 | DisplayDevice::DisplayDevice(DisplayDeviceCreationArgs& args) |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 73 | : mFlinger(args.flinger), |
Marin Shalamanov | 12c9e5a | 2021-01-07 00:25:35 +0100 | [diff] [blame] | 74 | mHwComposer(args.hwComposer), |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 75 | mDisplayToken(args.displayToken), |
Dominik Laskowski | e977409 | 2018-12-11 10:04:24 -0800 | [diff] [blame] | 76 | mSequenceId(args.sequenceId), |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 77 | mCompositionDisplay{args.compositionDisplay}, |
Dominik Laskowski | 718f960 | 2019-11-09 20:01:35 -0800 | [diff] [blame] | 78 | mPhysicalOrientation(args.physicalOrientation), |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 79 | mPowerMode(ftl::Concat("PowerMode ", getId().value).c_str(), args.initialPowerMode), |
Ady Abraham | 3efa394 | 2021-06-24 19:01:25 -0700 | [diff] [blame] | 80 | mIsPrimary(args.isPrimary), |
Huihong Luo | 1768cb0 | 2022-10-11 11:10:34 -0700 | [diff] [blame] | 81 | mRequestedRefreshRate(args.requestedRefreshRate), |
Dominik Laskowski | 5c989f5 | 2024-04-11 13:57:14 -0400 | [diff] [blame] | 82 | mRefreshRateSelector(std::move(args.refreshRateSelector)) { |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 83 | mCompositionDisplay->editState().isSecure = args.isSecure; |
Chavi Weingarten | 18fa7c6 | 2023-11-28 21:16:03 +0000 | [diff] [blame] | 84 | mCompositionDisplay->editState().isProtected = args.isProtected; |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 85 | mCompositionDisplay->createRenderSurface( |
Dominik Laskowski | b9ac3e1 | 2021-04-23 13:01:16 -0700 | [diff] [blame] | 86 | compositionengine::RenderSurfaceCreationArgsBuilder() |
| 87 | .setDisplayWidth(ANativeWindow_getWidth(args.nativeWindow.get())) |
| 88 | .setDisplayHeight(ANativeWindow_getHeight(args.nativeWindow.get())) |
| 89 | .setNativeWindow(std::move(args.nativeWindow)) |
| 90 | .setDisplaySurface(std::move(args.displaySurface)) |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 91 | .setMaxTextureCacheSize( |
| 92 | static_cast<size_t>(SurfaceFlinger::maxFrameBufferAcquiredBuffers)) |
Dominik Laskowski | b9ac3e1 | 2021-04-23 13:01:16 -0700 | [diff] [blame] | 93 | .build()); |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 94 | |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 95 | if (!mFlinger->mDisableClientCompositionCache && |
| 96 | SurfaceFlinger::maxFrameBufferAcquiredBuffers > 0) { |
Vishnu Nair | 9b079a2 | 2020-01-21 14:36:08 -0800 | [diff] [blame] | 97 | mCompositionDisplay->createClientCompositionCache( |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 98 | static_cast<uint32_t>(SurfaceFlinger::maxFrameBufferAcquiredBuffers)); |
Vishnu Nair | 9b079a2 | 2020-01-21 14:36:08 -0800 | [diff] [blame] | 99 | } |
| 100 | |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 101 | mCompositionDisplay->setPredictCompositionStrategy(mFlinger->mPredictCompositionStrategy); |
| 102 | mCompositionDisplay->setTreat170mAsSrgb(mFlinger->mTreat170mAsSrgb); |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 103 | mCompositionDisplay->createDisplayColorProfile( |
Kriti Dang | 646f8ec | 2022-01-18 14:35:02 +0100 | [diff] [blame] | 104 | compositionengine::DisplayColorProfileCreationArgsBuilder() |
| 105 | .setHasWideColorGamut(args.hasWideColorGamut) |
| 106 | .setHdrCapabilities(std::move(args.hdrCapabilities)) |
| 107 | .setSupportedPerFrameMetadata(args.supportedPerFrameMetadata) |
| 108 | .setHwcColorModes(std::move(args.hwcColorModes)) |
| 109 | .Build()); |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 110 | |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 111 | if (!mCompositionDisplay->isValid()) { |
| 112 | ALOGE("Composition Display did not validate!"); |
| 113 | } |
| 114 | |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 115 | mCompositionDisplay->getRenderSurface()->initialize(); |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 116 | |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 117 | setPowerMode(args.initialPowerMode); |
Alec Mouri | ba013fa | 2018-10-16 12:43:11 -0700 | [diff] [blame] | 118 | |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 119 | // initialize the display orientation transform. |
Dominik Laskowski | 718f960 | 2019-11-09 20:01:35 -0800 | [diff] [blame] | 120 | setProjection(ui::ROTATION_0, Rect::INVALID_RECT, Rect::INVALID_RECT); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 121 | } |
| 122 | |
Lloyd Pique | 0959483 | 2018-01-22 17:48:03 -0800 | [diff] [blame] | 123 | DisplayDevice::~DisplayDevice() = default; |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 124 | |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 125 | void DisplayDevice::disconnect() { |
| 126 | mCompositionDisplay->disconnect(); |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 129 | int DisplayDevice::getWidth() const { |
Angel Aguayo | b108a6d | 2021-08-06 21:34:57 +0000 | [diff] [blame] | 130 | return mCompositionDisplay->getState().displaySpace.getBounds().width; |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 131 | } |
| 132 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 133 | int DisplayDevice::getHeight() const { |
Angel Aguayo | b108a6d | 2021-08-06 21:34:57 +0000 | [diff] [blame] | 134 | return mCompositionDisplay->getState().displaySpace.getBounds().height; |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 135 | } |
| 136 | |
Dominik Laskowski | bf170d9 | 2018-04-19 15:08:05 -0700 | [diff] [blame] | 137 | void DisplayDevice::setDisplayName(const std::string& displayName) { |
| 138 | if (!displayName.empty()) { |
Mathias Agopian | 9e2463e | 2012-09-21 18:26:16 -0700 | [diff] [blame] | 139 | // never override the name with an empty name |
| 140 | mDisplayName = displayName; |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 141 | mCompositionDisplay->setName(displayName); |
Mathias Agopian | 9e2463e | 2012-09-21 18:26:16 -0700 | [diff] [blame] | 142 | } |
| 143 | } |
| 144 | |
Vishnu Nair | af6d297 | 2022-11-18 06:26:38 +0000 | [diff] [blame] | 145 | auto DisplayDevice::getFrontEndInfo() const -> frontend::DisplayInfo { |
Prabir Pradhan | 48f8cb9 | 2021-08-26 14:05:36 -0700 | [diff] [blame] | 146 | gui::DisplayInfo info; |
Linnan Li | 13bf76a | 2024-05-05 19:18:02 +0800 | [diff] [blame] | 147 | info.displayId = ui::LogicalDisplayId{static_cast<int32_t>(getLayerStack().id)}; |
Prabir Pradhan | 48f8cb9 | 2021-08-26 14:05:36 -0700 | [diff] [blame] | 148 | |
| 149 | // The physical orientation is set when the orientation of the display panel is |
| 150 | // different than the default orientation of the device. Other services like |
| 151 | // InputFlinger do not know about this, so we do not need to expose the physical |
| 152 | // orientation of the panel outside of SurfaceFlinger. |
| 153 | const ui::Rotation inversePhysicalOrientation = ui::ROTATION_0 - mPhysicalOrientation; |
| 154 | auto width = getWidth(); |
| 155 | auto height = getHeight(); |
| 156 | if (inversePhysicalOrientation == ui::ROTATION_90 || |
| 157 | inversePhysicalOrientation == ui::ROTATION_270) { |
| 158 | std::swap(width, height); |
| 159 | } |
| 160 | const ui::Transform undoPhysicalOrientation(ui::Transform::toRotationFlags( |
| 161 | inversePhysicalOrientation), |
| 162 | width, height); |
| 163 | const auto& displayTransform = undoPhysicalOrientation * getTransform(); |
| 164 | // Send the inverse display transform to input so it can convert display coordinates to |
| 165 | // logical display. |
| 166 | info.transform = displayTransform.inverse(); |
| 167 | |
| 168 | info.logicalWidth = getLayerStackSpaceRect().width(); |
| 169 | info.logicalHeight = getLayerStackSpaceRect().height(); |
Dominik Laskowski | 9f410f0 | 2022-01-08 16:22:46 -0800 | [diff] [blame] | 170 | |
| 171 | return {.info = info, |
| 172 | .transform = displayTransform, |
| 173 | .receivesInput = receivesInput(), |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 174 | .isSecure = isSecure(), |
| 175 | .isPrimary = isPrimary(), |
Vishnu Nair | 8175062 | 2023-03-08 15:02:06 -0800 | [diff] [blame] | 176 | .isVirtual = isVirtual(), |
Vishnu Nair | cfb2d25 | 2023-01-19 04:44:02 +0000 | [diff] [blame] | 177 | .rotationFlags = ui::Transform::toRotationFlags(mOrientation), |
| 178 | .transformHint = getTransformHint()}; |
Prabir Pradhan | 48f8cb9 | 2021-08-26 14:05:36 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Peiyong Lin | 65248e0 | 2020-04-18 21:15:07 -0700 | [diff] [blame] | 181 | void DisplayDevice::setPowerMode(hal::PowerMode mode) { |
Vladimir Komsiyski | e0ab7b9 | 2025-03-07 01:10:15 -0800 | [diff] [blame] | 182 | if (!isVirtual() && (mode == hal::PowerMode::OFF || mode == hal::PowerMode::ON)) { |
linpeter | dcfd4e6 | 2022-12-29 09:39:14 +0800 | [diff] [blame] | 183 | if (mStagedBrightness && mBrightness != mStagedBrightness) { |
joenchen | e72ba5e | 2022-08-24 13:08:58 +0000 | [diff] [blame] | 184 | getCompositionDisplay()->setNextBrightness(*mStagedBrightness); |
| 185 | mBrightness = *mStagedBrightness; |
| 186 | } |
| 187 | mStagedBrightness = std::nullopt; |
| 188 | getCompositionDisplay()->applyDisplayBrightness(true); |
| 189 | } |
| 190 | |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 191 | mPowerMode = mode; |
linpeter | 1c69cd3 | 2022-07-13 19:20:48 +0800 | [diff] [blame] | 192 | |
Dominik Laskowski | b4ff7d9 | 2022-11-22 13:59:53 -0500 | [diff] [blame] | 193 | getCompositionDisplay()->setCompositionEnabled(isPoweredOn()); |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 194 | } |
| 195 | |
Ady Abraham | 6645272 | 2023-03-14 17:41:47 -0700 | [diff] [blame] | 196 | void DisplayDevice::tracePowerMode() { |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 197 | // Assign the same value for tracing. |
| 198 | mPowerMode = mPowerMode.get(); |
Ady Abraham | 6645272 | 2023-03-14 17:41:47 -0700 | [diff] [blame] | 199 | } |
| 200 | |
Alec Mouri | 023c188 | 2021-05-08 16:36:33 -0700 | [diff] [blame] | 201 | void DisplayDevice::enableLayerCaching(bool enable) { |
| 202 | getCompositionDisplay()->setLayerCachingEnabled(enable); |
| 203 | } |
| 204 | |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 205 | hal::PowerMode DisplayDevice::getPowerMode() const { |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 206 | return mPowerMode; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 207 | } |
| 208 | |
Dominik Laskowski | eecd659 | 2018-05-29 10:25:41 -0700 | [diff] [blame] | 209 | bool DisplayDevice::isPoweredOn() const { |
Dominik Laskowski | a42d539 | 2022-09-29 14:26:53 -0400 | [diff] [blame] | 210 | return mPowerMode != hal::PowerMode::OFF; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 211 | } |
| 212 | |
Ady Abraham | 8e3e2ea | 2024-10-31 15:52:31 -0700 | [diff] [blame] | 213 | bool DisplayDevice::isRefreshable() const { |
| 214 | return mPowerMode == hal::PowerMode::DOZE || mPowerMode == hal::PowerMode::ON; |
| 215 | } |
| 216 | |
Peiyong Lin | dd9b2ae | 2018-03-01 16:22:45 -0800 | [diff] [blame] | 217 | ui::Dataspace DisplayDevice::getCompositionDataSpace() const { |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 218 | return mCompositionDisplay->getState().dataspace; |
Peiyong Lin | dd9b2ae | 2018-03-01 16:22:45 -0800 | [diff] [blame] | 219 | } |
| 220 | |
Dominik Laskowski | b363c4c | 2022-08-02 14:03:41 -0700 | [diff] [blame] | 221 | void DisplayDevice::setLayerFilter(ui::LayerFilter filter) { |
| 222 | mCompositionDisplay->setLayerFilter(filter); |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 223 | if (mRefreshRateOverlay) { |
Dominik Laskowski | b363c4c | 2022-08-02 14:03:41 -0700 | [diff] [blame] | 224 | mRefreshRateOverlay->setLayerStack(filter.layerStack); |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 225 | } |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 226 | if (mHdrSdrRatioOverlay) { |
| 227 | mHdrSdrRatioOverlay->setLayerStack(filter.layerStack); |
| 228 | } |
Mathias Agopian | 28947d7 | 2012-08-08 18:51:15 -0700 | [diff] [blame] | 229 | } |
| 230 | |
Evan Rosky | 2239b37 | 2021-05-20 13:43:47 -0700 | [diff] [blame] | 231 | void DisplayDevice::setFlags(uint32_t flags) { |
| 232 | mFlags = flags; |
| 233 | } |
| 234 | |
Dominik Laskowski | 251e612 | 2024-07-31 11:04:24 -0400 | [diff] [blame] | 235 | void DisplayDevice::setDisplaySize(ui::Size size) { |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 236 | mCompositionDisplay->setDisplaySize(size); |
| 237 | if (mRefreshRateOverlay) { |
| 238 | mRefreshRateOverlay->setViewport(size); |
| 239 | } |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 240 | if (mHdrSdrRatioOverlay) { |
| 241 | mHdrSdrRatioOverlay->setViewport(size); |
| 242 | } |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 243 | } |
| 244 | |
Marin Shalamanov | 6ad317c | 2020-07-29 23:34:07 +0200 | [diff] [blame] | 245 | void DisplayDevice::setProjection(ui::Rotation orientation, Rect layerStackSpaceRect, |
| 246 | Rect orientedDisplaySpaceRect) { |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 247 | mIsOrientationChanged = mOrientation != orientation; |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 248 | mOrientation = orientation; |
| 249 | |
Marin Shalamanov | 8c23c4e | 2020-08-19 15:26:31 +0200 | [diff] [blame] | 250 | // We need to take care of display rotation for globalTransform for case if the panel is not |
| 251 | // installed aligned with device orientation. |
| 252 | const auto transformOrientation = orientation + mPhysicalOrientation; |
Alec Mouri | 168f6cc | 2022-04-07 20:58:00 +0000 | [diff] [blame] | 253 | |
| 254 | const auto& state = getCompositionDisplay()->getState(); |
| 255 | |
| 256 | // If the layer stack and destination frames have never been set, then configure them to be the |
| 257 | // same as the physical device, taking into account the total transform. |
| 258 | if (!orientedDisplaySpaceRect.isValid()) { |
| 259 | ui::Size bounds = state.displaySpace.getBounds(); |
| 260 | bounds.rotate(transformOrientation); |
| 261 | orientedDisplaySpaceRect = Rect(bounds); |
| 262 | } |
| 263 | if (layerStackSpaceRect.isEmpty()) { |
| 264 | ui::Size bounds = state.framebufferSpace.getBounds(); |
| 265 | bounds.rotate(transformOrientation); |
| 266 | layerStackSpaceRect = Rect(bounds); |
| 267 | } |
Marin Shalamanov | 68933fb | 2020-09-10 17:58:12 +0200 | [diff] [blame] | 268 | getCompositionDisplay()->setProjection(transformOrientation, layerStackSpaceRect, |
| 269 | orientedDisplaySpaceRect); |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 270 | } |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 271 | |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 272 | void DisplayDevice::stageBrightness(float brightness) { |
| 273 | mStagedBrightness = brightness; |
| 274 | } |
| 275 | |
| 276 | void DisplayDevice::persistBrightness(bool needsComposite) { |
linpeter | dcfd4e6 | 2022-12-29 09:39:14 +0800 | [diff] [blame] | 277 | if (mStagedBrightness && mBrightness != mStagedBrightness) { |
joenchen | 4292810 | 2022-09-06 18:03:57 +0000 | [diff] [blame] | 278 | if (needsComposite) { |
| 279 | getCompositionDisplay()->setNextBrightness(*mStagedBrightness); |
| 280 | } |
Alec Mouri | cdf1679 | 2021-12-10 13:16:06 -0800 | [diff] [blame] | 281 | mBrightness = *mStagedBrightness; |
| 282 | } |
| 283 | mStagedBrightness = std::nullopt; |
| 284 | } |
| 285 | |
| 286 | std::optional<float> DisplayDevice::getStagedBrightness() const { |
| 287 | return mStagedBrightness; |
| 288 | } |
| 289 | |
Dominik Laskowski | e70461a | 2022-08-30 14:42:01 -0700 | [diff] [blame] | 290 | void DisplayDevice::dump(utils::Dumper& dumper) const { |
| 291 | using namespace std::string_view_literals; |
Marin Shalamanov | 5801c94 | 2020-12-17 17:00:13 +0100 | [diff] [blame] | 292 | |
Dominik Laskowski | 5d7de5f | 2022-11-03 12:38:32 -0400 | [diff] [blame] | 293 | dumper.dump("name"sv, '"' + mDisplayName + '"'); |
Dominik Laskowski | e70461a | 2022-08-30 14:42:01 -0700 | [diff] [blame] | 294 | dumper.dump("powerMode"sv, mPowerMode); |
Dennis Kiilerich | 8520206 | 2025-02-22 00:26:53 -0800 | [diff] [blame] | 295 | dumper.dump("optimizationPolicy"sv, mOptimizationPolicy); |
Ady Abraham | 3efa394 | 2021-06-24 19:01:25 -0700 | [diff] [blame] | 296 | |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 297 | if (mRefreshRateSelector) { |
| 298 | mRefreshRateSelector->dump(dumper); |
Ady Abraham | 3efa394 | 2021-06-24 19:01:25 -0700 | [diff] [blame] | 299 | } |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 300 | } |
Irvel | ffc9efc | 2016-07-27 15:16:37 -0700 | [diff] [blame] | 301 | |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 302 | bool DisplayDevice::hasRenderIntent(ui::RenderIntent intent) const { |
| 303 | return mCompositionDisplay->getDisplayColorProfile()->hasRenderIntent(intent); |
Peiyong Lin | 136fbbc | 2018-04-17 15:09:44 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Marin Shalamanov | 0f10d0d | 2020-08-06 20:04:06 +0200 | [diff] [blame] | 306 | DisplayId DisplayDevice::getId() const { |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 307 | return mCompositionDisplay->getId(); |
| 308 | } |
| 309 | |
Gil Dekel | 147626a | 2025-03-03 17:09:41 -0500 | [diff] [blame] | 310 | bool DisplayDevice::isVirtual() const { |
| 311 | return mCompositionDisplay->isVirtual(); |
| 312 | } |
| 313 | |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 314 | bool DisplayDevice::isSecure() const { |
| 315 | return mCompositionDisplay->isSecure(); |
| 316 | } |
| 317 | |
Huihong Luo | 9ebb7a7 | 2023-06-27 17:01:50 -0700 | [diff] [blame] | 318 | void DisplayDevice::setSecure(bool secure) { |
| 319 | mCompositionDisplay->setSecure(secure); |
| 320 | } |
| 321 | |
Dennis Kiilerich | 8520206 | 2025-02-22 00:26:53 -0800 | [diff] [blame] | 322 | gui::ISurfaceComposer::OptimizationPolicy DisplayDevice::getOptimizationPolicy() const { |
| 323 | return mOptimizationPolicy; |
| 324 | } |
| 325 | |
| 326 | void DisplayDevice::setOptimizationPolicy( |
| 327 | gui::ISurfaceComposer::OptimizationPolicy optimizationPolicy) { |
| 328 | mOptimizationPolicy = optimizationPolicy; |
| 329 | } |
| 330 | |
Angel Aguayo | b108a6d | 2021-08-06 21:34:57 +0000 | [diff] [blame] | 331 | const Rect DisplayDevice::getBounds() const { |
| 332 | return mCompositionDisplay->getState().displaySpace.getBoundsAsRect(); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | const Region& DisplayDevice::getUndefinedRegion() const { |
| 336 | return mCompositionDisplay->getState().undefinedRegion; |
| 337 | } |
| 338 | |
Dominik Laskowski | 3cb3d4e | 2019-11-21 11:14:45 -0800 | [diff] [blame] | 339 | ui::LayerStack DisplayDevice::getLayerStack() const { |
Dominik Laskowski | 29fa146 | 2021-04-27 15:51:50 -0700 | [diff] [blame] | 340 | return mCompositionDisplay->getState().layerFilter.layerStack; |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 341 | } |
| 342 | |
Garfield Tan | 54edd91 | 2020-10-21 16:31:41 -0700 | [diff] [blame] | 343 | ui::Transform::RotationFlags DisplayDevice::getTransformHint() const { |
| 344 | return mCompositionDisplay->getTransformHint(); |
| 345 | } |
| 346 | |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 347 | const ui::Transform& DisplayDevice::getTransform() const { |
| 348 | return mCompositionDisplay->getState().transform; |
| 349 | } |
| 350 | |
Marin Shalamanov | 6ad317c | 2020-07-29 23:34:07 +0200 | [diff] [blame] | 351 | const Rect& DisplayDevice::getLayerStackSpaceRect() const { |
Angel Aguayo | b108a6d | 2021-08-06 21:34:57 +0000 | [diff] [blame] | 352 | return mCompositionDisplay->getState().layerStackSpace.getContent(); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 353 | } |
| 354 | |
Marin Shalamanov | 6ad317c | 2020-07-29 23:34:07 +0200 | [diff] [blame] | 355 | const Rect& DisplayDevice::getOrientedDisplaySpaceRect() const { |
Angel Aguayo | b108a6d | 2021-08-06 21:34:57 +0000 | [diff] [blame] | 356 | return mCompositionDisplay->getState().orientedDisplaySpace.getContent(); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 357 | } |
| 358 | |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 359 | bool DisplayDevice::hasWideColorGamut() const { |
| 360 | return mCompositionDisplay->getDisplayColorProfile()->hasWideColorGamut(); |
| 361 | } |
| 362 | |
| 363 | bool DisplayDevice::hasHDR10PlusSupport() const { |
| 364 | return mCompositionDisplay->getDisplayColorProfile()->hasHDR10PlusSupport(); |
| 365 | } |
| 366 | |
| 367 | bool DisplayDevice::hasHDR10Support() const { |
| 368 | return mCompositionDisplay->getDisplayColorProfile()->hasHDR10Support(); |
| 369 | } |
| 370 | |
| 371 | bool DisplayDevice::hasHLGSupport() const { |
| 372 | return mCompositionDisplay->getDisplayColorProfile()->hasHLGSupport(); |
| 373 | } |
| 374 | |
| 375 | bool DisplayDevice::hasDolbyVisionSupport() const { |
| 376 | return mCompositionDisplay->getDisplayColorProfile()->hasDolbyVisionSupport(); |
| 377 | } |
| 378 | |
| 379 | int DisplayDevice::getSupportedPerFrameMetadata() const { |
| 380 | return mCompositionDisplay->getDisplayColorProfile()->getSupportedPerFrameMetadata(); |
| 381 | } |
| 382 | |
Kriti Dang | 49ad413 | 2021-01-08 11:49:56 +0100 | [diff] [blame] | 383 | void DisplayDevice::overrideHdrTypes(const std::vector<ui::Hdr>& hdrTypes) { |
| 384 | mOverrideHdrTypes = hdrTypes; |
| 385 | } |
| 386 | |
| 387 | HdrCapabilities DisplayDevice::getHdrCapabilities() const { |
| 388 | const HdrCapabilities& capabilities = |
| 389 | mCompositionDisplay->getDisplayColorProfile()->getHdrCapabilities(); |
| 390 | std::vector<ui::Hdr> hdrTypes = capabilities.getSupportedHdrTypes(); |
| 391 | if (!mOverrideHdrTypes.empty()) { |
| 392 | hdrTypes = mOverrideHdrTypes; |
| 393 | } |
| 394 | return HdrCapabilities(hdrTypes, capabilities.getDesiredMaxLuminance(), |
| 395 | capabilities.getDesiredMaxAverageLuminance(), |
| 396 | capabilities.getDesiredMinLuminance()); |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 397 | } |
| 398 | |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 399 | void DisplayDevice::enableHdrSdrRatioOverlay(bool enable) { |
| 400 | if (!enable) { |
| 401 | mHdrSdrRatioOverlay.reset(); |
| 402 | return; |
| 403 | } |
| 404 | |
Ady Abraham | ddba934 | 2023-10-02 16:28:03 -0700 | [diff] [blame] | 405 | mHdrSdrRatioOverlay = HdrSdrRatioOverlay::create(); |
| 406 | if (mHdrSdrRatioOverlay) { |
| 407 | mHdrSdrRatioOverlay->setLayerStack(getLayerStack()); |
| 408 | mHdrSdrRatioOverlay->setViewport(getSize()); |
| 409 | updateHdrSdrRatioOverlayRatio(mHdrSdrRatio); |
| 410 | } |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 411 | } |
| 412 | |
| 413 | void DisplayDevice::updateHdrSdrRatioOverlayRatio(float currentHdrSdrRatio) { |
Vishnu Nair | be0ad90 | 2024-06-27 23:38:43 +0000 | [diff] [blame] | 414 | SFTRACE_CALL(); |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 415 | mHdrSdrRatio = currentHdrSdrRatio; |
| 416 | if (mHdrSdrRatioOverlay) { |
| 417 | mHdrSdrRatioOverlay->changeHdrSdrRatio(currentHdrSdrRatio); |
| 418 | } |
| 419 | } |
| 420 | |
Dominik Laskowski | 5c989f5 | 2024-04-11 13:57:14 -0400 | [diff] [blame] | 421 | void DisplayDevice::enableRefreshRateOverlay(bool enable, bool setByHwc, Fps refreshRate, |
| 422 | Fps renderFps, bool showSpinner, bool showRenderRate, |
| 423 | bool showInMiddle) { |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 424 | if (!enable) { |
| 425 | mRefreshRateOverlay.reset(); |
| 426 | return; |
| 427 | } |
| 428 | |
Ady Abraham | 0aa373a | 2022-11-22 13:56:50 -0800 | [diff] [blame] | 429 | ftl::Flags<RefreshRateOverlay::Features> features; |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 430 | if (showSpinner) { |
Ady Abraham | 0aa373a | 2022-11-22 13:56:50 -0800 | [diff] [blame] | 431 | features |= RefreshRateOverlay::Features::Spinner; |
| 432 | } |
| 433 | |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 434 | if (showRenderRate) { |
Ady Abraham | 0aa373a | 2022-11-22 13:56:50 -0800 | [diff] [blame] | 435 | features |= RefreshRateOverlay::Features::RenderRate; |
| 436 | } |
| 437 | |
Lloyd Pique | 30db640 | 2023-06-26 18:56:51 +0000 | [diff] [blame] | 438 | if (showInMiddle) { |
Yifei Zhang | cfb7bb3 | 2023-01-12 16:17:14 -0800 | [diff] [blame] | 439 | features |= RefreshRateOverlay::Features::ShowInMiddle; |
| 440 | } |
| 441 | |
ramindani | b2158ee | 2023-02-13 20:29:59 -0800 | [diff] [blame] | 442 | if (setByHwc) { |
| 443 | features |= RefreshRateOverlay::Features::SetByHwc; |
| 444 | } |
| 445 | |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 446 | const auto fpsRange = mRefreshRateSelector->getSupportedRefreshRateRange(); |
Ady Abraham | ddba934 | 2023-10-02 16:28:03 -0700 | [diff] [blame] | 447 | mRefreshRateOverlay = RefreshRateOverlay::create(fpsRange, features); |
| 448 | if (mRefreshRateOverlay) { |
| 449 | mRefreshRateOverlay->setLayerStack(getLayerStack()); |
| 450 | mRefreshRateOverlay->setViewport(getSize()); |
Dominik Laskowski | 5c989f5 | 2024-04-11 13:57:14 -0400 | [diff] [blame] | 451 | updateRefreshRateOverlayRate(refreshRate, renderFps, setByHwc); |
Ady Abraham | ddba934 | 2023-10-02 16:28:03 -0700 | [diff] [blame] | 452 | } |
ramindani | b2158ee | 2023-02-13 20:29:59 -0800 | [diff] [blame] | 453 | } |
| 454 | |
Ying Wei | 22d59cc | 2024-05-11 02:41:08 +0000 | [diff] [blame] | 455 | void DisplayDevice::updateRefreshRateOverlayRate(Fps refreshRate, Fps renderFps, bool setByHwc) { |
Vishnu Nair | be0ad90 | 2024-06-27 23:38:43 +0000 | [diff] [blame] | 456 | SFTRACE_CALL(); |
ramindani | 3faf574 | 2023-09-21 13:45:12 -0700 | [diff] [blame] | 457 | if (mRefreshRateOverlay) { |
| 458 | if (!mRefreshRateOverlay->isSetByHwc() || setByHwc) { |
ramindani | c6e522e | 2024-05-07 16:42:51 -0700 | [diff] [blame] | 459 | if (mRefreshRateSelector->isVrrDevice() && !mRefreshRateOverlay->isSetByHwc()) { |
| 460 | refreshRate = renderFps; |
| 461 | } |
Ying Wei | 22d59cc | 2024-05-11 02:41:08 +0000 | [diff] [blame] | 462 | mRefreshRateOverlay->changeRefreshRate(refreshRate, renderFps); |
ramindani | 3faf574 | 2023-09-21 13:45:12 -0700 | [diff] [blame] | 463 | } else { |
| 464 | mRefreshRateOverlay->changeRenderRate(renderFps); |
| 465 | } |
ramindani | b2158ee | 2023-02-13 20:29:59 -0800 | [diff] [blame] | 466 | } |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | bool DisplayDevice::onKernelTimerChanged(std::optional<DisplayModeId> desiredModeId, |
| 470 | bool timerExpired) { |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 471 | if (mRefreshRateSelector && mRefreshRateOverlay) { |
Ady Abraham | 0aa373a | 2022-11-22 13:56:50 -0800 | [diff] [blame] | 472 | const auto newMode = |
Dominik Laskowski | d82e0f0 | 2022-10-26 15:23:04 -0400 | [diff] [blame] | 473 | mRefreshRateSelector->onKernelTimerChanged(desiredModeId, timerExpired); |
Ady Abraham | 0aa373a | 2022-11-22 13:56:50 -0800 | [diff] [blame] | 474 | if (newMode) { |
ramindani | a04b8a5 | 2023-08-07 18:49:47 -0700 | [diff] [blame] | 475 | updateRefreshRateOverlayRate(newMode->modePtr->getVsyncRate(), newMode->fps); |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 476 | return true; |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | return false; |
| 481 | } |
| 482 | |
Ady Abraham | eba039c | 2024-07-10 17:45:29 -0700 | [diff] [blame] | 483 | void DisplayDevice::onVrrIdle(bool idle) { |
| 484 | if (mRefreshRateOverlay) { |
| 485 | mRefreshRateOverlay->onVrrIdle(idle); |
| 486 | } |
| 487 | } |
| 488 | |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 489 | void DisplayDevice::animateOverlay() { |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 490 | if (mRefreshRateOverlay) { |
Dominik Laskowski | e0e0cde | 2021-07-30 10:42:05 -0700 | [diff] [blame] | 491 | mRefreshRateOverlay->animate(); |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 492 | } |
Sally Qi | 147581b | 2023-06-27 11:55:34 -0700 | [diff] [blame] | 493 | if (mHdrSdrRatioOverlay) { |
| 494 | // hdr sdr ratio is designed to be on the top right of the screen, |
| 495 | // therefore, we need to re-calculate the display's width and height |
| 496 | if (mIsOrientationChanged) { |
| 497 | auto width = getWidth(); |
| 498 | auto height = getHeight(); |
| 499 | if (mOrientation == ui::ROTATION_90 || mOrientation == ui::ROTATION_270) { |
| 500 | std::swap(width, height); |
| 501 | } |
| 502 | mHdrSdrRatioOverlay->setViewport({width, height}); |
| 503 | } |
| 504 | mHdrSdrRatioOverlay->animate(); |
| 505 | } |
Ady Abraham | 1b11bc6 | 2021-06-03 19:51:19 -0700 | [diff] [blame] | 506 | } |
| 507 | |
Leon Scroggins III | 1af0fb6 | 2023-03-02 14:21:44 -0500 | [diff] [blame] | 508 | void DisplayDevice::adjustRefreshRate(Fps pacesetterDisplayRefreshRate) { |
Huihong Luo | 59a60b7 | 2023-03-08 21:44:59 +0000 | [diff] [blame] | 509 | using fps_approx_ops::operator<=; |
| 510 | if (mRequestedRefreshRate <= 0_Hz) { |
Huihong Luo | 1768cb0 | 2022-10-11 11:10:34 -0700 | [diff] [blame] | 511 | return; |
| 512 | } |
| 513 | |
| 514 | using fps_approx_ops::operator>; |
Leon Scroggins III | 1af0fb6 | 2023-03-02 14:21:44 -0500 | [diff] [blame] | 515 | if (mRequestedRefreshRate > pacesetterDisplayRefreshRate) { |
| 516 | mAdjustedRefreshRate = pacesetterDisplayRefreshRate; |
Huihong Luo | 1768cb0 | 2022-10-11 11:10:34 -0700 | [diff] [blame] | 517 | return; |
| 518 | } |
| 519 | |
| 520 | unsigned divisor = static_cast<unsigned>( |
Huihong Luo | 59a60b7 | 2023-03-08 21:44:59 +0000 | [diff] [blame] | 521 | std::floor(pacesetterDisplayRefreshRate.getValue() / mRequestedRefreshRate.getValue())); |
| 522 | if (divisor == 0) { |
| 523 | mAdjustedRefreshRate = 0_Hz; |
| 524 | return; |
| 525 | } |
| 526 | |
Leon Scroggins III | 1af0fb6 | 2023-03-02 14:21:44 -0500 | [diff] [blame] | 527 | mAdjustedRefreshRate = pacesetterDisplayRefreshRate / divisor; |
Huihong Luo | 1768cb0 | 2022-10-11 11:10:34 -0700 | [diff] [blame] | 528 | } |
| 529 | |
Dominik Laskowski | 663bd28 | 2018-04-19 15:26:54 -0700 | [diff] [blame] | 530 | std::atomic<int32_t> DisplayDeviceState::sNextSequenceId(1); |
Peiyong Lin | fd997e0 | 2018-03-28 15:29:00 -0700 | [diff] [blame] | 531 | |
| 532 | } // namespace android |
Ady Abraham | b0dbdaa | 2020-01-06 16:19:42 -0800 | [diff] [blame] | 533 | |
| 534 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 535 | #pragma clang diagnostic pop // ignored "-Wconversion" |