summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-08-14 10:25:16 -0700
committerJohn Reck <jreck@google.com>2014-08-15 00:36:11 +0000
commit21be43e142a6fcb3283d7b2da14eb39b690cf643 (patch)
treea2065bc793185d1fc364d740412428e7d8bafe94 /libs
parent9fde9a250fffc15c6bcdfc985de12c8646a9813c (diff)
downloadframeworks_base-21be43e142a6fcb3283d7b2da14eb39b690cf643.zip
frameworks_base-21be43e142a6fcb3283d7b2da14eb39b690cf643.tar.gz
frameworks_base-21be43e142a6fcb3283d7b2da14eb39b690cf643.tar.bz2
Fix hwuitask & RT priorities
Bug: 15993695 Change-Id: Ib6f07237cb834e8d10f3074f8fb206d27f91859a
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp6
-rw-r--r--libs/hwui/thread/TaskManager.cpp10
-rw-r--r--libs/hwui/thread/TaskManager.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 03e98d5..68033dc 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -18,6 +18,9 @@
#include "RenderThread.h"
+#if defined(HAVE_PTHREADS)
+#include <sys/resource.h>
+#endif
#include <gui/DisplayEventReceiver.h>
#include <utils/Log.h>
@@ -244,6 +247,9 @@ void RenderThread::requestVsync() {
}
bool RenderThread::threadLoop() {
+#if defined(HAVE_PTHREADS)
+ setpriority(PRIO_PROCESS, 0, PRIORITY_DISPLAY);
+#endif
initThreadLocals();
int timeoutMillis = -1;
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index 3d2b0d9..cb5401c 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -15,6 +15,9 @@
*/
#include <sys/sysinfo.h>
+#if defined(HAVE_PTHREADS)
+#include <sys/resource.h>
+#endif
#include "TaskManager.h"
#include "Task.h"
@@ -79,6 +82,13 @@ bool TaskManager::addTaskBase(const sp<TaskBase>& task, const sp<TaskProcessorBa
// Thread
///////////////////////////////////////////////////////////////////////////////
+status_t TaskManager::WorkerThread::readyToRun() {
+#if defined(HAVE_PTHREADS)
+ setpriority(PRIO_PROCESS, 0, PRIORITY_FOREGROUND);
+#endif
+ return NO_ERROR;
+}
+
bool TaskManager::WorkerThread::threadLoop() {
mSignal.wait();
Vector<TaskWrapper> tasks;
diff --git a/libs/hwui/thread/TaskManager.h b/libs/hwui/thread/TaskManager.h
index f2a216f..5a933ab 100644
--- a/libs/hwui/thread/TaskManager.h
+++ b/libs/hwui/thread/TaskManager.h
@@ -84,6 +84,7 @@ private:
void exit();
private:
+ virtual status_t readyToRun();
virtual bool threadLoop();
// Lock for the list of tasks