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

Commit dfc76be3 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "BLASTBufferQueue: Support setFrameTimelineVsync"

parents c79b7537 9b611b7f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -381,6 +381,10 @@ public:
        }
        return mBbq->setFrameRate(frameRate, compatibility);
    }

    status_t setFrameTimelineVsync(int64_t frameTimelineVsyncId) override {
        return mBbq->setFrameTimelineVsync(frameTimelineVsyncId);
    }
};

// TODO: Can we coalesce this with frame updates? Need to confirm
@@ -393,6 +397,14 @@ status_t BLASTBufferQueue::setFrameRate(float frameRate, int8_t compatibility) {
        .apply();
}

status_t BLASTBufferQueue::setFrameTimelineVsync(int64_t frameTimelineVsyncId) {
    std::unique_lock _lock{mMutex};
    SurfaceComposerClient::Transaction t;

    return t.setFrameTimelineVsync(mSurfaceControl, frameTimelineVsyncId)
        .apply();
}

sp<Surface> BLASTBufferQueue::getSurface() {
    return new BBQSurface(mProducer, true, this);
}
+2 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ status_t layer_state_t::write(Parcel& output) const
    SAFE_PARCEL(output.writeByte, frameRateCompatibility);
    SAFE_PARCEL(output.writeUint32, fixedTransformHint);
    SAFE_PARCEL(output.writeUint64, frameNumber);
    SAFE_PARCEL(output.writeInt64, frameTimelineVsyncId);
    return NO_ERROR;
}

@@ -250,6 +251,7 @@ status_t layer_state_t::read(const Parcel& input)
    SAFE_PARCEL(input.readUint32, &tmpUint32);
    fixedTransformHint = static_cast<ui::Transform::RotationFlags>(tmpUint32);
    SAFE_PARCEL(input.readUint64, &frameNumber);
    SAFE_PARCEL(input.readInt64, &frameTimelineVsyncId);
    return NO_ERROR;
}

+6 −1
Original line number Diff line number Diff line
@@ -1521,7 +1521,7 @@ int Surface::dispatchSetFrameTimelineVsync(va_list args) {
    auto frameTimelineVsyncId = static_cast<int64_t>(va_arg(args, int64_t));

    ALOGV("Surface::dispatchSetFrameTimelineVsync");
    return composerService()->setFrameTimelineVsync(mGraphicBufferProducer, frameTimelineVsyncId);
    return setFrameTimelineVsync(frameTimelineVsyncId);
}

bool Surface::transformToDisplayInverse() {
@@ -2288,4 +2288,9 @@ status_t Surface::setFrameRate(float frameRate, int8_t compatibility) {
    return composerService()->setFrameRate(mGraphicBufferProducer, frameRate, compatibility);
}

status_t Surface::setFrameTimelineVsync(int64_t frameTimelineVsyncId) {
    return composerService()->setFrameTimelineVsync(mGraphicBufferProducer,
        frameTimelineVsyncId);
}

}; // namespace android
+13 −0
Original line number Diff line number Diff line
@@ -1510,6 +1510,19 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameTimelineVsync(
        const sp<SurfaceControl>& sc, int64_t frameTimelineVsyncId) {
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }

    s->what |= layer_state_t::eFrameTimelineVsyncChanged;
    s->frameTimelineVsyncId = frameTimelineVsyncId;
    return *this;
}

// ---------------------------------------------------------------------------

DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) {
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public:
    void flushShadowQueue() { mFlushShadowQueue = true; }

    status_t setFrameRate(float frameRate, int8_t compatibility);
    status_t setFrameTimelineVsync(int64_t frameTimelineVsyncId);

    virtual ~BLASTBufferQueue() = default;

Loading