Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96a5528e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4496165 from 577c8961 to pi-release

Change-Id: I9b07d691491a349ad1537c0c3e144caa2b414264
parents 8f27ea1d 577c8961
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -628,7 +628,6 @@ FrameEventHistoryDelta& FrameEventHistoryDelta::operator=(
        ALOGE("FrameEventHistoryDelta assign clobbering history.");
    }
    mDeltas = std::move(src.mDeltas);
    ALOGE_IF(src.mDeltas.empty(), "Source mDeltas not empty.");
    return *this;
}

+1 −35
Original line number Diff line number Diff line
@@ -31,20 +31,6 @@ namespace dvr {

namespace {

// Polls an fd for the given events.
Status<int> PollEvents(int fd, short events) {
  const int kTimeoutMs = 0;
  pollfd pfd{fd, events, 0};
  const int count = RETRY_EINTR(poll(&pfd, 1, kTimeoutMs));
  if (count < 0) {
    return ErrorStatus(errno);
  } else if (count == 0) {
    return ErrorStatus(ETIMEDOUT);
  } else {
    return {pfd.revents};
  }
}

std::pair<int32_t, int32_t> Unstuff(uint64_t value) {
  return {static_cast<int32_t>(value >> 32),
          static_cast<int32_t>(value & ((1ull << 32) - 1))};
@@ -670,27 +656,7 @@ Status<void> ConsumerQueue::AddBuffer(
    const std::shared_ptr<BufferConsumer>& buffer, size_t slot) {
  ALOGD_IF(TRACE, "ConsumerQueue::AddBuffer: queue_id=%d buffer_id=%d slot=%zu",
           id(), buffer->id(), slot);
  auto status = BufferHubQueue::AddBuffer(buffer, slot);
  if (!status)
    return status;

  // Check to see if the buffer is already signaled. This is necessary to catch
  // cases where buffers are already available; epoll edge triggered mode does
  // not fire until an edge transition when adding new buffers to the epoll
  // set. Note that we only poll the fd events because HandleBufferEvent() takes
  // care of checking the translated buffer events.
  auto poll_status = PollEvents(buffer->event_fd(), POLLIN);
  if (!poll_status && poll_status.error() != ETIMEDOUT) {
    ALOGE("ConsumerQueue::AddBuffer: Failed to poll consumer buffer: %s",
          poll_status.GetErrorMessage().c_str());
    return poll_status.error_status();
  }

  // Update accounting if the buffer is available.
  if (poll_status)
    return HandleBufferEvent(slot, buffer->event_fd(), poll_status.get());
  else
    return {};
  return BufferHubQueue::AddBuffer(buffer, slot);
}

Status<std::shared_ptr<BufferConsumer>> ConsumerQueue::Dequeue(
+3 −1
Original line number Diff line number Diff line
@@ -329,7 +329,9 @@ TEST_F(BufferHubQueueTest, TestMultipleConsumers) {

  // Check that buffers are correctly imported on construction.
  EXPECT_EQ(consumer_queue_->capacity(), kBufferCount);
  EXPECT_EQ(consumer_queue_->count(), 1U);
  // Buffers are only imported, but their availability is not checked until
  // first call to Dequeue().
  EXPECT_EQ(consumer_queue_->count(), 0U);

  // Reclaim released/ignored buffers.
  EXPECT_EQ(producer_queue_->count(), kBufferCount - 1);
+0 −11
Original line number Diff line number Diff line
@@ -75,17 +75,6 @@ BufferLayer::BufferLayer(SurfaceFlinger* flinger, const sp<Client>& client, cons
}

BufferLayer::~BufferLayer() {
    sp<Client> c(mClientRef.promote());
    if (c != 0) {
        c->detachLayer(this);
    }

    for (auto& point : mRemoteSyncPoints) {
        point->setTransactionApplied();
    }
    for (auto& point : mLocalSyncPoints) {
        point->setFrameAvailable();
    }
    mFlinger->deleteTextureAsync(mTextureName);

    if (!getBE().mHwcLayers.empty()) {
+11 −0
Original line number Diff line number Diff line
@@ -142,6 +142,17 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, const String8& n
void Layer::onFirstRef() {}

Layer::~Layer() {
    sp<Client> c(mClientRef.promote());
    if (c != 0) {
        c->detachLayer(this);
    }

    for (auto& point : mRemoteSyncPoints) {
        point->setTransactionApplied();
    }
    for (auto& point : mLocalSyncPoints) {
        point->setFrameAvailable();
    }
    mFrameTracker.logAndResetStats(mName);
}

Loading