Merge "graphics: use FIFO scheduler in IComposer"

This commit is contained in:
TreeHugger Robot
2017-02-10 22:47:13 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 0 deletions

View File

@@ -2,4 +2,5 @@ service hwcomposer-2-1 /system/bin/hw/android.hardware.graphics.composer@2.1-ser
class hal
user system
group graphics drmrpc readproc
capabilities SYS_NICE
onrestart restart surfaceflinger

View File

@@ -16,6 +16,8 @@
#define LOG_TAG "android.hardware.graphics.composer@2.1-service"
#include <sched.h>
#include <android/hardware/graphics/composer/2.1/IComposer.h>
#include <binder/ProcessState.h>
@@ -29,5 +31,13 @@ int main() {
android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
android::ProcessState::self()->startThreadPool();
// same as SF main thread
struct sched_param param = {0};
param.sched_priority = 2;
if (sched_setscheduler(0, SCHED_FIFO | SCHED_RESET_ON_FORK,
&param) != 0) {
ALOGE("Couldn't set SCHED_FIFO: %d", errno);
}
return defaultPassthroughServiceImplementation<IComposer>("hwcomposer");
}