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

Commit 3addef29 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

Merge "surfaceflinger: discard stale commands" into oc-dev

am: f8ca9a08

Change-Id: I6b7ce1798d2fe753c577ff3baa954283c372b80c
parents 45bf98c3 f8ca9a08
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -717,6 +717,12 @@ Error Display::presentOrValidate(uint32_t* outNumTypes, uint32_t* outNumRequests
    }
    return error;
}

void Display::discardCommands()
{
    mDevice.mComposer->resetCommands();
}

// For use by Device

int32_t Display::getAttribute(hwc2_config_t configId, Attribute attribute)
+6 −0
Original line number Diff line number Diff line
@@ -259,6 +259,12 @@ public:
                                                 uint32_t* outNumRequests,
                                                          android::sp<android::Fence>* outPresentFence, uint32_t* state);

    // Most methods in this class write a command to a command buffer.  The
    // command buffer is implicitly submitted in validate, present, and
    // presentOrValidate.  This method provides a way to discard the commands,
    // which can be used to discard stale commands.
    void discardCommands();

    // Other Display methods

    Device& getDevice() const { return mDevice; }
+1 −0
Original line number Diff line number Diff line
@@ -621,6 +621,7 @@ status_t HWComposer::presentAndGetReleaseFences(int32_t displayId) {
    auto& hwcDisplay = displayData.hwcDisplay;

    if (displayData.validateWasSkipped) {
        hwcDisplay->discardCommands();
        auto error = displayData.presentError;
        if (error != HWC2::Error::None) {
            ALOGE("skipValidate: failed for display %d: %s (%d)",