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

Commit 75e6bba5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "sf: Defer DispSync initialization"

parents 7e542319 f4174530
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -377,11 +377,16 @@ private:
DispSync::DispSync(const char* name) :
        mName(name),
        mRefreshSkipCount(0),
        mThread(new DispSyncThread(name)),
        mIgnorePresentFences(!SurfaceFlinger::hasSyncFramework){
        mThread(new DispSyncThread(name)) {
}

DispSync::~DispSync() {}

    mPresentTimeOffset = SurfaceFlinger::dispSyncPresentTimeOffset;
void DispSync::init(bool hasSyncFramework, int64_t dispSyncPresentTimeOffset) {
    mIgnorePresentFences = !hasSyncFramework;
    mPresentTimeOffset = dispSyncPresentTimeOffset;
    mThread->run("DispSync", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);

    // set DispSync to SCHED_FIFO to minimize jitter
    struct sched_param param = {0};
    param.sched_priority = 2;
@@ -389,7 +394,6 @@ DispSync::DispSync(const char* name) :
        ALOGE("Couldn't set SCHED_FIFO for DispSyncThread");
    }


    reset();
    beginResync();

@@ -405,8 +409,6 @@ DispSync::DispSync(const char* name) :
    }
}

DispSync::~DispSync() {}

void DispSync::reset() {
    Mutex::Autolock lock(mMutex);

+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ public:
    explicit DispSync(const char* name);
    ~DispSync();

    void init(bool hasSyncFramework, int64_t dispSyncPresentTimeOffset);

    // reset clears the resync samples and error value.
    void reset();

+2 −0
Original line number Diff line number Diff line
@@ -195,6 +195,8 @@ SurfaceFlinger::SurfaceFlinger()
    hasWideColorDisplay =
            getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::hasWideColorDisplay>(false);

    mPrimaryDispSync.init(hasSyncFramework, dispSyncPresentTimeOffset);

    // debugging stuff...
    char value[PROPERTY_VALUE_MAX];