Merge "graphics: ignore/reduce spurious vsync in VTS" into oc-dev

This commit is contained in:
Chia-I Wu 2017-09-07 17:18:25 +00:00 committed by Android (Google) Code Review
commit ef3389add5
2 changed files with 10 additions and 1 deletions

View file

@ -290,6 +290,11 @@ void ComposerClient::setVsyncEnabled(Display display, bool enabled) {
: IComposerClient::Vsync::DISABLE;
Error error = mClient->setVsyncEnabled(display, vsync);
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);
}
}
} // namespace tests

View file

@ -118,7 +118,7 @@ class GraphicsComposerCallback : public IComposerCallback {
// the set of all currently connected displays
std::unordered_set<Display> mDisplays;
// true only when vsync is enabled
bool mVsyncAllowed = false;
bool mVsyncAllowed = true;
// track invalid callbacks
int mInvalidHotplugCount = 0;
@ -137,6 +137,10 @@ class GraphicsComposerHidlTest : public ::testing::VtsHalHidlTargetTestBase {
// assume the first display is primary and is never removed
mPrimaryDisplay = waitForFirstDisplay();
// explicitly disable vsync
mComposerClient->setVsyncEnabled(mPrimaryDisplay, false);
mComposerCallback->setVsyncAllowed(false);
}
void TearDown() override {