From 31f6537535ff2f349e017495e91a571403b33102 Mon Sep 17 00:00:00 2001 From: Grant Yoshida Date: Fri, 12 Jul 2019 18:47:49 -0700 Subject: Add init.xr.rc. This was moved from device/google/crosshatch. Bug: 137238738 Test: Booted into Pixel XR. Change-Id: Icc8a7f5a97cc600b82b78d2c290bc10780a0a5ec Merged-In: Icc8a7f5a97cc600b82b78d2c290bc10780a0a5ec (cherry picked from commit 159c9e03599dd8392c3a1754167f0307f9ce1023) --- xr/init/init.xr.rc | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 xr/init/init.xr.rc diff --git a/xr/init/init.xr.rc b/xr/init/init.xr.rc new file mode 100644 index 0000000..d55201a --- /dev/null +++ b/xr/init/init.xr.rc @@ -0,0 +1,104 @@ +# +# 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 + + # 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 -- cgit v1.2.3 From e4a834e13b17847c4794801b3423cc3492ff0180 Mon Sep 17 00:00:00 2001 From: Jiwen 'Steve' Cai Date: Wed, 17 Jul 2019 11:19:28 -0700 Subject: Set ro.surface_flinger.use_vr_flinger for XR targets This is needed for SurfaceFlinger to load libvrflinger. Bug: 137325030 Test: Build and flash gsi_xr Change-Id: I52496660a7390c3650fda79345adde41a1ff45c6 --- xr/init/init.xr.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/xr/init/init.xr.rc b/xr/init/init.xr.rc index d55201a..57a8e63 100644 --- a/xr/init/init.xr.rc +++ b/xr/init/init.xr.rc @@ -19,6 +19,7 @@ on init # 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 -- cgit v1.2.3 From fe8d732e4049f9ec967638d18ac1e80bebbf4df8 Mon Sep 17 00:00:00 2001 From: Grant Yoshida Date: Wed, 7 Aug 2019 18:55:41 -0700 Subject: Add experimental_google_xr.mk to device/google/vrservices/xr/products. This is copied from /vendor/google/products. Bug: 139089383 Test: N/A Change-Id: I2ea0c11588de863ee739ded72021ea7f06326c69 --- xr/products/experimental_google_xr.mk | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 xr/products/experimental_google_xr.mk diff --git a/xr/products/experimental_google_xr.mk b/xr/products/experimental_google_xr.mk new file mode 100644 index 0000000..f05c35b --- /dev/null +++ b/xr/products/experimental_google_xr.mk @@ -0,0 +1,47 @@ +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.dvr.lens_metrics=vendor/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 += \ + vendor/unbundled_google/packages/PrebuiltGoogleVr/configs/daydream_viewer_config:$(TARGET_COPY_OUT_VENDOR)/etc/hmd_config \ + vendor/unbundled_google/packages/PrebuiltGoogleVr/scripts/boot-to-vr.sh:$(TARGET_COPY_OUT_VENDOR)/bin/boot-to-vr.sh \ + device/google/vrservices/xr/init/init.xr.rc:$(TARGET_COPY_OUT_SYSTEM)/etc/init/init.xr.rc \ + +# XR/VR prebuilt packages +PRODUCT_PACKAGES += \ + SetupWizardOverlay \ + VrHome \ + VrInputMethodIme \ + VrHeadsetPowerPolicy \ + pps-tool.sh \ + -- cgit v1.2.3 From cedffb4ec00b5dc9216cb7d48e375cd2ae33a5f8 Mon Sep 17 00:00:00 2001 From: Jiwen 'Steve' Cai Date: Fri, 9 Aug 2019 13:40:16 -0700 Subject: Copy XR config files to system image instead of vendor image Bug: 137033145 Test: Build and flash gsi_xr Change-Id: I1ec711c43a4740db25560d038691eac382d7df10 --- xr/products/experimental_google_xr.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xr/products/experimental_google_xr.mk b/xr/products/experimental_google_xr.mk index f05c35b..2f3c1a1 100644 --- a/xr/products/experimental_google_xr.mk +++ b/xr/products/experimental_google_xr.mk @@ -1,5 +1,5 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ - ro.dvr.lens_metrics=vendor/etc/hmd_config + ro.dvr.lens_metrics=/etc/hmd_config # SELinux permissions BOARD_SEPOLICY_DIRS += device/google/vrservices/xr/sepolicy @@ -33,9 +33,10 @@ PRODUCT_PROPERTY_OVERRIDES += ro.vendor.camera.external.hal3TrebleMinorVersion=5 PRODUCT_PACKAGES += NonXrProductPackagesRemover PRODUCT_COPY_FILES += \ - vendor/unbundled_google/packages/PrebuiltGoogleVr/configs/daydream_viewer_config:$(TARGET_COPY_OUT_VENDOR)/etc/hmd_config \ - vendor/unbundled_google/packages/PrebuiltGoogleVr/scripts/boot-to-vr.sh:$(TARGET_COPY_OUT_VENDOR)/bin/boot-to-vr.sh \ 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 += \ -- cgit v1.2.3