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

Commit acff43dc authored by Tim Murray's avatar Tim Murray
Browse files

Update SurfaceFlinger FIFO configuration.

- move SurfaceFlinger main thread to prio 2
- drop EventThread from FIFO but not SFEventThread, which is still FIFO
prio 1
- make DispSyncThread FIFO, prio 1

bug 30481949

Change-Id: Ifedccfbf3cf144ffad030109849a924dddae8d09
parent ba5c79ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -383,6 +383,13 @@ DispSync::DispSync(const char* name) :
        mThread(new DispSyncThread(name)) {

    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 = 1;
    if (sched_setscheduler(mThread->getTid(), SCHED_FIFO, &param) != 0) {
        ALOGE("Couldn't set SCHED_FIFO for DispSyncThread");
    }


    reset();
    beginResync();
+1 −6
Original line number Diff line number Diff line
@@ -465,18 +465,13 @@ void SurfaceFlinger::init() {
        mSFEventThread = new EventThread(sfVsyncSrc, *this);
        mEventQueue.setEventThread(mSFEventThread);

        // set EventThread and SFEventThread to SCHED_FIFO for minimum jitter
        // set SFEventThread to SCHED_FIFO to minimize jitter
        struct sched_param param = {0};
        param.sched_priority = 1;
        if (sched_setscheduler(mEventThread->getTid(), SCHED_FIFO, &param) != 0) {
            ALOGE("Couldn't set SCHED_FIFO for EventThread");
        }

        if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
            ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
        }


        // Get a RenderEngine for the given display / config (can't fail)
        mRenderEngine = RenderEngine::create(mEGLDisplay,
                HAL_PIXEL_FORMAT_RGBA_8888);
+1 −5
Original line number Diff line number Diff line
@@ -461,13 +461,9 @@ void SurfaceFlinger::init() {
    mSFEventThread = new EventThread(sfVsyncSrc, *this);
    mEventQueue.setEventThread(mSFEventThread);

    // set EventThread and SFEventThread to SCHED_FIFO for minimum jitter
    // set SFEventThread to SCHED_FIFO to minimize jitter
    struct sched_param param = {0};
    param.sched_priority = 1;
    if (sched_setscheduler(mEventThread->getTid(), SCHED_FIFO, &param) != 0) {
        ALOGE("Couldn't set SCHED_FIFO for EventThread");
    }

    if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
        ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
    }
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ int main(int, char**) {
    sm->addService(String16(GpuService::SERVICE_NAME), gpuservice, false);

    struct sched_param param = {0};
    param.sched_priority = 1;
    param.sched_priority = 2;
    if (sched_setscheduler(0, SCHED_FIFO, &param) != 0) {
        ALOGE("Couldn't set SCHED_FIFO");
    }