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

Commit 12bd4f15 authored by mtk27638's avatar mtk27638 Committed by Sungtak Lee
Browse files

GraphicsTracker: do not call cancelBuffer() after being stopped

When two codecs are using the same surface as below scenario, a buffer in Codec #2 can go inconsistent. Eventually the process using Codec #2 will be aborted. Fix this by not calling cancelBuffer() after GraphicsTracker is stopped.

1. Codec #1: stop using the surface (disconnect)
2. Codec #2: start to use the surface. (connect)
3. Codec #1: cancelBuffer() to the surface in HAL block dtor
4. Codec #2: a buffer by dequeueBuffer() is gone mistakenly by 3

Test: run cts -m CtsMediaStressTestCases

Bug: 354074267
Flag: EXEMPT bugfix
Change-Id: I8489a26021f456a5e9909a3546fc09c958053608
parent 7ea86521
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -824,6 +824,10 @@ c2_status_t GraphicsTracker::deallocate(uint64_t bid, const sp<Fence> &fence) {
    std::shared_ptr<BufferCache> cache;
    int slotId;
    sp<Fence> rFence;
    if (mStopped.load() == true) {
        ALOGE("cannot deallocate due to being stopped");
        return C2_BAD_STATE;
    }
    c2_status_t res = requestDeallocate(bid, fence, &completed, &updateDequeue,
                                        &cache, &slotId, &rFence);
    if (res != C2_OK) {