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

Commit e3ad40f5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7692139 from 5c8b18c9 to sc-qpr1-release

Change-Id: I1d42d6a947ff398fa2259f0098beca4bf43bb80e
parents b17fb4ad 5c8b18c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,12 +118,12 @@ void BLASTBufferItemConsumer::getConnectionEvents(uint64_t frameNumber, bool* ne
}

void BLASTBufferItemConsumer::setBlastBufferQueue(BLASTBufferQueue* blastbufferqueue) {
    Mutex::Autolock lock(mMutex);
    std::scoped_lock lock(mBufferQueueMutex);
    mBLASTBufferQueue = blastbufferqueue;
}

void BLASTBufferItemConsumer::onSidebandStreamChanged() {
    Mutex::Autolock lock(mMutex);
    std::scoped_lock lock(mBufferQueueMutex);
    if (mBLASTBufferQueue != nullptr) {
        sp<NativeHandle> stream = getSidebandStream();
        mBLASTBufferQueue->setSidebandStream(stream);
+2 −1
Original line number Diff line number Diff line
@@ -62,11 +62,12 @@ private:
    uint64_t mCurrentFrameNumber = 0;

    Mutex mMutex;
    std::mutex mBufferQueueMutex;
    ConsumerFrameEventHistory mFrameEventHistory GUARDED_BY(mMutex);
    std::queue<uint64_t> mDisconnectEvents GUARDED_BY(mMutex);
    bool mCurrentlyConnected GUARDED_BY(mMutex);
    bool mPreviouslyConnected GUARDED_BY(mMutex);
    BLASTBufferQueue* mBLASTBufferQueue GUARDED_BY(mMutex);
    BLASTBufferQueue* mBLASTBufferQueue GUARDED_BY(mBufferQueueMutex);
};

class BLASTBufferQueue
+7 −0
Original line number Diff line number Diff line
@@ -386,6 +386,13 @@ void Scheduler::dispatchCachedReportedMode() {
    }

    const auto modeId = *mFeatures.modeId;
    // If the modeId is not the current mode, this means that a
    // mode change is in progress. In that case we shouldn't dispatch an event
    // as it will be dispatched when the current mode changes.
    if (mRefreshRateConfigs.getCurrentRefreshRate().getModeId() != modeId) {
        return;
    }

    const auto vsyncPeriod = mRefreshRateConfigs.getRefreshRateFromModeId(modeId).getVsyncPeriod();

    // If there is no change from cached mode, there is no need to dispatch an event
+6 −0
Original line number Diff line number Diff line
@@ -1231,6 +1231,12 @@ VkResult CreateSwapchainKHR(VkDevice device,
        return VK_ERROR_SURFACE_LOST_KHR;
    }

    // In shared mode the num_images must be one regardless of how many
    // buffers were allocated for the buffer queue.
    if (swapchain_image_usage & VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID) {
        num_images = 1;
    }

    int32_t legacy_usage = 0;
    if (dispatch.GetSwapchainGrallocUsage2ANDROID) {
        uint64_t consumer_usage, producer_usage;