diff options
Diffstat (limited to 'libs/ui/BufferHubBuffer.cpp')
-rw-r--r-- | libs/ui/BufferHubBuffer.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libs/ui/BufferHubBuffer.cpp b/libs/ui/BufferHubBuffer.cpp index 1464e48367..5bc113f4b2 100644 --- a/libs/ui/BufferHubBuffer.cpp +++ b/libs/ui/BufferHubBuffer.cpp @@ -191,22 +191,22 @@ int BufferHubBuffer::ImportGraphicBuffer() { mClientStateMask = bufferTraits.client_state_mask(); // TODO(b/112012161) Set up shared fences. - ALOGD("BufferHubBuffer::ImportGraphicBuffer: id=%d, buffer_state=%" PRIx64 ".", id(), + ALOGD("BufferHubBuffer::ImportGraphicBuffer: id=%d, buffer_state=%" PRIx32 ".", id(), buffer_state_->load(std::memory_order_acquire)); return 0; } int BufferHubBuffer::Gain() { - uint64_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); + uint32_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); if (IsClientGained(current_buffer_state, mClientStateMask)) { - ALOGV("%s: Buffer is already gained by this client %" PRIx64 ".", __FUNCTION__, + ALOGV("%s: Buffer is already gained by this client %" PRIx32 ".", __FUNCTION__, mClientStateMask); return 0; } do { if (AnyClientGained(current_buffer_state & (~mClientStateMask)) || AnyClientAcquired(current_buffer_state)) { - ALOGE("%s: Buffer is in use, id=%d mClientStateMask=%" PRIx64 " state=%" PRIx64 ".", + ALOGE("%s: Buffer is in use, id=%d mClientStateMask=%" PRIx32 " state=%" PRIx32 ".", __FUNCTION__, mId, mClientStateMask, current_buffer_state); return -EBUSY; } @@ -220,13 +220,13 @@ int BufferHubBuffer::Gain() { } int BufferHubBuffer::Post() { - uint64_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); - uint64_t current_active_clients_bit_mask = 0ULL; - uint64_t updated_buffer_state = 0ULL; + uint32_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); + uint32_t current_active_clients_bit_mask = 0U; + uint32_t updated_buffer_state = 0U; do { if (!IsClientGained(current_buffer_state, mClientStateMask)) { ALOGE("%s: Cannot post a buffer that is not gained by this client. buffer_id=%d " - "mClientStateMask=%" PRIx64 " state=%" PRIx64 ".", + "mClientStateMask=%" PRIx32 " state=%" PRIx32 ".", __FUNCTION__, mId, mClientStateMask, current_buffer_state); return -EBUSY; } @@ -242,17 +242,17 @@ int BufferHubBuffer::Post() { } int BufferHubBuffer::Acquire() { - uint64_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); + uint32_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); if (IsClientAcquired(current_buffer_state, mClientStateMask)) { - ALOGV("%s: Buffer is already acquired by this client %" PRIx64 ".", __FUNCTION__, + ALOGV("%s: Buffer is already acquired by this client %" PRIx32 ".", __FUNCTION__, mClientStateMask); return 0; } - uint64_t updated_buffer_state = 0ULL; + uint32_t updated_buffer_state = 0U; do { if (!IsClientPosted(current_buffer_state, mClientStateMask)) { ALOGE("%s: Cannot acquire a buffer that is not in posted state. buffer_id=%d " - "mClientStateMask=%" PRIx64 " state=%" PRIx64 ".", + "mClientStateMask=%" PRIx32 " state=%" PRIx32 ".", __FUNCTION__, mId, mClientStateMask, current_buffer_state); return -EBUSY; } @@ -266,13 +266,13 @@ int BufferHubBuffer::Acquire() { } int BufferHubBuffer::Release() { - uint64_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); + uint32_t current_buffer_state = buffer_state_->load(std::memory_order_acquire); if (IsClientReleased(current_buffer_state, mClientStateMask)) { - ALOGV("%s: Buffer is already released by this client %" PRIx64 ".", __FUNCTION__, + ALOGV("%s: Buffer is already released by this client %" PRIx32 ".", __FUNCTION__, mClientStateMask); return 0; } - uint64_t updated_buffer_state = 0ULL; + uint32_t updated_buffer_state = 0U; do { updated_buffer_state = current_buffer_state & (~mClientStateMask); } while (!buffer_state_->compare_exchange_weak(current_buffer_state, updated_buffer_state, |