blob: 1215bd90573ed133f446d98fbb05a9bc22e517ca [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
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
Dan Stoza9e56aa02015-11-02 13:00:03 -080017// #define LOG_NDEBUG 0
18#undef LOG_TAG
19#define LOG_TAG "DisplayDevice"
20
Peiyong Lincbc184f2018-08-22 13:24:10 -070021#include "DisplayDevice.h"
22
Chia-I Wube02ec02018-05-18 10:59:36 -070023#include <array>
24#include <unordered_set>
25
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080026#include <stdlib.h>
27#include <stdio.h>
28#include <string.h>
29#include <math.h>
30
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -070031#include <android-base/stringprintf.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070032#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
33#include <configstore/Utils.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080034#include <cutils/properties.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070035#include <gui/Surface.h>
36#include <hardware/gralloc.h>
37#include <renderengine/RenderEngine.h>
Alec Mouri0a9c7b82018-11-16 13:05:25 -080038#include <sync/sync.h>
39#include <system/window.h>
Courtney Goeltzenleuchter152279d2017-08-14 18:18:30 -060040#include <ui/DebugUtils.h>
Mathias Agopianc666cae2012-07-25 18:56:13 -070041#include <ui/DisplayInfo.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070042#include <ui/PixelFormat.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070043#include <utils/Log.h>
Valerie Hau9758ae02018-10-09 16:05:09 -070044#include <utils/RefBase.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080045
Jesse Hall99c7dbb2013-03-14 14:29:29 -070046#include "DisplayHardware/DisplaySurface.h"
Mathias Agopian1b031492012-06-20 17:51:20 -070047#include "DisplayHardware/HWComposer.h"
Dan Stoza9e56aa02015-11-02 13:00:03 -080048#include "DisplayHardware/HWC2.h"
Mathias Agopianc7d14e22011-08-01 16:32:21 -070049#include "SurfaceFlinger.h"
Mathias Agopian13127d82013-03-05 17:47:11 -080050#include "Layer.h"
Mathias Agopian1f7bec62010-06-25 18:02:21 -070051
Peiyong Linfd997e02018-03-28 15:29:00 -070052namespace android {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053
Jaesoo Lee720a7242017-01-31 15:26:18 +090054// retrieve triple buffer setting from configstore
55using namespace android::hardware::configstore;
56using namespace android::hardware::configstore::V1_0;
Peiyong Linfd997e02018-03-28 15:29:00 -070057using android::ui::ColorMode;
Chia-I Wube02ec02018-05-18 10:59:36 -070058using android::ui::Dataspace;
Peiyong Lin62665892018-04-16 11:07:44 -070059using android::ui::Hdr;
Peiyong Lindd9b2ae2018-03-01 16:22:45 -080060using android::ui::RenderIntent;
Jaesoo Lee720a7242017-01-31 15:26:18 +090061
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080062/*
63 * Initialize the display to the specified values.
64 *
65 */
66
Pablo Ceballos021623b2016-04-15 17:31:51 -070067uint32_t DisplayDevice::sPrimaryDisplayOrientation = 0;
68
Chia-I Wube02ec02018-05-18 10:59:36 -070069namespace {
70
71// ordered list of known SDR color modes
Valerie Hau9758ae02018-10-09 16:05:09 -070072const std::array<ColorMode, 3> sSdrColorModes = {
73 ColorMode::DISPLAY_BT2020,
Chia-I Wube02ec02018-05-18 10:59:36 -070074 ColorMode::DISPLAY_P3,
75 ColorMode::SRGB,
76};
77
78// ordered list of known HDR color modes
79const std::array<ColorMode, 2> sHdrColorModes = {
80 ColorMode::BT2100_PQ,
81 ColorMode::BT2100_HLG,
82};
83
84// ordered list of known SDR render intents
85const std::array<RenderIntent, 2> sSdrRenderIntents = {
86 RenderIntent::ENHANCE,
87 RenderIntent::COLORIMETRIC,
88};
89
90// ordered list of known HDR render intents
91const std::array<RenderIntent, 2> sHdrRenderIntents = {
92 RenderIntent::TONE_MAP_ENHANCE,
93 RenderIntent::TONE_MAP_COLORIMETRIC,
94};
95
96// map known color mode to dataspace
97Dataspace colorModeToDataspace(ColorMode mode) {
98 switch (mode) {
99 case ColorMode::SRGB:
100 return Dataspace::SRGB;
101 case ColorMode::DISPLAY_P3:
102 return Dataspace::DISPLAY_P3;
Valerie Hau9758ae02018-10-09 16:05:09 -0700103 case ColorMode::DISPLAY_BT2020:
104 return Dataspace::DISPLAY_BT2020;
Chia-I Wube02ec02018-05-18 10:59:36 -0700105 case ColorMode::BT2100_HLG:
106 return Dataspace::BT2020_HLG;
107 case ColorMode::BT2100_PQ:
108 return Dataspace::BT2020_PQ;
109 default:
110 return Dataspace::UNKNOWN;
111 }
112}
113
114// Return a list of candidate color modes.
115std::vector<ColorMode> getColorModeCandidates(ColorMode mode) {
116 std::vector<ColorMode> candidates;
117
118 // add mode itself
119 candidates.push_back(mode);
120
121 // check if mode is HDR
122 bool isHdr = false;
123 for (auto hdrMode : sHdrColorModes) {
124 if (hdrMode == mode) {
125 isHdr = true;
126 break;
127 }
128 }
129
130 // add other HDR candidates when mode is HDR
131 if (isHdr) {
132 for (auto hdrMode : sHdrColorModes) {
133 if (hdrMode != mode) {
134 candidates.push_back(hdrMode);
135 }
136 }
137 }
138
139 // add other SDR candidates
140 for (auto sdrMode : sSdrColorModes) {
141 if (sdrMode != mode) {
142 candidates.push_back(sdrMode);
143 }
144 }
145
146 return candidates;
147}
148
149// Return a list of candidate render intents.
150std::vector<RenderIntent> getRenderIntentCandidates(RenderIntent intent) {
151 std::vector<RenderIntent> candidates;
152
153 // add intent itself
154 candidates.push_back(intent);
155
156 // check if intent is HDR
157 bool isHdr = false;
158 for (auto hdrIntent : sHdrRenderIntents) {
159 if (hdrIntent == intent) {
160 isHdr = true;
161 break;
162 }
163 }
164
Chia-I Wube02ec02018-05-18 10:59:36 -0700165 if (isHdr) {
Chia-I Wuc4b08bd2018-05-29 12:57:23 -0700166 // add other HDR candidates when intent is HDR
Chia-I Wube02ec02018-05-18 10:59:36 -0700167 for (auto hdrIntent : sHdrRenderIntents) {
168 if (hdrIntent != intent) {
169 candidates.push_back(hdrIntent);
170 }
171 }
Chia-I Wuc4b08bd2018-05-29 12:57:23 -0700172 } else {
173 // add other SDR candidates when intent is SDR
174 for (auto sdrIntent : sSdrRenderIntents) {
175 if (sdrIntent != intent) {
176 candidates.push_back(sdrIntent);
177 }
178 }
Chia-I Wube02ec02018-05-18 10:59:36 -0700179 }
180
181 return candidates;
182}
183
184// Return the best color mode supported by HWC.
185ColorMode getHwcColorMode(
186 const std::unordered_map<ColorMode, std::vector<RenderIntent>>& hwcColorModes,
187 ColorMode mode) {
188 std::vector<ColorMode> candidates = getColorModeCandidates(mode);
189 for (auto candidate : candidates) {
190 auto iter = hwcColorModes.find(candidate);
191 if (iter != hwcColorModes.end()) {
192 return candidate;
193 }
194 }
195
196 return ColorMode::NATIVE;
197}
198
199// Return the best render intent supported by HWC.
200RenderIntent getHwcRenderIntent(const std::vector<RenderIntent>& hwcIntents, RenderIntent intent) {
201 std::vector<RenderIntent> candidates = getRenderIntentCandidates(intent);
202 for (auto candidate : candidates) {
203 for (auto hwcIntent : hwcIntents) {
204 if (candidate == hwcIntent) {
205 return candidate;
206 }
207 }
208 }
209
210 return RenderIntent::COLORIMETRIC;
211}
212
213} // anonymous namespace
214
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700215DisplayDeviceCreationArgs::DisplayDeviceCreationArgs(const sp<SurfaceFlinger>& flinger,
216 const wp<IBinder>& displayToken,
Dominik Laskowski075d3172018-05-24 15:50:06 -0700217 const std::optional<DisplayId>& displayId)
218 : flinger(flinger), displayToken(displayToken), displayId(displayId) {}
Chia-I Wube02ec02018-05-18 10:59:36 -0700219
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700220DisplayDevice::DisplayDevice(DisplayDeviceCreationArgs&& args)
221 : lastCompositionHadVisibleLayers(false),
222 mFlinger(args.flinger),
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700223 mDisplayToken(args.displayToken),
Dominik Laskowski075d3172018-05-24 15:50:06 -0700224 mId(args.displayId),
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700225 mNativeWindow(args.nativeWindow),
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800226 mGraphicBuffer(nullptr),
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700227 mDisplaySurface(args.displaySurface),
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700228 mDisplayInstallOrientation(args.displayInstallOrientation),
229 mPageFlipCount(0),
Dominik Laskowski075d3172018-05-24 15:50:06 -0700230 mIsVirtual(args.isVirtual),
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700231 mIsSecure(args.isSecure),
232 mLayerStack(NO_LAYER_STACK),
233 mOrientation(),
234 mViewport(Rect::INVALID_RECT),
235 mFrame(Rect::INVALID_RECT),
236 mPowerMode(args.initialPowerMode),
237 mActiveConfig(0),
238 mColorTransform(HAL_COLOR_TRANSFORM_IDENTITY),
239 mHasWideColorGamut(args.hasWideColorGamut),
240 mHasHdr10(false),
241 mHasHLG(false),
242 mHasDolbyVision(false),
Dominik Laskowski075d3172018-05-24 15:50:06 -0700243 mSupportedPerFrameMetadata(args.supportedPerFrameMetadata),
244 mIsPrimary(args.isPrimary) {
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700245 populateColorModes(args.hwcColorModes);
246
247 ALOGE_IF(!mNativeWindow, "No native window was set for display");
248 ALOGE_IF(!mDisplaySurface, "No display surface was set for display");
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700249
250 std::vector<Hdr> types = args.hdrCapabilities.getSupportedHdrTypes();
Peiyong Linfb069302018-04-25 14:34:31 -0700251 for (Hdr hdrType : types) {
Peiyong Lin62665892018-04-16 11:07:44 -0700252 switch (hdrType) {
253 case Hdr::HDR10:
254 mHasHdr10 = true;
255 break;
256 case Hdr::HLG:
257 mHasHLG = true;
258 break;
259 case Hdr::DOLBY_VISION:
260 mHasDolbyVision = true;
261 break;
262 default:
263 ALOGE("UNKNOWN HDR capability: %d", static_cast<int32_t>(hdrType));
264 }
265 }
Jesse Hallffe1f192013-03-22 15:13:48 -0700266
Lloyd Pique2eef1d22018-09-18 21:30:04 -0700267 float minLuminance = args.hdrCapabilities.getDesiredMinLuminance();
268 float maxLuminance = args.hdrCapabilities.getDesiredMaxLuminance();
269 float maxAverageLuminance = args.hdrCapabilities.getDesiredMaxAverageLuminance();
Peiyong Linfb069302018-04-25 14:34:31 -0700270
271 minLuminance = minLuminance <= 0.0 ? sDefaultMinLumiance : minLuminance;
272 maxLuminance = maxLuminance <= 0.0 ? sDefaultMaxLumiance : maxLuminance;
273 maxAverageLuminance = maxAverageLuminance <= 0.0 ? sDefaultMaxLumiance : maxAverageLuminance;
274 if (this->hasWideColorGamut()) {
275 // insert HDR10/HLG as we will force client composition for HDR10/HLG
276 // layers
277 if (!hasHDR10Support()) {
278 types.push_back(Hdr::HDR10);
279 }
280
281 if (!hasHLGSupport()) {
282 types.push_back(Hdr::HLG);
283 }
284 }
285 mHdrCapabilities = HdrCapabilities(types, maxLuminance, maxAverageLuminance, minLuminance);
286
Alec Mouriba013fa2018-10-16 12:43:11 -0700287 ANativeWindow* const window = mNativeWindow.get();
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800288
Alec Mouri4efb6c22018-11-16 13:07:47 -0800289 int status = native_window_api_connect(window, NATIVE_WINDOW_API_EGL);
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800290 ALOGE_IF(status != NO_ERROR, "Unable to connect BQ producer: %d", status);
Alec Mouri4efb6c22018-11-16 13:07:47 -0800291 status = native_window_set_buffers_format(window, HAL_PIXEL_FORMAT_RGBA_8888);
292 ALOGE_IF(status != NO_ERROR, "Unable to set BQ format to RGBA888: %d", status);
293 status = native_window_set_usage(window, GRALLOC_USAGE_HW_RENDER);
294 ALOGE_IF(status != NO_ERROR, "Unable to set BQ usage bits for GPU rendering: %d", status);
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800295
Alec Mouriba013fa2018-10-16 12:43:11 -0700296 mDisplayWidth = ANativeWindow_getWidth(window);
297 mDisplayHeight = ANativeWindow_getHeight(window);
298
Jesse Hallffe1f192013-03-22 15:13:48 -0700299 // initialize the display orientation transform.
300 setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800301}
302
Lloyd Pique09594832018-01-22 17:48:03 -0800303DisplayDevice::~DisplayDevice() = default;
Mathias Agopian92a979a2012-08-02 18:32:23 -0700304
Jesse Hall02d86562013-03-25 14:43:23 -0700305void DisplayDevice::disconnect(HWComposer& hwc) {
Dominik Laskowski075d3172018-05-24 15:50:06 -0700306 if (mId) {
307 hwc.disconnectDisplay(*mId);
308 mId.reset();
Jesse Hall02d86562013-03-25 14:43:23 -0700309 }
310}
311
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700312int DisplayDevice::getWidth() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700313 return mDisplayWidth;
314}
315
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700316int DisplayDevice::getHeight() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700317 return mDisplayHeight;
318}
319
Dominik Laskowskibf170d92018-04-19 15:08:05 -0700320void DisplayDevice::setDisplayName(const std::string& displayName) {
321 if (!displayName.empty()) {
Mathias Agopian9e2463e2012-09-21 18:26:16 -0700322 // never override the name with an empty name
323 mDisplayName = displayName;
324 }
325}
326
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700327uint32_t DisplayDevice::getPageFlipCount() const {
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700328 return mPageFlipCount;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800329}
330
Chia-I Wub02087d2017-11-09 10:19:54 -0800331void DisplayDevice::flip() const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800332{
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700333 mPageFlipCount++;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800334}
335
Dan Stoza71433162014-02-04 16:22:36 -0800336status_t DisplayDevice::beginFrame(bool mustRecompose) const {
337 return mDisplaySurface->beginFrame(mustRecompose);
Jesse Hall028dc8f2013-08-20 16:35:32 -0700338}
339
David Sodmanfb95bcc2017-12-22 15:45:30 -0800340status_t DisplayDevice::prepareFrame(HWComposer& hwc,
341 std::vector<CompositionInfo>& compositionData) {
Dominik Laskowski075d3172018-05-24 15:50:06 -0700342 if (mId) {
343 status_t error = hwc.prepare(*mId, compositionData);
344 if (error != NO_ERROR) {
345 return error;
346 }
Dan Stoza9e56aa02015-11-02 13:00:03 -0800347 }
348
349 DisplaySurface::CompositionType compositionType;
Dominik Laskowski7e045462018-05-30 13:02:02 -0700350 bool hasClient = hwc.hasClientComposition(mId);
351 bool hasDevice = hwc.hasDeviceComposition(mId);
Dan Stoza9e56aa02015-11-02 13:00:03 -0800352 if (hasClient && hasDevice) {
353 compositionType = DisplaySurface::COMPOSITION_MIXED;
354 } else if (hasClient) {
355 compositionType = DisplaySurface::COMPOSITION_GLES;
356 } else if (hasDevice) {
357 compositionType = DisplaySurface::COMPOSITION_HWC;
358 } else {
359 // Nothing to do -- when turning the screen off we get a frame like
360 // this. Call it a HWC frame since we won't be doing any GLES work but
361 // will do a prepare/set cycle.
362 compositionType = DisplaySurface::COMPOSITION_HWC;
363 }
364 return mDisplaySurface->prepareFrame(compositionType);
365}
Jesse Hall38efe862013-04-06 23:12:29 -0700366
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800367sp<GraphicBuffer> DisplayDevice::dequeueBuffer() {
368 int fd;
369 ANativeWindowBuffer* buffer;
370
371 status_t res = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buffer, &fd);
372
373 if (res != NO_ERROR) {
374 ALOGE("ANativeWindow::dequeueBuffer failed for display [%s] with error: %d",
375 getDisplayName().c_str(), res);
376 // Return fast here as we can't do much more - any rendering we do
377 // now will just be wrong.
378 return mGraphicBuffer;
379 }
380
381 ALOGW_IF(mGraphicBuffer != nullptr, "Clobbering a non-null pointer to a buffer [%p].",
382 mGraphicBuffer->getNativeBuffer()->handle);
383 mGraphicBuffer = GraphicBuffer::from(buffer);
384
385 // Block until the buffer is ready
386 // TODO(alecmouri): it's perhaps more appropriate to block renderengine so
387 // that the gl driver can block instead.
388 if (fd >= 0) {
389 sync_wait(fd, -1);
390 close(fd);
391 }
392
393 return mGraphicBuffer;
394}
395
396void DisplayDevice::queueBuffer(HWComposer& hwc) {
Dominik Laskowski7e045462018-05-30 13:02:02 -0700397 if (hwc.hasClientComposition(mId) || hwc.hasFlipClientTargetRequest(mId)) {
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800398 // hasFlipClientTargetRequest could return true even if we haven't
399 // dequeued a buffer before. Try dequeueing one if we don't have a
400 // buffer ready.
401 if (mGraphicBuffer == nullptr) {
402 ALOGI("Attempting to queue a client composited buffer without one "
403 "previously dequeued for display [%s]. Attempting to dequeue "
404 "a scratch buffer now",
405 mDisplayName.c_str());
406 // We shouldn't deadlock here, since mGraphicBuffer == nullptr only
407 // after a successful call to queueBuffer, or if dequeueBuffer has
408 // never been called.
409 dequeueBuffer();
410 }
411
412 if (mGraphicBuffer == nullptr) {
413 ALOGE("No buffer is ready for display [%s]", mDisplayName.c_str());
414 } else {
415 int fd = mBufferReady.release();
416
417 status_t res = mNativeWindow->queueBuffer(mNativeWindow.get(),
418 mGraphicBuffer->getNativeBuffer(), fd);
419 if (res != NO_ERROR) {
420 ALOGE("Error when queueing buffer for display [%s]: %d", mDisplayName.c_str(), res);
421 // We risk blocking on dequeueBuffer if the primary display failed
422 // to queue up its buffer, so crash here.
423 if (isPrimary()) {
424 LOG_ALWAYS_FATAL("ANativeWindow::queueBuffer failed with error: %d", res);
425 } else {
426 mNativeWindow->cancelBuffer(mNativeWindow.get(),
427 mGraphicBuffer->getNativeBuffer(), fd);
428 }
429 }
430 mGraphicBuffer = nullptr;
431 }
Mathias Agopianda27af92012-09-13 18:17:13 -0700432 }
Mathias Agopian52e21482012-09-24 18:07:21 -0700433
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700434 status_t result = mDisplaySurface->advanceFrame();
435 if (result != NO_ERROR) {
Dominik Laskowskibf170d92018-04-19 15:08:05 -0700436 ALOGE("[%s] failed pushing new frame to HWC: %d", mDisplayName.c_str(), result);
Mathias Agopian32341382012-09-25 19:16:28 -0700437 }
Mathias Agopianda27af92012-09-13 18:17:13 -0700438}
439
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800440void DisplayDevice::onPresentDisplayCompleted() {
Dan Stoza9e56aa02015-11-02 13:00:03 -0800441 mDisplaySurface->onFrameCommitted();
442}
Mathias Agopianda27af92012-09-13 18:17:13 -0700443
Mathias Agopian875d8e12013-06-07 15:35:48 -0700444void DisplayDevice::setViewportAndProjection() const {
445 size_t w = mDisplayWidth;
446 size_t h = mDisplayHeight;
Dan Stozac1879002014-05-22 15:59:05 -0700447 Rect sourceCrop(0, 0, w, h);
Chia-I Wu1be50b52018-08-29 10:44:48 -0700448 mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, ui::Transform::ROT_0);
Mathias Agopianbae92d02012-09-28 01:00:47 -0700449}
450
Alec Mouri0a9c7b82018-11-16 13:05:25 -0800451void DisplayDevice::finishBuffer() {
452 mBufferReady = mFlinger->getRenderEngine().flush();
453 if (mBufferReady.get() < 0) {
454 mFlinger->getRenderEngine().finish();
455 }
456}
457
Dan Stoza9e56aa02015-11-02 13:00:03 -0800458const sp<Fence>& DisplayDevice::getClientTargetAcquireFence() const {
459 return mDisplaySurface->getClientTargetAcquireFence();
460}
Dan Stoza9e56aa02015-11-02 13:00:03 -0800461
Mathias Agopian1b031492012-06-20 17:51:20 -0700462// ----------------------------------------------------------------------------
463
Mathias Agopian13127d82013-03-05 17:47:11 -0800464void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers) {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700465 mVisibleLayersSortedByZ = layers;
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700466}
467
Mathias Agopian13127d82013-03-05 17:47:11 -0800468const Vector< sp<Layer> >& DisplayDevice::getVisibleLayersSortedByZ() const {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700469 return mVisibleLayersSortedByZ;
470}
471
Chia-I Wu83806892017-11-16 10:50:20 -0800472void DisplayDevice::setLayersNeedingFences(const Vector< sp<Layer> >& layers) {
473 mLayersNeedingFences = layers;
474}
475
476const Vector< sp<Layer> >& DisplayDevice::getLayersNeedingFences() const {
477 return mLayersNeedingFences;
478}
479
Mathias Agopiancd60f992012-08-16 16:28:27 -0700480Region DisplayDevice::getDirtyRegion(bool repaintEverything) const {
481 Region dirty;
Mathias Agopiancd60f992012-08-16 16:28:27 -0700482 if (repaintEverything) {
483 dirty.set(getBounds());
484 } else {
Peiyong Linefefaac2018-08-17 12:27:51 -0700485 const ui::Transform& planeTransform(mGlobalTransform);
Mathias Agopiancd60f992012-08-16 16:28:27 -0700486 dirty = planeTransform.transform(this->dirtyRegion);
487 dirty.andSelf(getBounds());
488 }
489 return dirty;
490}
491
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700492// ----------------------------------------------------------------------------
Prashant Malani2c9b11f2014-05-25 01:36:31 -0700493void DisplayDevice::setPowerMode(int mode) {
494 mPowerMode = mode;
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700495}
496
Prashant Malani2c9b11f2014-05-25 01:36:31 -0700497int DisplayDevice::getPowerMode() const {
498 return mPowerMode;
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700499}
500
Dominik Laskowskieecd6592018-05-29 10:25:41 -0700501bool DisplayDevice::isPoweredOn() const {
502 return mPowerMode != HWC_POWER_MODE_OFF;
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700503}
504
505// ----------------------------------------------------------------------------
Michael Lentine6c9e34a2014-07-14 13:48:55 -0700506void DisplayDevice::setActiveConfig(int mode) {
507 mActiveConfig = mode;
508}
509
510int DisplayDevice::getActiveConfig() const {
511 return mActiveConfig;
512}
513
514// ----------------------------------------------------------------------------
Peiyong Lina52f0292018-03-14 17:26:31 -0700515void DisplayDevice::setActiveColorMode(ColorMode mode) {
Michael Wright28f24d02016-07-12 13:30:53 -0700516 mActiveColorMode = mode;
517}
518
Peiyong Lina52f0292018-03-14 17:26:31 -0700519ColorMode DisplayDevice::getActiveColorMode() const {
Michael Wright28f24d02016-07-12 13:30:53 -0700520 return mActiveColorMode;
521}
Courtney Goeltzenleuchter79d27242017-07-13 17:54:01 -0600522
Peiyong Lindd9b2ae2018-03-01 16:22:45 -0800523RenderIntent DisplayDevice::getActiveRenderIntent() const {
524 return mActiveRenderIntent;
525}
526
527void DisplayDevice::setActiveRenderIntent(RenderIntent renderIntent) {
528 mActiveRenderIntent = renderIntent;
529}
530
Yiwei Zhang7c64f172018-03-07 14:52:28 -0800531void DisplayDevice::setColorTransform(const mat4& transform) {
532 const bool isIdentity = (transform == mat4());
533 mColorTransform =
534 isIdentity ? HAL_COLOR_TRANSFORM_IDENTITY : HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX;
535}
536
537android_color_transform_t DisplayDevice::getColorTransform() const {
538 return mColorTransform;
539}
540
Peiyong Lin34beb7a2018-03-28 11:57:12 -0700541void DisplayDevice::setCompositionDataSpace(ui::Dataspace dataspace) {
Peiyong Lindd9b2ae2018-03-01 16:22:45 -0800542 mCompositionDataSpace = dataspace;
Courtney Goeltzenleuchter79d27242017-07-13 17:54:01 -0600543 ANativeWindow* const window = mNativeWindow.get();
Peiyong Lin34beb7a2018-03-28 11:57:12 -0700544 native_window_set_buffers_data_space(window, static_cast<android_dataspace>(dataspace));
Courtney Goeltzenleuchter79d27242017-07-13 17:54:01 -0600545}
Michael Wright28f24d02016-07-12 13:30:53 -0700546
Peiyong Lindd9b2ae2018-03-01 16:22:45 -0800547ui::Dataspace DisplayDevice::getCompositionDataSpace() const {
548 return mCompositionDataSpace;
549}
550
Michael Wright28f24d02016-07-12 13:30:53 -0700551// ----------------------------------------------------------------------------
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700552
Mathias Agopian28947d72012-08-08 18:51:15 -0700553void DisplayDevice::setLayerStack(uint32_t stack) {
554 mLayerStack = stack;
555 dirtyRegion.set(bounds());
556}
557
558// ----------------------------------------------------------------------------
559
Mathias Agopianc1c05de2013-09-17 23:45:22 -0700560uint32_t DisplayDevice::getOrientationTransform() const {
561 uint32_t transform = 0;
562 switch (mOrientation) {
563 case DisplayState::eOrientationDefault:
Peiyong Linefefaac2018-08-17 12:27:51 -0700564 transform = ui::Transform::ROT_0;
Mathias Agopianc1c05de2013-09-17 23:45:22 -0700565 break;
566 case DisplayState::eOrientation90:
Peiyong Linefefaac2018-08-17 12:27:51 -0700567 transform = ui::Transform::ROT_90;
Mathias Agopianc1c05de2013-09-17 23:45:22 -0700568 break;
569 case DisplayState::eOrientation180:
Peiyong Linefefaac2018-08-17 12:27:51 -0700570 transform = ui::Transform::ROT_180;
Mathias Agopianc1c05de2013-09-17 23:45:22 -0700571 break;
572 case DisplayState::eOrientation270:
Peiyong Linefefaac2018-08-17 12:27:51 -0700573 transform = ui::Transform::ROT_270;
Mathias Agopianc1c05de2013-09-17 23:45:22 -0700574 break;
575 }
576 return transform;
577}
578
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700579status_t DisplayDevice::orientationToTransfrom(
Peiyong Linefefaac2018-08-17 12:27:51 -0700580 int orientation, int w, int h, ui::Transform* tr)
Mathias Agopian1b031492012-06-20 17:51:20 -0700581{
582 uint32_t flags = 0;
583 switch (orientation) {
Mathias Agopian3165cc22012-08-08 19:42:09 -0700584 case DisplayState::eOrientationDefault:
Peiyong Linefefaac2018-08-17 12:27:51 -0700585 flags = ui::Transform::ROT_0;
Mathias Agopian1b031492012-06-20 17:51:20 -0700586 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700587 case DisplayState::eOrientation90:
Peiyong Linefefaac2018-08-17 12:27:51 -0700588 flags = ui::Transform::ROT_90;
Mathias Agopian1b031492012-06-20 17:51:20 -0700589 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700590 case DisplayState::eOrientation180:
Peiyong Linefefaac2018-08-17 12:27:51 -0700591 flags = ui::Transform::ROT_180;
Mathias Agopian1b031492012-06-20 17:51:20 -0700592 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700593 case DisplayState::eOrientation270:
Peiyong Linefefaac2018-08-17 12:27:51 -0700594 flags = ui::Transform::ROT_270;
Mathias Agopian1b031492012-06-20 17:51:20 -0700595 break;
596 default:
597 return BAD_VALUE;
598 }
599 tr->set(flags, w, h);
600 return NO_ERROR;
601}
602
Michael Lentine47e45402014-07-18 15:34:25 -0700603void DisplayDevice::setDisplaySize(const int newWidth, const int newHeight) {
604 dirtyRegion.set(getBounds());
605
606 mDisplaySurface->resizeBuffers(newWidth, newHeight);
607
Alec Mouriba013fa2018-10-16 12:43:11 -0700608 mDisplayWidth = newWidth;
609 mDisplayHeight = newHeight;
Michael Lentine47e45402014-07-18 15:34:25 -0700610}
611
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700612void DisplayDevice::setProjection(int orientation,
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800613 const Rect& newViewport, const Rect& newFrame) {
614 Rect viewport(newViewport);
615 Rect frame(newFrame);
616
617 const int w = mDisplayWidth;
618 const int h = mDisplayHeight;
619
Peiyong Linefefaac2018-08-17 12:27:51 -0700620 ui::Transform R;
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800621 DisplayDevice::orientationToTransfrom(orientation, w, h, &R);
622
623 if (!frame.isValid()) {
624 // the destination frame can be invalid if it has never been set,
625 // in that case we assume the whole display frame.
626 frame = Rect(w, h);
627 }
628
629 if (viewport.isEmpty()) {
630 // viewport can be invalid if it has never been set, in that case
631 // we assume the whole display size.
632 // it's also invalid to have an empty viewport, so we handle that
633 // case in the same way.
634 viewport = Rect(w, h);
Peiyong Linefefaac2018-08-17 12:27:51 -0700635 if (R.getOrientation() & ui::Transform::ROT_90) {
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800636 // viewport is always specified in the logical orientation
637 // of the display (ie: post-rotation).
Peiyong Lin3db42342018-08-16 09:15:59 -0700638 std::swap(viewport.right, viewport.bottom);
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800639 }
640 }
641
642 dirtyRegion.set(getBounds());
643
Peiyong Linefefaac2018-08-17 12:27:51 -0700644 ui::Transform TL, TP, S;
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800645 float src_width = viewport.width();
646 float src_height = viewport.height();
647 float dst_width = frame.width();
648 float dst_height = frame.height();
649 if (src_width != dst_width || src_height != dst_height) {
650 float sx = dst_width / src_width;
651 float sy = dst_height / src_height;
652 S.set(sx, 0, 0, sy);
653 }
654
655 float src_x = viewport.left;
656 float src_y = viewport.top;
657 float dst_x = frame.left;
658 float dst_y = frame.top;
659 TL.set(-src_x, -src_y);
660 TP.set(dst_x, dst_y);
661
Iris Chang7501ed62018-04-30 14:45:42 +0800662 // need to take care of primary display rotation for mGlobalTransform
663 // for case if the panel is not installed aligned with device orientation
Dominik Laskowski075d3172018-05-24 15:50:06 -0700664 if (isPrimary()) {
Iris Chang7501ed62018-04-30 14:45:42 +0800665 DisplayDevice::orientationToTransfrom(
Chia-I Wua02871c2018-08-27 14:38:23 -0700666 (orientation + mDisplayInstallOrientation) % (DisplayState::eOrientation270 + 1),
Iris Chang7501ed62018-04-30 14:45:42 +0800667 w, h, &R);
668 }
669
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800670 // The viewport and frame are both in the logical orientation.
671 // Apply the logical translation, scale to physical size, apply the
672 // physical translation and finally rotate to the physical orientation.
673 mGlobalTransform = R * TP * S * TL;
674
675 const uint8_t type = mGlobalTransform.getType();
676 mNeedsFiltering = (!mGlobalTransform.preserveRects() ||
Peiyong Linefefaac2018-08-17 12:27:51 -0700677 (type >= ui::Transform::SCALE));
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800678
679 mScissor = mGlobalTransform.transform(viewport);
680 if (mScissor.isEmpty()) {
Mathias Agopian6c7f25a2013-05-09 20:37:10 -0700681 mScissor = getBounds();
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800682 }
683
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700684 mOrientation = orientation;
Dominik Laskowski281644e2018-04-19 15:47:35 -0700685 if (isPrimary()) {
Pablo Ceballos021623b2016-04-15 17:31:51 -0700686 uint32_t transform = 0;
687 switch (mOrientation) {
688 case DisplayState::eOrientationDefault:
Peiyong Linefefaac2018-08-17 12:27:51 -0700689 transform = ui::Transform::ROT_0;
Pablo Ceballos021623b2016-04-15 17:31:51 -0700690 break;
691 case DisplayState::eOrientation90:
Peiyong Linefefaac2018-08-17 12:27:51 -0700692 transform = ui::Transform::ROT_90;
Pablo Ceballos021623b2016-04-15 17:31:51 -0700693 break;
694 case DisplayState::eOrientation180:
Peiyong Linefefaac2018-08-17 12:27:51 -0700695 transform = ui::Transform::ROT_180;
Pablo Ceballos021623b2016-04-15 17:31:51 -0700696 break;
697 case DisplayState::eOrientation270:
Peiyong Linefefaac2018-08-17 12:27:51 -0700698 transform = ui::Transform::ROT_270;
Pablo Ceballos021623b2016-04-15 17:31:51 -0700699 break;
700 }
701 sPrimaryDisplayOrientation = transform;
702 }
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700703 mViewport = viewport;
704 mFrame = frame;
Mathias Agopian1b031492012-06-20 17:51:20 -0700705}
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700706
Pablo Ceballos021623b2016-04-15 17:31:51 -0700707uint32_t DisplayDevice::getPrimaryDisplayOrientationTransform() {
708 return sPrimaryDisplayOrientation;
709}
710
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -0700711std::string DisplayDevice::getDebugName() const {
Dominik Laskowski34157762018-10-31 13:07:19 -0700712 const auto id = mId ? to_string(*mId) + ", " : std::string();
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -0700713 return base::StringPrintf("DisplayDevice{%s%s%s\"%s\"}", id.c_str(),
714 isPrimary() ? "primary, " : "", isVirtual() ? "virtual, " : "",
715 mDisplayName.c_str());
716}
717
Mathias Agopian74d211a2013-04-22 16:55:35 +0200718void DisplayDevice::dump(String8& result) const {
Peiyong Linefefaac2018-08-17 12:27:51 -0700719 const ui::Transform& tr(mGlobalTransform);
Courtney Goeltzenleuchter152279d2017-08-14 18:18:30 -0600720 ANativeWindow* const window = mNativeWindow.get();
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -0700721 result.appendFormat("+ %s\n", getDebugName().c_str());
722 result.appendFormat(" layerStack=%u, (%4dx%4d), ANativeWindow=%p "
Alec Mourif6fd29e2018-11-17 04:56:41 +0000723 "format=%d, orient=%2d (type=%08x), flips=%u, isSecure=%d, "
724 "powerMode=%d, activeConfig=%d, numLayers=%zu\n",
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -0700725 mLayerStack, mDisplayWidth, mDisplayHeight, window,
Alec Mourif6fd29e2018-11-17 04:56:41 +0000726 ANativeWindow_getFormat(window), mOrientation, tr.getType(),
727 getPageFlipCount(), mIsSecure, mPowerMode, mActiveConfig,
Courtney Goeltzenleuchter0ebaac32017-04-13 12:17:03 -0600728 mVisibleLayersSortedByZ.size());
729 result.appendFormat(" v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d],"
730 "transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
731 mViewport.left, mViewport.top, mViewport.right, mViewport.bottom,
732 mFrame.left, mFrame.top, mFrame.right, mFrame.bottom, mScissor.left,
733 mScissor.top, mScissor.right, mScissor.bottom, tr[0][0], tr[1][0], tr[2][0],
734 tr[0][1], tr[1][1], tr[2][1], tr[0][2], tr[1][2], tr[2][2]);
Courtney Goeltzenleuchter152279d2017-08-14 18:18:30 -0600735 auto const surface = static_cast<Surface*>(window);
Peiyong Lin34beb7a2018-03-28 11:57:12 -0700736 ui::Dataspace dataspace = surface->getBuffersDataSpace();
Peiyong Lindd9b2ae2018-03-01 16:22:45 -0800737 result.appendFormat(" wideColorGamut=%d, hdr10=%d, colorMode=%s, dataspace: %s (%d)\n",
Alec Mourif6fd29e2018-11-17 04:56:41 +0000738 mHasWideColorGamut, mHasHdr10, decodeColorMode(mActiveColorMode).c_str(),
739 dataspaceDetails(static_cast<android_dataspace>(dataspace)).c_str(),
740 dataspace);
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700741
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700742 String8 surfaceDump;
Dan Stozaf10c46e2014-11-11 10:32:31 -0800743 mDisplaySurface->dumpAsString(surfaceDump);
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700744 result.append(surfaceDump);
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700745}
Irvelffc9efc2016-07-27 15:16:37 -0700746
Chia-I Wube02ec02018-05-18 10:59:36 -0700747// Map dataspace/intent to the best matched dataspace/colorMode/renderIntent
748// supported by HWC.
749void DisplayDevice::addColorMode(
750 const std::unordered_map<ColorMode, std::vector<RenderIntent>>& hwcColorModes,
751 const ColorMode mode, const RenderIntent intent) {
752 // find the best color mode
753 const ColorMode hwcColorMode = getHwcColorMode(hwcColorModes, mode);
754
755 // find the best render intent
756 auto iter = hwcColorModes.find(hwcColorMode);
757 const auto& hwcIntents =
758 iter != hwcColorModes.end() ? iter->second : std::vector<RenderIntent>();
759 const RenderIntent hwcIntent = getHwcRenderIntent(hwcIntents, intent);
760
761 const Dataspace dataspace = colorModeToDataspace(mode);
762 const Dataspace hwcDataspace = colorModeToDataspace(hwcColorMode);
763
Dominik Laskowski9b17b2c22018-11-01 14:49:03 -0700764 ALOGV("%s: map (%s, %s) to (%s, %s, %s)", getDebugName().c_str(),
Chia-I Wube02ec02018-05-18 10:59:36 -0700765 dataspaceDetails(static_cast<android_dataspace_t>(dataspace)).c_str(),
766 decodeRenderIntent(intent).c_str(),
767 dataspaceDetails(static_cast<android_dataspace_t>(hwcDataspace)).c_str(),
768 decodeColorMode(hwcColorMode).c_str(), decodeRenderIntent(hwcIntent).c_str());
769
770 mColorModes[getColorModeKey(dataspace, intent)] = {hwcDataspace, hwcColorMode, hwcIntent};
771}
772
773void DisplayDevice::populateColorModes(
774 const std::unordered_map<ColorMode, std::vector<RenderIntent>>& hwcColorModes) {
775 if (!hasWideColorGamut()) {
776 return;
777 }
778
Chia-I Wu0d711262018-05-21 15:19:35 -0700779 // collect all known SDR render intents
780 std::unordered_set<RenderIntent> sdrRenderIntents(sSdrRenderIntents.begin(),
781 sSdrRenderIntents.end());
782 auto iter = hwcColorModes.find(ColorMode::SRGB);
783 if (iter != hwcColorModes.end()) {
784 for (auto intent : iter->second) {
785 sdrRenderIntents.insert(intent);
786 }
787 }
788
Chia-I Wuc4b08bd2018-05-29 12:57:23 -0700789 // add all known SDR combinations
Chia-I Wu0d711262018-05-21 15:19:35 -0700790 for (auto intent : sdrRenderIntents) {
Chia-I Wube02ec02018-05-18 10:59:36 -0700791 for (auto mode : sSdrColorModes) {
792 addColorMode(hwcColorModes, mode, intent);
Peiyong Lin136fbbc2018-04-17 15:09:44 -0700793 }
794 }
Chia-I Wube02ec02018-05-18 10:59:36 -0700795
Chia-I Wuc4b08bd2018-05-29 12:57:23 -0700796 // collect all known HDR render intents
797 std::unordered_set<RenderIntent> hdrRenderIntents(sHdrRenderIntents.begin(),
798 sHdrRenderIntents.end());
799 iter = hwcColorModes.find(ColorMode::BT2100_PQ);
800 if (iter != hwcColorModes.end()) {
801 for (auto intent : iter->second) {
802 hdrRenderIntents.insert(intent);
803 }
804 }
805
806 // add all known HDR combinations
Chia-I Wube02ec02018-05-18 10:59:36 -0700807 for (auto intent : sHdrRenderIntents) {
808 for (auto mode : sHdrColorModes) {
809 addColorMode(hwcColorModes, mode, intent);
810 }
811 }
812}
813
814bool DisplayDevice::hasRenderIntent(RenderIntent intent) const {
815 // assume a render intent is supported when SRGB supports it; we should
816 // get rid of that assumption.
817 auto iter = mColorModes.find(getColorModeKey(Dataspace::SRGB, intent));
818 return iter != mColorModes.end() && iter->second.renderIntent == intent;
819}
820
Peiyong Lindfde5112018-06-05 10:58:41 -0700821bool DisplayDevice::hasLegacyHdrSupport(Dataspace dataspace) const {
Chia-I Wube02ec02018-05-18 10:59:36 -0700822 if ((dataspace == Dataspace::BT2020_PQ && hasHDR10Support()) ||
823 (dataspace == Dataspace::BT2020_HLG && hasHLGSupport())) {
824 auto iter =
825 mColorModes.find(getColorModeKey(dataspace, RenderIntent::TONE_MAP_COLORIMETRIC));
Peiyong Lindfde5112018-06-05 10:58:41 -0700826 return iter == mColorModes.end() || iter->second.dataspace != dataspace;
Chia-I Wube02ec02018-05-18 10:59:36 -0700827 }
828
829 return false;
830}
831
832void DisplayDevice::getBestColorMode(Dataspace dataspace, RenderIntent intent,
833 Dataspace* outDataspace, ColorMode* outMode,
834 RenderIntent* outIntent) const {
835 auto iter = mColorModes.find(getColorModeKey(dataspace, intent));
836 if (iter != mColorModes.end()) {
837 *outDataspace = iter->second.dataspace;
838 *outMode = iter->second.colorMode;
839 *outIntent = iter->second.renderIntent;
840 } else {
Chia-I Wu6333af52018-10-16 13:46:36 -0700841 // this is unexpected on a WCG display
842 if (hasWideColorGamut()) {
843 ALOGE("map unknown (%s)/(%s) to default color mode",
844 dataspaceDetails(static_cast<android_dataspace_t>(dataspace)).c_str(),
845 decodeRenderIntent(intent).c_str());
846 }
Chia-I Wube02ec02018-05-18 10:59:36 -0700847
848 *outDataspace = Dataspace::UNKNOWN;
849 *outMode = ColorMode::NATIVE;
850 *outIntent = RenderIntent::COLORIMETRIC;
851 }
Peiyong Lin136fbbc2018-04-17 15:09:44 -0700852}
853
Dominik Laskowski663bd282018-04-19 15:26:54 -0700854std::atomic<int32_t> DisplayDeviceState::sNextSequenceId(1);
Peiyong Linfd997e02018-03-28 15:29:00 -0700855
856} // namespace android