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

Commit b13d750d authored by Steven Thomas's avatar Steven Thomas
Browse files

Remove frame rate functions from buffer queue

Remove the frame rate functions that were recently added to buffer queue
in ag/10028291. Modifying buffer queue is considered risky because we
have prebuilt binaries that use the classes in unknown ways.

We added an alternative mechanism for communicating frame rate info in
ag/10221036, so this code is no longer used for anything.

Bug: 150642189

Test: - Built and deployed to a Pixel 4, confirmed normal behavior.
- Built all the surface flinger unit tests.
- Ran the setFrameRate() cts test.

Change-Id: I26a620e842e79a378f58a78a088cff872a49de0d
parent 7e221c91
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -147,16 +147,6 @@ status_t BufferHubConsumer::discardFreeBuffers() {
    return INVALID_OPERATION;
    return INVALID_OPERATION;
}
}


status_t BufferHubConsumer::setFrameRate(float /*frameRate*/) {
    ALOGE("BufferHubConsumer::setFrameRate: not implemented.");
    return INVALID_OPERATION;
}

status_t BufferHubConsumer::getFrameRate(float* /*frameRate*/) const {
    ALOGE("BufferHubConsumer::getFrameRate: not implemented.");
    return INVALID_OPERATION;
}

status_t BufferHubConsumer::dumpState(const String8& /*prefix*/, String8* /*outResult*/) const {
status_t BufferHubConsumer::dumpState(const String8& /*prefix*/, String8* /*outResult*/) const {
    ALOGE("BufferHubConsumer::dumpState: not implemented.");
    ALOGE("BufferHubConsumer::dumpState: not implemented.");
    return INVALID_OPERATION;
    return INVALID_OPERATION;
+0 −12
Original line number Original line Diff line number Diff line
@@ -783,18 +783,6 @@ status_t BufferQueueConsumer::discardFreeBuffers() {
    return NO_ERROR;
    return NO_ERROR;
}
}


status_t BufferQueueConsumer::setFrameRate(float frameRate) {
    std::lock_guard<std::mutex> lock(mCore->mMutex);
    mCore->mFrameRate = frameRate;
    return NO_ERROR;
}

status_t BufferQueueConsumer::getFrameRate(float* frameRate) const {
    std::lock_guard<std::mutex> lock(mCore->mMutex);
    *frameRate = mCore->mFrameRate;
    return NO_ERROR;
}

status_t BufferQueueConsumer::dumpState(const String8& prefix, String8* outResult) const {
status_t BufferQueueConsumer::dumpState(const String8& prefix, String8* outResult) const {
    struct passwd* pwd = getpwnam("shell");
    struct passwd* pwd = getpwnam("shell");
    uid_t shellUid = pwd ? pwd->pw_uid : 0;
    uid_t shellUid = pwd ? pwd->pw_uid : 0;
+1 −2
Original line number Original line Diff line number Diff line
@@ -130,8 +130,7 @@ BufferQueueCore::BufferQueueCore()
        mLastQueuedSlot(INVALID_BUFFER_SLOT),
        mLastQueuedSlot(INVALID_BUFFER_SLOT),
        mUniqueId(getUniqueId()),
        mUniqueId(getUniqueId()),
        mAutoPrerotation(false),
        mAutoPrerotation(false),
        mTransformHintInUse(0),
        mTransformHintInUse(0) {
        mFrameRate(0) {
    int numStartingBuffers = getMaxBufferCountLocked();
    int numStartingBuffers = getMaxBufferCountLocked();
    for (int s = 0; s < numStartingBuffers; s++) {
    for (int s = 0; s < numStartingBuffers; s++) {
        mFreeSlots.insert(s);
        mFreeSlots.insert(s);
+0 −10
Original line number Original line Diff line number Diff line
@@ -1676,14 +1676,4 @@ status_t BufferQueueProducer::setAutoPrerotation(bool autoPrerotation) {
    return NO_ERROR;
    return NO_ERROR;
}
}


status_t BufferQueueProducer::setFrameRate(float frameRate) {
    ATRACE_CALL();
    BQ_LOGV("setFrameRate: %.0f", frameRate);

    std::lock_guard<std::mutex> lock(mCore->mMutex);

    mCore->mFrameRate = frameRate;
    return NO_ERROR;
}

} // namespace android
} // namespace android
+0 −18
Original line number Original line Diff line number Diff line
@@ -363,24 +363,6 @@ status_t ConsumerBase::discardFreeBuffers() {
    return OK;
    return OK;
}
}


status_t ConsumerBase::setFrameRate(float frameRate) {
    Mutex::Autolock _l(mMutex);
    if (mAbandoned) {
        CB_LOGE("setFrameRate: ConsumerBase is abandoned!");
        return NO_INIT;
    }
    return mConsumer->setFrameRate(frameRate);
}

status_t ConsumerBase::getFrameRate(float* frameRate) {
    Mutex::Autolock _l(mMutex);
    if (mAbandoned) {
        CB_LOGE("getFrameRate: ConsumerBase is abandoned!");
        return NO_INIT;
    }
    return mConsumer->getFrameRate(frameRate);
}

void ConsumerBase::dumpState(String8& result) const {
void ConsumerBase::dumpState(String8& result) const {
    dumpState(result, "");
    dumpState(result, "");
}
}
Loading