summaryrefslogtreecommitdiffstats
path: root/media/utils/SchedulingPolicyService.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2018-04-17 14:14:31 -0700
committerChong Zhang <chz@google.com>2018-04-18 13:46:03 -0700
commit79d2b28f3a04d7914bb932a65d87117c0c7c11cf (patch)
tree386c0e23123c52191f3c098351898cd6a0bdb4bf /media/utils/SchedulingPolicyService.cpp
parent1cdd674121096020f7f17c216940a14aa58ff31e (diff)
downloadframeworks_av-79d2b28f3a04d7914bb932a65d87117c0c7c11cf.tar.gz
frameworks_av-79d2b28f3a04d7914bb932a65d87117c0c7c11cf.tar.bz2
frameworks_av-79d2b28f3a04d7914bb932a65d87117c0c7c11cf.zip
Request cpuset change for 1080p HDR using soft decoder
Keep track of cpuset change requests in ResourceManagerService, and request changing of cpuset via SchedulingPolicyService. Bug: 72841545 Test: 1)Using modified Youtube/Exoplayer (that uses softMediaCodec to decode VP9 profile2), manually verify the following: - media.codec is put into top-app cpuset playing VP9 1080p HDR - media.codec is put back into foreground after done - media.codec stays in foreground cpuset playing other content - kill the app process, verify media.codec is put back to foreground until new instances request top-app - kill mediaserver process, verify media.codec is put back to foreground until new instances request top-app - kill media.codec process, starting playback again, verify new media.codec's cpuset can be changed correctly - kill system_server process (using 'adb shell stop && adb shell start'), verify media.codec is put back to foreground. Restart playback and verify the cpuset can be changed correctly. 2) CTS post submit tests Change-Id: Iba50ede1c08b695821fe4f56dbfc5694eab54e7b
Diffstat (limited to 'media/utils/SchedulingPolicyService.cpp')
-rw-r--r--media/utils/SchedulingPolicyService.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/media/utils/SchedulingPolicyService.cpp b/media/utils/SchedulingPolicyService.cpp
index d7055ef9a1..4e9792fc7b 100644
--- a/media/utils/SchedulingPolicyService.cpp
+++ b/media/utils/SchedulingPolicyService.cpp
@@ -59,4 +59,31 @@ int requestPriority(pid_t pid, pid_t tid, int32_t prio, bool isForApp, bool asyn
return ret;
}
+int requestCpusetBoost(bool enable, const sp<IInterface> &client)
+{
+ int ret;
+ sMutex.lock();
+ sp<ISchedulingPolicyService> sps = sSchedulingPolicyService;
+ sMutex.unlock();
+ if (sps == 0) {
+ sp<IBinder> binder = defaultServiceManager()->checkService(_scheduling_policy);
+ if (binder == 0) {
+ return DEAD_OBJECT;
+ }
+ sps = interface_cast<ISchedulingPolicyService>(binder);
+ sMutex.lock();
+ sSchedulingPolicyService = sps;
+ sMutex.unlock();
+ }
+ ret = sps->requestCpusetBoost(enable, client);
+ if (ret != DEAD_OBJECT) {
+ return ret;
+ }
+ ALOGW("SchedulingPolicyService died");
+ sMutex.lock();
+ sSchedulingPolicyService.clear();
+ sMutex.unlock();
+ return ret;
+}
+
} // namespace android