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

Commit 64c1d990 authored by ramindani's avatar ramindani
Browse files

[SF] Update onModeChanged to send appVsyncOffset

[SF] Update onModeChanged to send presentationDeadline

BUG: 398872242
Test: atest EventThreadTest
Flag: com.android.server.display.feature.flags.enable_on_mode_changed_vsync_phase_offset

Change-Id: I1722b8dd44e71a98d2128e0b34366f1f743cd99e
parent b1e7d3cf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -349,7 +349,8 @@ void Choreographer::dispatchHotplugConnectionError(nsecs_t, int32_t connectionEr
          this, connectionError);
}

void Choreographer::dispatchModeChanged(nsecs_t, PhysicalDisplayId, int32_t, nsecs_t) {
void Choreographer::dispatchModeChanged(nsecs_t, PhysicalDisplayId, int32_t, nsecs_t, nsecs_t,
                                        nsecs_t) {
    LOG_ALWAYS_FATAL("dispatchModeChanged was called but was never registered");
}

+3 −1
Original line number Diff line number Diff line
@@ -194,7 +194,9 @@ bool DisplayEventDispatcher::processPendingEvents(nsecs_t* outTimestamp,
                    break;
                case DisplayEventType::DISPLAY_EVENT_MODE_CHANGE:
                    dispatchModeChanged(ev.header.timestamp, ev.header.displayId,
                                        ev.modeChange.modeId, ev.modeChange.vsyncPeriod);
                                        ev.modeChange.modeId, ev.modeChange.vsyncPeriod,
                                        ev.modeChange.appVsyncOffset,
                                        ev.modeChange.presentationDeadline);
                    break;
                case DisplayEventType::DISPLAY_EVENT_NULL:
                    dispatchNullEvent(ev.header.timestamp, ev.header.displayId);
+2 −1
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ private:
    void dispatchHotplug(nsecs_t timestamp, PhysicalDisplayId displayId, bool connected) override;
    void dispatchHotplugConnectionError(nsecs_t timestamp, int32_t connectionError) override;
    void dispatchModeChanged(nsecs_t timestamp, PhysicalDisplayId displayId, int32_t modeId,
                             nsecs_t vsyncPeriod) override;
                             nsecs_t vsyncPeriod, nsecs_t appVsyncOffset,
                             nsecs_t presentationDeadline) override;
    void dispatchNullEvent(nsecs_t, PhysicalDisplayId) override;
    void dispatchFrameRateOverrides(nsecs_t timestamp, PhysicalDisplayId displayId,
                                    std::vector<FrameRateOverride> overrides) override;
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ private:
    virtual void dispatchHotplugConnectionError(nsecs_t timestamp, int32_t connectionError) = 0;

    virtual void dispatchModeChanged(nsecs_t timestamp, PhysicalDisplayId displayId, int32_t modeId,
                                     nsecs_t vsyncPeriod) = 0;
                                     nsecs_t vsyncPeriod, nsecs_t appVsyncOffset,
                                     nsecs_t presentationDeadline) = 0;
    // AChoreographer-specific hook for processing null-events so that looper
    // can be properly poked.
    virtual void dispatchNullEvent(nsecs_t timestamp, PhysicalDisplayId displayId) = 0;
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ public:
        struct ModeChange {
            int32_t modeId;
            nsecs_t vsyncPeriod __attribute__((aligned(8)));
            nsecs_t appVsyncOffset __attribute__((aligned(8)));
            nsecs_t presentationDeadline __attribute__((aligned(8)));
        };

        struct ModeRejection {
Loading