summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-08-10 23:09:52 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-10 23:09:52 +0000
commit53263e475f4b664b35a9045e7591c64249c0a4ef (patch)
tree1c2af030b9da0149906b9e8628cb3e1a3e4d2b29
parentfad0891c305d31c231215eb4230c2a57043789db (diff)
parent4b77d124bfe037ac8a7b8da78b38b745887c93e3 (diff)
downloaddevice_google_vrservices-53263e475f4b664b35a9045e7591c64249c0a4ef.tar.gz
device_google_vrservices-53263e475f4b664b35a9045e7591c64249c0a4ef.tar.bz2
device_google_vrservices-53263e475f4b664b35a9045e7591c64249c0a4ef.zip
Snap for 5794878 from 4b77d124bfe037ac8a7b8da78b38b745887c93e3 to rvc-release
Change-Id: I848f8b711cef34d8993c42b60de4415d136b4b5b
-rw-r--r--xr/init/init.xr.rc105
-rw-r--r--xr/products/experimental_google_xr.mk48
2 files changed, 153 insertions, 0 deletions
diff --git a/xr/init/init.xr.rc b/xr/init/init.xr.rc
new file mode 100644
index 0000000..57a8e63
--- /dev/null
+++ b/xr/init/init.xr.rc
@@ -0,0 +1,105 @@
+#
+# Copyright (C) 2019 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+on init
+ # Temporarily stop booting into VR directly due to battery drain.
+ # TODO(b/131327495): Re-enable this once VrHeadsetPowerPolicyService or its
+ # equivalent lands in Android master.
+ setprop ro.boot.vr 0
+ setprop ro.surface_flinger.use_vr_flinger 1
+
+ # Setup cpusets used by the VR services.
+ mkdir /dev/cpuset/kernel 0750 root system
+ write /dev/cpuset/kernel/cpus 0
+ write /dev/cpuset/kernel/mems 0
+ chown system system /dev/cpuset/kernel/tasks
+ chown system system /dev/cpuset/kernel/cpus
+ chmod 0660 /dev/cpuset/kernel/tasks
+ chmod 0660 /dev/cpuset/kernel/cpus
+
+ mkdir /dev/cpuset/system 0750 root system
+ write /dev/cpuset/system/cpus 0
+ write /dev/cpuset/system/mems 0
+ chown system system /dev/cpuset/system/tasks
+ chmod 0660 /dev/cpuset/system/tasks
+
+ mkdir /dev/cpuset/system/performance 0750 root system
+ write /dev/cpuset/system/performance/cpus 0
+ write /dev/cpuset/system/performance/mems 0
+ chown system system /dev/cpuset/system/performance/tasks
+ chmod 0660 /dev/cpuset/system/performance/tasks
+
+ mkdir /dev/cpuset/system/background 0750 root system
+ write /dev/cpuset/system/background/cpus 0
+ write /dev/cpuset/system/background/mems 0
+ chown system system /dev/cpuset/system/background/tasks
+ chmod 0660 /dev/cpuset/system/background/tasks
+
+ mkdir /dev/cpuset/application 0750 root system
+ write /dev/cpuset/application/cpus 0
+ write /dev/cpuset/application/mems 0
+ chown system system /dev/cpuset/application/tasks
+ chmod 0660 /dev/cpuset/application/tasks
+
+ mkdir /dev/cpuset/application/performance 0750 root system
+ write /dev/cpuset/application/performance/cpus 0
+ write /dev/cpuset/application/performance/mems 0
+ chown system system /dev/cpuset/application/performance/tasks
+ chmod 0660 /dev/cpuset/application/performance/tasks
+
+ mkdir /dev/cpuset/application/background 0750 root system
+ write /dev/cpuset/application/background/cpus 0
+ write /dev/cpuset/application/background/mems 0
+ chown system system /dev/cpuset/application/background/tasks
+ chmod 0660 /dev/cpuset/application/background/tasks
+
+ # Create UDS structure for base VR services.
+ mkdir /dev/socket/pdx 0775 system system
+ mkdir /dev/socket/pdx/system 0775 system system
+ mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
+ mkdir /dev/socket/pdx/system/performance 0775 system system
+ mkdir /dev/socket/pdx/system/vr 0775 system system
+ mkdir /dev/socket/pdx/system/vr/display 0775 system system
+ mkdir /dev/socket/pdx/system/vr/pose 0775 system system
+ mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
+
+#
+# TODO(b/137410559): Remove this, it's specific to Snapdragon 845.
+#
+on boot
+ # Update DVR cpusets to boot-time values.
+ write /dev/cpuset/kernel/cpus 0-7
+ write /dev/cpuset/system/cpus 0-7
+ write /dev/cpuset/system/performance/cpus 0-7
+ write /dev/cpuset/system/background/cpus 0-7
+ write /dev/cpuset/system/cpus 0-7
+ write /dev/cpuset/application/cpus 0-7
+ write /dev/cpuset/application/performance/cpus 0-7
+ write /dev/cpuset/application/background/cpus 0-7
+ write /dev/cpuset/application/cpus 0-7
+
+#
+# TODO(b/137410559): Remove this, it's specific to Snapdragon 845.
+#
+on property:sys.boot_completed=1
+ # Update DVR cpusets to runtime values.
+ # Kernel cpuset will be apply on PowerHAL
+ write /dev/cpuset/system/performance/cpus 6-7
+ write /dev/cpuset/system/background/cpus 0-1
+ write /dev/cpuset/system/cpus 0-1,6-7
+ write /dev/cpuset/application/performance/cpus 4-5
+ write /dev/cpuset/application/background/cpus 0-1
+ write /dev/cpuset/application/cpus 0-1,4-5
diff --git a/xr/products/experimental_google_xr.mk b/xr/products/experimental_google_xr.mk
new file mode 100644
index 0000000..2f3c1a1
--- /dev/null
+++ b/xr/products/experimental_google_xr.mk
@@ -0,0 +1,48 @@
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ ro.dvr.lens_metrics=/etc/hmd_config
+
+# SELinux permissions
+BOARD_SEPOLICY_DIRS += device/google/vrservices/xr/sepolicy
+
+# Remove non-critical and non-XR packages from PRODUCT_PACKAGES.
+#
+# Overrides (i.e. removes) packages that are bundled into the system/product
+# image for smartphone use cases. We are removing those packages for two
+# reasons:
+# 1) Pixel devices' system/product image are almost out of disk spaces. It has
+# been hard for us to bundle the AIO flavored VrCore into the their system
+# image. Removing some of the packages free up enough disk spaces for XR use
+# cases.
+# 2) Removing those packages won't impact the functionality of the device. More
+# specifically, those package meet the following requirements:
+# i) they are not critical packages for XR use cases; and ii) can still be
+# install from Play Store if ever needed.
+# For certain packages, removing those packages are actually beneficial. For
+# example, the WallpapersBReel201* packages introduced unnecessary GPU load
+# for the system. Disabling those packages frees some GPU resources to XR use
+# cases and improves the accuracy of our GPU performance profiling.
+
+# External camera libraries.
+# There is no need to add extra SELinux policy for external cameras
+# because our devices do not run Trebel passthrough mode.
+PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-impl
+PRODUCT_PACKAGES += android.hardware.camera.provider@2.4-external-service
+# Use webcam camera device@3.5
+PRODUCT_PROPERTY_OVERRIDES += ro.vendor.camera.external.hal3TrebleMinorVersion=5
+
+PRODUCT_PACKAGES += NonXrProductPackagesRemover
+
+PRODUCT_COPY_FILES += \
+ device/google/vrservices/xr/init/init.xr.rc:$(TARGET_COPY_OUT_SYSTEM)/etc/init/init.xr.rc \
+ frameworks/native/data/etc/android.hardware.vr.high_performance.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/android.hardware.vr.high_performance.xml \
+ vendor/unbundled_google/packages/PrebuiltGoogleVr/configs/daydream_viewer_config:$(TARGET_COPY_OUT_SYSTEM)/etc/hmd_config \
+ vendor/unbundled_google/packages/PrebuiltGoogleVr/scripts/boot-to-vr.sh:$(TARGET_COPY_OUT_SYSTEM)/bin/boot-to-vr.sh \
+
+# XR/VR prebuilt packages
+PRODUCT_PACKAGES += \
+ SetupWizardOverlay \
+ VrHome \
+ VrInputMethodIme \
+ VrHeadsetPowerPolicy \
+ pps-tool.sh \
+