Fix BlockUntilVSync() to actually block
In my refactoring in ag/2008740 I introduced a regression where blocking
until the next vsync would busy loop instead of actually blocking on an
event on the vsync fd. The problem was I changed the poll() call to
listen for POLLIN in addition to POLLPRI. While waiting for vsync events
we only want to listen for POLLPRI.
Bug: 36495351
Test: Confirmed with debug logs the busy loop bug and that we correctly
block with this patch applied.
Change-Id: Iec4951e014575a5d0ed3cfe3fc20ea91c67edf1b
diff --git a/libs/vr/libvrflinger/hardware_composer.h b/libs/vr/libvrflinger/hardware_composer.h
index 2d3d78b..e570cb6 100644
--- a/libs/vr/libvrflinger/hardware_composer.h
+++ b/libs/vr/libvrflinger/hardware_composer.h
@@ -281,7 +281,7 @@
// Blocks until either event_fd becomes readable, or we're interrupted by a
// control thread. Any errors are returned as negative errno values. If we're
// interrupted, kPostThreadInterrupted will be returned.
- int PostThreadPollInterruptible(int event_fd);
+ int PostThreadPollInterruptible(int event_fd, int requested_events);
// BlockUntilVSync, WaitForVSync, and SleepUntil are all blocking calls made
// on the post thread that can be interrupted by a control thread. If