diff --git a/conf/init.factory.rc b/conf/init.factory.rc index 42a1ad15..409ab1a5 100644 --- a/conf/init.factory.rc +++ b/conf/init.factory.rc @@ -12,3 +12,8 @@ on boot # Audio test folder mkdir /data/AudioTest 0775 system system + +on property:sys.boot_completed=1 + # Bump nnapi min clamp & add adbd to it for factory (b/222226268) + write /sys/kernel/vendor_sched/nnapi_uclamp_min 512 + exec - system system -- /vendor/bin/factory/factory_post_boot diff --git a/device.mk b/device.mk index c928b3c8..2a23dbb0 100644 --- a/device.mk +++ b/device.mk @@ -153,50 +153,52 @@ endif USE_SWIFTSHADER := false # HWUI -TARGET_USES_VULKAN = false +TARGET_USES_VULKAN = true -PRODUCT_SOONG_NAMESPACES += vendor/arm/mali/valhall +PRODUCT_SOONG_NAMESPACES += \ + vendor/arm/mali/valhall $(call soong_config_set,pixel_mali,soc,$(TARGET_BOARD_PLATFORM)) +include device/google/gs101/neuralnetwork/neuralnetwork.mk + PRODUCT_PACKAGES += \ - csffw_image_prebuilt__firmware_prebuilt_todx_mali_csffw.bin \ - libGLES_mali \ - vulkan.mali \ - libOpenCL \ - libgpudataproducer \ + csffw_image_prebuilt__firmware_prebuilt_todx_mali_csffw.bin \ + libGLES_mali \ + vulkan.mali \ + libOpenCL \ + libgpudataproducer \ PRODUCT_VENDOR_PROPERTIES += \ - ro.hardware.vulkan=mali - -include device/google/gs101/neuralnetwork/neuralnetwork.mk + ro.hardware.vulkan=mali ifeq ($(USE_SWIFTSHADER),true) PRODUCT_PACKAGES += \ - libGLESv1_CM_swiftshader \ - libEGL_swiftshader \ - libGLESv2_swiftshader + libGLESv1_CM_swiftshader \ + libEGL_swiftshader \ + libGLESv2_swiftshader endif PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \ - frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ - frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ - frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \ - frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ - frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml + frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \ + frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \ + frameworks/native/data/etc/android.hardware.vulkan.level-1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \ + frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \ + frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \ + frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml ifeq ($(USE_SWIFTSHADER),true) PRODUCT_VENDOR_PROPERTIES += \ - ro.hardware.egl = swiftshader + ro.hardware.egl = swiftshader else PRODUCT_VENDOR_PROPERTIES += \ - ro.hardware.egl = mali + ro.hardware.egl = mali endif + PRODUCT_VENDOR_PROPERTIES += \ - ro.opengles.version=196610 \ - debug.renderengine.backend=skiaglthreaded \ - graphics.gpu.profiler.support=true \ + ro.opengles.version=196610 \ + graphics.gpu.profiler.support=true \ + debug.renderengine.backend=skiaglthreaded \ # GRAPHICS - GPU (end) # #################### diff --git a/factory/factory_post_boot/Android.bp b/factory/factory_post_boot/Android.bp new file mode 100644 index 00000000..cbbebda4 --- /dev/null +++ b/factory/factory_post_boot/Android.bp @@ -0,0 +1,25 @@ +// +// Copyright (C) 2022 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. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} +sh_binary { + name: "factory_post_boot", + src: "factory_post_boot.sh", + vendor: true, + sub_dir: "factory", +} + diff --git a/factory/factory_post_boot/factory_post_boot.sh b/factory/factory_post_boot/factory_post_boot.sh new file mode 100644 index 00000000..f610901a --- /dev/null +++ b/factory/factory_post_boot/factory_post_boot.sh @@ -0,0 +1,4 @@ +#!/vendor/bin/sh + +# Add adbd to nnapi vendor cgroup. (b/222226268) +echo `pidof adbd` > /sys/kernel/vendor_sched/set_task_group_nnapi diff --git a/factory_common.mk b/factory_common.mk index 0e2fd5c2..4a5d42bd 100644 --- a/factory_common.mk +++ b/factory_common.mk @@ -63,11 +63,14 @@ DEVICE_PACKAGE_OVERLAYS += device/google/gs201/overlay-factory PRODUCT_COPY_FILES += \ device/google/gs201/conf/init.factory.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.factory.rc +BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/factory_boost + # Add factory-friendly changes PRODUCT_PACKAGES += \ FactoryOverlaySettings \ FactoryOverlayLauncher3 \ - FactoryOverlayFrameworkRes + FactoryOverlayFrameworkRes \ + factory_post_boot # To prevent rebooting due to crashing services PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ diff --git a/media_codecs_aosp_c2.xml b/media_codecs_aosp_c2.xml index 3ab41a47..62b47070 100644 --- a/media_codecs_aosp_c2.xml +++ b/media_codecs_aosp_c2.xml @@ -115,7 +115,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -214,7 +214,7 @@ - +