graphics: ignore/reduce spurious vsync in VTS
Bug: 62802718 Test: VTS Change-Id: I1ed73e0b2f14414f540865a96e6bd5ac1599fbf3
This commit is contained in:
parent
7469ed665d
commit
4f49038e53
3 changed files with 10 additions and 1 deletions
|
@ -51,7 +51,7 @@ class GraphicsComposerCallback : public IComposerCallback {
|
||||||
// the set of all currently connected displays
|
// the set of all currently connected displays
|
||||||
std::unordered_set<Display> mDisplays;
|
std::unordered_set<Display> mDisplays;
|
||||||
// true only when vsync is enabled
|
// true only when vsync is enabled
|
||||||
bool mVsyncAllowed = false;
|
bool mVsyncAllowed = true;
|
||||||
|
|
||||||
// track invalid callbacks
|
// track invalid callbacks
|
||||||
int mInvalidHotplugCount = 0;
|
int mInvalidHotplugCount = 0;
|
||||||
|
|
|
@ -297,6 +297,11 @@ void ComposerClient::setVsyncEnabled(Display display, bool enabled) {
|
||||||
: IComposerClient::Vsync::DISABLE;
|
: IComposerClient::Vsync::DISABLE;
|
||||||
Error error = mClient->setVsyncEnabled(display, vsync);
|
Error error = mClient->setVsyncEnabled(display, vsync);
|
||||||
ASSERT_EQ(Error::NONE, error) << "failed to set vsync mode";
|
ASSERT_EQ(Error::NONE, error) << "failed to set vsync mode";
|
||||||
|
|
||||||
|
// give the hwbinder thread some time to handle any pending vsync callback
|
||||||
|
if (!enabled) {
|
||||||
|
usleep(5 * 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposerClient::execute(TestCommandReader* reader,
|
void ComposerClient::execute(TestCommandReader* reader,
|
||||||
|
|
|
@ -61,6 +61,10 @@ class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||||
|
|
||||||
// assume the first display is primary and is never removed
|
// assume the first display is primary and is never removed
|
||||||
mPrimaryDisplay = waitForFirstDisplay();
|
mPrimaryDisplay = waitForFirstDisplay();
|
||||||
|
|
||||||
|
// explicitly disable vsync
|
||||||
|
mComposerClient->setVsyncEnabled(mPrimaryDisplay, false);
|
||||||
|
mComposerCallback->setVsyncAllowed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
|
|
Loading…
Reference in a new issue