diff options
author | Steve Kondik <steve@cyngn.com> | 2016-10-13 20:32:42 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-12-16 00:02:37 +0100 |
commit | 7e654fcc223f6d191528028b7781bb23254115d7 (patch) | |
tree | 530f6f3c9ef601e35a50deb1cfb3d3149e98406e | |
parent | b17859e3065db622f3bec629f5cf25013fb84f8a (diff) |
input: Adjust priority
Change-Id: Ic0477225e9b0bb3eb4f2c71ab3b2620f56d947c7
-rw-r--r-- | services/inputflinger/Android.bp | 1 | ||||
-rw-r--r-- | services/inputflinger/InputThread.cpp | 6 | ||||
-rw-r--r-- | services/surfaceflinger/Android.bp | 1 | ||||
-rw-r--r-- | services/surfaceflinger/Scheduler/DispSync.cpp | 3 | ||||
-rw-r--r-- | services/surfaceflinger/Scheduler/EventControlThread.cpp | 3 | ||||
-rw-r--r-- | services/surfaceflinger/Scheduler/EventThread.cpp | 3 |
6 files changed, 16 insertions, 1 deletions
diff --git a/services/inputflinger/Android.bp b/services/inputflinger/Android.bp index f67c9d006b..9678bab2eb 100644 --- a/services/inputflinger/Android.bp +++ b/services/inputflinger/Android.bp @@ -107,6 +107,7 @@ cc_defaults { srcs: [":libinputflinger_base_sources"], shared_libs: [ "libbase", + "libbfqio", "libcutils", "libinput", "liblog", diff --git a/services/inputflinger/InputThread.cpp b/services/inputflinger/InputThread.cpp index b87f7a1243..7adc50d20f 100644 --- a/services/inputflinger/InputThread.cpp +++ b/services/inputflinger/InputThread.cpp @@ -16,6 +16,8 @@ #include "InputThread.h" +#include <bfqio/bfqio.h> + namespace android { namespace { @@ -42,7 +44,9 @@ private: InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake) : mName(name), mThreadWake(wake) { mThread = new InputThreadImpl(loop); - mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); + mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY + ANDROID_PRIORITY_MORE_FAVORABLE); + + android_set_rt_ioprio(mThread->getTid(), 1); } InputThread::~InputThread() { diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp index c408a6c7b5..14eb7cff91 100644 --- a/services/surfaceflinger/Android.bp +++ b/services/surfaceflinger/Android.bp @@ -39,6 +39,7 @@ cc_defaults { "android.hardware.power@1.3", "android.hardware.power-cpp", "libbase", + "libbfqio", "libbinder", "libbufferhubqueue", "libcutils", diff --git a/services/surfaceflinger/Scheduler/DispSync.cpp b/services/surfaceflinger/Scheduler/DispSync.cpp index ff91bf7bc0..f90ed3e06a 100644 --- a/services/surfaceflinger/Scheduler/DispSync.cpp +++ b/services/surfaceflinger/Scheduler/DispSync.cpp @@ -29,6 +29,7 @@ #include <algorithm> #include <android-base/stringprintf.h> +#include <bfqio/bfqio.h> #include <cutils/properties.h> #include <log/log.h> #include <utils/Thread.h> @@ -504,6 +505,8 @@ DispSync::DispSync(const char* name, bool hasSyncFramework) ALOGE("Couldn't set SCHED_FIFO for DispSyncThread"); } + android_set_rt_ioprio(mThread->getTid(), 1); + beginResync(); if (mTraceDetailedInfo && kEnableZeroPhaseTracer) { diff --git a/services/surfaceflinger/Scheduler/EventControlThread.cpp b/services/surfaceflinger/Scheduler/EventControlThread.cpp index 7f9db9ca2d..753081aeb4 100644 --- a/services/surfaceflinger/Scheduler/EventControlThread.cpp +++ b/services/surfaceflinger/Scheduler/EventControlThread.cpp @@ -22,6 +22,7 @@ #include <sched.h> #include <sys/resource.h> +#include <bfqio/bfqio.h> #include <cutils/sched_policy.h> #include <log/log.h> #include <system/thread_defs.h> @@ -41,6 +42,8 @@ EventControlThread::EventControlThread(EventControlThread::SetVSyncEnabledFuncti pid_t tid = pthread_gettid_np(mThread.native_handle()); setpriority(PRIO_PROCESS, tid, ANDROID_PRIORITY_URGENT_DISPLAY); set_sched_policy(tid, SP_FOREGROUND); + + android_set_rt_ioprio(tid, 1); } EventControlThread::~EventControlThread() { diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp index 845bf50ad3..8a0d514426 100644 --- a/services/surfaceflinger/Scheduler/EventThread.cpp +++ b/services/surfaceflinger/Scheduler/EventThread.cpp @@ -31,6 +31,7 @@ #include <android-base/stringprintf.h> +#include <bfqio/bfqio.h> #include <cutils/compiler.h> #include <cutils/sched_policy.h> @@ -189,6 +190,8 @@ EventThread::EventThread(std::unique_ptr<VSyncSource> vsyncSource, } set_sched_policy(tid, SP_FOREGROUND); + + android_set_rt_ioprio(tid, 1); } EventThread::~EventThread() { |