diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index d9225250..a559346c 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -32,15 +32,6 @@ TARGET_CPU_ABI := arm64-v8a TARGET_CPU_VARIANT := generic TARGET_CPU_VARIANT_RUNTIME := cortex-a53 -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) -TARGET_2ND_ARCH := arm -TARGET_2ND_ARCH_VARIANT := armv8-a -TARGET_2ND_CPU_ABI := armeabi-v7a -TARGET_2ND_CPU_ABI2 := armeabi -TARGET_2ND_CPU_VARIANT := generic -TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53 -endif - BOARD_KERNEL_CMDLINE += dyndbg=\"func alloc_contig_dump_pages +p\" BOARD_KERNEL_CMDLINE += earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on BOARD_KERNEL_CMDLINE += cma_sysfs.experimental=Y @@ -58,12 +49,7 @@ TARGET_RECOVERY_WIPE := device/google/gs201/conf/recovery.wipe # This is the fstab file that will be included in the recovery image. Note that # recovery doesn't care about the encryption settings, so it doesn't matter # whether we use the normal or the fips fstab here. -# -# Since this is a generated file, it's necessary to use intermediates-dir-for in -# order to refer to it correctly. And since intermediates-dir-for isn't defined -# yet when this file is included, it's necessary to use a deferred variable -# assignment ( = ) rather than an immediate variable assignment ( := ). -TARGET_RECOVERY_FSTAB = $(call intermediates-dir-for,ETC,fstab.gs201)/fstab.gs201 +TARGET_RECOVERY_FSTAB_GENRULE := gen_fstab.gs201 TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888 TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165 @@ -89,6 +75,9 @@ endif ifneq ($(PRODUCT_BUILD_VBMETA_IMAGE),false) AB_OTA_PARTITIONS += vbmeta endif +ifneq ($(PRODUCT_BUILD_PVMFW_IMAGE),false) +AB_OTA_PARTITIONS += pvmfw +endif # EMULATOR common modules BOARD_EMULATOR_COMMON_MODULES := liblight @@ -108,40 +97,28 @@ BOARD_USES_SWIFTSHADER := false # Gralloc4 ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) -SOONG_CONFIG_NAMESPACES += arm_gralloc -SOONG_CONFIG_arm_gralloc := \ - gralloc_arm_no_external_afbc \ - mali_gpu_support_afbc_basic \ - mali_gpu_support_afbc_wideblk \ - gralloc_init_afbc \ - gralloc_ion_sync_on_lock \ - dpu_support_1010102_afbc ifeq ($(BOARD_USES_SWIFTSHADER),true) -SOONG_CONFIG_arm_gralloc_gralloc_arm_no_external_afbc := true -SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_basic := false -SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_wideblk := false -SOONG_CONFIG_arm_gralloc_gralloc_init_afbc := false -SOONG_CONFIG_arm_gralloc_dpu_support_1010102_afbc := false +$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,true) +$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,false) +$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,false) +$(call soong_config_set,arm_gralloc,gralloc_init_afbc,false) +$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,false) else -SOONG_CONFIG_arm_gralloc_gralloc_arm_no_external_afbc := false -SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_basic := true -SOONG_CONFIG_arm_gralloc_mali_gpu_support_afbc_wideblk := true -SOONG_CONFIG_arm_gralloc_gralloc_init_afbc := true -SOONG_CONFIG_arm_gralloc_dpu_support_1010102_afbc := true +$(call soong_config_set,arm_gralloc,gralloc_arm_no_external_afbc,false) +$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_basic,true) +$(call soong_config_set,arm_gralloc,mali_gpu_support_afbc_wideblk,true) +$(call soong_config_set,arm_gralloc,gralloc_init_afbc,true) +$(call soong_config_set,arm_gralloc,dpu_support_1010102_afbc,true) endif # ifeq ($(BOARD_USES_SWIFTSHADER),true) -SOONG_CONFIG_arm_gralloc_gralloc_ion_sync_on_lock := $(BOARD_USES_GRALLOC_ION_SYNC) +$(call soong_config_set,arm_gralloc,gralloc_ion_sync_on_lock,$(BOARD_USES_GRALLOC_ION_SYNC)) endif # ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) # libVendorGraphicbuffer -SOONG_CONFIG_NAMESPACES += vendorgraphicbuffer -SOONG_CONFIG_vendorgraphicbuffer := \ - gralloc_version - ifeq ($(BOARD_USES_EXYNOS_GRALLOC_VERSION),4) -SOONG_CONFIG_vendorgraphicbuffer_gralloc_version := four +$(call soong_config_set,vendorgraphicbuffer,gralloc_version,four) else -SOONG_CONFIG_vendorgraphicbuffer_gralloc_version := three +$(call soong_config_set,vendorgraphicbuffer,gralloc_version,three) endif # Graphics @@ -212,28 +189,16 @@ BOARD_SUPER_PARTITION_ERROR_LIMIT := 8006926336 # BOARD_USES_GENERIC_AUDIO := true -SOONG_CONFIG_NAMESPACES += aoc_audio_func - -SOONG_CONFIG_aoc_audio_func += \ - ext_hidl - -SOONG_CONFIG_aoc_audio_func_ext_hidl := true +$(call soong_config_set,aoc_audio_func,ext_hidl,true) ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) -SOONG_CONFIG_aoc_audio_func += \ - dump_usecase_data \ - hal_socket_control \ - record_tunning_keys - -SOONG_CONFIG_aoc_audio_func_dump_usecase_data := true -SOONG_CONFIG_aoc_audio_func_hal_socket_control := true -SOONG_CONFIG_aoc_audio_func_record_tunning_keys := true +$(call soong_config_set,aoc_audio_func,dump_usecase_data,true) +$(call soong_config_set,aoc_audio_func,hal_socket_control,true) +$(call soong_config_set,aoc_audio_func,record_tunning_keys,true) endif ifneq (,$(filter aosp_%,$(TARGET_PRODUCT))) -SOONG_CONFIG_aoc_audio_func += aosp_build - -SOONG_CONFIG_aoc_audio_func_aosp_build := true +$(call soong_config_set,aoc_audio_func,aosp_build,true) endif # Primary AudioHAL Configuration @@ -379,11 +344,11 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := false # Vendor ramdisk image for kernel development BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true -BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := device/google/gs201/vendor_dlkm.blocklist - KERNEL_MODULE_DIR := $(TARGET_KERNEL_DIR) KERNEL_MODULES := $(wildcard $(KERNEL_MODULE_DIR)/*.ko) +BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_MODULE_DIR)/vendor_dlkm.modules.blocklist + BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_MODULE_DIR)/vendor_boot.modules.load)) ifndef BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD $(error vendor_boot.modules.load not found or empty) @@ -406,3 +371,6 @@ BOARD_KERNEL_CMDLINE += at24.write_timeout=100 # Enable larger logbuf BOARD_KERNEL_CMDLINE += log_buf_len=1024K + +# Protected VM firmware +BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000 diff --git a/CleanSpec.mk b/CleanSpec.mk index 41840d75..34323de4 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -77,3 +77,9 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.h $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.power.stats@1.0-service.gs201) $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/init/android.hardware.power.stats@1.0-service.gs201.rc) $(call add-clean-step, rm -f $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.power.stats@1.0-service.gs201.xml) + +# Health HAL to AIDL +$(call add-clean-step, find $(PRODUCT_OUT)/system -type f -name "*charger*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/vendor -type f -name "*health@*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*charger*" -print0 | xargs -0 rm -f) +$(call add-clean-step, find $(PRODUCT_OUT)/recovery/root -type f -name "*health@*" -print0 | xargs -0 rm -f) diff --git a/aosp_common.mk b/aosp_common.mk index e2d5d432..52ea5974 100644 --- a/aosp_common.mk +++ b/aosp_common.mk @@ -17,11 +17,7 @@ # # All components inherited here go to system image # -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -else $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) -endif $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk) # Enable CSI checking diff --git a/conf/fstab.gs201.in b/conf/fstab.gs201.in index f17c23a2..8d7ee918 100644 --- a/conf/fstab.gs201.in +++ b/conf/fstab.gs201.in @@ -5,9 +5,9 @@ # # system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,readahead_size_kb=128 -system_ext /system_ext erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount -product /product erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount -vendor /vendor erofs ro wait,slotselect,avb=vbmeta_vendor,logical,first_stage_mount +system_ext /system_ext erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,readahead_size_kb=128 +product /product erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,readahead_size_kb=128 +vendor /vendor erofs ro wait,slotselect,avb=vbmeta_vendor,logical,first_stage_mount,readahead_size_kb=128 vendor_dlkm /vendor_dlkm erofs ro wait,slotselect,avb=vbmeta,logical,first_stage_mount /dev/block/platform/14700000.ufs/by-name/boot /boot emmc defaults slotselect,avb=boot,first_stage_mount /dev/block/platform/14700000.ufs/by-name/efs /mnt/vendor/efs f2fs noatime,sync wait,check,formattable @@ -19,5 +19,4 @@ vendor_dlkm /vendor_dlkm #/dev/block/platform/14700000.ufs/by-name/pvmfw /pvmfw emmc defaults wait,slotselect,avb=pvmfw,first_stage_mount /dev/block/platform/14700000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt,compress_extension=apk,compress_extension=apex,compress_extension=so,compress_extension=vdex,compress_extension=odex,atgc,checkpoint_merge latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fileencryption=@fileencryption@,metadata_encryption=@metadata_encryption@,keydirectory=/metadata/vold/metadata_encryption,fscompress,readahead_size_kb=128 /dev/block/platform/14700000.ufs/by-name/vbmeta /vbmeta emmc defaults slotselect,first_stage_mount -/dev/block/zram0 none swap defaults zramsize=2147483648,max_comp_streams=8,zram_backingdev_size=512M /devices/platform/11210000.usb* auto vfat defaults voldmanaged=usb:auto diff --git a/conf/init.debug.rc b/conf/init.debug.rc index bd212736..282acd40 100644 --- a/conf/init.debug.rc +++ b/conf/init.debug.rc @@ -30,4 +30,4 @@ on property:power.battery_input.suspended=false # Bluetooth on post-fs-data chown bluetooth system /dev/logbuffer_btlpm - chown bluetooth system /dev/logbuffer_tty16 + chown bluetooth system /dev/logbuffer_tty18 diff --git a/conf/init.gs201.rc b/conf/init.gs201.rc index 5dbdc40d..7183af01 100644 --- a/conf/init.gs201.rc +++ b/conf/init.gs201.rc @@ -2,30 +2,7 @@ import /vendor/etc/init/hw/init.gs201.usb.rc import android.hardware.drm@1.2-service.widevine.rc import init.exynos.sensorhub.rc -service vendor.charger /system/bin/charger - class charger - seclabel u:r:charger:s0 - user system - group system wakelock input - capabilities SYS_BOOT - file /dev/kmsg w - file /sys/fs/pstore/console-ramoops-0 r - file /sys/fs/pstore/console-ramoops r - file /proc/last_kmsg r - on early-init - # Convert /dev/block/by-name/persist to f2fs - exec -- /vendor/bin/convert_to_f2fs.sh /dev/block/by-name/persist false - - # Format /efs to f2fs, if it's ext4 - exec -- /vendor/bin/convert_to_f2fs.sh /dev/block/by-name/efs true - - # Format /efs_backup to f2fs, if it's ext4 - exec -- /vendor/bin/convert_to_f2fs.sh /dev/block/by-name/efs_backup true - - # Format /modem_userdata to f2fs, if it's ext4 - exec -- /vendor/bin/convert_to_f2fs.sh /dev/block/by-name/modem_userdata true - mount_all /vendor/etc/fstab.persist --early on init @@ -40,6 +17,30 @@ on init write /dev/sys/fs/by-name/userdata/data_io_flag 56 write /dev/sys/fs/by-name/userdata/node_io_flag 56 + chown system system /sys/kernel/vendor_sched/set_task_group_bg + chown system system /sys/kernel/vendor_sched/set_task_group_cam + chown system system /sys/kernel/vendor_sched/set_task_group_fg + chown system system /sys/kernel/vendor_sched/set_task_group_nnapi + chown system system /sys/kernel/vendor_sched/set_task_group_sys + chown system system /sys/kernel/vendor_sched/set_task_group_sysbg + chown system system /sys/kernel/vendor_sched/set_task_group_ta + chown system system /sys/kernel/vendor_sched/set_task_group_rt + chown system system /sys/kernel/vendor_sched/set_task_group_sf + chown system system /sys/kernel/vendor_sched/set_task_group_dex2oat + chown system system /sys/kernel/vendor_sched/clear_group + + chmod 0220 /sys/kernel/vendor_sched/set_task_group_bg + chmod 0220 /sys/kernel/vendor_sched/set_task_group_cam + chmod 0220 /sys/kernel/vendor_sched/set_task_group_fg + chmod 0220 /sys/kernel/vendor_sched/set_task_group_nnapi + chmod 0220 /sys/kernel/vendor_sched/set_task_group_sys + chmod 0220 /sys/kernel/vendor_sched/set_task_group_sysbg + chmod 0220 /sys/kernel/vendor_sched/set_task_group_ta + chmod 0220 /sys/kernel/vendor_sched/set_task_group_rt + chmod 0220 /sys/kernel/vendor_sched/set_task_group_sf + chmod 0220 /sys/kernel/vendor_sched/set_task_group_dex2oat + chmod 0220 /sys/kernel/vendor_sched/clear_group + wait /dev/block/platform/${ro.boot.boot_devices} symlink /dev/block/platform/${ro.boot.boot_devices} /dev/block/bootdevice @@ -76,7 +77,7 @@ on init write /proc/sys/net/core/optmem_max 20480 write /proc/sys/net/core/netdev_max_backlog 10000 write /proc/sys/net/ipv4/tcp_rmem "2097152 4194304 8388608" - write /proc/sys/net/ipv4/tcp_wmem "262144 524288 1048576" + write /proc/sys/net/ipv4/tcp_wmem "262144 524288 8388608" write /proc/sys/net/ipv4/tcp_mem "44259 59012 88518" write /proc/sys/net/ipv4/udp_mem "88518 118025 177036" @@ -100,20 +101,18 @@ on init mkdir /dev/socket/pdx/system/vr/sensors 0775 system system # Boot time 183626384 - write /dev/cpuctl/top-app/cpu.uclamp.min 30 - write /dev/cpuctl/top-app/cpu.uclamp.latency_sensitive 1 - write /dev/cpuctl/foreground/cpu.uclamp.min 30 - write /dev/cpuctl/foreground/cpu.uclamp.latency_sensitive 1 - - write /sys/kernel/vendor_sched/ta_uclamp_min 308 + write /sys/kernel/vendor_sched/ta_uclamp_min 1024 write /sys/kernel/vendor_sched/ta_prefer_idle 1 - write /sys/kernel/vendor_sched/fg_uclamp_min 308 + write /sys/kernel/vendor_sched/fg_uclamp_min 1024 write /sys/kernel/vendor_sched/fg_prefer_idle 1 + write /sys/kernel/vendor_sched/sys_uclamp_min 1024 + write /sys/kernel/vendor_sched/sys_prefer_idle 1 # governor setting write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/up_rate_limit_us 500 - write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 2000 + write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 5000 + write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_scale_pow 2 write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor sched_pixel write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/up_rate_limit_us 500 write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us 20000 @@ -149,7 +148,7 @@ on init chmod 0664 /dev/cpuset/camera-daemon-mid-high-group/tasks write /sys/kernel/vendor_sched/cam_prefer_idle 1 - write /sys/kernel/vendor_sched/cam_uclamp_min 10 + write /sys/kernel/vendor_sched/cam_uclamp_min 1 chown system system /dev/cpuset/cgroup.procs @@ -255,8 +254,8 @@ on init start watchdogd # Add a boost for NNAPI HAL - write /dev/cpuctl/nnapi-hal/cpu.uclamp.min 15 - write /sys/kernel/vendor_sched/nnapi_uclamp_min 154 + write /sys/kernel/vendor_sched/nnapi_prefer_idle 0 + write /sys/kernel/vendor_sched/nnapi_uclamp_min 512 # Add memlat governor settings write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/polling_interval 10 @@ -280,17 +279,12 @@ on init on init setprop vendor.device.modules.ready 1 -on init && property:ro.boot.hw.soc.rev=0 - setprop vendor.powerhal.config powerhint_a0.json - -on init && property:ro.boot.hw.soc.rev=1 - setprop vendor.powerhal.config powerhint_a1.json - on late-fs # Wait for keymaster HALs exec_start wait_for_keymaster # Start bootanimation class before mount + start bootanim class_start animation # Mount RW partitions which need run fsck @@ -374,6 +368,7 @@ on post-fs-data on zygote-start # For PixelLogger configuration file. chmod 0771 /data/vendor/wifi + write /sys/kernel/vendor_sched/sys_uclamp_min 0 on post-fs-data # Create the directories used by the Wireless subsystem @@ -513,28 +508,31 @@ on fs chown system system /sys/class/backlight/panel0-backlight/hbm_mode chown system system /sys/class/backlight/panel0-backlight/local_hbm_mode chown system system /sys/devices/platform/exynos-drm/primary-panel/gamma + chown system system /sys/devices/platform/exynos-drm/primary-panel/min_vrefresh + chown system system /sys/devices/platform/exynos-drm/primary-panel/idle_delay_ms chown system system /sys/module/drm/parameters/vblankoffdelay - chown system system /sys/class/dqe/atc/ambient_light - chown system system /sys/class/dqe/atc/st - chown system system /sys/class/dqe/atc/en - chown system system /sys/class/dqe/atc/lt - chown system system /sys/class/dqe/atc/ns - chown system system /sys/class/dqe/atc/dither - chown system system /sys/class/dqe/atc/pl_w1 - chown system system /sys/class/dqe/atc/pl_w2 - chown system system /sys/class/dqe/atc/ctmode - chown system system /sys/class/dqe/atc/pp_en - chown system system /sys/class/dqe/atc/upgrade_on - chown system system /sys/class/dqe/atc/tdr_max - chown system system /sys/class/dqe/atc/tdr_min - chown system system /sys/class/dqe/atc/back_light - chown system system /sys/class/dqe/atc/dstep - chown system system /sys/class/dqe/atc/scale_mode - chown system system /sys/class/dqe/atc/threshold_1 - chown system system /sys/class/dqe/atc/threshold_2 - chown system system /sys/class/dqe/atc/threshold_3 - chown system system /sys/class/dqe/atc/gain_limit - chown system system /sys/class/dqe/atc/lt_calc_ab_shift + chown system system /sys/class/dqe0/atc/ambient_light + chown system system /sys/class/dqe0/atc/st + chown system system /sys/class/dqe0/atc/en + chown system system /sys/class/dqe0/atc/lt + chown system system /sys/class/dqe0/atc/ns + chown system system /sys/class/dqe0/atc/dither + chown system system /sys/class/dqe0/atc/pl_w1 + chown system system /sys/class/dqe0/atc/pl_w2 + chown system system /sys/class/dqe0/atc/ctmode + chown system system /sys/class/dqe0/atc/pp_en + chown system system /sys/class/dqe0/atc/upgrade_on + chown system system /sys/class/dqe0/atc/tdr_max + chown system system /sys/class/dqe0/atc/tdr_min + chown system system /sys/class/dqe0/atc/back_light + chown system system /sys/class/dqe0/atc/dstep + chown system system /sys/class/dqe0/atc/scale_mode + chown system system /sys/class/dqe0/atc/threshold_1 + chown system system /sys/class/dqe0/atc/threshold_2 + chown system system /sys/class/dqe0/atc/threshold_3 + chown system system /sys/class/dqe0/atc/gain_limit + chown system system /sys/class/dqe0/atc/lt_calc_ab_shift + chown system system /sys/devices/platform/1c240000.drmdecon/early_wakeup chmod 0220 /sys/devices/platform/1c240000.drmdecon/early_wakeup chown system system /sys/devices/platform/1c242000.drmdecon/early_wakeup @@ -637,7 +635,7 @@ on property:sys.boot_completed=1 # Runtime fs tuning write /sys/block/sda/queue/nr_requests 128 write /sys/block/sda/queue/iostats 1 - write /sys/block/sda/queue/iosched/slice_idle 8 + write /sys/block/sda/queue/iosched/slice_idle 0 write /dev/sys/fs/by-name/userdata/data_io_flag 8 write /dev/sys/fs/by-name/userdata/node_io_flag 8 @@ -673,10 +671,40 @@ on property:sys.boot_completed=1 setprop vendor.powerhal.init 1 # Setup final cpu.uclamp - write /dev/cpuctl/top-app/cpu.uclamp.min 10 - write /dev/cpuctl/foreground/cpu.uclamp.min 0 - write /sys/kernel/vendor_sched/ta_uclamp_min 103 + write /sys/kernel/vendor_sched/ta_uclamp_min 1 write /sys/kernel/vendor_sched/fg_uclamp_min 0 + write /sys/kernel/vendor_sched/sys_prefer_idle 0 + # cfs_rq clamp is using tg->uclamp setting + # align it with the vendor_group setting + write /sys/kernel/vendor_sched/bg_uclamp_max 512 + write /dev/cpuctl/background/cpu.uclamp.max 50 + write /sys/kernel/vendor_sched/bg_group_throttle 512 + write /sys/kernel/vendor_sched/sysbg_uclamp_max 512 + write /dev/cpuctl/system-background/cpu.uclamp.max 50 + write /sys/kernel/vendor_sched/sysbg_group_throttle 512 + write /sys/kernel/vendor_sched/dex2oat_uclamp_max 615 + write /dev/cpuctl/dex2oat/cpu.uclamp.max 60 + write /sys/kernel/vendor_sched/dex2oat_group_throttle 615 + write /sys/kernel/vendor_sched/ota_uclamp_max 410 + write /sys/kernel/vendor_sched/ota_group_throttle 410 + + # Setup groups for SF (RT used for SF RE, SF used for SF main) + write /sys/kernel/vendor_sched/rt_uclamp_min 125 + write /sys/kernel/vendor_sched/rt_prefer_idle 1 + write /sys/kernel/vendor_sched/sf_uclamp_min 30 + write /sys/kernel/vendor_sched/sf_prefer_idle 1 + + # Setup cpu.shares to throttle background groups (bg ~ 5% sysbg ~ 5% dex2oat ~2.5%) + write /dev/cpuctl/background/cpu.shares 1024 + write /dev/cpuctl/system-background/cpu.shares 1024 + write /dev/cpuctl/dex2oat/cpu.shares 512 + write /dev/cpuctl/system/cpu.shares 20480 + # We only have system and background groups holding tasks and the groups below are empty + write /dev/cpuctl/camera-daemon/cpu.shares 20480 + write /dev/cpuctl/foreground/cpu.shares 20480 + write /dev/cpuctl/nnapi-hal/cpu.shares 20480 + write /dev/cpuctl/rt/cpu.shares 20480 + write /dev/cpuctl/top-app/cpu.shares 20480 # gvotables for dumpstate chown system system /sys/kernel/debug/gvotables @@ -696,6 +724,14 @@ on property:sys.boot_completed=1 chown root system /sys/devices/platform/19000000.aoc/reset chmod 0220 /sys/devices/platform/19000000.aoc/reset + # AOC UDFPS clock compensation permission + chown system system /sys/devices/platform/19000000.aoc/control/udfps_set_clock_source + chmod 220 /sys/devices/platform/19000000.aoc/control/udfps_set_clock_source + chown system system /sys/devices/platform/19000000.aoc/control/udfps_get_osc_freq + chmod 440 /sys/devices/platform/19000000.aoc/control/udfps_get_osc_freq + chown system system /sys/devices/platform/19000000.aoc/control/udfps_get_disp_freq + chmod 440 /sys/devices/platform/19000000.aoc/control/udfps_get_disp_freq + # IMS WiFi Calling service charonservice /system/vendor/bin/charon class main @@ -776,14 +812,12 @@ on post-fs-data symlink /mnt/vendor/persist/ss /data/vendor/ss/persist chown root system /data/vendor/ss/persist chmod 0770 /data/vendor/ss/persist - chown system system /dev/sg1 - start storageproxyd + restart storageproxyd service storageproxyd /vendor/bin/storageproxyd -d /dev/trusty-ipc-dev0 \ -r /dev/sg1 -p /data/vendor/ss -t ufs - class main - disabled + class early_hal user root # Write build info to kdebuginfo @@ -809,18 +843,13 @@ on fs on property:vendor.thermal.link_ready=1 # BCL - write /dev/thermal/tz-by-name/smpl_gm/policy user_space - write /dev/thermal/tz-by-name/vdroop1/policy user_space - write /dev/thermal/tz-by-name/vdroop2/policy user_space - write /dev/thermal/tz-by-name/ocp_cpu1/policy user_space - write /dev/thermal/tz-by-name/ocp_cpu2/policy user_space - write /dev/thermal/tz-by-name/ocp_tpu/policy user_space - write /dev/thermal/tz-by-name/ocp_gpu/policy user_space - write /dev/thermal/tz-by-name/soft_ocp_cpu1/policy user_space - write /dev/thermal/tz-by-name/soft_ocp_cpu2/policy user_space - write /dev/thermal/tz-by-name/soft_ocp_tpu/policy user_space - write /dev/thermal/tz-by-name/soft_ocp_gpu/policy user_space - write /dev/thermal/tz-by-name/soc/policy user_space + write /sys/devices/virtual/pmic/mitigation/triggered_lvl/smpl_lvl 3100 + write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_cpu2_lvl 9000 + write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_gpu_lvl 9000 + write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_tpu_lvl 8500 + write /sys/devices/virtual/pmic/mitigation/clock_div/tpu_clk_div 0x201 + write /sys/devices/virtual/pmic/mitigation/clock_div/gpu_clk_div 0x801 + write /sys/devices/virtual/pmic/mitigation/clock_div/cpu2_clk_div 0x801 chown system system /dev/thermal/tz-by-name/soc/mode chown system system /dev/thermal/tz-by-name/vdroop2/trip_point_0_temp chown system system /dev/thermal/tz-by-name/vdroop2/trip_point_0_hyst @@ -847,9 +876,13 @@ on property:vendor.thermal.link_ready=1 chown system system /dev/thermal/tz-by-name/soc/trip_point_0_temp chown system system /dev/thermal/tz-by-name/soc/trip_point_0_hyst # Thermal + chown system system /dev/thermal/tz-by-name/quiet_therm/trip_point_0_temp + chown system system /dev/thermal/tz-by-name/quiet_therm/trip_point_0_hyst chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote + chown system system /dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote + chown system system /dev/thermal/cdev-by-name/tpu_cooling/user_vote chown system system /dev/thermal/cdev-by-name/fcc/cur_state on property:vendor.disable.bcl.control=1 diff --git a/conf/init.gs201.usb.rc b/conf/init.gs201.usb.rc index 330eb765..2354c697 100644 --- a/conf/init.gs201.usb.rc +++ b/conf/init.gs201.usb.rc @@ -89,6 +89,12 @@ on property:vendor.usb.config=* on property:persist.vendor.usb.usbradio.config=* start usbd +on property:vendor.usb.dwc3_irq=medium + exec /vendor/bin/hw/set_usb_irq.sh medium + +on property:vendor.usb.dwc3_irq=big + exec /vendor/bin/hw/set_usb_irq.sh big + on charger mkdir /config/usb_gadget/g1 mkdir /config/usb_gadget/g1/strings/0x409 diff --git a/conf/ueventd.gs201.rc b/conf/ueventd.gs201.rc index 7760ab98..b894ea32 100644 --- a/conf/ueventd.gs201.rc +++ b/conf/ueventd.gs201.rc @@ -162,6 +162,9 @@ /dev/trusty-ipc-dev0 0660 system drmrpc /dev/trusty-log0 0660 system system +# RPMB +/dev/sg1 0660 system system + # Citadel /dev/gsc0 0660 hsm hsm @@ -202,3 +205,6 @@ # Direct Charging /dev/logbuffer_pca9468_tcpm 0600 system system + +# Wlan +/dev/wlan 0660 wifi wifi diff --git a/convert_to_f2fs.sh b/convert_to_f2fs.sh deleted file mode 100644 index 806964c3..00000000 --- a/convert_to_f2fs.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -BLK=$1 -FORMAT_ONLY=$2 -MNT_OLD="/mnt/convert_old" -MNT_NEW="/mnt/convert_new" - -function log() { - if [ ! -z "$1" ]; then - echo "partition_convert: $1" > /dev/kmsg - fi -} - -function check_success() { - if [ $? -ne 0 ]; then - log "Failed: $1" - exit -1 - fi - log "Success: $1" -} - -F2FS_MAGIC=$(xxd $BLK -s 0x400 -l 4 -p) -if [ "$F2FS_MAGIC" = "1020f5f2" ]; then - log "$BLK is already f2fs - skipping" - exit 0 -fi - -EXT4_MAGIC=$(xxd $BLK -s 0x438 -l 2 -p) -if [ "$EXT4_MAGIC" != "53ef" ]; then - log "Unknown filesystem $EXT4_MAGIC" - exit -1 -fi - -if [ $FORMAT_ONLY == "true" ]; then - make_f2fs $BLK 2>&1 > /dev/null - check_success "make_f2fs $BLK" - sync - check_success "sync" - exit 0 -fi - -mkdir -p $MNT_OLD -check_success "mkdir $MNT_OLD" - -mkdir -p $MNT_NEW -check_success "mkdir $MNT_NEW" - -mount -t ext4 $BLK $MNT_OLD -check_success "mount $MNT_OLD as ext4" - -mount -t tmpfs tmpfs $MNT_NEW -check_success "mount $MNT_NEW as tmpfs" - -cp -rp $MNT_OLD/* $MNT_NEW/ -check_success "copy $MNT_OLD to $MNT_NEW" - -umount $MNT_OLD -check_success "umount $MNT_OLD" - -make_f2fs $BLK 2>&1 > /dev/null -check_success "make_f2fs $BLK" - -mount -t f2fs $BLK $MNT_OLD -check_success "mount $MNT_OLD as f2fs" - -cp -rp $MNT_NEW/* $MNT_OLD/ -check_success "copy $MNT_NEW to $MNT_OLD" - -sync -check_success "sync" - -umount $MNT_OLD -check_success "umount $MNT_OLD" -umount $MNT_NEW -check_success "umount $MNT_NEW" - -rmdir $MNT_OLD -check_success "rmdir $MNT_OLD" - -rmdir $MNT_NEW -check_success "rmdir $MNT_NEW" diff --git a/device-common.mk b/device-common.mk index 5cdcb856..cc7818b1 100644 --- a/device-common.mk +++ b/device-common.mk @@ -14,12 +14,17 @@ # limitations under the License. # +-include vendor/google_devices/gs201/proprietary/telephony/device-vendor.mk include device/google/gs201/device.mk # Telephony PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.telephony.carrierlock.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.carrierlock.xml +# Android Verified Boot +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml + # Factory OTA -include vendor/unbundled_google/packages/FactoryOtaPrebuilt/factoryota.mk @@ -29,3 +34,6 @@ PRODUCT_VENDOR_PROPERTIES += ro.soc.model=GS201 PRODUCT_PRODUCT_PROPERTIES += \ persist.vendor.testing_battery_profile=0 + +# ZramWriteback +-include hardware/google/pixel/mm/device_gki.mk diff --git a/device-shipping-common.mk b/device-shipping-common.mk index 93e3a157..63cfb734 100644 --- a/device-shipping-common.mk +++ b/device-shipping-common.mk @@ -14,8 +14,3 @@ # limitations under the License. include device/google/gs201/device-common.mk - -PRODUCT_PROPERTY_OVERRIDES += \ - ro.bluetooth.a2dp_offload.supported=true \ - persist.bluetooth.a2dp_offload.disabled=true \ - persist.bluetooth.a2dp_offload.cap=sbc-aac-aptx-aptxhd-ldac diff --git a/device.mk b/device.mk index 3a46be14..a87b066b 100644 --- a/device.mk +++ b/device.mk @@ -14,11 +14,9 @@ # limitations under the License. # -TARGET_BOARD_PLATFORM := gs201 +include device/google/gs-common/device.mk -ifneq (,$(filter %_64,$(TARGET_PRODUCT))) -LOCAL_64ONLY := _64 -endif +TARGET_BOARD_PLATFORM := gs201 AB_OTA_POSTINSTALL_CONFIG += \ RUN_POSTINSTALL_system=true \ @@ -32,6 +30,14 @@ VENDOR_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) # Set boot SPL BOOT_SECURITY_PATCH = $(PLATFORM_SECURITY_PATCH) +# TODO(b/207450311): Remove this flag once implemented +USE_PIXEL_GRALLOC := false +ifeq ($(USE_PIXEL_GRALLOC),true) + PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/GrallocHAL +else + PRODUCT_SOONG_NAMESPACES += hardware/google/gchips/gralloc4 +endif + PRODUCT_SOONG_NAMESPACES += \ hardware/google/av \ hardware/google/gchips \ @@ -40,6 +46,7 @@ PRODUCT_SOONG_NAMESPACES += \ hardware/google/interfaces \ hardware/google/pixel \ device/google/gs201 \ + device/google/gs201/powerstats \ vendor/google/whitechapel/tools \ vendor/google/interfaces \ vendor/google_devices/common/proprietary/confirmatioui_hal \ @@ -55,6 +62,10 @@ LOCAL_KERNEL := $(TARGET_KERNEL_DIR)/Image.lz4 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ ro.oem_unlock_supported=1 +# Include vendor telephony soong namespace +PRODUCT_SOONG_NAMESPACES += \ + vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY) + ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) #Set IKE logs to verbose for WFC PRODUCT_PROPERTY_OVERRIDES += log.tag.IKE=VERBOSE @@ -86,7 +97,6 @@ endif # From system.property PRODUCT_PROPERTY_OVERRIDES += \ - dev.usbsetting.embedded=on \ ro.telephony.default_network=27 \ persist.vendor.ril.use.iccid_to_plmn=1 \ persist.vendor.ril.emergencynumber.mode=5 @@ -108,6 +118,10 @@ PRODUCT_PRODUCT_PROPERTIES += \ PRODUCT_PRODUCT_PROPERTIES += \ persist.vendor.ril.camp_on_earlier=1 +# Hearing Aid Audio Support Using Bluetooth LE +PRODUCT_PRODUCT_PROPERTIES += \ + bluetooth.profile.asha.central.enabled=true + # Carrier configuration default location PRODUCT_PROPERTY_OVERRIDES += \ persist.vendor.radio.config.carrier_config_dir=/mnt/vendor/modem_img/images/default/confpack @@ -141,17 +155,17 @@ TARGET_USES_VULKAN = false # TODO(b/185349920) # PRODUCT_SOONG_NAMESPACES += \ -# vendor/arm/mali/valhall \ -# vendor/arm/mali/valhall/cl \ -# vendor/arm/mali/valhall/libmali \ -# vendor/arm/mali/valhall/cinstr/production/gpu-hwc-reader +# vendor/arm/mali/valhall PRODUCT_PACKAGES += \ - mali_csffw.bin \ - libGLES_mali-gs201-prebuilt \ - vulkan.gs201-prebuilt \ + csffw_image_prebuilt__firmware_prebuilt_todx_mali_csffw.bin \ + libGLES_mali \ + vulkan.mali \ libOpenCL \ -# libgpudataproducer + libgpudataproducer \ + +PRODUCT_VENDOR_PROPERTIES += \ + ro.hardware.vulkan=mali include device/google/gs101/neuralnetwork/neuralnetwork.mk @@ -175,12 +189,12 @@ PRODUCT_VENDOR_PROPERTIES += \ ro.hardware.egl = swiftshader else PRODUCT_VENDOR_PROPERTIES += \ - ro.hardware.egl = mali_gs201 + ro.hardware.egl = mali endif PRODUCT_VENDOR_PROPERTIES += \ ro.opengles.version=196610 \ - debug.renderengine.backend=skiaglthreaded -# graphics.gpu.profiler.support=true \ + debug.renderengine.backend=skiaglthreaded \ + graphics.gpu.profiler.support=true \ # GRAPHICS - GPU (end) # #################### @@ -188,10 +202,10 @@ PRODUCT_VENDOR_PROPERTIES += \ # Device Manifest, Device Compatibility Matrix for Treble ifeq ($(DEVICE_USES_EXYNOS_GRALLOC_VERSION), 4) DEVICE_MANIFEST_FILE := \ - device/google/gs201/manifest$(LOCAL_64ONLY).xml + device/google/gs201/manifest.xml else DEVICE_MANIFEST_FILE := \ - device/google/gs201/manifest$(LOCAL_64ONLY)-gralloc3.xml + device/google/gs201/manifest-gralloc3.xml endif ifneq (,$(filter aosp_%,$(TARGET_PRODUCT))) @@ -254,6 +268,7 @@ PRODUCT_COPY_FILES += \ # Shell scripts PRODUCT_COPY_FILES += \ device/google/gs201/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \ + device/google/$(TARGET_BOARD_PLATFORM)/set_usb_irq.sh:$(TARGET_COPY_OUT_VENDOR)/bin/hw/set_usb_irq.sh # insmod files PRODUCT_COPY_FILES += \ @@ -292,10 +307,6 @@ PRODUCT_PACKAGES += \ tune2fs.vendor_ramdisk \ resize2fs.vendor_ramdisk -# Filesystem: convert /dev/block/by-name/persist to f2fs -PRODUCT_COPY_FILES += \ - device/google/gs201/convert_to_f2fs.sh:$(TARGET_COPY_OUT_VENDOR)/bin/convert_to_f2fs.sh \ - # Userdata Checkpointing OTA GC PRODUCT_PACKAGES += \ checkpoint_gc @@ -319,8 +330,13 @@ PRODUCT_PROPERTY_OVERRIDES += \ persist.vendor.sys.modem.logging.enable=true # Enable silent CP crash handling +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_PROPERTY_OVERRIDES += \ persist.vendor.ril.crash_handling_mode=1 +else +PRODUCT_PROPERTY_OVERRIDES += \ + persist.vendor.ril.crash_handling_mode=2 +endif # Add support dual SIM mode PRODUCT_PROPERTY_OVERRIDES += \ @@ -376,13 +392,11 @@ PRODUCT_PRODUCT_PROPERTIES += \ PRODUCT_COPY_FILES += \ device/google/gs201/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json -PRODUCT_COPY_FILES += \ - device/google/gs201/powerhint_a0.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint_a0.json - -PRODUCT_COPY_FILES += \ - device/google/gs201/powerhint_a1.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint_a1.json -include hardware/google/pixel/power-libperfmgr/aidl/device.mk +# IRQ rebalancing. +include hardware/google/pixel/rebalance_interrupts/rebalance_interrupts.mk + # PowerStats HAL PRODUCT_PACKAGES += \ android.hardware.power.stats-service.pixel @@ -483,34 +497,18 @@ else LOCAL_TARGET_PRODUCT := slider endif -#ifneq ($(wildcard vendor/google/camera),) -SOONG_CONFIG_NAMESPACES += lyric -SOONG_CONFIG_lyric += \ - use_lyric_camera_hal \ - soc \ - tuning_product +$(call soong_config_set,google3a_config,soc,gs201) +$(call soong_config_set,google3a_config,gcam_awb,true) +$(call soong_config_set,google3a_config,ghawb_truetone,true) -SOONG_CONFIG_lyric_soc := gs201 -SOONG_CONFIG_lyric_use_lyric_camera_hal := true -# SOONG_CONFIG_lyric_tuning_product is set in device-specific makefiles, +ifneq ($(wildcard vendor/google/services/LyricCameraHAL/src),) +$(call soong_config_set,lyric,soc,gs201) +$(call soong_config_set,lyric,use_lyric_camera_hal,true) +# lyric::tuning_product is set in device-specific makefiles, # such as device/google/${DEVICE}/device-${DEVICE}.mk -SOONG_CONFIG_NAMESPACES += google3a_config -SOONG_CONFIG_google3a_config += \ - soc \ - gcam_awb \ - ghawb_truetone \ - target_device - -SOONG_CONFIG_google3a_config_soc := gs201 -SOONG_CONFIG_google3a_config_gcam_awb := true -SOONG_CONFIG_google3a_config_ghawb_truetone := true - - -SOONG_CONFIG_NAMESPACES += gch -SOONG_CONFIG_gch += hwl_library -SOONG_CONFIG_gch_hwl_library := lyric -#endif +$(call soong_config_set,gch,hwl_library,lyric) +endif # WiFi PRODUCT_PACKAGES += \ @@ -571,7 +569,7 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml -#PRODUCT_COPY_FILES += \ +PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ @@ -601,17 +599,19 @@ endif PRODUCT_PROPERTY_OVERRIDES += \ debug.sf.disable_backpressure=0 \ - debug.sf.enable_gl_backpressure=1 + debug.sf.enable_gl_backpressure=1 \ + debug.sf.enable_sdr_dimming=1 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.use_phase_offsets_as_durations=1 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.sf.duration=8300000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.app.duration=20500000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.sf.duration=16000000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.app.duration=16500000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.sf.duration=13500000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.app.duration=21000000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.sf.duration=10500000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.late.app.duration=16600000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.sf.duration=16600000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.early.app.duration=16600000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.sf.duration=16600000 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += debug.sf.earlyGl.app.duration=16600000 -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=80 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.enable_layer_caching=true +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms?=80 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_touch_timer_ms=200 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_display_power_timer_ms=1000 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_content_detection_for_refresh_rate=true @@ -670,9 +670,7 @@ endif ## VIDEO #################################### -SOONG_CONFIG_NAMESPACES += bigo -SOONG_CONFIG_bigo += soc -SOONG_CONFIG_bigo_soc := gs201 +$(call soong_config_set,bigo,soc,gs201) # 1. Codec 2.0 # exynos service @@ -705,6 +703,10 @@ PRODUCT_PROPERTY_OVERRIDES += \ debug.stagefright.ccodec_delayed_params=1 \ ro.vendor.gpu.dataspace=1 +# Create input surface on the framework side +PRODUCT_PROPERTY_OVERRIDES += \ + debug.stagefright.c2inputsurface=-1 \ + # 2. OpenMAX IL PRODUCT_COPY_FILES += \ device/google/gs201/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ @@ -720,7 +722,7 @@ CBD_USE_V2 := true CBD_PROTOCOL_SIT := true # setup dalvik vm configs. -$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) +$(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk) PRODUCT_TAGS += dalvik.gc.type-precise @@ -827,12 +829,10 @@ PRODUCT_PACKAGES += \ vts.bin # This will be called only if IMSService is building with source code for dev branches. -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-ims/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/shannon-ims/device-vendor.mk) PRODUCT_PACKAGES += ShannonIms -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-iwlan/device-vendor.mk) - #RCS Test Messaging App PRODUCT_PACKAGES_DEBUG += \ TestRcsApp @@ -857,18 +857,14 @@ USE_RADIO_HAL_1_6 := true #$(call inherit-product, vendor/google_devices/gs201/proprietary/device-vendor.mk) ifneq ($(BOARD_WITHOUT_RADIO),true) -$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/common/device-vendor.mk) +$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device-vendor.mk) endif #GPS HAL include device/google/gs201/gnss/device-gnss.mk BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs201-sepolicy/gps -ifeq (,$(filter %_64,$(TARGET_PRODUCT))) -$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -else $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) -endif #$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk) #$(call inherit-product-if-exists, hardware/google_devices/gs201/gs201.mk) #$(call inherit-product-if-exists, vendor/google_devices/common/exynos-vendor.mk) @@ -888,6 +884,13 @@ PRODUCT_PACKAGES += modem_svc_sit # modem logging binary/configs PRODUCT_PACKAGES += modem_logging_control +# modem logging configs +PRODUCT_COPY_FILES += \ + device/google/gs201/radio/config/logging.conf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/logging.conf \ + device/google/gs201/radio/config/default.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default.cfg \ + device/google/gs201/radio/config/default.nprf:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default.nprf \ + device/google/gs201/radio/config/default_metrics.xml:$(TARGET_COPY_OUT_VENDOR)/etc/modem/default_metrics.xml + PRODUCT_COPY_FILES += \ device/google/gs201/radio/gnss_blanking.csv:$(TARGET_COPY_OUT_VENDOR)/etc/modem/gnss_blanking.csv @@ -902,14 +905,14 @@ PRODUCT_PACKAGES_DEBUG += \ $(NULL) PRODUCT_PACKAGES += \ - android.hardware.health@2.1-impl-gs201 \ - android.hardware.health@2.1-service + android.hardware.health-service.gs201 \ + android.hardware.health-service.gs201_recovery \ # Audio # Audio HAL Server & Default Implementations PRODUCT_PACKAGES += \ android.hardware.audio.service \ - android.hardware.audio@7.0-impl \ + android.hardware.audio@7.1-impl \ android.hardware.audio.effect@7.0-impl \ android.hardware.soundtrigger@2.3-impl \ vendor.google.whitechapel.audio.audioext@2.0-impl \ @@ -936,8 +939,8 @@ PRODUCT_PACKAGES += \ audio.a2dp.default \ audio.bluetooth.default \ audio.r_submix.default \ - audio_spk_35l41 -# sound_trigger.primary.$(TARGET_BOARD_PLATFORM) \ + audio_spk_35l41 \ + sound_trigger.primary.$(TARGET_BOARD_PLATFORM) # libaoc_waves \ # @@ -963,11 +966,14 @@ PRODUCT_SOONG_NAMESPACES += \ vendor/google/whitechapel/audio/hal \ vendor/google/whitechapel/audio/interfaces -SOONG_CONFIG_NAMESPACES += aoc_audio_board -SOONG_CONFIG_aoc_audio_board += \ - platform +$(call soong_config_set,aoc_audio_board,platform,$(TARGET_BOARD_PLATFORM)) + +## AoC soong +PRODUCT_SOONG_NAMESPACES += \ + vendor/google/whitechapel/aoc + +$(call soong_config_set,aoc,target_soc,$(TARGET_BOARD_PLATFORM)) -SOONG_CONFIG_aoc_audio_board_platform := $(TARGET_BOARD_PLATFORM) # ## Audio properties PRODUCT_PROPERTY_OVERRIDES += \ diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml index 245d313f..c660eda1 100644 --- a/device_framework_matrix_product.xml +++ b/device_framework_matrix_product.xml @@ -65,6 +65,7 @@ com.google.edgetpu + 2 IEdgeTpuVendorService default @@ -126,7 +127,7 @@ vendor.google.google_battery - 1.1 + 1.2 IGoogleBattery default @@ -150,7 +151,7 @@ vendor.google.wifi_ext - 1.2 + 1.3 IWifiExt default diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 57775940..8f788f97 100644 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -209,6 +209,7 @@ void DumpstateDevice::dumpCameraLogs(int fd, const std::string &destDir) { dumpLogs(fd, kCameraLogDir, cameraDestDir, 10, "session-ended-"); dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "high-drop-rate-"); dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "watchdog-"); + dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "camera-ended-"); } timepoint_t startSection(int fd, const std::string §ionName) { @@ -480,9 +481,6 @@ void DumpstateDevice::dumpPowerSection(int fd) { "a=${f/\\/sys\\/devices\\/virtual\\/pmic\\/mitigation\\/instruction\\//}; " "echo \"$a=$val\" ; done"}); - DumpFileToFd(fd, "BCL", "/sys/devices/virtual/pmic/mitigation/triggered_stats"); - DumpFileToFd(fd, "IF PMIC", "/sys/devices/virtual/pmic/max77759-mitigation/triggered_stats"); - } // Dump items related to thermal @@ -965,6 +963,7 @@ void DumpstateDevice::dumpRamdumpSection(int fd) { // Dump items that don't fit well into any other section void DumpstateDevice::dumpMiscSection(int fd) { RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"}); + DumpFileToFd(fd, "VENDOR PROC DUMP", "/proc/vendor_sched/dump_task"); } // Dump items related to GSC diff --git a/edgetpu/edgetpu.mk b/edgetpu/edgetpu.mk index da17a4c7..c97b5abc 100644 --- a/edgetpu/edgetpu.mk +++ b/edgetpu/edgetpu.mk @@ -1,10 +1,7 @@ # Edgetpu packages # Config variables for TPU chip on device. -SOONG_CONFIG_NAMESPACES += edgetpu_config -SOONG_CONFIG_edgetpu_config += chip - -SOONG_CONFIG_edgetpu_config_chip := janeiro +$(call soong_config_set,edgetpu_config,chip,janeiro) # TPU logging service PRODUCT_PACKAGES += \ diff --git a/factory_common.mk b/factory_common.mk index 4fa3f93d..8befad2c 100644 --- a/factory_common.mk +++ b/factory_common.mk @@ -38,13 +38,17 @@ PRODUCT_PROPERTY_OVERRIDES += \ vendor.camera.debug.force_mesh_warp_on=0 \ vendor.camera.debug.force_rectiface_node_on=0 \ vendor.camera.debug.force_steadiface_on=0 \ - vendor.camera.debug.force_tnr_on=0 + vendor.camera.debug.force_tnr_on=0 \ + vendor.camera.debug.force_segmentation_node_on=0 \ + vendor.camera.debug.enable_saliency=0 \ + vendor.camera.debug.force_local_tone_mapping_on=0 \ + vendor.camera.debug.local_tone_mapping_controller_v1.mode=0 # Disable ScreenDecorations for factory builds PRODUCT_PROPERTY_OVERRIDES += \ debug.disable_screen_decorations=true -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms=80 +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_idle_timer_ms?=80 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_touch_timer_ms=200 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.set_display_power_timer_ms=1000 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += ro.surface_flinger.use_content_detection_for_refresh_rate=true diff --git a/fingerprint/udfps.mk b/fingerprint/udfps.mk index dbd827a9..61f138f6 100644 --- a/fingerprint/udfps.mk +++ b/fingerprint/udfps.mk @@ -21,9 +21,7 @@ PRODUCT_COPY_FILES += \ PRODUCT_SOONG_NAMESPACES += vendor/goodix/udfps/g6_trusty PRODUCT_SOONG_NAMESPACES += vendor/goodix/udfps/g6_aidl_trusty -SOONG_CONFIG_NAMESPACES += fp_hal_feature -SOONG_CONFIG_fp_hal_feature += biometric_suez_support -SOONG_CONFIG_fp_hal_feature_biometric_suez_support := true +$(call soong_config_set,fp_hal_feature,biometric_suez_support,true) PRODUCT_PACKAGES += \ android.hardware.biometrics.fingerprint@2.1-service.goodix \ diff --git a/gnss/47765/bin/flp.default.so b/gnss/47765/bin/flp.default.so index 4c56d2a6..3c04452b 100755 Binary files a/gnss/47765/bin/flp.default.so and b/gnss/47765/bin/flp.default.so differ diff --git a/gnss/47765/bin/gps.default.so b/gnss/47765/bin/gps.default.so index a8721ad3..1fe03515 100755 Binary files a/gnss/47765/bin/gps.default.so and b/gnss/47765/bin/gps.default.so differ diff --git a/gnss/47765/bin/gpsd b/gnss/47765/bin/gpsd index 531898d0..04977f43 100755 Binary files a/gnss/47765/bin/gpsd and b/gnss/47765/bin/gpsd differ diff --git a/gnss/47765/bin/lhd b/gnss/47765/bin/lhd index bfc03410..e5b51e3d 100755 Binary files a/gnss/47765/bin/lhd and b/gnss/47765/bin/lhd differ diff --git a/gnss/47765/bin/scd b/gnss/47765/bin/scd index 8878aa30..d213525b 100755 Binary files a/gnss/47765/bin/scd and b/gnss/47765/bin/scd differ diff --git a/gnss/47765/firmware/SensorHub.patch b/gnss/47765/firmware/SensorHub.patch index 857efce0..131e56fc 100644 --- a/gnss/47765/firmware/SensorHub.patch +++ b/gnss/47765/firmware/SensorHub.patch @@ -1,35 +1,35 @@ - - + + - + - +0000000000000000000200000024000000010073010020 +3A0000000400CDBCB42D09B5FFFFF394D49DD2AB05A000 +003AEF58C0F40500A002000000000002000000020073FC +0020010100200400CD5C082E48B6FFFFBF6ED49D051B22 +A1000073A68CB3AD5C00C00F0000000000020000000300 +73050060FB0000300400CD3CEA2DD5B5FFFF146FD49D38 +0AE2A00000DCA99D188353004001000000000002000000 +0400730600008F0000400400CD84232EB0B6FFFF416CD4 +9D3D64FAA0000095BECDE17D3900000300000000000200 +0000050073010040530000600400CC54262EBBB6FFFF70 +68D49DF25113A1000097A6AD4618660060020000000000 +02000000060073FC00C03700F19403C064820000D00300 +CD8CB12DFCB4FFFFBE70D49D1488F19F0000D56B48AC3E +940080060000000000020000000700730500A0DA0000E0 +0300CD94EB2DDAB5FFFF1370D49D538CEEA00000A4AA2A +E7375000A0FEFF00000000020000000800730600801201 +00F00300CDECEC2DDFB5FFFF186BD49D0827EFA0000066 +B97C773C3D0020FEFF0000000002000000090073FE0000 +D80000000400CD345D2DBBB3FFFF4667D49D8DEEA1F500 +004E91213846690000000000000000020000000A0073F9 +00C0BE0000100400CD34DC2D9FB5FFFF5556D49DCD72A0 +F500001C0409736CF200C0FDFF00000000020000000B01 +730000E0450000300400CCC40C2E59B6FFFF2B55D49D1E +6486F5000052AB517C415E00A0FFFF0000000002000000 +0C0073FF0020900000400400CD9CE42DBFB5FFFF7166D4 +9DF71D02F600005ECE84D9FA3300C00700000000000200 +00000D0073FE00C0370000500400CD8CDA2D98B5FFFF2C +54D49D539295F5000048441C8EEBB80040FEFF00000000 +020000000E0073F90060520000600400CDA4B02DF8B4FF +FF9E64D49DE6AEF4F500003DA8ECC38C4D002002000000 +0000020000000F00730000006A0000E00300CDCCD72D8E +B5FFFF9D65D49D10DD1EF6000039BE0338114900600300 +0000000002000000100073FF00006C0100F00300CD9C91 +2D82B4FFFFE376D49D0A9A0FF5000094099B2A83F50080 +FFFF0000000002000000110073040000660000000400CD +449E2E89B8FFFFC666D49DF9DEBB4B0000FA80898C8985 +00400E000000000002000000120073FD00C09300001004 +00CD44CD2E3EB9FFFF1E64D49D37E1F74B00008BF79625 +6A0A00A0020000000000020000001300730300A0250000 +200400CDB4F72EE2B9FFFFFF56D49D54E9FA4C00009048 +622069B60020FBFF000000000200000014007302008075 +0000300400CD0CFA2EEBB9FFFFCB61D49D7CE80B4D0000 +D000972BF5F30060FEFF00000000020000001500730400 +C04D0000500400CD54C22E14B9FFFF3F6FD49DD146E24B +0000E56B2EFEB29900E0F8FF0000000002000000160073 +FD00001D0100600400CDECE32E96B9FFFFCF5CD49DBA33 +2F4C0000000FEF8B68F20020FCFF000000000200000017 +0073030000470000E00300CDACE12E8CB9FFFF772FD49D +4BB1294C00006A3B77C1DFCF00C0FFFF00000000020000 +001800730200A0340000F00300CDFC242EB6B6FFFF7661 +D49DDFC0604C0000E0A3B90C2968008001000000000002 +0000001800000001007300F19403506882007625A50590 +1004005F4B1F2824A9FFFFC07E0DA1CED3915FA54C2323 +4DD0BAFA814D150099FFFFFF020000000200730020F354 +0AA010040064CA3F27CFA3FFFF3EA50DA159D1215C3535 +68C285AE7606F1DDEBFFE7FFFFFF0200000003007300D2 +CFD901A0100400E18885274CABFFFF6B9B0CA16504D189 +22473123440098D0F674F9FFA1FFFFFF02000000040073 +008E2BA600A010040048AE1D27ABA4FFFF0DC00DA18EB0 +D7B5FDFA5E884CC4B63DF16CF9FFF7FFFFFF0200000005 +007300D8572403A0100400C9B0FD267AABFFFFF72E0FA1 +9D244D88126130251E4681672780FEFFF6FFFFFF020000 +0006007300DD161501901004004F791928A3AAFFFF0952 +0EA148C33B5F511D8FD860077203C4FE00002B00000002 +000000070073005697BB07A0100400DC74C42600A7FFFF +490A0EA1CBE078DF22A454A17C4DCAE291100600540000 +00020000000800730008AC4003A0100400AE5F652775A3 +FFFFDEE90CA17B12BD338C987902B7F33A57EA24FFFFF3 +FFFFFF0200000009007300D419F700A01004000B9FD326 +6BA4FFFF5B010EA16200C3B3EF8F774A06301767C573F4 +FFF0FFFFFF020000000A007300478C6D03A0100400D433 +842779ACFFFF4B640DA1D714B38958505E97A68F22A96E +28FBFFBDFFFFFF020000000C0073009B4B4604A0100400 +ECAAAB272CA9FFFF2BDA0DA1AD82B50CE57FD731AB8BED +C35113FEFFD2FFFFFF020000000D00730025479502A010 +040073F06C27F8A6FFFFCB590DA1D871D6B9167E1F2700 +48BB3EAADC04002B000000020000000E00730056686A00 +A0100400505BFF2641A9FFFF550F0EA18B40960B87327F +74845BACCB60150200BAFFFFFF020000000F007300EC87 +C806A0100400F59FD6254D9FFFFFA9F50CA1EEE0B1AFB9 +216E2845CDBD305765FBFF170000000200000010007300 +32D23C06A0100400CE3EAC27BBABFFFF49C20DA16ECB78 +0DDC20A91B76982C7ABCACF4FFCBFFFFFF020000001100 +7300C5CED506A0100400B29CFF27BCA7FFFF1CEF0CA1E2 +E0EE368E663EC07007FE55A5290F003400000002000000 +120073006176CC00A01004007E8E752705A9FFFF4A550D +A1B9260860DC4F8475116EAE0804510B00EEFFFFFF0200 +000013007300E9EFC604A0100400FB60F02723A5FFFF93 +150DA1A7DAC538A44A0D4C86C27AB9258E00002C000000 +020000001400730062471E0390100400999C412674A7FF +FF55F3FDA053C7D6837BC4E97B619761199B111100FDFF +FFFF0200000015007300F19403E06B8200ADE84A0CA010 +0400B8EF022780ABFFFF0A6E0DA1ACD1205CD3FF3CD2F9 +A2345B8E270400150000000200000016007300CA149503 +A010040040271F2652A7FFFF84740EA1FBFFB985CBE6D9 +D97829AC2B27F1ECFF54000000020000001700730017D8 +AB00A01E0400C92550274EABFFFF7D430DA16A86BC8828 +63A96AEDE01C00DB110300D8FFFFFF0200000018007300 +8158B705A01004007B9B16267DA4FFFF30CF0DA1F7CD43 +DCFECD2F1EFB87E909BDBD040095000000020000001900 +7300A91E0B05A0100400A301282729AAFFFFA0F50CA1F3 +F3B309D0A38F2757872ABAB94405003C00000002000000 +1A0073001D960603A010040043FB6026ADA7FFFF0CB40C +A1154DF8079D57620C13B1639EF05503002A0000000200 +00001B00730019CED604A010040082E7BE2722A4FFFF87 +760DA1526173348B5BDD197F9B6C53AB08FBFFCAFFFFFF +020000001C3F73005F1FF408A0100400F8D2A227ADADFF +FFD8E50DA16BED9D0DB7492FC9FB26436B6B061200C9FF +FFFF020000001D0073000D5CFF00A010040070221328ED +A4FFFF43F40CA1008671371800055972CD125AECEBF3FF +C9FFFFFF020000001E0073005C30B802A01004004C512A +26CBA7FFFF02830DA1F6C327E06A42C48FB5AE5FDCCF81 +F1FFD7FFFFFF020000001F0073009EA02305A010040071 +8DF1266AAAFFFFDB720CA14ED02BE0F6D6C80A26BC77CC +B9EAFBFFEDFFFFFF0200000020007300B79A9102A01004 +00CDE4FC2609A7FFFF5B5E0DA170E92CB418F5D29FE18A +337235920000F2FFFFFF020000000BFF00000000000000 +0000000000000000000000000000000000000000000000 +0000000000000000000000000200000020000000020073 +0010D73301000B04007293641498EBFFFF608DEACA4EC0 +F3012DC3D281B5A780B69F961B00000000000200000003 +007300B6EE0A01000B040005489D0194B6FEFF77E9EBCA +B51E19AA72096908A837B09B81B9F6FFF8020000020000 +0004007300A1C02D0180F4030020A1DD1414EBFFFFA372 +EDCA5D4FFE011FABB4813579DBCD0A65FFFF3500000002 +00000005007300F347E900000B0400FA1CC614A4E1FFFF +1D62EACA3BCF56814DEF9B7F7300BB61202E1500070A00 +000200000006007300C026020180F4030040725D01ECC7 +FEFF1D36EBCA01B475C6B70F5F87D1A450CB090AE7FFD5 +02000002000000090073008B08EF0080F403002260B414 +84DBFFFF89EDEBCA26FD8C8A4A88A5801E1F1D1EBF0E19 +000DFFFFFF02000000F1EC01706F820001FF0000000000 +0000000000000000000000000000000000000000000000 +00000000000000000000000000000200000007FF000000 +0000000000000000000000000000000000000000000000 +000000000000000000000000000000000200000008FF00 +0000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000200000009 +000000C10073005C16DD26A0100400F4EAD31D5DDBFFFF +9334ECCA39418AA3F0299CC09C639B17ECDBF2FFC0FFFF +FF02000000C2007300DB1AA426A01004009729291EB3F4 +FFFFAEBDE9CA1B00A100F0E37ABFEAD5EBBADDFCFFFFFE +FFFFFF02000000C30073007AB14826A0100400574C041D +9BE3FFFF7A0FEFCA86B3FA45862B05C125D8BC71A2B5FF +FFF6FFFFFF02000000C7007300E92E2000A01004003574 +0400040A0000A81BECCAED5DF8CDC1001DB99E4DBCEABB +FFFFFF0000000002000000C4FF00000000000000000000 +0000000000000000000000000000000000000000000000 +00000000000000000002000000C5FF0000000000000000 +0000000000000000000000000000000000000000000000 +000000000000000000000002000000C6FF000000000000 +0000000000000000000000000000000000000000000000 +000000000000000000000000000200000007000000> diff --git a/health/Android.bp b/health/Android.bp index b8a6a550..01ca99eb 100644 --- a/health/Android.bp +++ b/health/Android.bp @@ -25,12 +25,14 @@ package { ], } -cc_library_shared { - name: "android.hardware.health@2.1-impl-gs201", - stem: "android.hardware.health@2.0-impl-2.1-gs201", - - proprietary: true, +cc_defaults { + name: "android.hardware.health-service.gs201-defaults", + defaults: [ + "libhealth_aidl_impl_user", + "libhealth_aidl_charger_defaults", + ], relative_install_path: "hw", + vintf_fragments: ["android.hardware.health-service.gs201.xml"], srcs: [ "Health.cpp", ], @@ -41,19 +43,25 @@ cc_library_shared { ], static_libs: [ - "android.hardware.health@1.0-convert", - "libbatterymonitor", - "libhealth2impl", - "libhealthloop", - ], - - shared_libs: [ - "libbase", - "libcutils", - "libhidlbase", - "libpixelhealth", - "libutils", - "android.hardware.health@2.0", - "android.hardware.health@2.1", + "libhealth_aidl_impl", ], } + +cc_binary { + name: "android.hardware.health-service.gs201", + defaults: ["android.hardware.health-service.gs201-defaults"], + proprietary: true, + init_rc: ["android.hardware.health-service.gs201.rc"], + overrides: ["charger"], + shared_libs: [ + "libpixelhealth", + ], +} + +cc_binary { + name: "android.hardware.health-service.gs201_recovery", + defaults: ["android.hardware.health-service.gs201-defaults"], + recovery: true, + init_rc: ["android.hardware.health-service.gs201_recovery.rc"], + overrides: ["charger.recovery"], +} diff --git a/health/Health.cpp b/health/Health.cpp index 5d2f7e9b..d4030631 100644 --- a/health/Health.cpp +++ b/health/Health.cpp @@ -19,17 +19,20 @@ #include #include #include -#include -#include +#include +#include #include -#include +// Recovery doesn't have libpixelhealth and charger mode +#ifndef __ANDROID_RECOVERY__ +#include #include #include #include #include #include #include +#endif // !__ANDROID_RECOVERY__ #include #include @@ -41,15 +44,15 @@ namespace { using namespace std::literals; -using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; -using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; -using android::hardware::health::V2_0::DiskStats; -using android::hardware::health::V2_0::StorageAttribute; -using android::hardware::health::V2_0::StorageInfo; -using android::hardware::health::V2_0::Result; -using ::android::hardware::health::V2_1::IHealth; +using aidl::android::hardware::health::DiskStats; +using aidl::android::hardware::health::HalHealthLoop; +using aidl::android::hardware::health::HealthInfo; +using aidl::android::hardware::health::StorageInfo; using android::hardware::health::InitHealthdConfig; +#ifndef __ANDROID_RECOVERY__ +using aidl::android::hardware::health::charger::ChargerCallback; +using aidl::android::hardware::health::charger::ChargerModeMain; using hardware::google::pixel::health::BatteryDefender; using hardware::google::pixel::health::BatteryMetricsLogger; using hardware::google::pixel::health::BatteryThermalControl; @@ -70,6 +73,7 @@ static BatteryThermalControl battThermalControl( static BatteryMetricsLogger battMetricsLogger(kBatteryResistance, kBatteryOCV); static LowBatteryShutdownMetrics shutdownMetrics(kVoltageAvg); static DeviceHealth deviceHealth; +#endif // !__ANDROID_RECOVERY__ #define UFS_DIR "/dev/sys/block/bootdevice" constexpr char kUfsHealthEol[]{UFS_DIR "/health_descriptor/eol_info"}; @@ -77,7 +81,6 @@ constexpr char kUfsHealthLifetimeA[]{UFS_DIR "/health_descriptor/life_time_estim constexpr char kUfsHealthLifetimeB[]{UFS_DIR "/health_descriptor/life_time_estimation_b"}; constexpr char kUfsVersion[]{UFS_DIR "/device_descriptor/specification_version"}; constexpr char kDiskStatsFile[]{"/sys/block/sda/stat"}; -constexpr char kUFSName[]{"UFS0"}; static std::string ufs_version; static uint16_t eol; @@ -86,8 +89,10 @@ static uint16_t lifetimeB; static std::chrono::system_clock::time_point ufs_last_query_time; constexpr auto kUfsQueryIntervalHours = std::chrono::hours{24}; +#ifndef __ANDROID_RECOVERY__ static bool needs_wlc_updates = false; constexpr char kWlcCapacity[]{WLC_DIR "/capacity"}; +#endif // !__ANDROID_RECOVERY__ std::ifstream assert_open(const std::string &path) { std::ifstream stream(path); @@ -116,11 +121,10 @@ void read_ufs_version(StorageInfo *info) { info->version = ufs_version; } -void fill_ufs_storage_attribute(StorageAttribute *attr) { - attr->isInternal = true; - attr->isBootDevice = true; - attr->name = kUFSName; -} +#ifdef __ANDROID_RECOVERY__ +void private_healthd_board_init(struct healthd_config *) {} +int private_healthd_board_battery_update(HealthInfo *) { return 0; } +#else // !__ANDROID__RECOVERY__ static bool FileExists(const std::string &filename) { struct stat buffer; @@ -138,26 +142,26 @@ void private_healthd_board_init(struct healthd_config *hc) { } } -int private_healthd_board_battery_update(struct android::BatteryProperties *props) { - deviceHealth.update(props); - battThermalControl.updateThermalState(props); - battMetricsLogger.logBatteryProperties(props); - shutdownMetrics.logShutdownVoltage(props); +int private_healthd_board_battery_update(HealthInfo *health_info) { + deviceHealth.update(health_info); + battThermalControl.updateThermalState(*health_info); + battMetricsLogger.logBatteryProperties(*health_info); + shutdownMetrics.logShutdownVoltage(*health_info); // Allow BatteryDefender to override online properties - ChargerDetect::onlineUpdate(props); - battDefender.update(props); + ChargerDetect::onlineUpdate(health_info); + battDefender.update(health_info); if (needs_wlc_updates && - !android::base::WriteStringToFile(std::to_string(props->batteryLevel), kWlcCapacity)) + !android::base::WriteStringToFile(std::to_string(health_info->batteryLevel), kWlcCapacity)) LOG(INFO) << "Unable to write battery level to wireless capacity"; return 0; } +#endif // __ANDROID_RECOVERY__ -void private_get_storage_info(std::vector &vec_storage_info) { - vec_storage_info.resize(1); - StorageInfo *storage_info = &vec_storage_info[0]; - fill_ufs_storage_attribute(&storage_info->attr); +void private_get_storage_info(std::vector *vec_storage_info) { + vec_storage_info->resize(1); + StorageInfo *storage_info = &vec_storage_info->at(0); read_ufs_version(storage_info); @@ -178,10 +182,9 @@ void private_get_storage_info(std::vector &vec_storage_info) { return; } -void private_get_disk_stats(std::vector &vec_stats) { - vec_stats.resize(1); - DiskStats *stats = &vec_stats[0]; - fill_ufs_storage_attribute(&stats->attr); +void private_get_disk_stats(std::vector *vec_stats) { + vec_stats->resize(1); + DiskStats *stats = &vec_stats->at(0); auto stream = assert_open(kDiskStatsFile); // Regular diskstats entries @@ -193,18 +196,14 @@ void private_get_disk_stats(std::vector &vec_stats) { } } // anonymous namespace -namespace android { -namespace hardware { -namespace health { -namespace V2_1 { -namespace implementation { +namespace aidl::android::hardware::health::implementation { class HealthImpl : public Health { public: - HealthImpl(std::unique_ptr&& config) - : Health(std::move(config)) {} + HealthImpl(std::string_view instance_name, std::unique_ptr&& config) + : Health(std::move(instance_name), std::move(config)) {} - Return getStorageInfo(getStorageInfo_cb _hidl_cb) override; - Return getDiskStats(getDiskStats_cb _hidl_cb) override; + ndk::ScopedAStatus getDiskStats(std::vector* out) override; + ndk::ScopedAStatus getStorageInfo(std::vector* out) override; protected: void UpdateHealthInfo(HealthInfo* health_info) override; @@ -212,53 +211,57 @@ class HealthImpl : public Health { }; void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) { - struct BatteryProperties props; - convertFromHealthInfo(health_info->legacy.legacy, &props); - private_healthd_board_battery_update(&props); - convertToHealthInfo(&props, health_info->legacy.legacy); + private_healthd_board_battery_update(health_info); } -Return HealthImpl::getStorageInfo(getStorageInfo_cb _hidl_cb) +ndk::ScopedAStatus HealthImpl::getStorageInfo(std::vector* out) { - std::vector info; - private_get_storage_info(info); - hidl_vec info_vec(info); - if (!info.size()) { - _hidl_cb(Result::NOT_SUPPORTED, info_vec); - } else { - _hidl_cb(Result::SUCCESS, info_vec); + private_get_storage_info(out); + if (out->empty()) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } - return Void(); + return ndk::ScopedAStatus::ok(); } -Return HealthImpl::getDiskStats(getDiskStats_cb _hidl_cb) +ndk::ScopedAStatus HealthImpl::getDiskStats(std::vector* out) { - std::vector stats; - private_get_disk_stats(stats); - hidl_vec stats_vec(stats); - if (!stats.size()) { - _hidl_cb(Result::NOT_SUPPORTED, stats_vec); - } else { - _hidl_cb(Result::SUCCESS, stats_vec); + private_get_disk_stats(out); + if (out->empty()) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } - return Void(); + return ndk::ScopedAStatus::ok(); } -} // namespace implementation -} // namespace V2_1 -} // namespace health -} // namespace hardware -} // namespace android +} // namespace aidl::android::hardware::health::implementation + +int main(int argc, char **argv) { + using ::aidl::android::hardware::health::implementation::HealthImpl; + + // Use kernel logging in recovery +#ifdef __ANDROID_RECOVERY__ + android::base::InitLogging(argv, android::base::KernelLogger); +#endif -extern "C" IHealth* HIDL_FETCH_IHealth(const char* instance) { - using ::android::hardware::health::V2_1::implementation::HealthImpl; - if (instance != "default"sv) { - return nullptr; - } auto config = std::make_unique(); InitHealthdConfig(config.get()); private_healthd_board_init(config.get()); - return new HealthImpl(std::move(config)); + auto binder = + ndk::SharedRefBase::make("default"sv, std::move(config)); + + if (argc >= 2 && argv[1] == "--charger"sv) { + // In regular mode, start charger UI. +#ifndef __ANDROID_RECOVERY__ + LOG(INFO) << "Starting charger mode with UI."; + return ChargerModeMain(binder, std::make_shared(binder)); +#endif + // In recovery, ignore --charger arg. + LOG(INFO) << "Starting charger mode without UI."; + } else { + LOG(INFO) << "Starting health HAL."; + } + + auto hal_health_loop = std::make_shared(binder, binder); + return hal_health_loop->StartLoop(); } diff --git a/health/android.hardware.health-service.gs201.rc b/health/android.hardware.health-service.gs201.rc new file mode 100644 index 00000000..bff83a39 --- /dev/null +++ b/health/android.hardware.health-service.gs201.rc @@ -0,0 +1,17 @@ +service vendor.health-gs201 /vendor/bin/hw/android.hardware.health-service.gs201 + class hal + user system + group system + capabilities WAKE_ALARM BLOCK_SUSPEND + file /dev/kmsg w + +service vendor.charger /vendor/bin/hw/android.hardware.health-service.gs201 --charger + class charger + seclabel u:r:charger_vendor:s0 + user system + group system wakelock input + capabilities SYS_BOOT + file /dev/kmsg w + file /sys/fs/pstore/console-ramoops-0 r + file /sys/fs/pstore/console-ramoops r + file /proc/last_kmsg r diff --git a/health/android.hardware.health-service.gs201.xml b/health/android.hardware.health-service.gs201.xml new file mode 100644 index 00000000..98026cbd --- /dev/null +++ b/health/android.hardware.health-service.gs201.xml @@ -0,0 +1,7 @@ + + + android.hardware.health + 1 + IHealth/default + + diff --git a/health/android.hardware.health-service.gs201_recovery.rc b/health/android.hardware.health-service.gs201_recovery.rc new file mode 100644 index 00000000..ddaeaa5e --- /dev/null +++ b/health/android.hardware.health-service.gs201_recovery.rc @@ -0,0 +1,7 @@ +service vendor.health-gs201 /system/bin/hw/android.hardware.health-service.gs201_recovery + class hal + seclabel u:r:hal_health_default:s0 + user system + group system + capabilities WAKE_ALARM BLOCK_SUSPEND + file /dev/kmsg w diff --git a/manifest-gralloc3.xml b/manifest-gralloc3.xml index 89e9e3a3..f859c7b9 100644 --- a/manifest-gralloc3.xml +++ b/manifest-gralloc3.xml @@ -2,7 +2,7 @@ android.hardware.audio hwbinder - 7.0 + 7.1 IDevicesFactory default @@ -25,19 +25,6 @@ ISoundTriggerHw default - - - android.hardware.media.omx - hwbinder - 1.0 - - IOmx - default - - - IOmxStore - default - android.hardware.graphics.allocator @@ -148,15 +135,6 @@ hwbinder @1.3::IDevice/google-edgetpu - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - com.google.input @@ -167,7 +145,7 @@ vendor.google.google_battery hwbinder - 1.1 + 1.2 IGoogleBattery default diff --git a/manifest.xml b/manifest.xml index b446f5b9..566d80b2 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,7 +2,7 @@ android.hardware.audio hwbinder - 7.0 + 7.1 IDevicesFactory default @@ -26,19 +26,6 @@ default - - android.hardware.media.omx - hwbinder - 1.0 - - IOmx - default - - - IOmxStore - default - - android.hardware.graphics.allocator hwbinder @@ -108,15 +95,6 @@ @1.3::IDevice/google-armnn - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - com.google.input @@ -127,7 +105,7 @@ vendor.google.google_battery hwbinder - 1.1 + 1.2 IGoogleBattery default diff --git a/manifest_64-gralloc3.xml b/manifest_64-gralloc3.xml deleted file mode 100644 index 3e70ec4f..00000000 --- a/manifest_64-gralloc3.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.0 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - android.hardware.graphics.allocator - hwbinder - 2.0 - - IAllocator - default - - - - android.hardware.graphics.mapper - passthrough - 2.1 - - IMapper - default - - - - android.hardware.graphics.composer - hwbinder - 2.4 - - IComposer - default - - - - android.hardware.memtrack - hwbinder - 1.0 - - IMemtrack - default - - - - android.hardware.renderscript - passthrough - 1.0 - - IDevice - default - - - - android.hardware.drm - hwbinder - 1.0 - - ICryptoFactory - default - - - IDrmFactory - default - - @1.3::ICryptoFactory/clearkey - @1.3::IDrmFactory/clearkey - @1.3::ICryptoFactory/widevine - @1.3::IDrmFactory/widevine - - - android.hardware.dumpstate - hwbinder - 1.0 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - - - android.hardware.boot - hwbinder - @1.2::IBootControl/default - - - android.hardware.sensors - hwbinder - 1.0 - - ISensors - default - - - - android.hardware.neuralnetworks - hwbinder - 1.3 - - IDevice - google-armnn - - @1.3::IDevice/google-armnn - - - android.hardware.neuralnetworks - hwbinder - @1.3::IDevice/google-edgetpu - - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - - - com.google.input - - ITouchContextService - default - - - - hardware.google.bluetooth.bt_channel_avoidance - hwbinder - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.sar - hwbinder - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.0 - - IBluetoothCcc - default - - - - vendor.google.google_battery - hwbinder - 1.1 - - IGoogleBattery - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 2.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - - diff --git a/manifest_64.xml b/manifest_64.xml deleted file mode 100644 index 17b08d04..00000000 --- a/manifest_64.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - android.hardware.audio - hwbinder - 7.0 - - IDevicesFactory - default - - - - android.hardware.audio.effect - hwbinder - 7.0 - - IEffectsFactory - default - - - - android.hardware.soundtrigger - hwbinder - 2.3 - - ISoundTriggerHw - default - - - - android.hardware.graphics.allocator - hwbinder - 4.0 - - IAllocator - default - - - - android.hardware.graphics.mapper - passthrough - 4.0 - - IMapper - default - - - - android.hardware.graphics.composer - hwbinder - 2.4 - - IComposer - default - - - - android.hardware.renderscript - passthrough - 1.0 - - IDevice - default - - - - android.hardware.dumpstate - hwbinder - 1.1 - - IDumpstateDevice - default - - - - android.hardware.bluetooth - hwbinder - 1.1 - - IBluetoothHci - default - - - - android.hardware.bluetooth.audio - hwbinder - 2.1 - - IBluetoothAudioProvidersFactory - default - - - - android.hardware.boot - hwbinder - @1.2::IBootControl/default - - - android.hardware.neuralnetworks - hwbinder - 1.3 - - IDevice - google-armnn - - @1.3::IDevice/google-armnn - - - android.hardware.neuralnetworks - hwbinder - @1.3::IDevice/google-edgetpu - - - android.hardware.health - hwbinder - 2.1 - - IHealth - default - - - - com.google.input - - ITouchContextService - default - - - - hardware.google.bluetooth.bt_channel_avoidance - hwbinder - 1.0 - - IBTChannelAvoidance - default - - - - hardware.google.bluetooth.sar - hwbinder - 1.1 - - IBluetoothSar - default - - - - hardware.google.bluetooth.ccc - hwbinder - 1.0 - - IBluetoothCcc - default - - - - vendor.google.google_battery - hwbinder - 1.1 - - IGoogleBattery - default - - - - vendor.google.whitechapel.audio.audioext - hwbinder - 2.0 - - IAudioExt - default - - - - vendor.google.audiometricext - hwbinder - 1.0 - - IAudioMetricExt - default - - - - diff --git a/media_codecs_aosp_c2.xml b/media_codecs_aosp_c2.xml index 942cd3c2..6f35fa41 100644 --- a/media_codecs_aosp_c2.xml +++ b/media_codecs_aosp_c2.xml @@ -142,6 +142,7 @@ + @@ -153,6 +154,7 @@ + @@ -164,6 +166,7 @@ + @@ -174,6 +177,7 @@ + @@ -185,6 +189,7 @@ + @@ -196,6 +201,7 @@ + diff --git a/media_codecs_performance_c2.xml b/media_codecs_performance_c2.xml index a595ee4b..2c6663e9 100644 --- a/media_codecs_performance_c2.xml +++ b/media_codecs_performance_c2.xml @@ -257,15 +257,19 @@ + + + + - + - + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 5e2361e6..2aeeb230 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -34,12 +34,6 @@ 4 - - true - - - true - true @@ -146,7 +140,6 @@ com.google.android.iwlan com.google.android.iwlan false - com.shannon.qualifiednetworksservice @@ -161,6 +154,11 @@ true + + 3000 + true @@ -241,9 +239,9 @@ "/apex/com.android.art/javalib/core-oj.jar" "/apex/com.android.art/javalib/core-libart.jar" - "/apex/com.android.media/javalib/updatable-media.jar" "/system/framework/framework.jar" "/system/framework/services.jar" + "/system/bin/surfaceflinger" "/system_ext/priv-app/SystemUIGoogle/SystemUIGoogle.apk" @@ -279,4 +277,19 @@ manually by the user. Off by default, since the expected haptic feedback may not be available on some devices. --> true + + + 2097152,6291456,16777216,512000,2097152,8388608 diff --git a/overlay/frameworks/base/core/res/res/values/dimens.xml b/overlay/frameworks/base/core/res/res/values/dimens.xml new file mode 100644 index 00000000..fc36aa34 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/dimens.xml @@ -0,0 +1,21 @@ + + + + + 70px + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml index cea6e902..6d08eb4c 100644 --- a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml +++ b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml @@ -16,9 +16,6 @@ */ --> - - 70px - 1dp diff --git a/powerhint.json b/powerhint.json index 846440de..07aa66d6 100644 --- a/powerhint.json +++ b/powerhint.json @@ -131,6 +131,25 @@ "DefaultIndex": 0, "ResetOnInit": true }, + { + "Name": "SFUClampBoost", + "Path": "/sys/kernel/vendor_sched/sf_uclamp_min", + "Values": [ + "65", + "30" + ], + "ResetOnInit": true + }, + { + "Name": "MLUclampBoost", + "Path": "/sys/kernel/vendor_sched/nnapi_uclamp_min", + "Values": [ + "154", + "512" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "CDPreferIdle", "Path": "/sys/kernel/vendor_sched/cam_prefer_idle", @@ -212,15 +231,6 @@ ], "ResetOnInit": true }, - { - "Name": "HighCapacityStartCpu", - "Path": "/sys/kernel/vendor_sched/high_capacity_start_cpu", - "Values": [ - "4", - "6" - ], - "ResetOnInit": true - }, { "Name": "DisplayWakeup", "Path": "/sys/devices/platform/1c240000.drmdecon/early_wakeup", @@ -273,6 +283,12 @@ "Type": "EndHint", "Value": "DISABLE_TA_BOOST" }, + { + "PowerHint": "INTERACTION", + "Node": "SFUClampBoost", + "Duration": 5000, + "Value": "65" + }, { "PowerHint": "INTERACTION", "Node": "CPUBigClusterMinFreq", @@ -662,12 +678,6 @@ "Duration": 0, "Value": "1" }, - { - "PowerHint": "CAMERA_STREAMING_EXTREME", - "Node": "HighCapacityStartCpu", - "Duration": 0, - "Value": "4" - }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "GPUMinFreq", @@ -740,12 +750,6 @@ "Duration": 0, "Value": "1" }, - { - "PowerHint": "CAMERA_STREAMING_HIGH", - "Node": "HighCapacityStartCpu", - "Duration": 0, - "Value": "4" - }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "CPULittleClusterMaxFreq", @@ -884,12 +888,6 @@ "Duration": 0, "Value": "0" }, - { - "PowerHint": "CAMERA_STREAMING_LOW", - "Node": "HighCapacityStartCpu", - "Duration": 0, - "Value": "4" - }, { "PowerHint": "CAMERA_STREAMING_LOW", "Node": "CPUBigClusterMaxFreq", @@ -1053,6 +1051,18 @@ "Node": "GPUMinFreq", "Duration": 0, "Value": "400000" + }, + { + "PowerHint": "FP_BOOST", + "Node": "CPUBigClusterMaxFreq", + "Duration": 1000, + "Value": "9999999" + }, + { + "PowerHint": "FP_BOOST", + "Node": "CPUBigClusterMinFreq", + "Duration": 1000, + "Value": "9999999" } ] } diff --git a/powerhint_a0.json b/powerhint_a0.json deleted file mode 100644 index feafbef2..00000000 --- a/powerhint_a0.json +++ /dev/null @@ -1,384 +0,0 @@ -{ - "Nodes": [ - { - "Name": "CPULittleClusterMaxFreq", - "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", - "Values": [ - "9999999", - "1197000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "CPULittleClusterMinFreq", - "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", - "Values": [ - "9999999", - "1197000", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "CPUBigClusterMaxFreq", - "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq", - "Values": [ - "9999999", - "1999000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "CPUBigClusterMinFreq", - "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq", - "Values": [ - "9999999", - "1197000", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "GPUMinFreq", - "Path": "/sys/devices/platform/28000000.mali/hint_min_freq", - "Values": [ - "151000", - "302000", - "510000", - "572000", - "762000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "TAUClampBoost", - "Path": "/sys/kernel/vendor_sched/ta_uclamp_min", - "Values": [ - "0", - "410", - "308", - "205", - "103" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "UfsClkGateEnable", - "Path": "/dev/sys/block/bootdevice/clkgate_enable", - "Values": [ - "0", - "1" - ], - "ResetOnInit": true - }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "DisplayWakeup", - "Path": "/sys/devices/platform/1c240000.drmdecon/early_wakeup", - "Values": [ - "1", - "0" - ] - }, - { - "Name": "PowerHALRenderingState", - "Path": "vendor.powerhal.rendering", - "Values": [ - "EXPENSIVE_RENDERING", - "" - ], - "Type": "Property" - } - ], - "Actions": [ - { - "PowerHint": "INTERACTION", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "INTERACTION", - "Node": "CPUBigClusterMinFreq", - "Duration": 6000, - "Value": "1197000" - }, - { - "PowerHint": "INTERACTION", - "Node": "CPULittleClusterMinFreq", - "Duration": 6000, - "Value": "1197000" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "INTERACTION_120", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "410" - }, - { - "PowerHint": "INTERACTION_90", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "308" - }, - { - "PowerHint": "INTERACTION_60", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "205" - }, - { - "PowerHint": "REFRESH_120FPS", - "Type": "MaskHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "REFRESH_120FPS", - "Type": "MaskHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "REFRESH_90FPS", - "Type": "MaskHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "REFRESH_90FPS", - "Type": "MaskHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "REFRESH_60FPS", - "Type": "MaskHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "REFRESH_60FPS", - "Type": "MaskHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "INTERACTION", - "Node": "UfsClkGateEnable", - "Duration": 200, - "Value": "0" - }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, - { - "PowerHint": "LAUNCH", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPUBigClusterMaxFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPUBigClusterMinFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPULittleClusterMaxFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPULittleClusterMinFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "TAUClampBoost", - "Duration": 5000, - "Value": "308" - }, - { - "PowerHint": "LAUNCH", - "Node": "UfsClkGateEnable", - "Duration": 5000, - "Value": "0" - }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPUBigClusterMaxFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPUBigClusterMinFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPULittleClusterMaxFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPULittleClusterMinFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "UfsClkGateEnable", - "Duration": 1000, - "Value": "0" - }, - { - "PowerHint": "CAMERA_STREAMING_STANDARD", - "Node": "CPUBigClusterMaxFreq", - "Duration": 0, - "Value": "1999000" - }, - { - "PowerHint": "CAMERA_STREAMING_STANDARD", - "Node": "GPUMinFreq", - "Duration": 0, - "Value": "762000" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUBigClusterMaxFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUBigClusterMinFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPULittleClusterMaxFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPULittleClusterMinFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "EXPENSIVE_RENDERING", - "Node": "PowerHALRenderingState", - "Duration": 0, - "Value": "EXPENSIVE_RENDERING" - }, - { - "PowerHint": "EXPENSIVE_RENDERING", - "Node": "GPUMinFreq", - "Duration": 0, - "Value": "510000" - }, - { - "PowerHint": "REFRESH_120FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "308" - }, - { - "PowerHint": "REFRESH_90FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "205" - }, - { - "PowerHint": "REFRESH_60FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "103" - }, - { - "PowerHint": "DISABLE_TA_BOOST", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "0" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "DoHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "DISPLAY_UPDATE_IMMINENT" - }, - { - "PowerHint": "DISPLAY_UPDATE_IMMINENT", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "DISPLAY_UPDATE_IMMINENT", - "Node": "DisplayWakeup", - "Duration": 50, - "Value": "1" - } - ] -} diff --git a/powerhint_a1.json b/powerhint_a1.json deleted file mode 100644 index 6ab15f5e..00000000 --- a/powerhint_a1.json +++ /dev/null @@ -1,444 +0,0 @@ -{ - "Nodes": [ - { - "Name": "CPULittleClusterMaxFreq", - "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", - "Values": [ - "9999999", - "1197000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "CPULittleClusterMinFreq", - "Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", - "Values": [ - "9999999", - "1197000", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "CPUMidClusterMaxFreq", - "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq", - "Values": [ - "9999999", - "1999000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "CPUMidClusterMinFreq", - "Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq", - "Values": [ - "9999999", - "1197000", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "CPUBigClusterMaxFreq", - "Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq", - "Values": [ - "9999999", - "1999000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "CPUBigClusterMinFreq", - "Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq", - "Values": [ - "9999999", - "1106000", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "GPUMinFreq", - "Path": "/sys/devices/platform/28000000.mali/hint_min_freq", - "Values": [ - "151000", - "302000", - "510000", - "572000", - "762000" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "TAUClampBoost", - "Path": "/sys/kernel/vendor_sched/ta_uclamp_min", - "Values": [ - "0", - "410", - "308", - "205", - "103" - ], - "DefaultIndex": 0, - "ResetOnInit": true - }, - { - "Name": "UfsClkGateEnable", - "Path": "/dev/sys/block/bootdevice/clkgate_enable", - "Values": [ - "0", - "1" - ], - "ResetOnInit": true - }, - { - "Name": "F2fsRecessModeEnable", - "Path": "/dev/sys/fs/by-name/userdata/gc_urgent", - "Values": [ - "2", - "0" - ], - "ResetOnInit": true - }, - { - "Name": "DisplayWakeup", - "Path": "/sys/devices/platform/1c240000.drmdecon/early_wakeup", - "Values": [ - "1", - "0" - ] - }, - { - "Name": "LimitFlashCurrent", - "Path": "vendor.camera.max_flash_current", - "Values": [ - "100", - "1500" - ], - "ResetOnInit": true, - "Type": "Property" - }, - { - "Name": "PowerHALRenderingState", - "Path": "vendor.powerhal.rendering", - "Values": [ - "EXPENSIVE_RENDERING", - "" - ], - "Type": "Property" - } - ], - "Actions": [ - { - "PowerHint": "INTERACTION", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "INTERACTION", - "Node": "CPUBigClusterMinFreq", - "Duration": 6000, - "Value": "1106000" - }, - { - "PowerHint": "INTERACTION", - "Node": "CPUMidClusterMinFreq", - "Duration": 6000, - "Value": "1197000" - }, - { - "PowerHint": "INTERACTION", - "Node": "CPULittleClusterMinFreq", - "Duration": 6000, - "Value": "1197000" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "INTERACTION", - "Type": "DoHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "INTERACTION_120", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "410" - }, - { - "PowerHint": "INTERACTION_90", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "308" - }, - { - "PowerHint": "INTERACTION_60", - "Node": "TAUClampBoost", - "Duration": 6000, - "Value": "205" - }, - { - "PowerHint": "REFRESH_120FPS", - "Type": "MaskHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "REFRESH_120FPS", - "Type": "MaskHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "REFRESH_90FPS", - "Type": "MaskHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "REFRESH_90FPS", - "Type": "MaskHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "REFRESH_60FPS", - "Type": "MaskHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "REFRESH_60FPS", - "Type": "MaskHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_120" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_90" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "INTERACTION_60" - }, - { - "PowerHint": "INTERACTION", - "Node": "UfsClkGateEnable", - "Duration": 200, - "Value": "0" - }, - { - "PowerHint": "DEVICE_IDLE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, - { - "PowerHint": "LAUNCH", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPUMidClusterMaxFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPUMidClusterMinFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPULittleClusterMaxFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "CPULittleClusterMinFreq", - "Duration": 5000, - "Value": "9999999" - }, - { - "PowerHint": "LAUNCH", - "Node": "TAUClampBoost", - "Duration": 5000, - "Value": "308" - }, - { - "PowerHint": "LAUNCH", - "Node": "UfsClkGateEnable", - "Duration": 5000, - "Value": "0" - }, - { - "PowerHint": "DISPLAY_INACTIVE", - "Node": "F2fsRecessModeEnable", - "Duration": 0, - "Value": "2" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPUBigClusterMaxFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPUBigClusterMinFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPULittleClusterMaxFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "CPULittleClusterMinFreq", - "Duration": 1000, - "Value": "9999999" - }, - { - "PowerHint": "CAMERA_LAUNCH", - "Node": "UfsClkGateEnable", - "Duration": 1000, - "Value": "0" - }, - { - "PowerHint": "CAMERA_STREAMING_STANDARD", - "Node": "CPUBigClusterMaxFreq", - "Duration": 0, - "Value": "1999000" - }, - { - "PowerHint": "CAMERA_STREAMING_STANDARD", - "Node": "GPUMinFreq", - "Duration": 0, - "Value": "762000" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUBigClusterMaxFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUBigClusterMinFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUMidClusterMaxFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPUMidClusterMinFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPULittleClusterMaxFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "FIXED_PERFORMANCE", - "Node": "CPULittleClusterMinFreq", - "Duration": 0, - "Value": "9999999" - }, - { - "PowerHint": "REFRESH_120FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "308" - }, - { - "PowerHint": "REFRESH_90FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "205" - }, - { - "PowerHint": "REFRESH_60FPS", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "103" - }, - { - "PowerHint": "DISABLE_TA_BOOST", - "Node": "TAUClampBoost", - "Duration": 0, - "Value": "0" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "DoHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "DISPLAY_IDLE", - "Type": "EndHint", - "Value": "DISPLAY_UPDATE_IMMINENT" - }, - { - "PowerHint": "DISPLAY_UPDATE_IMMINENT", - "Type": "EndHint", - "Value": "DISABLE_TA_BOOST" - }, - { - "PowerHint": "DISPLAY_UPDATE_IMMINENT", - "Node": "DisplayWakeup", - "Duration": 50, - "Value": "1" - }, - { - "PowerHint": "THERMAL_FLASH_LED_REDUCE_CRITICAL", - "Node": "LimitFlashCurrent", - "Duration": 0, - "Value": "100" - }, - { - "PowerHint": "THERMAL_FLASH_LED_REDUCE_NONE", - "Node": "LimitFlashCurrent", - "Duration": 0, - "Value": "1500" - }, - { - "PowerHint": "EXPENSIVE_RENDERING", - "Node": "PowerHALRenderingState", - "Duration": 0, - "Value": "EXPENSIVE_RENDERING" - }, - { - "PowerHint": "EXPENSIVE_RENDERING", - "Node": "GPUMinFreq", - "Duration": 0, - "Value": "510000" - } - ] -} diff --git a/powerstats/Android.bp b/powerstats/Android.bp index df23609c..3991c149 100644 --- a/powerstats/Android.bp +++ b/powerstats/Android.bp @@ -11,6 +11,14 @@ // 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. + +soong_namespace { + imports: [ + "hardware/google/pixel", + "device/google/gs-common/powerstats", + ], +} + package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -33,6 +41,7 @@ cc_library { ], shared_libs: [ + "android.hardware.power.stats-impl.gs-common", "android.hardware.power.stats-impl.pixel", ], } diff --git a/powerstats/AocStateResidencyDataProvider.cpp b/powerstats/AocStateResidencyDataProvider.cpp deleted file mode 100644 index c64496dd..00000000 --- a/powerstats/AocStateResidencyDataProvider.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ - -#include "AocStateResidencyDataProvider.h" - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -AocStateResidencyDataProvider::AocStateResidencyDataProvider(std::vector> ids, std::vector> states) { - // AoC stats are reported in ticks of 244.140625ns. The transform - // function converts ticks to milliseconds. - // 1000000 / 244.140625 = 4096. - static const uint64_t AOC_CLK = 4096; - std::function aocTickToMs = [](uint64_t a) { return a / AOC_CLK; }; - GenericStateResidencyDataProvider::StateResidencyConfig config = { - .entryCountSupported = true, - .entryCountPrefix = "Counter:", - .totalTimeSupported = true, - .totalTimePrefix = "Cumulative time:", - .totalTimeTransform = aocTickToMs, - .lastEntrySupported = true, - .lastEntryPrefix = "Time last entered:", - .lastEntryTransform = aocTickToMs, - }; - for (const auto &id : ids) { - for (const auto &state : states) { - std::vector> aocStateHeaders = { - std::make_pair(state.first, ""), - }; - std::vector cfgs; - cfgs.emplace_back(generateGenericStateResidencyConfigs(config, aocStateHeaders), - id.first, ""); - std::unique_ptr sdp( - new GenericStateResidencyDataProvider(id.second + state.second, cfgs)); - mProviders[id.first].push_back(std::move(sdp)); - } - } -} - -bool AocStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - // States from the same power entity are merged. - bool ret = true; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateResidencies; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> residency; - ret &= provider->getStateResidencies(&residency); - - // Each provider should only return data for curEntity but checking anyway - if (residency.find(curEntity) != residency.end()) { - for (auto &r : residency.at(curEntity)) { - /* - * Modifying stateId here because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - r.id = stateId++; - stateResidencies.push_back(r); - } - } - } - - residencies->emplace(curEntity, stateResidencies); - } - return ret; -} - -std::unordered_map> AocStateResidencyDataProvider::getInfo() { - // States from the same power entity are merged - std::unordered_map> infos; - for (const auto &providerList : mProviders) { - int32_t stateId = 0; - std::string curEntity = providerList.first; - std::vector stateInfos; - - // Iterate over each provider in the providerList, appending each of the states - for (const auto &provider : providerList.second) { - std::unordered_map> info = provider->getInfo(); - - // Each provider should only return data for curEntity but checking anyway - if (info.find(curEntity) != info.end()) { - for (auto &i : info.at(curEntity)) { - /* - * Modifying stateId because we are stitching together infos from - * multiple GenericStateResidencyDataProviders. stateId must be modified - * to maintain uniqueness for a given entity - */ - i.id = stateId++; - stateInfos.push_back(i); - } - } - } - - infos.emplace(curEntity, stateInfos); - } - - return infos; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/AocStateResidencyDataProvider.h b/powerstats/AocStateResidencyDataProvider.h deleted file mode 100644 index 50089121..00000000 --- a/powerstats/AocStateResidencyDataProvider.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ -#pragma once - -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class AocStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - AocStateResidencyDataProvider(std::vector> ids, - std::vector> states); - ~AocStateResidencyDataProvider() = default; - bool getStateResidencies( - std::unordered_map> *residencies) override; - std::unordered_map> getInfo() override; - - private: - std::unordered_map> /* providers */> mProviders; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl \ No newline at end of file diff --git a/powerstats/DevfreqStateResidencyDataProvider.cpp b/powerstats/DevfreqStateResidencyDataProvider.cpp deleted file mode 100644 index d59e1e5e..00000000 --- a/powerstats/DevfreqStateResidencyDataProvider.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#include "DevfreqStateResidencyDataProvider.h" - -#include - -static const std::string nameSuffix = "-DVFS"; -static const std::string pathSuffix = "/time_in_state"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DevfreqStateResidencyDataProvider::DevfreqStateResidencyDataProvider(const std::string& name, - const std::string& path) : mName(name + nameSuffix), mPath(path + pathSuffix) {} - -bool DevfreqStateResidencyDataProvider::extractNum(const char *str, char **str_end, int base, - int64_t* num) { - // errno can be set to any non-zero value by a library function call - // regardless of whether there was an error, so it needs to be cleared - // in order to check the error set by strtoll - errno = 0; - *num = std::strtoll(str, str_end, base); - return (errno != ERANGE); -} - -std::vector> DevfreqStateResidencyDataProvider::parseTimeInState() { - // Using FILE* instead of std::ifstream for performance reasons - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << "Failed to open file " << mPath; - return {}; - } - - std::vector> timeInState; - - char *line = nullptr; - size_t len = 0; - while (getline(&line, &len, fp.get()) != -1) { - char* pEnd; - int64_t frequencyHz, totalTimeMs; - if (!extractNum(line, &pEnd, 10, &frequencyHz) || - !extractNum(pEnd, &pEnd, 10, &totalTimeMs)) { - PLOG(ERROR) << "Failed to parse " << mPath; - free(line); - return {}; - } - - timeInState.push_back({frequencyHz, totalTimeMs}); - } - - free(line); - return timeInState; -} - -bool DevfreqStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return false; - } - - int32_t id = 0; - std::vector stateResidencies; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - StateResidency s = {.id = id++, .totalTimeInStateMs = totalTimeMs}; - stateResidencies.push_back(s); - } - - residencies->emplace(mName, stateResidencies); - return true; -} - -std::unordered_map> DevfreqStateResidencyDataProvider::getInfo() { - std::vector> timeInState = parseTimeInState(); - - if (timeInState.empty()) { - return {}; - } - - int32_t id = 0; - std::vector states; - for (const auto[frequencyHz, totalTimeMs] : timeInState) { - State s = {.id = id++, .name = std::to_string(frequencyHz / 1000) + "MHz"}; - states.push_back(s); - } - - return {{mName, states}}; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DevfreqStateResidencyDataProvider.h b/powerstats/DevfreqStateResidencyDataProvider.h deleted file mode 100644 index 8341b433..00000000 --- a/powerstats/DevfreqStateResidencyDataProvider.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DevfreqStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - DevfreqStateResidencyDataProvider(const std::string& name, const std::string& path); - ~DevfreqStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - bool extractNum(const char *str, char **str_end, int base, int64_t* num); - std::vector> parseTimeInState(); - const std::string mName; - const std::string mPath; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DvfsStateResidencyDataProvider.cpp b/powerstats/DvfsStateResidencyDataProvider.cpp deleted file mode 100644 index 511159ef..00000000 --- a/powerstats/DvfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ -#include "DvfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseUint; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -static const std::string nameSuffix = "-DVFS"; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -DvfsStateResidencyDataProvider::DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, - std::vector cfgs) - : mPath(std::move(path)), mClockRate(clockRate), mPowerEntities(std::move(cfgs)) {} - -int32_t DvfsStateResidencyDataProvider::matchEntity(char const *line) { - for (int32_t i = 0; i < mPowerEntities.size(); i++) { - if (mPowerEntities[i].powerEntityName == Trim(std::string(line))) { - return i; - } - } - return -1; -} - -int32_t DvfsStateResidencyDataProvider::matchState(char const *line, const Config& powerEntity) { - for (int32_t i = 0; i < powerEntity.states.size(); i++) { - if (StartsWith(Trim(std::string(line)), powerEntity.states[i].second)) { - return i; - } - } - return -1; -} - -bool DvfsStateResidencyDataProvider::parseState(char const *line, uint64_t *duration, - uint64_t *count) { - std::vector parts = Split(line, " "); - if (parts.size() != 7) { - return false; - } - if (!ParseUint(Trim(parts[3]), count)) { - return false; - } - if (!ParseUint(Trim(parts[6]), duration)) { - return false; - } - return true; -} - -bool DvfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - std::unique_ptr fp(fopen(mPath.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << mPath; - return false; - } - - for (const Config &powerEntity : mPowerEntities) { - std::vector stateResidency(powerEntity.states.size()); - for (int32_t i = 0; i < stateResidency.size(); i++) { - stateResidency[i].id = i; - } - residencies->emplace(powerEntity.powerEntityName + nameSuffix, stateResidency); - } - - size_t len = 0; - char *line = nullptr; - - int32_t temp, powerEntityIndex, stateId = -1; - uint64_t duration, count; - auto it = residencies->end(); - - while (getline(&line, &len, fp.get()) != -1) { - temp = matchEntity(line); - // Assign new index only when a new valid entity is encountered. - if (temp >= 0) { - powerEntityIndex = temp; - it = residencies->find(mPowerEntities[powerEntityIndex].powerEntityName + nameSuffix); - } - - if (it != residencies->end()) { - stateId = matchState(line, mPowerEntities[powerEntityIndex]); - - if (stateId >= 0) { - if (parseState(line, &duration, &count)) { - it->second[stateId].totalTimeInStateMs = - duration / mClockRate; - it->second[stateId].totalStateEntryCount = count; - } else { - LOG(ERROR) << "Failed to parse duration and count from [" << std::string(line) - << "]"; - return false; - } - } - } - } - - free(line); - - return true; -} - -std::unordered_map> DvfsStateResidencyDataProvider::getInfo() { - std::unordered_map> info; - for (auto const &entity : mPowerEntities) { - std::vector stateInfo(entity.states.size()); - int32_t stateId = 0; - for (auto const &state : entity.states) { - stateInfo[stateId] = State{ - .id = stateId, - .name = state.first - }; - stateId++; - } - info.emplace(entity.powerEntityName + nameSuffix, stateInfo); - } - return info; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/DvfsStateResidencyDataProvider.h b/powerstats/DvfsStateResidencyDataProvider.h deleted file mode 100644 index ca8ab22b..00000000 --- a/powerstats/DvfsStateResidencyDataProvider.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2020 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class DvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - class Config { - public: - // Power entity name to parse. - std::string powerEntityName; - - // List of state pairs (name to display, name to parse). - std::vector> states; - }; - /* - * path - path to dvfs sysfs node. - * clockRate - clock rate in KHz. - */ - DvfsStateResidencyDataProvider(std::string path, uint64_t clockRate, std::vector cfgs); - ~DvfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int32_t matchEntity(char const *line); - int32_t matchState(char const *line, const Config& powerEntity); - bool parseState(char const *line, uint64_t *duration, uint64_t *count); - - const std::string mPath; - const uint64_t mClockRate; - std::vector mPowerEntities; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/Gs201CommonDataProviders.cpp b/powerstats/Gs201CommonDataProviders.cpp index 7c944ea8..503606ae 100644 --- a/powerstats/Gs201CommonDataProviders.cpp +++ b/powerstats/Gs201CommonDataProviders.cpp @@ -16,10 +16,10 @@ #include #include -#include "AocStateResidencyDataProvider.h" -#include "DevfreqStateResidencyDataProvider.h" -#include "DvfsStateResidencyDataProvider.h" -#include "UfsStateResidencyDataProvider.h" +#include +#include +#include +#include #include #include #include @@ -161,7 +161,13 @@ void addDvfsStats(std::shared_ptr p) { }}); cfgs.push_back({"CL0", { + std::make_pair("2024MHz", "2024000"), + std::make_pair("1950MHz", "1950000"), + std::make_pair("1803MHz", "1803000"), + std::make_pair("1704MHz", "1704000"), std::make_pair("1598MHz", "1598000"), + std::make_pair("1401MHz", "1401000"), + std::make_pair("1328MHz", "1328000"), std::make_pair("1197MHz", "1197000"), std::make_pair("1098MHz", "1098000"), std::make_pair("930MHz", "930000"), @@ -172,15 +178,40 @@ void addDvfsStats(std::shared_ptr p) { }}); cfgs.push_back({"CL1", { + std::make_pair("2348MHz", "2348000"), + std::make_pair("2253MHz", "2253000"), + std::make_pair("2130MHz", "2130000"), + std::make_pair("1999MHz", "1999000"), + std::make_pair("1836MHz", "1836000"), + std::make_pair("1663MHz", "1663000"), + std::make_pair("1491MHz", "1491000"), + std::make_pair("1328MHz", "1328000"), + std::make_pair("1197MHz", "1197000"), + std::make_pair("1024MHz", "1024000"), std::make_pair("910MHz", "910000"), std::make_pair("799MHz", "799000"), std::make_pair("696MHz", "696000"), - std::make_pair("533MHz", "533000"), + std::make_pair("553MHz", "553000"), std::make_pair("400MHz", "400000"), std::make_pair("0MHz", "0"), }}); cfgs.push_back({"CL2", { + std::make_pair("2850MHz", "2850000"), + std::make_pair("2802MHz", "2802000"), + std::make_pair("2704MHz", "2704000"), + std::make_pair("2630MHz", "2630000"), + std::make_pair("2507MHz", "2507000"), + std::make_pair("2401MHz", "2401000"), + std::make_pair("2252MHz", "2252000"), + std::make_pair("2188MHz", "2188000"), + std::make_pair("2048MHz", "2048000"), + std::make_pair("1826MHz", "1826000"), + std::make_pair("1745MHz", "1745000"), + std::make_pair("1582MHz", "1582000"), + std::make_pair("1426MHz", "1426000"), + std::make_pair("1277MHz", "1277000"), + std::make_pair("1106MHz", "1106000"), std::make_pair("984MHz", "984000"), std::make_pair("851MHz", "851000"), std::make_pair("500MHz", "500000"), @@ -376,7 +407,8 @@ void addMobileRadio(std::shared_ptr p) "/sys/devices/platform/cpif/modem/power_stats", cfgs)); p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterConsumer(p, - EnergyConsumerType::MOBILE_RADIO, "MODEM", {"VSYS_PWR_MODEM", "VSYS_PWR_RFFE"})); + EnergyConsumerType::MOBILE_RADIO, "MODEM", + {"VSYS_PWR_MODEM", "VSYS_PWR_RFFE", "VSYS_PWR_MMWAVE"})); } void addGNSS(std::shared_ptr p) @@ -533,17 +565,28 @@ void addPowerDomains(std::shared_ptr p) { void addDevfreq(std::shared_ptr p) { p->addStateResidencyDataProvider(std::make_unique( - "INT", "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int")); + "INT", + "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int")); p->addStateResidencyDataProvider(std::make_unique( "INTCAM", "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam")); p->addStateResidencyDataProvider(std::make_unique( - "CAM", "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam")); + "DISP", + "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp")); p->addStateResidencyDataProvider(std::make_unique( - "TNR", "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr")); + "CAM", + "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam")); + + p->addStateResidencyDataProvider(std::make_unique( + "TNR", + "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr")); + + p->addStateResidencyDataProvider(std::make_unique( + "MFC", + "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc")); } void addTPU(std::shared_ptr p) { diff --git a/powerstats/UfsStateResidencyDataProvider.cpp b/powerstats/UfsStateResidencyDataProvider.cpp deleted file mode 100644 index aec77241..00000000 --- a/powerstats/UfsStateResidencyDataProvider.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#include "UfsStateResidencyDataProvider.h" - -#include -#include -#include - -#include -#include - -using android::base::ParseInt; -using android::base::Split; -using android::base::StartsWith; -using android::base::Trim; - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -const int32_t HIBERNATE_STATE_ID = 0; -const std::string UFS_NAME = "UFS"; - -UfsStateResidencyDataProvider::UfsStateResidencyDataProvider(std::string prefix) : kPrefix(prefix) {} - -bool UfsStateResidencyDataProvider::getStateResidencies( - std::unordered_map> *residencies) { - StateResidency residency; - residency.id = HIBERNATE_STATE_ID; - - // The transform function converts microseconds to milliseconds. - std::function usecToMs = [](uint64_t a) { return a / 1000; }; - - residency.totalTimeInStateMs = usecToMs(readStat(kPrefix + "hibern8_total_us")); - residency.totalStateEntryCount = readStat(kPrefix + "hibern8_exit_cnt"); - residency.lastEntryTimestampMs = usecToMs(readStat(kPrefix + "last_hibern8_enter_time")); - - residencies->emplace(UFS_NAME, std::vector{residency}); - return true; -} - -std::unordered_map> UfsStateResidencyDataProvider::getInfo() { - return {{UFS_NAME, std::vector{{HIBERNATE_STATE_ID, "HIBERN8"}} }}; -} - -int64_t UfsStateResidencyDataProvider::readStat(std::string path) { - std::unique_ptr fp(fopen(path.c_str(), "r"), fclose); - if (!fp) { - PLOG(ERROR) << __func__ << ":Failed to open file " << path - << " Error = " << strerror(errno); - return 0; - } - const size_t size = 20; - char buf[size]; - (void)fread(&buf, sizeof(char), size, fp.get()); - int64_t ret; - if (!ParseInt(Trim(std::string(buf)), &ret)) { - LOG(ERROR) << "Failed to parse int64 from [" << std::string(buf) << "]"; - } - return ret; -} - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/powerstats/UfsStateResidencyDataProvider.h b/powerstats/UfsStateResidencyDataProvider.h deleted file mode 100644 index f4ef268d..00000000 --- a/powerstats/UfsStateResidencyDataProvider.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2021 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. - */ -#pragma once - -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace power { -namespace stats { - -class UfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider { - public: - UfsStateResidencyDataProvider(std::string prefix); - ~UfsStateResidencyDataProvider() = default; - - /* - * See IStateResidencyDataProvider::getStateResidencies - */ - bool getStateResidencies( - std::unordered_map> *residencies) override; - - /* - * See IStateResidencyDataProvider::getInfo - */ - std::unordered_map> getInfo() override; - - private: - int64_t readStat(std::string path); - - const std::string kPrefix; -}; - -} // namespace stats -} // namespace power -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/radio/config/default.cfg b/radio/config/default.cfg new file mode 100644 index 00000000..58f9cd39 --- /dev/null +++ b/radio/config/default.cfg @@ -0,0 +1 @@ +default.nprf,default_metrics.xml \ No newline at end of file diff --git a/radio/config/default.nprf b/radio/config/default.nprf new file mode 100644 index 00000000..fe15d733 Binary files /dev/null and b/radio/config/default.nprf differ diff --git a/radio/config/default_metrics.xml b/radio/config/default_metrics.xml new file mode 100644 index 00000000..51374d9d --- /dev/null +++ b/radio/config/default_metrics.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/radio/config/logging.conf b/radio/config/logging.conf new file mode 100644 index 00000000..d57c82aa --- /dev/null +++ b/radio/config/logging.conf @@ -0,0 +1 @@ +modem_logging_control START -o /data/vendor/radio/logs/always-on -n 10 -s 20 -m /vendor/etc/modem/default.cfg --enable_exmetric --enable_exmetric_internal \ No newline at end of file diff --git a/set_usb_irq.sh b/set_usb_irq.sh new file mode 100644 index 00000000..c131713e --- /dev/null +++ b/set_usb_irq.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Switch into /proc/irq/$IRQ for the dwc3 usb controller +cd /proc/irq/*/dwc3/.. || exit 7 + +# Move the USB Controller (DWC3) interrupt as requested +# Modem and DIT are on 0/2/5 depending on throughput, so avoid those. +# 0-3 small, 4-5 medium, 6-7 big +case "$1" in + medium) core=4;; + big) core=6;; + *) core=0;; +esac + +# This can sometimes fail due to smp_affinity_list no longer existing... +echo "${core}" > smp_affinity_list diff --git a/task_profiles.json b/task_profiles.json index 5ca54314..b113f35d 100644 --- a/task_profiles.json +++ b/task_profiles.json @@ -3,14 +3,6 @@ { "Name": "MaxPerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -25,14 +17,6 @@ { "Name": "CameraServicePerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -44,6 +28,48 @@ } ] }, + { + "Name": "CameraServicePower", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/set_task_group_cam_power", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "Dex2oatPerformance", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/set_task_group_dex2oat", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "OtaPerformance", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/set_task_group_ota", + "Value": "", + "LogFailures": "false" + } + } + ] + }, { "Name": "CameraServiceHighCapacity", "Actions": [ @@ -86,14 +112,6 @@ { "Name": "HighEnergySaving", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "background" - } - }, { "Name": "WriteFile", "Params": @@ -108,19 +126,11 @@ { "Name": "NormalPerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": { - "FilePath": "/sys/kernel/vendor_sched/clear_group", + "FilePath": "/sys/kernel/vendor_sched/set_task_group_sys", "Value": "", "LogFailures": "false" } @@ -130,14 +140,6 @@ { "Name": "HighPerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -152,14 +154,6 @@ { "Name": "RealtimePerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -174,14 +168,6 @@ { "Name": "NNApiHALPerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -194,16 +180,8 @@ ] }, { - "Name": "SystemBGPerformance", + "Name": "ServicePerformance", "Actions": [ - { - "Name": "JoinCgroup", - "Params": - { - "Controller": "cpu", - "Path": "system" - } - }, { "Name": "WriteFile", "Params": @@ -214,6 +192,89 @@ } } ] + }, + { + "Name": "SFMainPolicy", + "Actions": [ + { + "Name": "JoinCgroup", + "Params": + { + "Controller": "cpuset", + "Path": "top-app" + } + }, + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/set_task_group_sf", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "SFRenderEnginePolicy", + "Actions": [ + { + "Name": "JoinCgroup", + "Params": + { + "Controller": "cpuset", + "Path": "top-app" + } + }, + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/set_task_group_rt", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "ResetUclampGrp", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/uclamp_fork_reset_set", + "Value": "", + "LogFailures": "false" + } + } + ] + }, + { + "Name": "NoResetUclampGrp", + "Actions": [ + { + "Name": "WriteFile", + "Params": + { + "FilePath": "/sys/kernel/vendor_sched/uclamp_fork_reset_clear", + "Value": "", + "LogFailures": "false" + } + } + ] + } + ], + + "AggregateProfiles": [ + { + "Name": "Dex2OatBootComplete", + "Profiles": [ "Dex2oatPerformance", "ProcessCapacityNormal", "LowIoPriority", "TimerSlackHigh" ] + }, + { + "Name": "OtaProfiles", + "Profiles": [ "OtaPerformance", "ServiceCapacityLow", "LowIoPriority", "TimerSlackHigh" ] } ] } diff --git a/usb/UsbGadget.cpp b/usb/UsbGadget.cpp index d8e1b1f5..23e56597 100644 --- a/usb/UsbGadget.cpp +++ b/usb/UsbGadget.cpp @@ -390,6 +390,12 @@ Return UsbGadget::setCurrentUsbFunctions(uint64_t functions, goto error; } + if (functions & GadgetFunction::NCM) { + SetProperty("vendor.usb.dwc3_irq", "big"); + } else { + SetProperty("vendor.usb.dwc3_irq", "medium"); + } + ALOGI("Usb Gadget setcurrent functions called successfully"); return Void(); diff --git a/uwb/calibration/UWB-calibration.conf.p7 b/uwb/calibration/UWB-calibration.conf.p7 deleted file mode 100644 index b52c8d38..00000000 --- a/uwb/calibration/UWB-calibration.conf.p7 +++ /dev/null @@ -1,118 +0,0 @@ -[CCC]format=1 -[CCC]kind=0 -[CCC]settings=1 -[CCC]ant0.ch5.prf64.pdoa_iso_rf2_rf1=0 -[CCC]ant0.ch5.prf64.pdoa_iso_rf1_rf2=0 -[CCC]ant0.ch9.prf64.pdoa_iso_rf2_rf1=0 -[CCC]ant0.ch9.prf64.pdoa_iso_rf1_rf2=0 -[CCC]ant0.ch5.prf64.pdoa_offset=0 -[CCC]ant0.ch9.prf64.pdoa_offset=0 -[CCC]ant0.ch5.prf64.pll_locking_code=0 -[CCC]ant0.ch9.prf64.pll_locking_code=0 -[CCC]id=0 -[CCC]wifi_coex_time_gap=10 -[CCC]ap_coop_mode=1 -[CCC]antenna_selection=4 -ant0.ch5.prf16.ant_delay=16450 -ant0.ch5.prf16.tx_power=0 -ant0.ch5.prf16.pg_count=0 -ant0.ch5.prf16.pg_delay=0 -ant0.ch5.prf64.ant_delay=16450 -ant0.ch5.prf64.tx_power=0 -ant0.ch5.prf64.pg_count=0 -ant0.ch5.prf64.pg_delay=0 -ant0.ch9.prf16.ant_delay=16450 -ant0.ch9.prf16.tx_power=0 -ant0.ch9.prf16.pg_count=0 -ant0.ch9.prf16.pg_delay=0 -ant0.ch9.prf64.ant_delay=16450 -ant0.ch9.prf64.tx_power=0 -ant0.ch9.prf64.pg_count=0 -ant0.ch9.prf64.pg_delay=0 -ant0.port=0 -ant0.selector_gpio=7 -ant0.selector_gpio_value=0 -ant1.ch5.prf16.ant_delay=16450 -ant1.ch5.prf16.tx_power=0 -ant1.ch5.prf16.pg_count=0 -ant1.ch5.prf16.pg_delay=0 -ant1.ch5.prf64.ant_delay=16450 -ant1.ch5.prf64.tx_power=0 -ant1.ch5.prf64.pg_count=0 -ant1.ch5.prf64.pg_delay=0 -ant1.ch9.prf16.ant_delay=16450 -ant1.ch9.prf16.tx_power=0 -ant1.ch9.prf16.pg_count=0 -ant1.ch9.prf16.pg_delay=0 -ant1.ch9.prf64.ant_delay=16450 -ant1.ch9.prf64.tx_power=0 -ant1.ch9.prf64.pg_count=0 -ant1.ch9.prf64.pg_delay=0 -ant1.port=0 -ant1.selector_gpio=7 -ant1.selector_gpio_value=1 -ant2.ch5.prf16.ant_delay=16450 -ant2.ch5.prf16.tx_power=0 -ant2.ch5.prf16.pg_count=0 -ant2.ch5.prf16.pg_delay=0 -ant2.ch5.prf64.ant_delay=16450 -ant2.ch5.prf64.tx_power=0 -ant2.ch5.prf64.pg_count=0 -ant2.ch5.prf64.pg_delay=0 -ant2.ch9.prf16.ant_delay=16450 -ant2.ch9.prf16.tx_power=0 -ant2.ch9.prf16.pg_count=0 -ant2.ch9.prf16.pg_delay=0 -ant2.ch9.prf64.ant_delay=16450 -ant2.ch9.prf64.tx_power=0 -ant2.ch9.prf64.pg_count=0 -ant2.ch9.prf64.pg_delay=0 -ant2.port=1 -ant2.selector_gpio=6 -ant2.selector_gpio_value=0 -ant3.ch5.prf16.ant_delay=16450 -ant3.ch5.prf16.tx_power=0 -ant3.ch5.prf16.pg_count=0 -ant3.ch5.prf16.pg_delay=0 -ant3.ch5.prf64.ant_delay=16450 -ant3.ch5.prf64.tx_power=0 -ant3.ch5.prf64.pg_count=0 -ant3.ch5.prf64.pg_delay=0 -ant3.ch9.prf16.ant_delay=16450 -ant3.ch9.prf16.tx_power=0 -ant3.ch9.prf16.pg_count=0 -ant3.ch9.prf16.pg_delay=0 -ant3.ch9.prf64.ant_delay=16450 -ant3.ch9.prf64.tx_power=0 -ant3.ch9.prf64.pg_count=0 -ant3.ch9.prf64.pg_delay=0 -ant3.port=1 -ant3.selector_gpio=6 -ant3.selector_gpio_value=1 -ant0.ant1.ch5.pdoa_offset=0 -ant0.ant1.ch9.pdoa_offset=0 -ant0.ant2.ch5.pdoa_offset=0 -ant0.ant2.ch9.pdoa_offset=0 -ant1.ant2.ch5.pdoa_offset=2173 -ant1.ant2.ch9.pdoa_offset=3555 -ant0.ant3.ch5.pdoa_offset=0 -ant0.ant3.ch9.pdoa_offset=0 -ant1.ant3.ch5.pdoa_offset=3845 -ant1.ant3.ch9.pdoa_offset=647 -ant2.ant3.ch5.pdoa_offset=0 -ant2.ant3.ch9.pdoa_offset=0 -ch5.pll_locking_code=0 -ch9.pll_locking_code=0 -ant1.ant2.ch5.pdoa_lut=3d:ea:7b:0a:66:ea:c3:09:a4:ea:0a:09:cd:ea:66:08:0a:eb:ae:07:33:eb:f6:06:48:eb:52:06:71:eb:9a:05:c3:eb:e1:04:e1:ec:29:04:c3:ef:85:03:a4:f4:cd:02:14:f8:14:02:b8:fa:5c:01:8f:fc:b8:00:e1:fe:00:00:48:01:48:ff:85:03:a4:fe:ae:05:ec:fd:00:08:33:fd:d7:09:7b:fc:85:0b:d7:fb:0a:0d:1f:fb:66:0e:66:fa:33:0f:ae:f9:00:10:0a:f9:a4:10:52:f8:1f:11:9a:f7:5c:11:f6:f6:9a:11:3d:f6:ae:11:85:f5 -ant1.ant2.ch9.pdoa_lut=c3:ed:7b:0a:29:ee:c3:09:3d:ee:0a:09:cd:ee:66:08:c3:ef:ae:07:f6:f0:f6:06:3d:f2:52:06:52:f2:9a:05:cd:f2:e1:04:5c:f3:29:04:c3:f3:85:03:b8:f4:cd:02:71:f7:14:02:52:fa:5c:01:85:fd:b8:00:00:00:00:00:0a:01:48:ff:5c:01:a4:fe:14:02:ec:fd:5c:03:33:fd:48:05:7b:fc:b8:06:d7:fb:14:08:1f:fb:33:09:66:fa:ec:09:ae:f9:3d:0a:0a:f9:0a:0b:52:f8:1f:0b:9a:f7:48:0b:f6:f6:85:0b:3d:f6:9a:0b:85:f5 -ant1.ant3.ch5.pdoa_lut=66:ec:7b:0a:e1:ec:c3:09:14:ee:0a:09:d7:ef:66:08:8f:f2:ae:07:00:f6:f6:06:cd:f6:52:06:33:f7:9a:05:d7:f7:e1:04:48:f9:29:04:33:fd:85:03:d7:fd:cd:02:3d:fe:14:02:ec:ff:5c:01:14:00:b8:00:3d:00:00:00:cd:02:48:ff:29:04:a4:fe:a4:04:ec:fd:85:05:33:fd:e1:06:7b:fc:b8:08:d7:fb:14:0a:1f:fb:e1:0a:66:fa:1f:0b:0a:f9:1f:0b:ae:f9:5c:0b:52:f8:c3:0b:9a:f7:52:0c:f6:f6:0a:0d:3d:f6:00:0e:85:f5 -ant1.ant3.ch9.pdoa_lut=0a:ef:7b:0a:c3:ef:c3:09:00:f0:0a:09:14:f0:66:08:7b:f0:ae:07:48:f1:f6:06:00:f2:52:06:c3:f3:9a:05:00:f6:e1:04:d7:f7:29:04:1f:f9:85:03:ae:f9:cd:02:e1:fa:14:02:e1:fc:5c:01:b8:fe:b8:00:c3:ff:00:00:00:02:48:ff:5c:05:a4:fe:52:08:ec:fd:14:0a:33:fd:e1:0a:7b:fc:14:0c:d7:fb:14:0e:1f:fb:1f:0f:66:fa:00:10:ae:f9:b8:10:0a:f9:29:12:52:f8:00:14:9a:f7:7b:16:f6:f6:d7:17:3d:f6:29:18:85:f5 -xtal_trim=23 -temperature_reference=85 -smart_tx_power=1 -auto_sleep_margin=20000 -[HAL]antenna_pair_azimuth=3 -[HAL]antenna_pair_elevation=4 -[HAL]tx_antenna=0 -[HAL]minimum_system_offset_uwbtime0=200 -restricted_channels=0 diff --git a/uwb/calibration/country_conf_gen.sh b/uwb/calibration/country_conf_gen.sh deleted file mode 100755 index 3bc0bcfd..00000000 --- a/uwb/calibration/country_conf_gen.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -# This script is used to generate uwb conuntry configuration file, -# and the PRODUCT_COPY_FILES list in uwb.mk based on uwb_country.conf -# Bug: 196073172 - -project=("r4" "p7") -count=1 - -while read line ; do - if [[ "$line" =~ ^"*" ]]; then - header=${line:1} - elif [[ "$line" =~ ^"\"" ]]; then - line=$(echo ${line/,} | tr -d "\"") - country[count]=$(echo $line | cut -d ':' -f1) - code[count]=$(echo $line | cut -d ':' -f2 | tr -d " ") - - for var in ${project[@]}; do - if [ "$header" = "restricted_channels=0x20" ]; then - echo "alternate_pulse_shape=0x01" > UWB-calibration-${code[$count]}.conf.$var - echo "$header" >> UWB-calibration-${code[$count]}.conf.$var - else - echo "$header" > UWB-calibration-${code[$count]}.conf.$var - fi - done - fi -((count++)) -done < uwb_country.conf - -for var in ${project[@]}; do - echo "============== $var ==============" - for var2 in ${code[@]}; do - if [ "$var2" = "${code[-1]}" ]; then - echo "\$(LOCAL_UWB_CAL_DIR)/UWB-calibration-$var2.conf.$var:\$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-$var2.conf" - else - echo "\$(LOCAL_UWB_CAL_DIR)/UWB-calibration-$var2.conf.$var:\$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-$var2.conf \\" - fi - done -done diff --git a/uwb/calibration/uwb_country.conf b/uwb/calibration/uwb_country.conf deleted file mode 100644 index 51dd4341..00000000 --- a/uwb/calibration/uwb_country.conf +++ /dev/null @@ -1,21 +0,0 @@ -*restricted_channels=0xffff -"Argentina": "ar", -"Armenia": "am", -"Azerbaijan": "az", -"Belarus": "by", -"Indonesia": "id", -"Kazakhstan": "kz", -"Kyrgyzstan": "kg", -"Nepal": "np", -"Pakistan": "pk", -"Paraguay": "py", -"Russia": "ru", -"Solomon Islands": "sb", -"Tajikistan": "tj", -"Turkmenistanr": "tm", -"Ukraine": "ua", -"Uzbekistan": "uz" - -*restricted_channels=0x20 -"Japan": "jp", -"Taiwan": "tw" diff --git a/uwb/uwb.mk b/uwb/uwb.mk deleted file mode 100644 index 32fbe6aa..00000000 --- a/uwb/uwb.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright (C) 2021 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. - -# UWB - ultra wide band -$(call inherit-product-if-exists, vendor/qorvo/uwb/uwb.mk) - -LOCAL_UWB_CAL_DIR=device/google/gs201/uwb/calibration - -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.uwb.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.uwb.xml - -PRODUCT_COPY_FILES += \ - $(LOCAL_UWB_CAL_DIR)/UWB-calibration.conf.p7:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration.conf \ - $(LOCAL_UWB_CAL_DIR)/UWB-calibration.conf.p7:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-unknown.conf \ - $(LOCAL_UWB_CAL_DIR)/UWB-calibration.conf.p7:$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-default.conf diff --git a/vendor_dlkm.blocklist b/vendor_dlkm.blocklist deleted file mode 100644 index ea20dc01..00000000 --- a/vendor_dlkm.blocklist +++ /dev/null @@ -1,6 +0,0 @@ -blocklist bcmdhd4389 -blocklist sec_touch -blocklist uwb_desense.ko -blocklist uwb-hal.ko -blocklist uwbcore.ko -blocklist gxp.ko diff --git a/wifi/qcom/BoardConfig-wifi.mk b/wifi/qcom/BoardConfig-wifi.mk index 64683ca9..b49c7b21 100644 --- a/wifi/qcom/BoardConfig-wifi.mk +++ b/wifi/qcom/BoardConfig-wifi.mk @@ -27,24 +27,20 @@ CONFIG_IEEE80211AX := true # BOARD_HAS_QCOM_WLAN := true # CONFIG_ACS := true -# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {2 STA + 1 of (P2P or NAN)} -# WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{AP}, 1}}, {{{STA}, 2}, {{P2P, NAN}, 1}} +# Wifi interface combination - {1 STA + 1 of (P2P or NAN)} or {1 AP} +WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN}, 1}}, {{{AP}, 1}} WIFI_HIDL_FEATURE_AWARE := true -#Enable STA + SAP Concurrency. -WIFI_HIDL_FEATURE_DUAL_INTERFACE:= true WIFI_FEATURE_WIFI_EXT_HAL := true WIFI_FEATURE_IMU_DETECTION := true WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true # Avoid Wifi reset on MAC Address change # WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true # WIFI_FEATURE_HOSTAPD_11AX := true +WIFI_DRIVER_STATE_CTRL_PARAM := "/dev/wlan" +WIFI_DRIVER_STATE_ON := "ON" +WIFI_DRIVER_STATE_OFF := "OFF" # WLAN driver configuration files PRODUCT_COPY_FILES += \ $(LOCAL_WIFI_PATH)/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \ $(LOCAL_WIFI_PATH)/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf - - - - -