SurfaceFlinger.h revision 9524cb3b37a91b5741790c77ff24fd825b02bca7
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 17#ifndef ANDROID_SURFACE_FLINGER_H 18#define ANDROID_SURFACE_FLINGER_H 19 20#include <memory> 21#include <stdint.h> 22#include <sys/types.h> 23 24#include <EGL/egl.h> 25 26/* 27 * NOTE: Make sure this file doesn't include anything from <gl/ > or <gl2/ > 28 */ 29 30#include <cutils/compiler.h> 31 32#include <utils/Atomic.h> 33#include <utils/Errors.h> 34#include <utils/KeyedVector.h> 35#include <utils/RefBase.h> 36#include <utils/SortedVector.h> 37#include <utils/threads.h> 38 39#include <binder/IMemory.h> 40 41#include <ui/FenceTime.h> 42#include <ui/PixelFormat.h> 43#include <math/mat4.h> 44 45#include <gui/FrameTimestamps.h> 46#include <gui/ISurfaceComposer.h> 47#include <gui/ISurfaceComposerClient.h> 48#include <gui/OccupancyTracker.h> 49 50#include <hardware/hwcomposer_defs.h> 51 52#include <system/graphics.h> 53 54#include <private/gui/LayerState.h> 55 56#include "Barrier.h" 57#include "DisplayDevice.h" 58#include "DispSync.h" 59#include "FrameTracker.h" 60#include "LayerVector.h" 61#include "MessageQueue.h" 62#include "SurfaceInterceptor.h" 63#include "StartBootAnimThread.h" 64 65#include "DisplayHardware/HWComposer.h" 66#include "Effects/Daltonizer.h" 67 68#include <map> 69#include <mutex> 70#include <queue> 71#include <string> 72#include <utility> 73 74namespace android { 75 76// --------------------------------------------------------------------------- 77 78class Client; 79class DisplayEventConnection; 80class EventThread; 81class IGraphicBufferAlloc; 82class Layer; 83class LayerDim; 84class Surface; 85class RenderEngine; 86class EventControlThread; 87class VSyncSource; 88class InjectVSyncSource; 89class VrStateCallbacks; 90 91namespace dvr { 92class VrFlinger; 93} // namespace dvr 94 95// --------------------------------------------------------------------------- 96 97enum { 98 eTransactionNeeded = 0x01, 99 eTraversalNeeded = 0x02, 100 eDisplayTransactionNeeded = 0x04, 101 eTransactionMask = 0x07 102}; 103 104class SurfaceFlinger : public BnSurfaceComposer, 105 private IBinder::DeathRecipient, 106 private HWComposer::EventHandler 107{ 108public: 109 static char const* getServiceName() ANDROID_API { 110 return "SurfaceFlinger"; 111 } 112 113 SurfaceFlinger() ANDROID_API; 114 115 // must be called before clients can connect 116 void init() ANDROID_API; 117 118 // starts SurfaceFlinger main loop in the current thread 119 void run() ANDROID_API; 120 121 enum { 122 EVENT_VSYNC = HWC_EVENT_VSYNC 123 }; 124 125 // post an asynchronous message to the main thread 126 status_t postMessageAsync(const sp<MessageBase>& msg, nsecs_t reltime = 0, uint32_t flags = 0); 127 128 // post a synchronous message to the main thread 129 status_t postMessageSync(const sp<MessageBase>& msg, nsecs_t reltime = 0, uint32_t flags = 0); 130 131 // force full composition on all displays 132 void repaintEverything(); 133 134 // returns the default Display 135 sp<const DisplayDevice> getDefaultDisplayDevice() const { 136 return getDisplayDevice(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY]); 137 } 138 139 // utility function to delete a texture on the main thread 140 void deleteTextureAsync(uint32_t texture); 141 142 // enable/disable h/w composer event 143 // TODO: this should be made accessible only to EventThread 144#ifdef USE_HWC2 145 void setVsyncEnabled(int disp, int enabled); 146#else 147 void eventControl(int disp, int event, int enabled); 148#endif 149 150 // called on the main thread by MessageQueue when an internal message 151 // is received 152 // TODO: this should be made accessible only to MessageQueue 153 void onMessageReceived(int32_t what); 154 155 // for debugging only 156 // TODO: this should be made accessible only to HWComposer 157 const Vector< sp<Layer> >& getLayerSortedByZForHwcDisplay(int id); 158 159 RenderEngine& getRenderEngine() const { 160 return *mRenderEngine; 161 } 162 163 bool authenticateSurfaceTextureLocked( 164 const sp<IGraphicBufferProducer>& bufferProducer) const; 165 166private: 167 friend class Client; 168 friend class DisplayEventConnection; 169 friend class EventThread; 170 friend class Layer; 171 friend class MonitoredProducer; 172 friend class VrStateCallbacks; 173 174 // This value is specified in number of frames. Log frame stats at most 175 // every half hour. 176 enum { LOG_FRAME_STATS_PERIOD = 30*60*60 }; 177 178 static const size_t MAX_LAYERS = 4096; 179 180 // We're reference counted, never destroy SurfaceFlinger directly 181 virtual ~SurfaceFlinger(); 182 183 /* ------------------------------------------------------------------------ 184 * Internal data structures 185 */ 186 187 class State { 188 public: 189 LayerVector layersSortedByZ; 190 DefaultKeyedVector< wp<IBinder>, DisplayDeviceState> displays; 191 192 void traverseInZOrder(const std::function<void(Layer*)>& consume) const; 193 void traverseInReverseZOrder(const std::function<void(Layer*)>& consume) const; 194 }; 195 196 /* ------------------------------------------------------------------------ 197 * IBinder interface 198 */ 199 virtual status_t onTransact(uint32_t code, const Parcel& data, 200 Parcel* reply, uint32_t flags); 201 virtual status_t dump(int fd, const Vector<String16>& args); 202 203 /* ------------------------------------------------------------------------ 204 * ISurfaceComposer interface 205 */ 206 virtual sp<ISurfaceComposerClient> createConnection(); 207 virtual sp<ISurfaceComposerClient> createScopedConnection(const sp<IGraphicBufferProducer>& gbp); 208 virtual sp<IGraphicBufferAlloc> createGraphicBufferAlloc(); 209 virtual sp<IBinder> createDisplay(const String8& displayName, bool secure); 210 virtual void destroyDisplay(const sp<IBinder>& display); 211 virtual sp<IBinder> getBuiltInDisplay(int32_t id); 212 virtual void setTransactionState(const Vector<ComposerState>& state, 213 const Vector<DisplayState>& displays, uint32_t flags); 214 virtual void bootFinished(); 215 virtual bool authenticateSurfaceTexture( 216 const sp<IGraphicBufferProducer>& bufferProducer) const; 217 virtual status_t getSupportedFrameTimestamps( 218 std::vector<FrameEvent>* outSupported) const; 219 virtual sp<IDisplayEventConnection> createDisplayEventConnection(); 220 virtual status_t captureScreen(const sp<IBinder>& display, 221 const sp<IGraphicBufferProducer>& producer, 222 Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, 223 int32_t minLayerZ, int32_t maxLayerZ, 224 bool useIdentityTransform, ISurfaceComposer::Rotation rotation); 225 virtual status_t getDisplayStats(const sp<IBinder>& display, 226 DisplayStatInfo* stats); 227 virtual status_t getDisplayConfigs(const sp<IBinder>& display, 228 Vector<DisplayInfo>* configs); 229 virtual int getActiveConfig(const sp<IBinder>& display); 230 virtual status_t getDisplayColorModes(const sp<IBinder>& display, 231 Vector<android_color_mode_t>* configs); 232 virtual android_color_mode_t getActiveColorMode(const sp<IBinder>& display); 233 virtual status_t setActiveColorMode(const sp<IBinder>& display, android_color_mode_t colorMode); 234 virtual void setPowerMode(const sp<IBinder>& display, int mode); 235 virtual status_t setActiveConfig(const sp<IBinder>& display, int id); 236 virtual status_t clearAnimationFrameStats(); 237 virtual status_t getAnimationFrameStats(FrameStats* outStats) const; 238 virtual status_t getHdrCapabilities(const sp<IBinder>& display, 239 HdrCapabilities* outCapabilities) const; 240 virtual status_t enableVSyncInjections(bool enable); 241 virtual status_t injectVSync(nsecs_t when); 242 243 244 /* ------------------------------------------------------------------------ 245 * DeathRecipient interface 246 */ 247 virtual void binderDied(const wp<IBinder>& who); 248 249 /* ------------------------------------------------------------------------ 250 * RefBase interface 251 */ 252 virtual void onFirstRef(); 253 254 /* ------------------------------------------------------------------------ 255 * HWComposer::EventHandler interface 256 */ 257 virtual void onVSyncReceived(HWComposer* composer, int type, nsecs_t timestamp); 258 virtual void onHotplugReceived(int disp, bool connected); 259 virtual void onInvalidateReceived(HWComposer* composer); 260 261 /* ------------------------------------------------------------------------ 262 * Message handling 263 */ 264 void waitForEvent(); 265 void signalTransaction(); 266 void signalLayerUpdate(); 267 void signalRefresh(); 268 269 // called on the main thread in response to initializeDisplays() 270 void onInitializeDisplays(); 271 // called on the main thread in response to setActiveConfig() 272 void setActiveConfigInternal(const sp<DisplayDevice>& hw, int mode); 273 // called on the main thread in response to setPowerMode() 274 void setPowerModeInternal(const sp<DisplayDevice>& hw, int mode); 275 276 // Called on the main thread in response to setActiveColorMode() 277 void setActiveColorModeInternal(const sp<DisplayDevice>& hw, android_color_mode_t colorMode); 278 279 // Returns whether the transaction actually modified any state 280 bool handleMessageTransaction(); 281 282 // Returns whether a new buffer has been latched (see handlePageFlip()) 283 bool handleMessageInvalidate(); 284 285 void handleMessageRefresh(); 286 287 void handleTransaction(uint32_t transactionFlags); 288 void handleTransactionLocked(uint32_t transactionFlags); 289 290 void updateCursorAsync(); 291 292 /* handlePageFlip - latch a new buffer if available and compute the dirty 293 * region. Returns whether a new buffer has been latched, i.e., whether it 294 * is necessary to perform a refresh during this vsync. 295 */ 296 bool handlePageFlip(); 297 298 /* ------------------------------------------------------------------------ 299 * Transactions 300 */ 301 uint32_t getTransactionFlags(uint32_t flags); 302 uint32_t peekTransactionFlags(); 303 uint32_t setTransactionFlags(uint32_t flags); 304 void commitTransaction(); 305 uint32_t setClientStateLocked(const sp<Client>& client, const layer_state_t& s); 306 uint32_t setDisplayStateLocked(const DisplayState& s); 307 308 /* ------------------------------------------------------------------------ 309 * Layer management 310 */ 311 status_t createLayer(const String8& name, const sp<Client>& client, 312 uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, 313 uint32_t windowType, uint32_t ownerUid, sp<IBinder>* handle, 314 sp<IGraphicBufferProducer>* gbp, sp<Layer>* parent); 315 316 status_t createNormalLayer(const sp<Client>& client, const String8& name, 317 uint32_t w, uint32_t h, uint32_t flags, PixelFormat& format, 318 sp<IBinder>* outHandle, sp<IGraphicBufferProducer>* outGbp, 319 sp<Layer>* outLayer); 320 321 status_t createDimLayer(const sp<Client>& client, const String8& name, 322 uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, 323 sp<IGraphicBufferProducer>* outGbp, sp<Layer>* outLayer); 324 325 // called in response to the window-manager calling 326 // ISurfaceComposerClient::destroySurface() 327 status_t onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle); 328 329 // called when all clients have released all their references to 330 // this layer meaning it is entirely safe to destroy all 331 // resources associated to this layer. 332 status_t onLayerDestroyed(const wp<Layer>& layer); 333 334 // remove a layer from SurfaceFlinger immediately 335 status_t removeLayer(const sp<Layer>& layer); 336 337 // add a layer to SurfaceFlinger 338 status_t addClientLayer(const sp<Client>& client, 339 const sp<IBinder>& handle, 340 const sp<IGraphicBufferProducer>& gbc, 341 const sp<Layer>& lbc, 342 const sp<Layer>& parent); 343 344 /* ------------------------------------------------------------------------ 345 * Boot animation, on/off animations and screen capture 346 */ 347 348 void startBootAnim(); 349 350 void renderScreenImplLocked( 351 const sp<const DisplayDevice>& hw, 352 Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, 353 int32_t minLayerZ, int32_t maxLayerZ, 354 bool yswap, bool useIdentityTransform, Transform::orientation_flags rotation); 355 356 status_t captureScreenImplLocked( 357 const sp<const DisplayDevice>& hw, 358 const sp<IGraphicBufferProducer>& producer, 359 Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, 360 int32_t minLayerZ, int32_t maxLayerZ, 361 bool useIdentityTransform, Transform::orientation_flags rotation, 362 bool isLocalScreenshot); 363 364 sp<StartBootAnimThread> mStartBootAnimThread = nullptr; 365 366 /* ------------------------------------------------------------------------ 367 * EGL 368 */ 369 size_t getMaxTextureSize() const; 370 size_t getMaxViewportDims() const; 371 372 /* ------------------------------------------------------------------------ 373 * Display and layer stack management 374 */ 375 // called when starting, or restarting after system_server death 376 void initializeDisplays(); 377 378 // Create an IBinder for a builtin display and add it to current state 379 void createBuiltinDisplayLocked(DisplayDevice::DisplayType type); 380 381 // NOTE: can only be called from the main thread or with mStateLock held 382 sp<const DisplayDevice> getDisplayDevice(const wp<IBinder>& dpy) const { 383 return mDisplays.valueFor(dpy); 384 } 385 386 // NOTE: can only be called from the main thread or with mStateLock held 387 sp<DisplayDevice> getDisplayDevice(const wp<IBinder>& dpy) { 388 return mDisplays.valueFor(dpy); 389 } 390 391 int32_t getDisplayType(const sp<IBinder>& display) { 392 if (!display.get()) return NAME_NOT_FOUND; 393 for (int i = 0; i < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES; ++i) { 394 if (display == mBuiltinDisplays[i]) { 395 return i; 396 } 397 } 398 return NAME_NOT_FOUND; 399 } 400 401 // mark a region of a layer stack dirty. this updates the dirty 402 // region of all screens presenting this layer stack. 403 void invalidateLayerStack(uint32_t layerStack, const Region& dirty); 404 405#ifndef USE_HWC2 406 int32_t allocateHwcDisplayId(DisplayDevice::DisplayType type); 407#endif 408 409 /* ------------------------------------------------------------------------ 410 * H/W composer 411 */ 412 413 HWComposer& getHwComposer() const { return *mHwc; } 414 415 /* ------------------------------------------------------------------------ 416 * Compositing 417 */ 418 void invalidateHwcGeometry(); 419 void computeVisibleRegions(uint32_t layerStack, 420 Region& dirtyRegion, Region& opaqueRegion); 421 422 void preComposition(nsecs_t refreshStartTime); 423 void postComposition(nsecs_t refreshStartTime); 424 void updateCompositorTiming( 425 nsecs_t vsyncPhase, nsecs_t vsyncInterval, nsecs_t compositeTime, 426 std::shared_ptr<FenceTime>& presentFenceTime); 427 void rebuildLayerStacks(); 428 void setUpHWComposer(); 429 void doComposition(); 430 void doDebugFlashRegions(); 431 void doDisplayComposition(const sp<const DisplayDevice>& displayDevice, const Region& dirtyRegion); 432 433 // compose surfaces for display hw. this fails if using GL and the surface 434 // has been destroyed and is no longer valid. 435 bool doComposeSurfaces(const sp<const DisplayDevice>& displayDevice, const Region& dirty); 436 437 void postFramebuffer(); 438 void drawWormhole(const sp<const DisplayDevice>& displayDevice, const Region& region) const; 439 440 /* ------------------------------------------------------------------------ 441 * Display management 442 */ 443 444 /* ------------------------------------------------------------------------ 445 * VSync 446 */ 447 void enableHardwareVsync(); 448 void resyncToHardwareVsync(bool makeAvailable); 449 void disableHardwareVsync(bool makeUnavailable); 450 451public: 452 void resyncWithRateLimit(); 453 void getCompositorTiming(CompositorTiming* compositorTiming); 454private: 455 456 /* ------------------------------------------------------------------------ 457 * Debugging & dumpsys 458 */ 459 void listLayersLocked(const Vector<String16>& args, size_t& index, String8& result) const; 460 void dumpStatsLocked(const Vector<String16>& args, size_t& index, String8& result) const; 461 void clearStatsLocked(const Vector<String16>& args, size_t& index, String8& result); 462 void dumpAllLocked(const Vector<String16>& args, size_t& index, String8& result) const; 463 bool startDdmConnection(); 464 void appendSfConfigString(String8& result) const; 465 void checkScreenshot(size_t w, size_t s, size_t h, void const* vaddr, 466 const sp<const DisplayDevice>& hw, 467 int32_t minLayerZ, int32_t maxLayerZ); 468 469 void logFrameStats(); 470 471 void dumpStaticScreenStats(String8& result) const; 472 // Not const because each Layer needs to query Fences and cache timestamps. 473 void dumpFrameEventsLocked(String8& result); 474 475 void recordBufferingStats(const char* layerName, 476 std::vector<OccupancyTracker::Segment>&& history); 477 void dumpBufferingStats(String8& result) const; 478 479 bool isLayerTripleBufferingDisabled() const { 480 return this->mLayerTripleBufferingDisabled; 481 } 482 483#ifdef USE_HWC2 484 /* ------------------------------------------------------------------------ 485 * VrFlinger 486 */ 487 void clearHwcLayers(const LayerVector& layers); 488 void resetHwc(); 489 490 // Check to see if we should change to or from vr mode, and if so, perform 491 // the handoff. 492 void updateVrMode(); 493#endif 494 495 /* ------------------------------------------------------------------------ 496 * Attributes 497 */ 498 499 // access must be protected by mStateLock 500 mutable Mutex mStateLock; 501 State mCurrentState; 502 volatile int32_t mTransactionFlags; 503 Condition mTransactionCV; 504 bool mTransactionPending; 505 bool mAnimTransactionPending; 506 SortedVector< sp<Layer> > mLayersPendingRemoval; 507 SortedVector< wp<IBinder> > mGraphicBufferProducerList; 508 509 // protected by mStateLock (but we could use another lock) 510 bool mLayersRemoved; 511 bool mLayersAdded; 512 513 // access must be protected by mInvalidateLock 514 volatile int32_t mRepaintEverything; 515 516 // current, real and vr hardware composers. 517 HWComposer* mHwc; 518#ifdef USE_HWC2 519 HWComposer* mRealHwc; 520 HWComposer* mVrHwc; 521#endif 522 // constant members (no synchronization needed for access) 523 RenderEngine* mRenderEngine; 524 nsecs_t mBootTime; 525 bool mGpuToCpuSupported; 526 sp<EventThread> mEventThread; 527 sp<EventThread> mSFEventThread; 528 sp<EventThread> mInjectorEventThread; 529 sp<InjectVSyncSource> mVSyncInjector; 530 sp<EventControlThread> mEventControlThread; 531 EGLContext mEGLContext; 532 EGLDisplay mEGLDisplay; 533 sp<IBinder> mBuiltinDisplays[DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES]; 534 535#ifdef USE_HWC2 536 std::unique_ptr<dvr::VrFlinger> mVrFlinger; 537#endif 538 539 // Can only accessed from the main thread, these members 540 // don't need synchronization 541 State mDrawingState; 542 bool mVisibleRegionsDirty; 543#ifndef USE_HWC2 544 bool mHwWorkListDirty; 545#else 546 bool mGeometryInvalid; 547#endif 548 bool mAnimCompositionPending; 549#ifdef USE_HWC2 550 std::vector<sp<Layer>> mLayersWithQueuedFrames; 551 sp<Fence> mPreviousPresentFence = Fence::NO_FENCE; 552 bool mHadClientComposition = false; 553#endif 554 FenceTimeline mGlCompositionDoneTimeline; 555 FenceTimeline mDisplayTimeline; 556 557 // this may only be written from the main thread with mStateLock held 558 // it may be read from other threads with mStateLock held 559 DefaultKeyedVector< wp<IBinder>, sp<DisplayDevice> > mDisplays; 560 561 // don't use a lock for these, we don't care 562 int mDebugRegion; 563 int mDebugDDMS; 564 int mDebugDisableHWC; 565 int mDebugDisableTransformHint; 566 volatile nsecs_t mDebugInSwapBuffers; 567 nsecs_t mLastSwapBufferTime; 568 volatile nsecs_t mDebugInTransaction; 569 nsecs_t mLastTransactionTime; 570 bool mBootFinished; 571 bool mForceFullDamage; 572#ifdef USE_HWC2 573 bool mPropagateBackpressure = true; 574#endif 575 SurfaceInterceptor mInterceptor; 576 bool mUseHwcVirtualDisplays = false; 577 578 // Restrict layers to use two buffers in their bufferqueues. 579 bool mLayerTripleBufferingDisabled = false; 580 581 // these are thread safe 582 mutable MessageQueue mEventQueue; 583 FrameTracker mAnimFrameTracker; 584 DispSync mPrimaryDispSync; 585 586 // protected by mDestroyedLayerLock; 587 mutable Mutex mDestroyedLayerLock; 588 Vector<Layer const *> mDestroyedLayers; 589 590 // protected by mHWVsyncLock 591 Mutex mHWVsyncLock; 592 bool mPrimaryHWVsyncEnabled; 593 bool mHWVsyncAvailable; 594 595 // protected by mCompositorTimingLock; 596 mutable std::mutex mCompositeTimingLock; 597 CompositorTiming mCompositorTiming; 598 599 // Only accessed from the main thread. 600 struct CompositePresentTime { 601 nsecs_t composite { -1 }; 602 std::shared_ptr<FenceTime> display { FenceTime::NO_FENCE }; 603 }; 604 std::queue<CompositePresentTime> mCompositePresentTimes; 605 606 /* ------------------------------------------------------------------------ 607 * Feature prototyping 608 */ 609 610 bool mInjectVSyncs; 611 612 Daltonizer mDaltonizer; 613#ifndef USE_HWC2 614 bool mDaltonize; 615#endif 616 617 mat4 mPreviousColorMatrix; 618 mat4 mColorMatrix; 619 bool mHasColorMatrix; 620 621 // Static screen stats 622 bool mHasPoweredOff; 623 static const size_t NUM_BUCKETS = 8; // < 1-7, 7+ 624 nsecs_t mFrameBuckets[NUM_BUCKETS]; 625 nsecs_t mTotalTime; 626 std::atomic<nsecs_t> mLastSwapTime; 627 628 size_t mNumLayers; 629 630 // Double- vs. triple-buffering stats 631 struct BufferingStats { 632 BufferingStats() 633 : numSegments(0), 634 totalTime(0), 635 twoBufferTime(0), 636 doubleBufferedTime(0), 637 tripleBufferedTime(0) {} 638 639 size_t numSegments; 640 nsecs_t totalTime; 641 642 // "Two buffer" means that a third buffer was never used, whereas 643 // "double-buffered" means that on average the segment only used two 644 // buffers (though it may have used a third for some part of the 645 // segment) 646 nsecs_t twoBufferTime; 647 nsecs_t doubleBufferedTime; 648 nsecs_t tripleBufferedTime; 649 }; 650 mutable Mutex mBufferingStatsMutex; 651 std::unordered_map<std::string, BufferingStats> mBufferingStats; 652 653 // Verify that transaction is being called by an approved process: 654 // either AID_GRAPHICS or AID_SYSTEM. 655 status_t CheckTransactCodeCredentials(uint32_t code); 656 657#ifdef USE_HWC2 658 sp<VrStateCallbacks> mVrStateCallbacks; 659 660 std::atomic<bool> mEnterVrMode; 661#endif 662 }; 663 664}; // namespace android 665 666#endif // ANDROID_SURFACE_FLINGER_H 667