Loading libs/vr/libvrflinger/hardware_composer.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -518,10 +518,13 @@ void HardwareComposer::SetDisplaySurfaces( post_thread_cond_var_.notify_all(); } int HardwareComposer::PostThreadPollInterruptible(int event_fd) { int HardwareComposer::PostThreadPollInterruptible(int event_fd, int requested_events) { pollfd pfd[2] = { { .fd = event_fd, .events = POLLPRI | POLLIN, .revents = 0, .fd = event_fd, .events = static_cast<short>(requested_events), .revents = 0, }, { .fd = post_thread_interrupt_event_fd_.Get(), Loading Loading @@ -645,7 +648,9 @@ int HardwareComposer::ReadVSyncTimestamp(int64_t* timestamp) { // TODO(eieio): This is pretty driver specific, this should be moved to a // separate class eventually. int HardwareComposer::BlockUntilVSync() { return PostThreadPollInterruptible(primary_display_vsync_event_fd_.Get()); return PostThreadPollInterruptible(primary_display_vsync_event_fd_.Get(), // There will be a POLLPRI event on vsync POLLPRI); } // Waits for the next vsync and returns the timestamp of the vsync event. If Loading Loading @@ -718,7 +723,7 @@ int HardwareComposer::SleepUntil(int64_t wakeup_timestamp) { return -error; } return PostThreadPollInterruptible(timer_fd); return PostThreadPollInterruptible(timer_fd, POLLIN); } void HardwareComposer::PostThread() { Loading libs/vr/libvrflinger/hardware_composer.h +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ class HardwareComposer { // 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 Loading Loading
libs/vr/libvrflinger/hardware_composer.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -518,10 +518,13 @@ void HardwareComposer::SetDisplaySurfaces( post_thread_cond_var_.notify_all(); } int HardwareComposer::PostThreadPollInterruptible(int event_fd) { int HardwareComposer::PostThreadPollInterruptible(int event_fd, int requested_events) { pollfd pfd[2] = { { .fd = event_fd, .events = POLLPRI | POLLIN, .revents = 0, .fd = event_fd, .events = static_cast<short>(requested_events), .revents = 0, }, { .fd = post_thread_interrupt_event_fd_.Get(), Loading Loading @@ -645,7 +648,9 @@ int HardwareComposer::ReadVSyncTimestamp(int64_t* timestamp) { // TODO(eieio): This is pretty driver specific, this should be moved to a // separate class eventually. int HardwareComposer::BlockUntilVSync() { return PostThreadPollInterruptible(primary_display_vsync_event_fd_.Get()); return PostThreadPollInterruptible(primary_display_vsync_event_fd_.Get(), // There will be a POLLPRI event on vsync POLLPRI); } // Waits for the next vsync and returns the timestamp of the vsync event. If Loading Loading @@ -718,7 +723,7 @@ int HardwareComposer::SleepUntil(int64_t wakeup_timestamp) { return -error; } return PostThreadPollInterruptible(timer_fd); return PostThreadPollInterruptible(timer_fd, POLLIN); } void HardwareComposer::PostThread() { Loading
libs/vr/libvrflinger/hardware_composer.h +1 −1 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ class HardwareComposer { // 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 Loading