Make hwc_vsync thread realtime
authorErik Wolsheimer <ewol@google.com>
Wed, 28 Mar 2018 23:27:54 +0000 (16:27 -0700)
committerFrancescodario Cuzzocrea <bosconovic@gmail.com>
Tue, 26 Jan 2021 16:08:26 +0000 (17:08 +0100)
Bug: 68395248
Change-Id: I4ac93464aa2ccf416577b4067ed658b525089983

libhwc/ExynosHWC.cpp

index c6f1e50a31bfc2a2e5e37d98e1e34fc95408a276..02913a44fed1d6bf088b08a5115d1b57d636fea3 100644 (file)
@@ -626,7 +626,11 @@ void *hwc_vsync_thread(void *data)
     char uevent_desc[4096];
     memset(uevent_desc, 0, sizeof(uevent_desc));
 
-    setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY);
+    struct sched_param sched_param = {0};
+    sched_param.sched_priority = 5;
+    if (sched_setscheduler(gettid(), SCHED_FIFO, &sched_param) != 0) {
+        ALOGE("Couldn't set SCHED_FIFO for hwc_vsync");
+    }
 
     uevent_init();