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

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

Snap for 10205056 from 01b8e815 to udc-release

Change-Id: Id7678d53c89522fd2020b122c345cfd092a58aaa
parents 2e22983a 01b8e815
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -343,14 +343,17 @@ status_t Gralloc5Mapper::validateBufferSize(buffer_handle_t bufferHandle, uint32
            return BAD_VALUE;
        }
    }
    {
        auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
        if (static_cast<BufferUsage>(usage) != value) {
            ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
                  static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
            return BAD_VALUE;
        }
    }
    // TODO: This can false-positive fail if the allocator adjusted the USAGE bits internally
    //       Investigate further & re-enable or remove, but for now ignoring usage should be OK
    (void)usage;
    // {
    //     auto value = getStandardMetadata<StandardMetadataType::USAGE>(mMapper, bufferHandle);
    //     if (static_cast<BufferUsage>(usage) != value) {
    //         ALOGW("Usage didn't match, expected %" PRIu64 " got %" PRId64, usage,
    //               static_cast<int64_t>(value.value_or(BufferUsage::CPU_READ_NEVER)));
    //         return BAD_VALUE;
    //     }
    // }
    {
        auto value = getStandardMetadata<StandardMetadataType::STRIDE>(mMapper, bufferHandle);
        if (stride != value) {
+0 −17
Original line number Diff line number Diff line
@@ -5659,14 +5659,6 @@ void InputDispatcher::dumpDispatchStateLocked(std::string& dump) const {
    } else {
        dump += INDENT "Displays: <none>\n";
    }
    dump += INDENT "Window Infos:\n";
    dump += StringPrintf(INDENT2 "vsync id: %" PRId64 "\n", mWindowInfosVsyncId);
    dump += StringPrintf(INDENT2 "timestamp (ns): %" PRId64 "\n", mWindowInfosTimestamp);
    dump += "\n";
    dump += StringPrintf(INDENT2 "max update delay (ns): %" PRId64 "\n", mMaxWindowInfosDelay);
    dump += StringPrintf(INDENT2 "max update delay vsync id: %" PRId64 "\n",
                         mMaxWindowInfosDelayVsyncId);
    dump += "\n";

    if (!mGlobalMonitorsByDisplay.empty()) {
        for (const auto& [displayId, monitors] : mGlobalMonitorsByDisplay) {
@@ -6708,15 +6700,6 @@ void InputDispatcher::onWindowInfosChanged(const gui::WindowInfosUpdate& update)
        for (const auto& [displayId, handles] : handlesPerDisplay) {
            setInputWindowsLocked(handles, displayId);
        }

        mWindowInfosVsyncId = update.vsyncId;
        mWindowInfosTimestamp = update.timestamp;

        int64_t delay = systemTime() - update.timestamp;
        if (delay > mMaxWindowInfosDelay) {
            mMaxWindowInfosDelay = delay;
            mMaxWindowInfosDelayVsyncId = update.vsyncId;
        }
    }
    // Wake up poll loop since it may need to make new input dispatching choices.
    mLooper->wake();
+0 −5
Original line number Diff line number Diff line
@@ -204,11 +204,6 @@ private:

    const IdGenerator mIdGenerator;

    int64_t mWindowInfosVsyncId GUARDED_BY(mLock);
    int64_t mWindowInfosTimestamp GUARDED_BY(mLock);
    int64_t mMaxWindowInfosDelay GUARDED_BY(mLock) = -1;
    int64_t mMaxWindowInfosDelayVsyncId GUARDED_BY(mLock) = -1;

    // With each iteration, InputDispatcher nominally processes one queued event,
    // a timeout, or a response from an input consumer.
    // This method should only be called on the input dispatcher's own thread.
+14 −29
Original line number Diff line number Diff line
@@ -2547,7 +2547,7 @@ bool SurfaceFlinger::commit(TimePoint frameTime, VsyncId vsyncId, TimePoint expe
    }

    updateCursorAsync();
    updateInputFlinger(vsyncId);
    updateInputFlinger(vsyncId, frameTime);

    if (mLayerTracingEnabled && !mLayerTracing.flagIsSet(LayerTracing::TRACE_COMPOSITION)) {
        // This will block and tracing should only be enabled for debugging.
@@ -3740,7 +3740,7 @@ void SurfaceFlinger::commitTransactionsLocked(uint32_t transactionFlags) {
    doCommitTransactions();
}

void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) {
void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId, TimePoint frameTime) {
    if (!mInputFlinger || (!mUpdateInputInfo && mInputWindowCommands.empty())) {
        return;
    }
@@ -3752,8 +3752,6 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) {
    if (mUpdateInputInfo) {
        mUpdateInputInfo = false;
        updateWindowInfo = true;
        mLastInputFlingerUpdateVsyncId = vsyncId;
        mLastInputFlingerUpdateTimestamp = systemTime();
        buildWindowInfos(windowInfos, displayInfos);
    }

@@ -3775,17 +3773,17 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId) {
                                                      inputWindowCommands =
                                                              std::move(mInputWindowCommands),
                                                      inputFlinger = mInputFlinger, this,
                                                      visibleWindowsChanged]() {
                                                      visibleWindowsChanged, vsyncId, frameTime]() {
        ATRACE_NAME("BackgroundExecutor::updateInputFlinger");
        if (updateWindowInfo) {
            mWindowInfosListenerInvoker
                    ->windowInfosChanged(std::move(windowInfos), std::move(displayInfos),
                    ->windowInfosChanged(gui::WindowInfosUpdate{std::move(windowInfos),
                                                                std::move(displayInfos),
                                                                vsyncId.value, frameTime.ns()},
                                         std::move(
                                                 inputWindowCommands.windowInfosReportedListeners),
                                         /* forceImmediateCall= */ visibleWindowsChanged ||
                                                 !inputWindowCommands.focusRequests.empty(),
                                         mLastInputFlingerUpdateVsyncId,
                                         mLastInputFlingerUpdateTimestamp);
                                                 !inputWindowCommands.focusRequests.empty());
        } else {
            // If there are listeners but no changes to input windows, call the listeners
            // immediately.
@@ -6152,27 +6150,14 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp
    result.append("\n");

    result.append("Window Infos:\n");
    StringAppendF(&result, "  input flinger update vsync id: %" PRId64 "\n",
                  mLastInputFlingerUpdateVsyncId.value);
    StringAppendF(&result, "  input flinger update timestamp (ns): %" PRId64 "\n",
                  mLastInputFlingerUpdateTimestamp);
    auto windowInfosDebug = mWindowInfosListenerInvoker->getDebugInfo();
    StringAppendF(&result, "  max send vsync id: %" PRId64 "\n",
                  windowInfosDebug.maxSendDelayVsyncId.value);
    StringAppendF(&result, "  max send delay (ns): %" PRId64 " ns\n",
                  windowInfosDebug.maxSendDelayDuration);
    StringAppendF(&result, "  unsent messages: %" PRIu32 "\n",
                  windowInfosDebug.pendingMessageCount);
    result.append("\n");

    if (int64_t unsentVsyncId = mWindowInfosListenerInvoker->getUnsentMessageVsyncId().value;
        unsentVsyncId != -1) {
        StringAppendF(&result, "  unsent input flinger update vsync id: %" PRId64 "\n",
                      unsentVsyncId);
        StringAppendF(&result, "  unsent input flinger update timestamp (ns): %" PRId64 "\n",
                      mWindowInfosListenerInvoker->getUnsentMessageTimestamp());
        result.append("\n");
    }

    if (uint32_t pendingMessages = mWindowInfosListenerInvoker->getPendingMessageCount();
        pendingMessages != 0) {
        StringAppendF(&result, "  pending input flinger calls: %" PRIu32 "\n",
                      mWindowInfosListenerInvoker->getPendingMessageCount());
        result.append("\n");
    }
}

mat4 SurfaceFlinger::calculateColorMatrix(float saturation) {
+1 −4
Original line number Diff line number Diff line
@@ -722,7 +722,7 @@ private:
    void updateLayerHistory(const frontend::LayerSnapshot& snapshot);
    frontend::Update flushLifecycleUpdates() REQUIRES(kMainThreadContext);

    void updateInputFlinger(VsyncId);
    void updateInputFlinger(VsyncId vsyncId, TimePoint frameTime);
    void persistDisplayBrightness(bool needsComposite) REQUIRES(kMainThreadContext);
    void buildWindowInfos(std::vector<gui::WindowInfo>& outWindowInfos,
                          std::vector<gui::DisplayInfo>& outDisplayInfos);
@@ -1259,9 +1259,6 @@ private:

    VsyncId mLastCommittedVsyncId;

    VsyncId mLastInputFlingerUpdateVsyncId;
    nsecs_t mLastInputFlingerUpdateTimestamp;

    // If blurs should be enabled on this device.
    bool mSupportsBlur = false;
    std::atomic<uint32_t> mFrameMissedCount = 0;
Loading