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

Commit e7382c1c authored by Huihong Luo's avatar Huihong Luo
Browse files

Reset pending commands

Allow takePendingCommands to have ownership for mComamnds so commands
are reset on each call. resetCommands methods are removed since they
are not really used.

Bug: 273525126
Test: manual
Change-Id: If91cf6253b0d8f0d8c5d761f7cf257d090fcaf6f
parent e469593a
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -329,14 +329,6 @@ void AidlComposer::registerCallback(HWC2::ComposerCallback& callback) {
    }
}

void AidlComposer::resetCommands(Display display) {
    mMutex.lock_shared();
    if (auto writer = getWriter(display)) {
        writer->get().reset();
    }
    mMutex.unlock_shared();
}

Error AidlComposer::executeCommands(Display display) {
    mMutex.lock_shared();
    auto error = execute(display);
@@ -1054,9 +1046,8 @@ Error AidlComposer::execute(Display display) {
        return Error::BAD_DISPLAY;
    }

    const auto& commands = writer->get().getPendingCommands();
    auto commands = writer->get().takePendingCommands();
    if (commands.empty()) {
        writer->get().reset();
        return Error::NONE;
    }

@@ -1088,8 +1079,6 @@ Error AidlComposer::execute(Display display) {
        }
    }

    writer->get().reset();

    return error;
}

+0 −4
Original line number Diff line number Diff line
@@ -72,10 +72,6 @@ public:

    void registerCallback(HWC2::ComposerCallback& callback) override;

    // Reset all pending commands in the command buffer. Useful if you want to
    // skip a frame but have already queued some commands.
    void resetCommands(Display) override;

    // Explicitly flush all pending commands in the command buffer.
    Error executeCommands(Display) override;

+0 −4
Original line number Diff line number Diff line
@@ -110,10 +110,6 @@ public:

    virtual void registerCallback(HWC2::ComposerCallback& callback) = 0;

    // Reset all pending commands in the command buffer. Useful if you want to
    // skip a frame but have already queued some commands.
    virtual void resetCommands(Display) = 0;

    // Explicitly flush all pending commands in the command buffer.
    virtual Error executeCommands(Display) = 0;

+0 −4
Original line number Diff line number Diff line
@@ -293,10 +293,6 @@ void HidlComposer::registerCallback(const sp<IComposerCallback>& callback) {
    }
}

void HidlComposer::resetCommands(Display) {
    mWriter.reset();
}

Error HidlComposer::executeCommands(Display) {
    return execute();
}
+0 −4
Original line number Diff line number Diff line
@@ -174,10 +174,6 @@ public:

    void registerCallback(HWC2::ComposerCallback& callback) override;

    // Reset all pending commands in the command buffer. Useful if you want to
    // skip a frame but have already queued some commands.
    void resetCommands(Display) override;

    // Explicitly flush all pending commands in the command buffer.
    Error executeCommands(Display) override;

Loading