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

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

Merge "sf: Defer DispSync initialization" into oc-dr1-dev

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

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);
    mThread->run("DispSync", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);

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



    reset();
    reset();
    beginResync();
    beginResync();


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


DispSync::~DispSync() {}

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


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


    void init(bool hasSyncFramework, int64_t dispSyncPresentTimeOffset);

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


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


    mPrimaryDispSync.init(hasSyncFramework, dispSyncPresentTimeOffset);

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