diff options
author | Jesse Hall <jessehall@google.com> | 2013-03-20 11:37:21 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2013-03-22 09:56:58 -0700 |
commit | 13f01cbdbd34779a234bc674df79e23672fd5c0b (patch) | |
tree | 9b1c9334f276ff039a2621fe0e639ff06249473c /services/surfaceflinger/DisplayHardware/HWComposer.cpp | |
parent | 8d8c75976171d194ca8f94727b22e3bf7676b9dd (diff) | |
download | frameworks_native-13f01cbdbd34779a234bc674df79e23672fd5c0b.zip frameworks_native-13f01cbdbd34779a234bc674df79e23672fd5c0b.tar.gz frameworks_native-13f01cbdbd34779a234bc674df79e23672fd5c0b.tar.bz2 |
Pass sp<Fence>s around instead of file descriptors
Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
Diffstat (limited to 'services/surfaceflinger/DisplayHardware/HWComposer.cpp')
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 8599a29..eb7d128 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -627,9 +627,9 @@ bool HWComposer::hasGlesComposition(int32_t id) const { return mDisplayData[id].hasFbComp; } -int HWComposer::getAndResetReleaseFenceFd(int32_t id) { +sp<Fence> HWComposer::getAndResetReleaseFence(int32_t id) { if (uint32_t(id)>31 || !mAllocatedDisplayIDs.hasBit(id)) - return BAD_INDEX; + return Fence::NO_FENCE; int fd = INVALID_OPERATION; if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) { @@ -640,7 +640,7 @@ int HWComposer::getAndResetReleaseFenceFd(int32_t id) { disp.framebufferTarget->releaseFenceFd = -1; } } - return fd; + return fd >= 0 ? new Fence(fd) : Fence::NO_FENCE; } status_t HWComposer::commit() { @@ -803,10 +803,10 @@ public: virtual uint32_t getHints() const { return getLayer()->hints; } - virtual int getAndResetReleaseFenceFd() { + virtual sp<Fence> getAndResetReleaseFence() { int fd = getLayer()->releaseFenceFd; getLayer()->releaseFenceFd = -1; - return fd; + return fd >= 0 ? new Fence(fd) : Fence::NO_FENCE; } virtual void setAcquireFenceFd(int fenceFd) { getLayer()->acquireFenceFd = fenceFd; |