• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2019 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17on init
18    # Temporarily stop booting into VR directly due to battery drain.
19    # TODO(b/131327495): Re-enable this once VrHeadsetPowerPolicyService or its
20    #                    equivalent lands in Android master.
21    setprop ro.boot.vr 0
22    setprop ro.surface_flinger.use_vr_flinger 1
23    setprop persist.sys.vr.pluggy_enabled 1
24
25    # Setup cpusets used by the VR services.
26    mkdir /dev/cpuset/kernel 0750 root system
27    write /dev/cpuset/kernel/cpus 0
28    write /dev/cpuset/kernel/mems 0
29    chown system system /dev/cpuset/kernel/tasks
30    chown system system /dev/cpuset/kernel/cpus
31    chmod 0660 /dev/cpuset/kernel/tasks
32    chmod 0660 /dev/cpuset/kernel/cpus
33
34    mkdir /dev/cpuset/system 0750 root system
35    write /dev/cpuset/system/cpus 0
36    write /dev/cpuset/system/mems 0
37    chown system system /dev/cpuset/system/tasks
38    chmod 0660 /dev/cpuset/system/tasks
39
40    mkdir /dev/cpuset/system/performance 0750 root system
41    write /dev/cpuset/system/performance/cpus 0
42    write /dev/cpuset/system/performance/mems 0
43    chown system system /dev/cpuset/system/performance/tasks
44    chmod 0660 /dev/cpuset/system/performance/tasks
45
46    mkdir /dev/cpuset/system/background 0750 root system
47    write /dev/cpuset/system/background/cpus 0
48    write /dev/cpuset/system/background/mems 0
49    chown system system /dev/cpuset/system/background/tasks
50    chmod 0660 /dev/cpuset/system/background/tasks
51
52    mkdir /dev/cpuset/application 0750 root system
53    write /dev/cpuset/application/cpus 0
54    write /dev/cpuset/application/mems 0
55    chown system system /dev/cpuset/application/tasks
56    chmod 0660 /dev/cpuset/application/tasks
57
58    mkdir /dev/cpuset/application/performance 0750 root system
59    write /dev/cpuset/application/performance/cpus 0
60    write /dev/cpuset/application/performance/mems 0
61    chown system system /dev/cpuset/application/performance/tasks
62    chmod 0660 /dev/cpuset/application/performance/tasks
63
64    mkdir /dev/cpuset/application/background 0750 root system
65    write /dev/cpuset/application/background/cpus 0
66    write /dev/cpuset/application/background/mems 0
67    chown system system /dev/cpuset/application/background/tasks
68    chmod 0660 /dev/cpuset/application/background/tasks
69
70    # Create UDS structure for base VR services.
71    mkdir /dev/socket/pdx 0775 system system
72    mkdir /dev/socket/pdx/system 0775 system system
73    mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
74    mkdir /dev/socket/pdx/system/performance 0775 system system
75    mkdir /dev/socket/pdx/system/vr 0775 system system
76    mkdir /dev/socket/pdx/system/vr/display 0775 system system
77    mkdir /dev/socket/pdx/system/vr/pose 0775 system system
78    mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
79
80#
81# TODO(b/137410559): Remove this, it's specific to Snapdragon 845.
82#
83on boot
84    # Update DVR cpusets to boot-time values.
85    write /dev/cpuset/kernel/cpus 0-7
86    write /dev/cpuset/system/cpus 0-7
87    write /dev/cpuset/system/performance/cpus 0-7
88    write /dev/cpuset/system/background/cpus 0-7
89    write /dev/cpuset/system/cpus 0-7
90    write /dev/cpuset/application/cpus 0-7
91    write /dev/cpuset/application/performance/cpus 0-7
92    write /dev/cpuset/application/background/cpus 0-7
93    write /dev/cpuset/application/cpus 0-7
94
95#
96# TODO(b/137410559): Remove this, it's specific to Snapdragon 845.
97#
98on property:sys.boot_completed=1
99    # Update DVR cpusets to runtime values.
100    # Kernel cpuset will be apply on PowerHAL
101    write /dev/cpuset/system/performance/cpus 6-7
102    write /dev/cpuset/system/background/cpus 0-1
103    write /dev/cpuset/system/cpus 0-1,6-7
104    write /dev/cpuset/application/performance/cpus 4-5
105    write /dev/cpuset/application/background/cpus 0-1
106    write /dev/cpuset/application/cpus 0-1,4-5
107