summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-06-29 15:21:18 -0700
committerJesse Hall <jessehall@google.com>2012-06-30 21:38:51 -0700
commitdc5b485f74edf2d2f31c62054eb6c180421a3ade (patch)
treef33c9322cadc2895f0e0f28c1968d796c423c8c6 /libs
parentb42b1ac1587aebda5e2f334d95b620271fafba4e (diff)
downloadframeworks_native-dc5b485f74edf2d2f31c62054eb6c180421a3ade.zip
frameworks_native-dc5b485f74edf2d2f31c62054eb6c180421a3ade.tar.gz
frameworks_native-dc5b485f74edf2d2f31c62054eb6c180421a3ade.tar.bz2
Pass fence to HWC on first use of buffer
Also do a CPU-wait on the fence before using it for GL composition. Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/SurfaceTexture.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 435a665..9c76e6e 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -260,14 +260,6 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
}
}
- // Temporary; fence will be provided to clients soon
- if (item.mFence.get()) {
- err = item.mFence->wait(Fence::TIMEOUT_NEVER);
- if (err != OK) {
- ST_LOGE("updateTexImage: failure waiting for fence: %d", err);
- }
- }
-
if (err == NO_ERROR) {
GLint error;
while ((error = glGetError()) != GL_NO_ERROR) {
@@ -322,6 +314,7 @@ status_t SurfaceTexture::updateTexImage(BufferRejecter* rejecter) {
mCurrentTransform = item.mTransform;
mCurrentScalingMode = item.mScalingMode;
mCurrentTimestamp = item.mTimestamp;
+ mCurrentFence = item.mFence;
computeCurrentTransformMatrix();
} else {
if (err < 0) {
@@ -733,6 +726,11 @@ uint32_t SurfaceTexture::getCurrentScalingMode() const {
return mCurrentScalingMode;
}
+sp<Fence> SurfaceTexture::getCurrentFence() const {
+ Mutex::Autolock lock(mMutex);
+ return mCurrentFence;
+}
+
bool SurfaceTexture::isSynchronousMode() const {
Mutex::Autolock lock(mMutex);
return mBufferQueue->isSynchronousMode();