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

Commit 10b8cdf3 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7306623 from 3665bc2c to sc-release

Change-Id: I2bcfb23351d1662d3e7ce41ecbaf245ecdef93e0
parents c72e311b 3665bc2c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6,5 +6,6 @@ service media.transcoding /apex/com.android.media/bin/mediatranscoding
    user media
    group media
    ioprio rt 4
    task_profiles ProcessCapacityHigh HighPerformance
    # Restrict to little cores only with system-background cpuset.
    writepid /dev/cpuset/system-background/tasks
    disabled
+6 −4
Original line number Diff line number Diff line
@@ -1482,7 +1482,8 @@ c2_status_t Codec2Client::Component::configureVideoTunnel(
c2_status_t Codec2Client::Component::setOutputSurface(
        C2BlockPool::local_id_t blockPoolId,
        const sp<IGraphicBufferProducer>& surface,
        uint32_t generation) {
        uint32_t generation,
        int maxDequeueCount) {
    uint64_t bqId = 0;
    sp<IGraphicBufferProducer> nullIgbp;
    sp<HGraphicBufferProducer2> nullHgbp;
@@ -1496,14 +1497,15 @@ c2_status_t Codec2Client::Component::setOutputSurface(
    std::shared_ptr<SurfaceSyncObj> syncObj;

    if (!surface) {
        mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr);
        mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr);
    } else if (surface->getUniqueId(&bqId) != OK) {
        LOG(ERROR) << "setOutputSurface -- "
                   "cannot obtain bufferqueue id.";
        bqId = 0;
        mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr);
        mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr);
    } else {
        mOutputBufferQueue->configure(surface, generation, bqId, nullptr);
        mOutputBufferQueue->configure(surface, generation, bqId, maxDequeueCount, mBase1_2 ?
                                      &syncObj : nullptr);
    }
    ALOGD("surface generation remote change %u HAL ver: %s",
          generation, syncObj ? "1.2" : "1.0");
+2 −1
Original line number Diff line number Diff line
@@ -384,7 +384,8 @@ struct Codec2Client::Component : public Codec2Client::Configurable {
    c2_status_t setOutputSurface(
            C2BlockPool::local_id_t blockPoolId,
            const sp<IGraphicBufferProducer>& surface,
            uint32_t generation);
            uint32_t generation,
            int maxDequeueBufferCount);

    // Extract a slot number from of the block, then call
    // IGraphicBufferProducer::queueBuffer().
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ struct OutputBufferQueue {
    bool configure(const sp<IGraphicBufferProducer>& igbp,
                   uint32_t generation,
                   uint64_t bqId,
                   int maxDequeueBufferCount,
                   std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj);

    // Render a graphic block to current surface.
+20 −1
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ OutputBufferQueue::~OutputBufferQueue() {
bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp,
                                  uint32_t generation,
                                  uint64_t bqId,
                                  int maxDequeueBufferCount,
                                  std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj) {
    uint64_t consumerUsage = 0;
    if (igbp->getConsumerUsage(&consumerUsage) != OK) {
@@ -219,6 +220,20 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp,
    {
        std::scoped_lock<std::mutex> l(mMutex);
        if (generation == mGeneration) {
            // case of old BlockPool destruction
            C2SyncVariables *var = mSyncMem ? mSyncMem->mem() : nullptr;
            if (var) {
                *syncObj = std::make_shared<V1_2::SurfaceSyncObj>();
                (*syncObj)->bqId = bqId;
                (*syncObj)->syncMemory = mSyncMem->handle();
                (*syncObj)->generationId = generation;
                (*syncObj)->consumerUsage = consumerUsage;
                mMaxDequeueBufferCount = maxDequeueBufferCount;
                var->lock();
                var->setSyncStatusLocked(C2SyncVariables::STATUS_INIT);
                var->setInitialDequeueCountLocked(mMaxDequeueBufferCount, 0);
                var->unlock();
            }
            return false;
        }
        std::shared_ptr<C2SurfaceSyncMemory> oldMem = mSyncMem;
@@ -238,6 +253,7 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp,
        mGeneration = generation;
        mBqId = bqId;
        mOwner = std::make_shared<int>(0);
        mMaxDequeueBufferCount = maxDequeueBufferCount;
        for (int i = 0; i < BufferQueueDefs::NUM_BUFFER_SLOTS; ++i) {
            if (mBqId == 0 || !mBuffers[i]) {
                continue;
@@ -288,7 +304,9 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp,
            mPoolDatas[i] = poolDatas[i];
        }
        if (newSync) {
            newSync->setInitialDequeueCount(mMaxDequeueBufferCount, success);
            newSync->lock();
            newSync->setInitialDequeueCountLocked(mMaxDequeueBufferCount, success);
            newSync->unlock();
        }
    }
    ALOGD("remote graphic buffer migration %zu/%zu",
@@ -452,6 +470,7 @@ void OutputBufferQueue::updateMaxDequeueBufferCount(int maxDequeueBufferCount) {
        syncVar->unlock();
    }
    mMutex.unlock();
    ALOGD("set max dequeue count %d from update", maxDequeueBufferCount);
}

}  // namespace c2
Loading