hwc: Set real time priority to gl threads.

CRs-Fixed: 2646317
Change-Id: I2c3d984006f7b9779eb8d0c8d83bbc04734a1ecf
diff --git a/composer/gl_common.cpp b/composer/gl_common.cpp
index 4524867..4d4744d 100644
--- a/composer/gl_common.cpp
+++ b/composer/gl_common.cpp
@@ -173,5 +173,14 @@
   image_wrapper_.Init();
 }
 
+void GLCommon::SetRealTimePriority() {
+  // same as composer thread
+  struct sched_param param = {0};
+  param.sched_priority = 2;
+  if (sched_setscheduler(0, SCHED_FIFO | SCHED_RESET_ON_FORK, &param) != 0) {
+    DLOGE("Couldn't set SCHED_FIFO: %d", errno);
+  }
+}
+
 }  // namespace sdm