OSDN Git Service

Boost priority of short-running SF FIFO threads slightly.
authorTim Murray <timmurray@google.com>
Wed, 7 Sep 2016 19:18:17 +0000 (12:18 -0700)
committerTim Murray <timmurray@google.com>
Wed, 7 Sep 2016 19:18:17 +0000 (12:18 -0700)
The short-running FIFO threads should preempt the SurfaceFlinger main
thread in order to prevent deadlock.

bug 31223682

Change-Id: I29e7b4b8439bb876998a8aeeb2b8d6ee5b6b7d36

services/surfaceflinger/DispSync.cpp
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger_hwc1.cpp

index c67feb3..1a9820d 100644 (file)
@@ -385,7 +385,7 @@ DispSync::DispSync(const char* 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;
+    param.sched_priority = 2;
     if (sched_setscheduler(mThread->getTid(), SCHED_FIFO, &param) != 0) {
         ALOGE("Couldn't set SCHED_FIFO for DispSyncThread");
     }
index 2a67f4c..92c6571 100644 (file)
@@ -471,7 +471,7 @@ void SurfaceFlinger::init() {
 
         // set SFEventThread to SCHED_FIFO to minimize jitter
         struct sched_param param = {0};
-        param.sched_priority = 1;
+        param.sched_priority = 2;
         if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
             ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
         }
index 650d6b4..b0f418c 100644 (file)
@@ -467,7 +467,7 @@ void SurfaceFlinger::init() {
 
     // set SFEventThread to SCHED_FIFO to minimize jitter
     struct sched_param param = {0};
-    param.sched_priority = 1;
+    param.sched_priority = 2;
     if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
         ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
     }