Loading graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,11 @@ ComposerClientWrapper::takeListOfRefreshRateChangedDebugData() { return mComposerCallback->takeListOfRefreshRateChangedDebugData(); } std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> ComposerClientWrapper::getAndClearLatestHotplugs() { return mComposerCallback->getAndClearLatestHotplugs(); } int64_t ComposerClientWrapper::getInvalidDisplayId() { // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to Loading graphics/composer/aidl/libhwc_aidl_test/GraphicsComposerCallback.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,16 @@ int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount return mInvalidRefreshRateDebugEnabledCallbackCount; } std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> GraphicsComposerCallback::getAndClearLatestHotplugs() { std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> ret; { std::scoped_lock lock(mMutex); ret.swap(mLatestHotplugs); } return ret; } ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplug(int64_t in_display, bool in_connected) { std::scoped_lock lock(mMutex); Loading Loading @@ -196,6 +206,11 @@ int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplugEvent(int64_t in_display, common::DisplayHotplugEvent event) { { std::scoped_lock lock(mMutex); mLatestHotplugs.emplace_back(in_display, event); } switch (event) { case common::DisplayHotplugEvent::CONNECTED: return onHotplug(in_display, true); Loading graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h +2 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,8 @@ class ComposerClientWrapper { std::pair<ScopedAStatus, std::vector<Luts>> getLuts(int64_t display, const std::vector<Buffer>& buffers); std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> getAndClearLatestHotplugs(); static constexpr int32_t kMaxFrameIntervalNs = 50000000; // 20fps static constexpr int32_t kNoFrameIntervalNs = 0; Loading graphics/composer/aidl/libhwc_aidl_test/include/GraphicsComposerCallback.h +4 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,8 @@ class GraphicsComposerCallback : public BnComposerCallback { int32_t getInvalidRefreshRateDebugEnabledCallbackCount() const; std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> getAndClearLatestHotplugs(); private: virtual ::ndk::ScopedAStatus onHotplug(int64_t in_display, bool in_connected) override; virtual ::ndk::ScopedAStatus onRefresh(int64_t in_display) override; Loading @@ -71,6 +73,8 @@ class GraphicsComposerCallback : public BnComposerCallback { mutable std::mutex mMutex; // the set of all currently connected displays std::vector<int64_t> mDisplays GUARDED_BY(mMutex); std::vector<std::pair<int64_t /*display id*/, common::DisplayHotplugEvent>> mLatestHotplugs GUARDED_BY(mMutex); // true only when vsync is enabled bool mVsyncAllowed GUARDED_BY(mMutex) = true; // true only when RefreshRateChangedCallbackDebugEnabled is set to true. Loading Loading
graphics/composer/aidl/libhwc_aidl_test/ComposerClientWrapper.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,11 @@ ComposerClientWrapper::takeListOfRefreshRateChangedDebugData() { return mComposerCallback->takeListOfRefreshRateChangedDebugData(); } std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> ComposerClientWrapper::getAndClearLatestHotplugs() { return mComposerCallback->getAndClearLatestHotplugs(); } int64_t ComposerClientWrapper::getInvalidDisplayId() { // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to Loading
graphics/composer/aidl/libhwc_aidl_test/GraphicsComposerCallback.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,16 @@ int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount return mInvalidRefreshRateDebugEnabledCallbackCount; } std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> GraphicsComposerCallback::getAndClearLatestHotplugs() { std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> ret; { std::scoped_lock lock(mMutex); ret.swap(mLatestHotplugs); } return ret; } ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplug(int64_t in_display, bool in_connected) { std::scoped_lock lock(mMutex); Loading Loading @@ -196,6 +206,11 @@ int32_t GraphicsComposerCallback::getInvalidRefreshRateDebugEnabledCallbackCount ::ndk::ScopedAStatus GraphicsComposerCallback::onHotplugEvent(int64_t in_display, common::DisplayHotplugEvent event) { { std::scoped_lock lock(mMutex); mLatestHotplugs.emplace_back(in_display, event); } switch (event) { case common::DisplayHotplugEvent::CONNECTED: return onHotplug(in_display, true); Loading
graphics/composer/aidl/libhwc_aidl_test/include/ComposerClientWrapper.h +2 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,8 @@ class ComposerClientWrapper { std::pair<ScopedAStatus, std::vector<Luts>> getLuts(int64_t display, const std::vector<Buffer>& buffers); std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> getAndClearLatestHotplugs(); static constexpr int32_t kMaxFrameIntervalNs = 50000000; // 20fps static constexpr int32_t kNoFrameIntervalNs = 0; Loading
graphics/composer/aidl/libhwc_aidl_test/include/GraphicsComposerCallback.h +4 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,8 @@ class GraphicsComposerCallback : public BnComposerCallback { int32_t getInvalidRefreshRateDebugEnabledCallbackCount() const; std::vector<std::pair<int64_t, common::DisplayHotplugEvent>> getAndClearLatestHotplugs(); private: virtual ::ndk::ScopedAStatus onHotplug(int64_t in_display, bool in_connected) override; virtual ::ndk::ScopedAStatus onRefresh(int64_t in_display) override; Loading @@ -71,6 +73,8 @@ class GraphicsComposerCallback : public BnComposerCallback { mutable std::mutex mMutex; // the set of all currently connected displays std::vector<int64_t> mDisplays GUARDED_BY(mMutex); std::vector<std::pair<int64_t /*display id*/, common::DisplayHotplugEvent>> mLatestHotplugs GUARDED_BY(mMutex); // true only when vsync is enabled bool mVsyncAllowed GUARDED_BY(mMutex) = true; // true only when RefreshRateChangedCallbackDebugEnabled is set to true. Loading