Add a setting for vendor to set uclamp.min boost for SF main thread

Bug: 190137562
Test: boot and check uclamp.min of SF
Change-Id: Iee4bac8e4cfcb33a284bb7c206fe1dc4400e2ded
diff --git a/services/surfaceflinger/main_surfaceflinger.cpp b/services/surfaceflinger/main_surfaceflinger.cpp
index 9686523..673239d 100644
--- a/services/surfaceflinger/main_surfaceflinger.cpp
+++ b/services/surfaceflinger/main_surfaceflinger.cpp
@@ -89,6 +89,12 @@
     // binder threads to 4.
     ProcessState::self()->setThreadPoolMaxThreadCount(4);
 
+    // Set uclamp.min setting on all threads, maybe an overkill but we want
+    // to cover important threads like RenderEngine.
+    if (SurfaceFlinger::setSchedAttr(true) != NO_ERROR) {
+        ALOGW("Couldn't set uclamp.min: %s\n", strerror(errno));
+    }
+
     // The binder threadpool we start will inherit sched policy and priority
     // of (this) creating thread. We want the binder thread pool to have
     // SCHED_FIFO policy and priority 1 (lowest RT priority)