summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-09-17 00:45:55 -0700
committerSteve Kondik <steve@cyngn.com>2015-09-21 15:42:56 -0700
commitc1049a96c6d56125afb801c97503d6537f6549d3 (patch)
treefffe802814d0a03edbe1c46dfb4371efc6c58d5e
parent94e3a0dc19570cf8605c7f793d002decdcd662d9 (diff)
downloadandroid_hardware_qcom_display-stable/cm-12.1-caf-8916-YOG4P.tar.gz
android_hardware_qcom_display-stable/cm-12.1-caf-8916-YOG4P.tar.bz2
android_hardware_qcom_display-stable/cm-12.1-caf-8916-YOG4P.zip
display: Set rtio for vsync threadstable/cm-12.1-caf-8916-YOG4P
SAMBAR-275 display: Set thread priority using cutils * To take advantage of our custom behavior there. Change-Id: Ia2fb85c66ab075229f01851686053daf5474bd4b hwc: Set ioprio for vsync thread * We're not doing this automatically anymore. Change-Id: I0ba52fe4648938bd7a0309bc03dc439e3d906970
-rw-r--r--libcopybit/copybit_c2d.cpp3
-rw-r--r--libhwcomposer/hwc_uevents.cpp3
-rw-r--r--libhwcomposer/hwc_vsync.cpp4
3 files changed, 6 insertions, 4 deletions
diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp
index 7841bb735..7f0392d9a 100644
--- a/libcopybit/copybit_c2d.cpp
+++ b/libcopybit/copybit_c2d.cpp
@@ -36,6 +36,7 @@
#include <EGL/eglplatform.h>
#include <cutils/native_handle.h>
#include <gralloc_priv.h>
+#include <cutils/threads.h>
#include <copybit.h>
#include <alloc_controller.h>
@@ -216,7 +217,7 @@ static void* c2d_wait_loop(void* ptr) {
copybit_context_t* ctx = (copybit_context_t*)(ptr);
char thread_name[64] = "copybitWaitThr";
prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0);
- setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY);
+ androidSetThreadPriority(0, HAL_PRIORITY_URGENT_DISPLAY);
while(ctx->stop_thread == false) {
pthread_mutex_lock(&ctx->wait_cleanup_lock);
diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp
index d1c68a5d3..4332cfb38 100644
--- a/libhwcomposer/hwc_uevents.cpp
+++ b/libhwcomposer/hwc_uevents.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright (C) 2012-14, The Linux Foundation. All rights reserved.
@@ -213,7 +212,7 @@ static void *uevent_loop(void *param)
hwc_context_t * ctx = reinterpret_cast<hwc_context_t *>(param);
char thread_name[64] = HWC_UEVENT_THREAD_NAME;
prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0);
- setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY);
+ androidSetThreadPriority(0, HAL_PRIORITY_URGENT_DISPLAY);
if(!uevent_init()) {
ALOGE("%s: failed to init uevent ",__FUNCTION__);
return NULL;
diff --git a/libhwcomposer/hwc_vsync.cpp b/libhwcomposer/hwc_vsync.cpp
index 89f8044bf..3f3a094ce 100644
--- a/libhwcomposer/hwc_vsync.cpp
+++ b/libhwcomposer/hwc_vsync.cpp
@@ -19,6 +19,7 @@
*/
#include <cutils/properties.h>
+#include <cutils/iosched_policy.h>
#include <utils/Log.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -114,8 +115,9 @@ static void *vsync_loop(void *param)
char thread_name[64] = HWC_VSYNC_THREAD_NAME;
prctl(PR_SET_NAME, (unsigned long) &thread_name, 0, 0, 0);
- setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY +
+ androidSetThreadPriority(0, HAL_PRIORITY_URGENT_DISPLAY +
android::PRIORITY_MORE_FAVORABLE);
+ android_set_rt_ioprio(0, 1);
char vdata[MAX_DATA];
//Number of physical displays