Skip to content

Commit

Permalink
input: Adjust priority
Browse files Browse the repository at this point in the history
 * Bring into the desired group to get the best result.

Change-Id: I3bd031074cd7006994736b4c22d0294b6012f662

Revert "Revert "input: Adjust priority""

 * Fixit.

This reverts commit b7299fc50032b325ec259b53713631e681516af6.

Change-Id: Ic0477225e9b0bb3eb4f2c71ab3b2620f56d947c7
Signed-off-by: D. Andrei Măceș <[email protected]>
  • Loading branch information
Steve Kondik authored and airend committed Dec 6, 2017
1 parent ee27a9f commit 3dd852c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions services/inputflinger/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "InputManager.h"

#include <cutils/iosched_policy.h>
#include <cutils/log.h>

namespace android {
Expand Down Expand Up @@ -51,20 +52,25 @@ void InputManager::initialize() {
}

status_t InputManager::start() {
status_t result = mDispatcherThread->run("InputDispatcher", PRIORITY_URGENT_DISPLAY);
status_t result = mDispatcherThread->run("InputDispatcher",
PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
if (result) {
ALOGE("Could not start InputDispatcher thread due to error %d.", result);
return result;
}

result = mReaderThread->run("InputReader", PRIORITY_URGENT_DISPLAY);
result = mReaderThread->run("InputReader",
PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
if (result) {
ALOGE("Could not start InputReader thread due to error %d.", result);

mDispatcherThread->requestExit();
return result;
}

android_set_rt_ioprio(mDispatcherThread->getTid(), 1);
android_set_rt_ioprio(mReaderThread->getTid(), 1);

return OK;
}

Expand Down
2 changes: 2 additions & 0 deletions services/surfaceflinger/DispSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <math.h>

#include <cutils/iosched_policy.h>
#include <cutils/log.h>

#include <ui/Fence.h>
Expand Down Expand Up @@ -390,6 +391,7 @@ DispSync::DispSync(const char* name) :
ALOGE("Couldn't set SCHED_FIFO for DispSyncThread");
}

android_set_rt_ioprio(mThread->getTid(), 1);

reset();
beginResync();
Expand Down
2 changes: 2 additions & 0 deletions services/surfaceflinger/EventThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sys/types.h>

#include <cutils/compiler.h>
#include <cutils/iosched_policy.h>

#include <gui/BitTube.h>
#include <gui/IDisplayEventConnection.h>
Expand Down Expand Up @@ -92,6 +93,7 @@ void EventThread::sendVsyncHintOnLocked() {

void EventThread::onFirstRef() {
run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
android_set_rt_ioprio(getTid(), 1);
}

sp<EventThread::Connection> EventThread::createEventConnection() const {
Expand Down
2 changes: 2 additions & 0 deletions services/surfaceflinger/SurfaceFlinger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <EGL/egl.h>

#include <cutils/iosched_policy.h>
#include <cutils/log.h>
#include <cutils/properties.h>

Expand Down Expand Up @@ -501,6 +502,7 @@ void SurfaceFlinger::init() {

mEventControlThread = new EventControlThread(this);
mEventControlThread->run("EventControl", PRIORITY_URGENT_DISPLAY);
android_set_rt_ioprio(mEventControlThread->getTid(), 1);

// initialize our drawing state
mDrawingState = mCurrentState;
Expand Down
2 changes: 2 additions & 0 deletions services/surfaceflinger/SurfaceFlinger_hwc1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <EGL/egl.h>

#include <cutils/iosched_policy.h>
#include <cutils/log.h>
#include <cutils/properties.h>

Expand Down Expand Up @@ -526,6 +527,7 @@ void SurfaceFlinger::init() {

mEventControlThread = new EventControlThread(this);
mEventControlThread->run("EventControl", PRIORITY_URGENT_DISPLAY);
android_set_rt_ioprio(mEventControlThread->getTid(), 1);

// set a fake vsync period if there is no HWComposer
if (mHwc->initCheck() != NO_ERROR) {
Expand Down

0 comments on commit 3dd852c

Please sign in to comment.