diff options
author | Jamie Gennis <jgennis@google.com> | 2012-12-20 14:05:45 -0800 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2013-02-12 18:15:38 -0800 |
commit | 1df8c345854155cbbcb9f80de9d12d66ea70ac08 (patch) | |
tree | 9e3eedb37edfbb45c323364366ae09ea82ba847d /services/surfaceflinger/DisplayHardware | |
parent | 351c2941736039c495dd7ac849ec64fbf7f3ff05 (diff) | |
download | frameworks_native-1df8c345854155cbbcb9f80de9d12d66ea70ac08.zip frameworks_native-1df8c345854155cbbcb9f80de9d12d66ea70ac08.tar.gz frameworks_native-1df8c345854155cbbcb9f80de9d12d66ea70ac08.tar.bz2 |
libgui: disallow NULL Fence pointers
This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required. Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.
Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
Diffstat (limited to 'services/surfaceflinger/DisplayHardware')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index ead158e..7a24d4c 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -539,7 +539,7 @@ status_t HWComposer::setFramebufferTarget(int32_t id, } int acquireFenceFd = -1; - if (acquireFence != NULL) { + if (acquireFence->isValid()) { acquireFenceFd = acquireFence->dup(); } @@ -659,7 +659,7 @@ status_t HWComposer::commit() { for (size_t i=0 ; i<mNumDisplays ; i++) { DisplayData& disp(mDisplayData[i]); disp.lastDisplayFence = disp.lastRetireFence; - disp.lastRetireFence = NULL; + disp.lastRetireFence = Fence::NO_FENCE; if (disp.list) { if (disp.list->retireFenceFd != -1) { disp.lastRetireFence = new Fence(disp.list->retireFenceFd); @@ -725,9 +725,7 @@ int HWComposer::fbPost(int32_t id, if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) { return setFramebufferTarget(id, acquireFence, buffer); } else { - if (acquireFence != NULL) { - acquireFence->waitForever(1000, "HWComposer::fbPost"); - } + acquireFence->waitForever(1000, "HWComposer::fbPost"); return mFbDev->post(mFbDev, buffer->handle); } } |