Revert "Revert "hwc: Set ioprio for vsync thread""

This reverts commit 1cc26e544bc8752bfdab777d0bc5d45c0102430f.

Change-Id: Ifab34ee400e5ea5e76851ccfade18565d6456973
diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk
index 3c3ac73..78d2ddc 100644
--- a/libhwcomposer/Android.mk
+++ b/libhwcomposer/Android.mk
@@ -12,7 +12,7 @@
 LOCAL_SHARED_LIBRARIES        := $(common_libs) libEGL liboverlay \
                                  libhdmi libqdutils libhardware_legacy \
                                  libdl libmemalloc libqservice libsync \
-                                 libbinder libmedia
+                                 libbinder libmedia libbfqio_vendor
 
 ifeq ($(TARGET_USES_QCOM_BSP),true)
 LOCAL_SHARED_LIBRARIES += libskia
diff --git a/libhwcomposer/hwc_vsync.cpp b/libhwcomposer/hwc_vsync.cpp
index 579f43c..bca9320 100644
--- a/libhwcomposer/hwc_vsync.cpp
+++ b/libhwcomposer/hwc_vsync.cpp
@@ -18,6 +18,7 @@
  * limitations under the License.
  */
 
+#include <bfqio/bfqio.h>
 #include <cutils/properties.h>
 #include <utils/Log.h>
 #include <fcntl.h>
@@ -115,6 +116,7 @@
     prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0);
     setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY +
                 android::PRIORITY_MORE_FAVORABLE);
+    android_set_rt_ioprio(0, 1);
 
     char vdata[MAX_DATA];
     //Number of physical displays