summaryrefslogtreecommitdiff
path: root/drmframebuffer.h
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2015-09-29 00:56:00 -0400
committerSean Paul <seanpaul@chromium.org>2015-09-29 14:27:01 -0400
commitd106b919a575fb45388ee4a21b41c77e18e7cd27 (patch)
treee0b1429f0564bd16e72b5fce19d3e1981251e057 /drmframebuffer.h
parent2133275a68d3a3b4968c20e5827924abfa48938a (diff)
drm_hwcomposer: Set timeouts for fence waits
Instead of waiting forever for fences, set some reasonable timeouts so we can move on with life if a fence doesn't signal. BUG=chrome-os-partner:45868 TEST=Tested on smaug with osmos, recovered from fence timeouts Change-Id: I7f18d684d483d789f228cbad8d5a3e43ac898a43 Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drmframebuffer.h')
-rw-r--r--drmframebuffer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drmframebuffer.h b/drmframebuffer.h
index 6f078d9..897589c 100644
--- a/drmframebuffer.h
+++ b/drmframebuffer.h
@@ -58,7 +58,8 @@ struct DrmFramebuffer {
return true;
if (release_fence_fd_ >= 0) {
- if (sync_wait(release_fence_fd_, -1) != 0) {
+ if (sync_wait(release_fence_fd_, kReleaseWaitTimeoutMs) != 0) {
+ ALOGE("Wait for release fence failed\n");
return false;
}
}
@@ -93,6 +94,10 @@ struct DrmFramebuffer {
return ret;
}
+ // Somewhat arbitrarily chosen, but wanted to stay below 3000ms, which is the
+ // system timeout
+ static const int kReleaseWaitTimeoutMs = 1500;
+
private:
sp<GraphicBuffer> buffer_;
int release_fence_fd_;