From bc25286b64b9c867c3638196002a7b70ac69ac62 Mon Sep 17 00:00:00 2001 From: Ankur Bakshi Date: Thu, 30 May 2024 00:05:17 +0000 Subject: [PATCH 01/27] Update felix SVN to 53 Bug: 342381152 Change-Id: I21048d04ff40b1237bcf3d8258b3a3263394fe42 --- device-felix.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index 94a95d5..19292e3 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -224,7 +224,7 @@ PRODUCT_SOONG_NAMESPACES += \ # Increment the SVN for any official public releases PRODUCT_VENDOR_PROPERTIES += \ - ro.vendor.build.svn=52 + ro.vendor.build.svn=53 # Vibrator HAL PRODUCT_VENDOR_PROPERTIES +=\ From c24bdaad2610af2a926b6ba671b8383e602e0cfd Mon Sep 17 00:00:00 2001 From: Barry Date: Tue, 25 Jun 2024 09:55:17 +0000 Subject: [PATCH 02/27] BT: update LEA unicast allowlist: SONY Add Sony WF-1000XM5 into unicast default allowlist. bug: 349296638 Test: Build and check system property Flag: NONE alowlist extension Change-Id: If6a2eec7576ff89d0e4be3f6fab0c2c2adcf13e4 --- device-felix.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index cc75c91..80ac10f 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -382,7 +382,7 @@ PRODUCT_COPY_FILES += \ # LE Audio Unicast Allowlist PRODUCT_PRODUCT_PROPERTIES += \ - persist.bluetooth.leaudio.allow_list=SM-R510 + persist.bluetooth.leaudio.allow_list=SM-R510,WF-1000XM5 # Bluetooth EWP test tool PRODUCT_PACKAGES_DEBUG += \ From eaeec923035b0bc7dffc11b5696163856c20e57b Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Tue, 25 Jun 2024 09:48:18 +0000 Subject: [PATCH 03/27] gps: Set configuration by kernel version Bug: 258364350 Test: Verification at b/258364350. Test: Function verification at b/258364350. Test: Compile and verify the configuration is correct. Change-Id: I0e5426dadc03e8f1681fc8b99aa2abd7bf0b6d27 --- device-felix.mk | 16 ++++- location/gps.6.1.xml.f10 | 106 ++++++++++++++++++++++++++++++++++ location/gps_user.6.1.xml.f10 | 105 +++++++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 location/gps.6.1.xml.f10 create mode 100644 location/gps_user.6.1.xml.f10 diff --git a/device-felix.mk b/device-felix.mk index cc75c91..4637a7b 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -279,14 +279,26 @@ PRODUCT_COPY_FILES += \ # Location ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_COPY_FILES += \ - device/google/felix/location/gps.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml \ device/google/felix/location/lhd.conf.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ device/google/felix/location/scd.conf.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf + ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION))) + PRODUCT_COPY_FILES += \ + device/google/felix/location/gps.6.1.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml + else + PRODUCT_COPY_FILES += \ + device/google/felix/location/gps.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml + endif else PRODUCT_COPY_FILES += \ - device/google/felix/location/gps_user.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml \ device/google/felix/location/lhd_user.conf.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \ device/google/felix/location/scd_user.conf.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf + ifneq (,$(filter 6.1, $(TARGET_LINUX_KERNEL_VERSION))) + PRODUCT_COPY_FILES += \ + device/google/felix/location/gps_user.6.1.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml + else + PRODUCT_COPY_FILES += \ + device/google/felix/location/gps_user.xml.f10:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml + endif endif PRODUCT_PACKAGES += \ diff --git a/location/gps.6.1.xml.f10 b/location/gps.6.1.xml.f10 new file mode 100644 index 0000000..fbf2d67 --- /dev/null +++ b/location/gps.6.1.xml.f10 @@ -0,0 +1,106 @@ + + + + + + + + + + diff --git a/location/gps_user.6.1.xml.f10 b/location/gps_user.6.1.xml.f10 new file mode 100644 index 0000000..e4f32da --- /dev/null +++ b/location/gps_user.6.1.xml.f10 @@ -0,0 +1,105 @@ + + + + + + + + + + From 87907f0071ae7ec6f81de189bf895d4fc6eee494 Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Goel Date: Thu, 4 Apr 2024 00:12:08 +0000 Subject: [PATCH 04/27] felix: Use build_flags for SVN Flag: build.RELEASE_SVN_FELIX Bug: 332726030 Change-Id: Icdf9198885ba0fa9c02bd161e2b2ff45927aa8a0 --- device-felix.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index cc75c91..0fc65b2 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -217,8 +217,15 @@ PRODUCT_SOONG_NAMESPACES += \ device/google/felix # Increment the SVN for any official public releases +ifdef RELEASE_SVN_FELIX +TARGET_SVN ?= $(RELEASE_SVN_FELIX) +else +# Set this for older releases that don't use build flag +TARGET_SVN ?= 53 +endif + PRODUCT_VENDOR_PROPERTIES += \ - ro.vendor.build.svn=53 + ro.vendor.build.svn=$(TARGET_SVN) # Vibrator HAL $(call soong_config_set,haptics,kernel_ver,v$(subst .,_,$(TARGET_LINUX_KERNEL_VERSION))) From c004bba0e7fdd1223b61cc6e21cac778c217ddb7 Mon Sep 17 00:00:00 2001 From: Koli Lin Date: Tue, 9 Jul 2024 07:34:20 +0000 Subject: [PATCH 05/27] add device id Test: manual Bug: 316248308 Flag: EXEMPT prop value only update Change-Id: I1f929402d041541a1ad95673cd9e0346fdbe4122 --- device-felix.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/device-felix.mk b/device-felix.mk index c7b8c06..161a833 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -417,3 +417,6 @@ PRODUCT_PACKAGES += \ NoCutoutOverlay \ AvoidAppsInCutoutOverlay +# Bluetooth device id +PRODUCT_PRODUCT_PROPERTIES += \ + bluetooth.device_id.product_id=20494 From 36015c810ee6ebe7cc9a9b2dad3e9b85ccae47ab Mon Sep 17 00:00:00 2001 From: Ankur Bakshi Date: Mon, 15 Jul 2024 14:17:29 +0000 Subject: [PATCH 06/27] Update felix SVN to 54 Bug:352170103 Change-Id: I60fb3fb1d4ddae9ce7a3b07a5392b12e76c388dc Flag: EXEMPT bugfix --- device-felix.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index c6eb0af..64f343d 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -221,7 +221,7 @@ ifdef RELEASE_SVN_FELIX TARGET_SVN ?= $(RELEASE_SVN_FELIX) else # Set this for older releases that don't use build flag -TARGET_SVN ?= 53 +TARGET_SVN ?= 54 endif PRODUCT_VENDOR_PROPERTIES += \ From 2a59cf1891e96f5d4d85c69e57ed574fc79a2191 Mon Sep 17 00:00:00 2001 From: Kyle Hsiao Date: Thu, 18 Jul 2024 11:23:08 +0000 Subject: [PATCH 07/27] Update antenna position coordinates Bug: 353895373 Test: manual Flag: EXEMPT bugfix Change-Id: Ia89d2c410164ec44fde3d6400be8f38b24aa625d --- rro_overlays/NfcOverlay/res/values/config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rro_overlays/NfcOverlay/res/values/config.xml b/rro_overlays/NfcOverlay/res/values/config.xml index 135ed8a..b90278e 100644 --- a/rro_overlays/NfcOverlay/res/values/config.xml +++ b/rro_overlays/NfcOverlay/res/values/config.xml @@ -29,8 +29,8 @@ 30 - 103 - 103 + 44 + 44 true From 3279a16af449dce427affb7f9a29c0f3906a3507 Mon Sep 17 00:00:00 2001 From: James Huang Date: Fri, 26 Jul 2024 15:11:42 +0800 Subject: [PATCH 08/27] gps: Enable Beidou measurements only in the US for F10. Bug: 354884462 Test: Field test in the US Change-Id: Ic864c27f90f17da2fa65d3864d3882395226aa91 --- location/gps.xml.f10 | 1 + location/gps_user.xml.f10 | 1 + 2 files changed, 2 insertions(+) diff --git a/location/gps.xml.f10 b/location/gps.xml.f10 index da3e110..a852a7a 100644 --- a/location/gps.xml.f10 +++ b/location/gps.xml.f10 @@ -100,6 +100,7 @@ diff --git a/location/gps_user.xml.f10 b/location/gps_user.xml.f10 index 19842ca..8f92092 100644 --- a/location/gps_user.xml.f10 +++ b/location/gps_user.xml.f10 @@ -99,6 +99,7 @@ From 7eeceadfac4f7ccf57f304d2732c60d6b32872cf Mon Sep 17 00:00:00 2001 From: guibing Date: Thu, 25 Jul 2024 20:13:19 +0000 Subject: [PATCH 09/27] Adpf:felix: switch to multitier heuristic boost. Bug: 344685639 Test: Checked the trace file running on the device. Flag: NONE powerhal doesn't have a flag yet Change-Id: I1b37c1e71eb148a4dab454b7e7db9cf46f09d9a3 --- powerhint.json | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/powerhint.json b/powerhint.json index 926d7c4..530c865 100644 --- a/powerhint.json +++ b/powerhint.json @@ -2209,11 +2209,12 @@ "TargetTimeFactor": 1.0, "StaleTimeFactor": 15.0, "HeuristicBoost_On": true, - "HBoostOnMissedCycles": 8, - "HBoostOffMaxAvgRatio": 4.0, - "HBoostOffMissedCycles": 5, - "HBoostPidPuFactor": 0.5, - "HBoostUclampMin": 722, + "HBoostModerateJankThreshold": 2, + "HBoostOffMaxAvgDurRatio": 4.0, + "HBoostSevereJankPidPu": 0.5, + "HBoostSevereJankThreshold": 8, + "HBoostUclampMinCeilingRange": [480, 722], + "HBoostUclampMinFloorRange": [230, 410], "JankCheckTimeFactor": 1.2, "LowFrameRateThreshold": 25, "MaxRecordsNum": 300 @@ -2244,11 +2245,12 @@ "TargetTimeFactor": 1.0, "StaleTimeFactor": 15.0, "HeuristicBoost_On": true, - "HBoostOnMissedCycles": 8, - "HBoostOffMaxAvgRatio": 4.0, - "HBoostOffMissedCycles": 5, - "HBoostPidPuFactor": 0.5, - "HBoostUclampMin": 722, + "HBoostModerateJankThreshold": 2, + "HBoostOffMaxAvgDurRatio": 4.0, + "HBoostSevereJankPidPu": 0.5, + "HBoostSevereJankThreshold": 8, + "HBoostUclampMinCeilingRange": [480, 722], + "HBoostUclampMinFloorRange": [230, 410], "JankCheckTimeFactor": 1.2, "LowFrameRateThreshold": 25, "MaxRecordsNum": 300 @@ -2279,11 +2281,12 @@ "TargetTimeFactor": 1.0, "StaleTimeFactor": 15.0, "HeuristicBoost_On": true, - "HBoostOnMissedCycles": 8, - "HBoostOffMaxAvgRatio": 4.0, - "HBoostOffMissedCycles": 5, - "HBoostPidPuFactor": 0.5, - "HBoostUclampMin": 722, + "HBoostModerateJankThreshold": 2, + "HBoostOffMaxAvgDurRatio": 4.0, + "HBoostSevereJankPidPu": 0.5, + "HBoostSevereJankThreshold": 8, + "HBoostUclampMinCeilingRange": [480, 722], + "HBoostUclampMinFloorRange": [230, 410], "JankCheckTimeFactor": 1.2, "LowFrameRateThreshold": 25, "MaxRecordsNum": 300 From c64871377f906bf33598a414e5a8b29ff167f305 Mon Sep 17 00:00:00 2001 From: Chris Paulo Date: Mon, 22 Jul 2024 17:11:30 -0700 Subject: [PATCH 10/27] haptics: Update output distortion gain Recommended output distortion gain is 0.52. Bug: 328799172 Test: getprop | grep hapticgenerator Flag: EXEMPT bugfix Change-Id: I7ca1ca0186ad9d76d0ef9db604fdbdbbf02103ce --- device-felix.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/device-felix.mk b/device-felix.mk index 64f343d..e38f324 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -236,6 +236,10 @@ PRODUCT_VENDOR_PROPERTIES +=\ persist.vendor.vibrator.hal.chirp.enabled=0 ACTUATOR_MODEL := luxshare_ict_lt_xlra1906d +# Override Output Distortion Gain +PRODUCT_VENDOR_PROPERTIES += \ + vendor.audio.hapticgenerator.distortion.output.gain=0.52 + # Fingerprint include device/google/gs101/fingerprint/fpc1540/sw42/fpc1540.mk FPC_MODULE_TYPE=1542_C From ae27f1a5b6bca60fd4328ef98f205f7c64b5431b Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Goel Date: Fri, 19 Apr 2024 20:48:51 +0000 Subject: [PATCH 11/27] felix: Add build_flags based properties for SMR/EMR build Flag: build.RELEASE_IS_SMR Flag: build.RELEASE_IS_EMR Flag: build.RELEASE_BASE_OS_FELIX Bug: 155105803 Change-Id: Ib2db14ae61d914ee8bc9619058753dbd8a81f0cf --- device-felix.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/device-felix.mk b/device-felix.mk index 64f343d..2c2307c 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -227,6 +227,24 @@ endif PRODUCT_VENDOR_PROPERTIES += \ ro.vendor.build.svn=$(TARGET_SVN) +# Set device family property for SMR +PRODUCT_PROPERTY_OVERRIDES += \ + ro.build.device_family=F10 + +# Set build properties for SMR builds +ifeq ($(RELEASE_IS_SMR), true) + ifneq (,$(RELEASE_BASE_OS_FELIX)) + PRODUCT_BASE_OS := $(RELEASE_BASE_OS_FELIX) + endif +endif + +# Set build properties for EMR builds +ifeq ($(RELEASE_IS_EMR), true) + ifneq (,$(RELEASE_BASE_OS_FELIX)) + PRODUCT_PROPERTY_OVERRIDES += \ + ro.build.version.emergency_base_os=$(RELEASE_BASE_OS_FELIX) + endif +endif # Vibrator HAL $(call soong_config_set,haptics,kernel_ver,v$(subst .,_,$(TARGET_LINUX_KERNEL_VERSION))) PRODUCT_VENDOR_PROPERTIES +=\ From a33d70164d6a0e26c713fcfcaef248ae00c420fe Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 18 Jul 2024 09:18:24 +0000 Subject: [PATCH 12/27] Upgrade IDisplay to V13 Bug: 315496839 Flag: EXEMPT bugfix Test: build pass Change-Id: I3039f3c843b03f0df46e952d6c7f28fd8b3e101e --- device_framework_matrix_product_felix.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device_framework_matrix_product_felix.xml b/device_framework_matrix_product_felix.xml index 475edd2..492724d 100644 --- a/device_framework_matrix_product_felix.xml +++ b/device_framework_matrix_product_felix.xml @@ -1,7 +1,7 @@ com.google.hardware.pixel.display - 12 + 13 IDisplay secondary From 0dcee74707d8fc7ebda69a728da3b47d0056c1a2 Mon Sep 17 00:00:00 2001 From: leonardian Date: Mon, 20 May 2024 03:58:21 +0000 Subject: [PATCH 13/27] vibrator: cs40l26: Implement braking duration for haptic effects 1. Add sysfs nodes for querying braking duration - braking_time_bank - braking_time_index - braking_time_ms 2. Set delay time between effects to include the whole braking duration 3. Add braking effect durations in HAL dumpsys logs Bug: 325121485 Test: Plotted acceleration Test: Checked HAL dumpsys Test: atest VibratorHalCs40l26TestSuite Flag: EXEMPT bugfix Change-Id: Ifacc94db4224adbab971e8d2c01c54422838760c Signed-off-by: leonardian --- vibrator/common/utils.h | 8 +++-- vibrator/cs40l26/Hardware.h | 16 ++++++++++ vibrator/cs40l26/Vibrator.cpp | 29 +++++++++++-------- vibrator/cs40l26/Vibrator.h | 10 +++++++ ...rdware.vibrator-service.cs40l26-private.rc | 9 ++++++ vibrator/cs40l26/tests/mocks.h | 4 +++ vibrator/cs40l26/tests/test-vibrator.cpp | 7 ++++- 7 files changed, 67 insertions(+), 16 deletions(-) diff --git a/vibrator/common/utils.h b/vibrator/common/utils.h index 188554d..86dd37e 100644 --- a/vibrator/common/utils.h +++ b/vibrator/common/utils.h @@ -110,10 +110,12 @@ inline bool getProperty(const std::string &key, const bool def) { template static void openNoCreate(const std::string &file, T *outStream) { - auto mode = std::is_base_of_v ? std::ios_base::out : std::ios_base::in; + if (!std::filesystem::exists(file)) { + ALOGE("File does not exist: %s", file.c_str()); + return; + } - // Force 'in' mode to prevent file creation - outStream->open(file, mode | std::ios_base::in); + outStream->open(file); if (!*outStream) { ALOGE("Failed to open %s (%d): %s", file.c_str(), errno, strerror(errno)); } diff --git a/vibrator/cs40l26/Hardware.h b/vibrator/cs40l26/Hardware.h index 69cf9ae..d06fc6d 100644 --- a/vibrator/cs40l26/Hardware.h +++ b/vibrator/cs40l26/Hardware.h @@ -78,6 +78,9 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { open("calibration/q_stored", &mQ); open("default/vibe_state", &mVibeState); open("default/num_waves", &mEffectCount); + open("default/braking_time_bank", &mEffectBrakingTimeBank); + open("default/braking_time_index", &mEffectBrakingTimeIndex); + open("default/braking_time_ms", &mEffectBrakingTimeMs); open("default/owt_free_space", &mOwtFreeSpace); open("default/f0_comp_enable", &mF0CompEnable); open("default/redc_comp_enable", &mRedcCompEnable); @@ -89,6 +92,16 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { bool setRedc(std::string value) override { return set(value, &mRedc); } bool setQ(std::string value) override { return set(value, &mQ); } bool getEffectCount(uint32_t *value) override { return get(value, &mEffectCount); } + bool hasEffectBrakingTimeBank() override { return mEffectBrakingTimeBank.is_open(); } + bool setEffectBrakingTimeBank(uint32_t value) override { + return set(value, &mEffectBrakingTimeBank); + } + bool setEffectBrakingTimeIndex(uint32_t value) override { + return set(value, &mEffectBrakingTimeIndex); + } + bool getEffectBrakingTimeMs(uint32_t *value) override { + return get(value, &mEffectBrakingTimeMs); + } bool pollVibeState(uint32_t value, int32_t timeoutMs) override { return poll(value, &mVibeState, timeoutMs); } @@ -282,6 +295,9 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { std::ofstream mRedc; std::ofstream mQ; std::ifstream mEffectCount; + std::ofstream mEffectBrakingTimeBank; + std::ofstream mEffectBrakingTimeIndex; + std::ifstream mEffectBrakingTimeMs; std::ifstream mVibeState; std::ifstream mOwtFreeSpace; std::ofstream mF0CompEnable; diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index b3ce88e..bf3b535 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -485,8 +485,9 @@ Vibrator::Vibrator(std::unique_ptr hwApiDefault, std::unique_ptr h mFfEffects.resize(WAVEFORM_MAX_INDEX); mEffectDurations.resize(WAVEFORM_MAX_INDEX); mEffectDurations = { - 1000, 100, 12, 1000, 300, 130, 150, 500, 100, 5, 12, 1000, 1000, 1000, + 1000, 100, 9, 1000, 300, 130, 150, 500, 100, 5, 12, 1000, 1000, 1000, }; /* 11+3 waveforms. The duration must < UINT16_MAX */ + mEffectBrakingDurations.resize(WAVEFORM_MAX_INDEX); mEffectCustomData.reserve(WAVEFORM_MAX_INDEX); uint8_t effectIndex; @@ -519,6 +520,11 @@ Vibrator::Vibrator(std::unique_ptr hwApiDefault, std::unique_ptr h if (mFfEffects[effectIndex].id != effectIndex) { ALOGW("Unexpected effect index: %d -> %d", effectIndex, mFfEffects[effectIndex].id); } + + if (mHwApiDef->hasEffectBrakingTimeBank()) { + mHwApiDef->setEffectBrakingTimeIndex(effectIndex); + mHwApiDef->getEffectBrakingTimeMs(&mEffectBrakingDurations[effectIndex]); + } } else { /* Initiate placeholders for OWT effects. */ numBytes = effectIndex == WAVEFORM_COMPOSE ? FF_CUSTOM_DATA_LEN_MAX_COMP @@ -850,7 +856,7 @@ ndk::ScopedAStatus Vibrator::getPrimitiveDuration(CompositePrimitive primitive, return status; } - *durationMs = mEffectDurations[effectIndex]; + *durationMs = mEffectDurations[effectIndex] + mEffectBrakingDurations[effectIndex]; } else { *durationMs = 0; } @@ -863,7 +869,6 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi ALOGD("Vibrator::compose"); uint16_t size; uint16_t nextEffectDelay; - uint16_t totalDuration = 0; if (composite.size() > COMPOSE_SIZE_MAX || composite.empty()) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); @@ -871,7 +876,6 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi /* Check if there is a wait before the first effect. */ nextEffectDelay = composite.front().delayMs; - totalDuration += nextEffectDelay; if (nextEffectDelay > COMPOSE_DELAY_MAX_MS || nextEffectDelay < 0) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } else if (nextEffectDelay > 0) { @@ -913,7 +917,6 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi effectScale = mPrimitiveMinScale[static_cast(e_curr.primitive)]; } effectVolLevel = intensityToVolLevel(effectScale, effectIndex); - totalDuration += mEffectDurations[effectIndex]; } /* Fetch the next composite effect delay and fill into the current section */ @@ -926,13 +929,14 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } nextEffectDelay = delay; - totalDuration += delay; } if (effectIndex == 0 && nextEffectDelay == 0) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } + nextEffectDelay += mEffectBrakingDurations[effectIndex]; + ch.constructComposeSegment(effectVolLevel, effectIndex, 0 /*repeat*/, 0 /*flags*/, nextEffectDelay /*delay*/); } @@ -1395,19 +1399,20 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) { dprintf(fd, " FF effect:\n"); dprintf(fd, " Physical waveform:\n"); - dprintf(fd, "==== Base ====\n\tId\tIndex\tt ->\tt'\ttrigger button\n"); + dprintf(fd, "==== Base ====\n\tId\tIndex\tt ->\tt'\tBrake\ttrigger button\n"); uint8_t effectId; for (effectId = 0; effectId < WAVEFORM_MAX_PHYSICAL_INDEX; effectId++) { - dprintf(fd, "\t%d\t%d\t%d\t%d\t%X\n", mFfEffects[effectId].id, + dprintf(fd, "\t%d\t%d\t%d\t%d\t%d\t%X\n", mFfEffects[effectId].id, mFfEffects[effectId].u.periodic.custom_data[1], mEffectDurations[effectId], - mFfEffects[effectId].replay.length, mFfEffects[effectId].trigger.button); + mFfEffects[effectId].replay.length, mEffectBrakingDurations[effectId], + mFfEffects[effectId].trigger.button); } if (mIsDual) { - dprintf(fd, "==== Flip ====\n\tId\tIndex\tt ->\tt'\ttrigger button\n"); + dprintf(fd, "==== Flip ====\n\tId\tIndex\tt ->\tt'\tBrake\ttrigger button\n"); for (effectId = 0; effectId < WAVEFORM_MAX_PHYSICAL_INDEX; effectId++) { - dprintf(fd, "\t%d\t%d\t%d\t%d\t%X\n", mFfEffectsDual[effectId].id, + dprintf(fd, "\t%d\t%d\t%d\t%d\t%d\t%X\n", mFfEffectsDual[effectId].id, mFfEffectsDual[effectId].u.periodic.custom_data[1], mEffectDurations[effectId], - mFfEffectsDual[effectId].replay.length, + mFfEffectsDual[effectId].replay.length, mEffectBrakingDurations[effectId], mFfEffectsDual[effectId].trigger.button); } } diff --git a/vibrator/cs40l26/Vibrator.h b/vibrator/cs40l26/Vibrator.h index 8f89713..e21ef58 100644 --- a/vibrator/cs40l26/Vibrator.h +++ b/vibrator/cs40l26/Vibrator.h @@ -62,6 +62,15 @@ class Vibrator : public BnVibrator { virtual bool setQ(std::string value) = 0; // Reports the number of effect waveforms loaded in firmware. virtual bool getEffectCount(uint32_t *value) = 0; + // Checks whether braking time bank is supported. + virtual bool hasEffectBrakingTimeBank() = 0; + // Specifies the bank of the effect for querying braking time. + // 0: RAM bank, 2: OWT bank + virtual bool setEffectBrakingTimeBank(uint32_t value) = 0; + // Specifies the index of an effect whose braking time is to be read. + virtual bool setEffectBrakingTimeIndex(uint32_t value) = 0; + // Gets the braking time duration of SVC effects (returns 0 if not SVC). + virtual bool getEffectBrakingTimeMs(uint32_t *value) = 0; // Blocks until timeout or vibrator reaches desired state // (2 = ASP enabled, 1 = haptic enabled, 0 = disabled). virtual bool pollVibeState(uint32_t value, int32_t timeoutMs = -1) = 0; @@ -218,6 +227,7 @@ class Vibrator : public BnVibrator { std::vector mFfEffects; std::vector mFfEffectsDual; std::vector mEffectDurations; + std::vector mEffectBrakingDurations; std::vector> mEffectCustomData; std::vector> mEffectCustomDataDual; std::future mAsyncHandle; diff --git a/vibrator/cs40l26/android.hardware.vibrator-service.cs40l26-private.rc b/vibrator/cs40l26/android.hardware.vibrator-service.cs40l26-private.rc index e45356e..01b37bb 100644 --- a/vibrator/cs40l26/android.hardware.vibrator-service.cs40l26-private.rc +++ b/vibrator/cs40l26/android.hardware.vibrator-service.cs40l26-private.rc @@ -14,6 +14,9 @@ on property:vendor.all.modules.ready=1 chown system system /sys/bus/i2c/devices/15-0043/calibration/redc_stored chown system system /sys/bus/i2c/devices/15-0043/default/vibe_state chown system system /sys/bus/i2c/devices/15-0043/default/num_waves + chown system system /sys/bus/i2c/devices/15-0043/default/braking_time_bank + chown system system /sys/bus/i2c/devices/15-0043/default/braking_time_index + chown system system /sys/bus/i2c/devices/15-0043/default/braking_time_ms chown system system /sys/bus/i2c/devices/15-0043/default/f0_offset chown system system /sys/bus/i2c/devices/15-0043/default/owt_free_space chown system system /sys/bus/i2c/devices/15-0043/default/f0_comp_enable @@ -25,6 +28,9 @@ on property:vendor.all.modules.ready=1 chown system system /sys/bus/i2c/devices/15-0042/calibration/redc_stored chown system system /sys/bus/i2c/devices/15-0042/default/vibe_state chown system system /sys/bus/i2c/devices/15-0042/default/num_waves + chown system system /sys/bus/i2c/devices/15-0042/default/braking_time_bank + chown system system /sys/bus/i2c/devices/15-0042/default/braking_time_index + chown system system /sys/bus/i2c/devices/15-0042/default/braking_time_ms chown system system /sys/bus/i2c/devices/15-0042/default/f0_offset chown system system /sys/bus/i2c/devices/15-0042/default/owt_free_space chown system system /sys/bus/i2c/devices/15-0042/default/f0_comp_enable @@ -56,6 +62,9 @@ service vendor.vibrator.cs40l26 /vendor/bin/hw/android.hardware.vibrator-service calibration/q_stored default/vibe_state default/num_waves + default/braking_time_bank + default/braking_time_index + default/braking_time_ms default/f0_offset default/owt_free_space default/f0_comp_enable diff --git a/vibrator/cs40l26/tests/mocks.h b/vibrator/cs40l26/tests/mocks.h index 641aba8..c521b02 100644 --- a/vibrator/cs40l26/tests/mocks.h +++ b/vibrator/cs40l26/tests/mocks.h @@ -39,6 +39,10 @@ class MockApi : public ::aidl::android::hardware::vibrator::Vibrator::HwApi { MOCK_METHOD1(setRedc, bool(std::string value)); MOCK_METHOD1(setQ, bool(std::string value)); MOCK_METHOD1(getEffectCount, bool(uint32_t *value)); + MOCK_METHOD0(hasEffectBrakingTimeBank, bool()); + MOCK_METHOD1(setEffectBrakingTimeBank, bool(uint32_t value)); + MOCK_METHOD1(setEffectBrakingTimeIndex, bool(uint32_t value)); + MOCK_METHOD1(getEffectBrakingTimeMs, bool(uint32_t *value)); MOCK_METHOD2(pollVibeState, bool(uint32_t value, int32_t timeoutMs)); MOCK_METHOD0(hasOwtFreeSpace, bool()); MOCK_METHOD1(getOwtFreeSpace, bool(uint32_t *value)); diff --git a/vibrator/cs40l26/tests/test-vibrator.cpp b/vibrator/cs40l26/tests/test-vibrator.cpp index 3ea6bda..6c8cebb 100644 --- a/vibrator/cs40l26/tests/test-vibrator.cpp +++ b/vibrator/cs40l26/tests/test-vibrator.cpp @@ -74,7 +74,7 @@ static constexpr std::array V_TICK_DEFAULT = {1, 100}; static constexpr std::array V_CLICK_DEFAULT{1, 100}; static constexpr std::array V_LONG_DEFAULT{1, 100}; static constexpr std::array EFFECT_DURATIONS{ - 0, 100, 30, 1000, 300, 130, 150, 500, 100, 15, 20, 1000, 1000, 1000}; + 1000, 100, 9, 1000, 300, 130, 150, 500, 100, 5, 12, 1000, 1000, 1000}; // Constants With Prescribed Values @@ -375,6 +375,11 @@ TEST_F(VibratorTest, Constructor) { .WillOnce(DoAll(SetArgPointee<0>(supportedPrimitivesBits), Return(true))); EXPECT_CALL(*mMockApi, setMinOnOffInterval(MIN_ON_OFF_INTERVAL_US)).WillOnce(Return(true)); + EXPECT_CALL(*mMockApi, setEffectBrakingTimeBank(0)).WillRepeatedly(Return(true)); + for (uint32_t i = 0; i < WAVEFORM_MAX_PHYSICAL_INDEX; i++) { + EXPECT_CALL(*mMockApi, setEffectBrakingTimeIndex(i)).WillRepeatedly(Return(true)); + EXPECT_CALL(*mMockApi, getEffectBrakingTimeMs(_)).WillRepeatedly(Return(true)); + } createVibrator(std::move(mockapi), std::move(mockcal), std::move(mockgpio), false); } From 1d29f93863959713e0351576c4787daf4ef4bbd9 Mon Sep 17 00:00:00 2001 From: leonardian Date: Mon, 8 Jul 2024 17:00:50 +0800 Subject: [PATCH 14/27] vibrator: common: Check whether file is opened correctly - Add compile-time type checking inside the has() function to ensure it receives the correct type. - Add is_open() inside the has() function. Bug: 350911314 Test: alarm, ringtone vibrations Test: keyboard vibrations Test: idlcli commands Test: atest PTS, CTS, VTS Flag: EXEMPT bugfix Change-Id: Ifa8f197f6f4b25d51b2edaf6fec27a086bd4f73c --- vibrator/common/HardwareBase.cpp | 4 ---- vibrator/common/HardwareBase.h | 14 +++++++++++++- vibrator/cs40l26/Hardware.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/vibrator/common/HardwareBase.cpp b/vibrator/common/HardwareBase.cpp index 7d61b57..329293a 100644 --- a/vibrator/common/HardwareBase.cpp +++ b/vibrator/common/HardwareBase.cpp @@ -40,10 +40,6 @@ void HwApiBase::saveName(const std::string &name, const std::ios *stream) { mNames[stream] = name; } -bool HwApiBase::has(const std::ios &stream) { - return !!stream; -} - void HwApiBase::debug(int fd) { dprintf(fd, "Kernel:\n"); diff --git a/vibrator/common/HardwareBase.h b/vibrator/common/HardwareBase.h index 448d29c..a957848 100644 --- a/vibrator/common/HardwareBase.h +++ b/vibrator/common/HardwareBase.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "utils.h" @@ -67,7 +68,8 @@ class HwApiBase { void saveName(const std::string &name, const std::ios *stream); template void open(const std::string &name, T *stream); - bool has(const std::ios &stream); + template + bool has(const T &stream); template bool get(T *value, std::istream *stream); template @@ -93,6 +95,16 @@ void HwApiBase::open(const std::string &name, T *stream) { utils::openNoCreate(mPathPrefix + name, stream); } +template +bool HwApiBase::has(const T &stream) { + if constexpr (std::is_same::value || std::is_same::value || + std::is_same::value) + return stream.is_open() && !stream.fail(); + + ALOGE("File stream is not of the correct type"); + return false; +} + template bool HwApiBase::get(T *value, std::istream *stream) { ATRACE_NAME("HwApi::get"); diff --git a/vibrator/cs40l26/Hardware.h b/vibrator/cs40l26/Hardware.h index d06fc6d..e2c2d36 100644 --- a/vibrator/cs40l26/Hardware.h +++ b/vibrator/cs40l26/Hardware.h @@ -92,7 +92,7 @@ class HwApi : public Vibrator::HwApi, private HwApiBase { bool setRedc(std::string value) override { return set(value, &mRedc); } bool setQ(std::string value) override { return set(value, &mQ); } bool getEffectCount(uint32_t *value) override { return get(value, &mEffectCount); } - bool hasEffectBrakingTimeBank() override { return mEffectBrakingTimeBank.is_open(); } + bool hasEffectBrakingTimeBank() override { return has(mEffectBrakingTimeBank); } bool setEffectBrakingTimeBank(uint32_t value) override { return set(value, &mEffectBrakingTimeBank); } From 697c73328cbb0a78aee71a2422387ba20a5b6117 Mon Sep 17 00:00:00 2001 From: samou Date: Fri, 12 Jul 2024 09:38:14 +0000 Subject: [PATCH 15/27] thermal: Remove bcl related tzones Flag: EXEMPT tuning changes Bug: 349935208 Test: Confirm boot Change-Id: I9162338b20afd9b5d4472d8a7176c69e04ce0175 Signed-off-by: samou --- powerhint.json | 12 -- thermal_info_config_felix.json | 286 --------------------------------- 2 files changed, 298 deletions(-) diff --git a/powerhint.json b/powerhint.json index 926d7c4..18bd582 100644 --- a/powerhint.json +++ b/powerhint.json @@ -1959,18 +1959,6 @@ "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", diff --git a/thermal_info_config_felix.json b/thermal_info_config_felix.json index a0bc0f2..e76c913 100644 --- a/thermal_info_config_felix.json +++ b/thermal_info_config_felix.json @@ -550,292 +550,6 @@ "Type":"NPU", "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", "NAN"], "Multiplier":0.001 - }, - { - "Name":"battery_cycle", - "Type":"BCL_VOLTAGE", - "Multiplier":1, - "SendCallback":false - }, - { - "Name":"critical-battery-cell", - "Type":"BCL_VOLTAGE", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "vdroop1", - "Combination":["battery", "battery_cycle", "vdroop1"], - "Coefficient":[-10000, 400, 1000], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 3.00, "NAN"], - "Multiplier":1, - "SendCallback":true - }, - { - "Name":"FLASH_LED_REDUCE", - "Type":"UNKNOWN", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "vdroop1", - "Combination":["battery", "battery_cycle", "vdroop1"], - "Coefficient":[-10000, 400, 1000], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 3.00, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "SendPowerHint":true - }, - { - "Name":"soc", - "Type":"BCL_PERCENTAGE", - "HotThreshold":["NAN", "NAN", 80, "NAN", "NAN", "NAN", "NAN"], - "Multiplier":1 - }, - { - "Name":"BCL_TPU_LOW_TEMP", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "TriggerSensor": "ocp_tpu", - "Combination":["ocp_tpu", "battery"], - "Coefficient":[1, -10], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 13000, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - } - ] - }, - { - "Name":"BCL_GPU_LOW_TEMP", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"WEIGHTED_AVG", - "TriggerSensor": "ocp_gpu", - "Combination":["ocp_gpu", "battery"], - "Coefficient":[1, -10], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 13000, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 9, 9, 9] - } - ] - }, - { - "Name":"BCL_BATOILO_GPU_LOW_TEMP", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "batoilo", - "Combination":["batoilo", "ocp_gpu", "battery"], - "Coefficient":[5000, 12000, -1000 ], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 3.0, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 9, 9, 9] - } - ] - }, - { - "Name":"BCL_BATOILO_TPU_LOW_TEMP", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "batoilo", - "Combination":["batoilo", "ocp_tpu", "battery"], - "Coefficient":[5000, 12000, -1000], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 3.0, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - } - ] - }, - { - "Name":"BCL_BATOILO_GPU", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "batoilo", - "Combination":["batoilo", "ocp_gpu"], - "Coefficient":[5000, 12000], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 2.0, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 4, 4, 4] - } - ] - }, - { - "Name":"BCL_BATOILO_TPU", - "Type":"BCL_CURRENT", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "batoilo", - "Combination":[ - "batoilo", - "ocp_tpu" - ], - "Coefficient":[5000, 12000], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 2.0, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true, - "BindedCdevInfo": [ - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 6, 6, 6] - } - ] - }, - { - "Name":"batoilo", - "Type":"BCL_CURRENT", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 5000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "SendCallback":true, - "PollingDelay":0, - "PassiveDelay":60000, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-cpufreq-2", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - }, - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 3, 3, 3] - }, - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 5, 5, 5] - } - ] - }, - { - "Name":"BCL_AUDIO_BAACL", - "Type":"BCL_VOLTAGE", - "VirtualSensor":true, - "Formula":"COUNT_THRESHOLD", - "TriggerSensor": "soc", - "Combination":["battery", "soc"], - "Coefficient":[-10000, 80], - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 2.0, "NAN", "NAN"], - "Multiplier":1, - "SendCallback":true - }, - { - "Name":"vdroop1", - "Type":"BCL_VOLTAGE", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 1000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "SendCallback":true, - "PollingDelay":0, - "PassiveDelay":60000, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-cpufreq-2", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - }, - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 2, 2, 2] - }, - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 3, 3, 3] - } - ] - }, - { - "Name":"vdroop2", - "Type":"BCL_VOLTAGE", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 1200, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "SendCallback":true, - "PollingDelay":0, - "PassiveDelay":60000, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-cpufreq-2", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - }, - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 4, 4, 4] - }, - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 3, 3, 3] - } - ] - }, - { - "Name":"smpl_gm", - "Type":"BCL_VOLTAGE", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 1100, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "SendCallback":true, - "PollingDelay":0, - "PassiveDelay":60000, - "BindedCdevInfo": [ - { - "CdevRequest": "thermal-cpufreq-2", - "LimitInfo": [0, 0, 0, 0, 7, 7, 7] - }, - { - "CdevRequest": "thermal-gpufreq-0", - "LimitInfo": [0, 0, 0, 0, 3, 3, 3] - }, - { - "CdevRequest": "tpu_cooling", - "LimitInfo": [0, 0, 0, 0, 3, 3, 3] - } - ] - }, - { - "Name":"ocp_cpu1", - "Type":"BCL_CURRENT", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 8000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "Hidden":true - }, - { - "Name":"ocp_cpu2", - "Type":"BCL_CURRENT", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 12000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1, - "Hidden":true - }, - { - "Name":"ocp_tpu", - "Type":"BCL_CURRENT", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 12000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1 - }, - { - "Name":"ocp_gpu", - "Type":"BCL_CURRENT", - "HotThreshold":["NAN", "NAN", "NAN", "NAN", 12000, "NAN", "NAN"], - "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 100, 0.0, 0.0], - "Multiplier":1 } ], "CoolingDevices":[ From 42ebfa74b90679a79e4c2c42d2371d027ffb4ff4 Mon Sep 17 00:00:00 2001 From: Chris Paulo Date: Thu, 25 Jul 2024 14:32:09 -0700 Subject: [PATCH 16/27] vibrator: Update polling timeout to 50ms Update the polling timeout to match that of main vibrator HAL. The polling timeout is too short, and will cause reset logic to run if the bus is busy. Bug: 348364432 Flag: EXEMPT bugfix Test: atest PtsVibratorHalTestSuite \ PtsHapticsTestCases \ VibratorHalCs40l26TestSuite \ VtsHalVibratorManagerTargetTest \ VtsHalVibratorTargetTest \ CtsVibratorTestCases Change-Id: I31dac8f1693eda8f1a5bac8420aaa7c0d11781fa --- vibrator/cs40l26/Vibrator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index b3ce88e..d045bce 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -58,7 +58,7 @@ static constexpr int8_t MAX_PAUSE_TIMING_ERROR_MS = 1; // ALERT Irq Handling static constexpr uint32_t MAX_TIME_MS = UINT16_MAX; static constexpr auto ASYNC_COMPLETION_TIMEOUT = std::chrono::milliseconds(100); -static constexpr auto POLLING_TIMEOUT = 20; +static constexpr auto POLLING_TIMEOUT = 50; static constexpr int32_t COMPOSE_DELAY_MAX_MS = 10000; /* nsections is 8 bits. Need to preserve 1 section for the first delay before the first effect. */ From 3b2b23e5e28aa3cd453c84f4c7b92295191a9fbd Mon Sep 17 00:00:00 2001 From: Chris Paulo Date: Wed, 7 Aug 2024 15:05:09 -0700 Subject: [PATCH 17/27] vibrator: Fix scaling logic for felix vibrator Felix vibrator has stricter primitive effect scaling values. We need to update the logic to assure that we apply the upper and lower bounds of the voltage range to avoid brownout and to maximize the usable range. Bug: 344037610 Flag: EXEMPT bugfix Test: atest PtsVibratorHalTestSuite \ PtsHapticsTestCases \ VibratorHalCs40l26TestSuite \ VtsHalVibratorManagerTargetTest \ VtsHalVibratorTargetTest \ CtsVibratorTestCases Test: Verify scale values Change-Id: Iba8b8115fea01e56105b43f520d32c63ffcf7fd4 --- vibrator/cs40l26/Vibrator.cpp | 48 ++++++++++++++++++++++++----------- vibrator/cs40l26/Vibrator.h | 4 +-- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index d045bce..507e247 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -677,8 +677,21 @@ Vibrator::Vibrator(std::unique_ptr hwApiDefault, std::unique_ptr h mSupportedPrimitives = defaultSupportedPrimitives; } - mPrimitiveMaxScale = {1.0f, 0.95f, 0.75f, 0.9f, 1.0f, 1.0f, 1.0f, 0.75f, 0.75f}; - mPrimitiveMinScale = {0.0f, 0.01f, 0.11f, 0.23f, 0.0f, 0.25f, 0.02f, 0.03f, 0.16f}; + mPrimitiveMaxScale.resize(WAVEFORM_MAX_INDEX, 100); + mPrimitiveMaxScale[WAVEFORM_CLICK_INDEX] = 95; + mPrimitiveMaxScale[WAVEFORM_THUD_INDEX] = 75; + mPrimitiveMaxScale[WAVEFORM_SPIN_INDEX] = 90; + mPrimitiveMaxScale[WAVEFORM_LIGHT_TICK_INDEX] = 75; + mPrimitiveMaxScale[WAVEFORM_LOW_TICK_INDEX] = 75; + + mPrimitiveMinScale.resize(WAVEFORM_MAX_INDEX, 0); + mPrimitiveMinScale[WAVEFORM_CLICK_INDEX] = 1; + mPrimitiveMinScale[WAVEFORM_THUD_INDEX] = 11; + mPrimitiveMinScale[WAVEFORM_SPIN_INDEX] = 23; + mPrimitiveMinScale[WAVEFORM_SLOW_RISE_INDEX] = 25; + mPrimitiveMinScale[WAVEFORM_QUICK_FALL_INDEX] = 2; + mPrimitiveMinScale[WAVEFORM_LIGHT_TICK_INDEX] = 3; + mPrimitiveMinScale[WAVEFORM_LOW_TICK_INDEX] = 16; // ====== Get GPIO status and init it ================ mGPIOStatus = mHwGPIO->getGPIO(); @@ -904,14 +917,6 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi if (!status.isOk()) { return status; } - // Add a max and min threshold to prevent the device crash(overcurrent) or no - // feeling - if (effectScale > mPrimitiveMaxScale[static_cast(e_curr.primitive)]) { - effectScale = mPrimitiveMaxScale[static_cast(e_curr.primitive)]; - } - if (effectScale < mPrimitiveMinScale[static_cast(e_curr.primitive)]) { - effectScale = mPrimitiveMinScale[static_cast(e_curr.primitive)]; - } effectVolLevel = intensityToVolLevel(effectScale, effectIndex); totalDuration += mEffectDurations[effectIndex]; } @@ -1412,7 +1417,13 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) { } } - dprintf(fd, "Base: OWT waveform:\n"); + dprintf(fd, "==== Scales ====\n\tId\tMinScale\tMaxScale\n"); + for (effectId = 0; effectId < WAVEFORM_MAX_PHYSICAL_INDEX; effectId++) { + dprintf(fd, "\t%d\t%d\t\t%d\n", effectId, mPrimitiveMinScale[effectId], + mPrimitiveMaxScale[effectId]); + } + + dprintf(fd, "\nBase: OWT waveform:\n"); dprintf(fd, "\tId\tBytes\tData\tt\ttrigger button\n"); for (effectId = WAVEFORM_MAX_PHYSICAL_INDEX; effectId < WAVEFORM_MAX_INDEX; effectId++) { uint32_t numBytes = mFfEffects[effectId].u.periodic.custom_len * 2; @@ -1520,10 +1531,6 @@ ndk::ScopedAStatus Vibrator::getSimpleDetails(Effect effect, EffectStrength stre case Effect::HEAVY_CLICK: effectIndex = WAVEFORM_CLICK_INDEX; intensity *= 1.0f; - // WAVEFORM_CLICK_INDEX is 2, but the primitive CLICK index is 1. - if (intensity > mPrimitiveMaxScale[WAVEFORM_CLICK_INDEX - 1]) { - intensity = mPrimitiveMaxScale[WAVEFORM_CLICK_INDEX - 1]; - } break; default: return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); @@ -1765,6 +1772,17 @@ uint32_t Vibrator::intensityToVolLevel(float intensity, uint32_t effectIndex) { volLevel = calc(intensity, mClickEffectVol); break; } + + // The waveform being played must fall within the allowable scale range + if (effectIndex < WAVEFORM_MAX_INDEX) { + if (volLevel > mPrimitiveMaxScale[effectIndex]) { + volLevel = mPrimitiveMaxScale[effectIndex]; + } + if (volLevel < mPrimitiveMinScale[effectIndex]) { + volLevel = mPrimitiveMinScale[effectIndex]; + } + } + return volLevel; } diff --git a/vibrator/cs40l26/Vibrator.h b/vibrator/cs40l26/Vibrator.h index 8f89713..20f45d7 100644 --- a/vibrator/cs40l26/Vibrator.h +++ b/vibrator/cs40l26/Vibrator.h @@ -233,8 +233,8 @@ class Vibrator : public BnVibrator { bool mIsChirpEnabled; uint32_t mSupportedPrimitivesBits = 0x0; std::vector mSupportedPrimitives; - std::vector mPrimitiveMaxScale; - std::vector mPrimitiveMinScale; + std::vector mPrimitiveMaxScale; + std::vector mPrimitiveMinScale; bool mConfigHapticAlsaDeviceDone{false}; bool mGPIOStatus; bool mIsDual{false}; From 9e47f5a1ce41b54fc17d066b1b4a794277e6fcc6 Mon Sep 17 00:00:00 2001 From: Ankur Bakshi Date: Wed, 14 Aug 2024 23:07:09 +0000 Subject: [PATCH 18/27] Update felix SVN to 55 Bug:352170103 Change-Id: Ib76fb34d8c9fa0317c7cc150a80d5fe79bcec81f Flag: EXEMPT bugfix --- device-felix.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index 64f343d..710b13e 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -221,7 +221,7 @@ ifdef RELEASE_SVN_FELIX TARGET_SVN ?= $(RELEASE_SVN_FELIX) else # Set this for older releases that don't use build flag -TARGET_SVN ?= 54 +TARGET_SVN ?= 55 endif PRODUCT_VENDOR_PROPERTIES += \ From 5142673794cb6dba72d742c115d7b28405f4c035 Mon Sep 17 00:00:00 2001 From: "Peter (YM)" Date: Wed, 14 Aug 2024 08:55:36 +0000 Subject: [PATCH 19/27] thermal:remove unused state2power value Bug: 355566259 Test: Build test Flag: EXEMPT NDK Change-Id: Ib3e2e2772c340d13f3bc80583f6e1f1b7715a44d Signed-off-by: Peter (YM) --- thermal_info_config_felix.json | 12 ++++-------- thermal_info_config_proactive_skin_felix.json | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/thermal_info_config_felix.json b/thermal_info_config_felix.json index a0bc0f2..5f16bf3 100644 --- a/thermal_info_config_felix.json +++ b/thermal_info_config_felix.json @@ -842,26 +842,22 @@ { "Name":"thermal-cpufreq-0", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote", - "State2Power":[516, 456, 392, 296, 264, 216, 184, 140, 100, 68, 28] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote" }, { "Name":"thermal-cpufreq-1", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote", - "State2Power":[2466, 2166, 1840, 1544, 1260, 1024, 816, 642, 538, 410, 342, 276, 224, 162, 104] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote" }, { "Name":"thermal-cpufreq-2", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote", - "State2Power":[4920, 4614, 4092, 3684, 3198, 2820, 2354, 2184, 1862, 1476, 1338, 1110, 928, 738, 552, 450, 362, 188] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote" }, { "Name":"thermal-gpufreq-0", "Type":"GPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote", - "State2Power":[1925, 1528, 1258, 928, 795, 703, 573, 481, 396, 314, 236] + "WritePath":"/dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote" }, { "Name":"chg_mdis", diff --git a/thermal_info_config_proactive_skin_felix.json b/thermal_info_config_proactive_skin_felix.json index 5c10f4b..e45ecb5 100644 --- a/thermal_info_config_proactive_skin_felix.json +++ b/thermal_info_config_proactive_skin_felix.json @@ -872,26 +872,22 @@ { "Name":"thermal-cpufreq-0", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote", - "State2Power":[516, 456, 392, 296, 264, 216, 184, 140, 100, 68, 28] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote" }, { "Name":"thermal-cpufreq-1", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote", - "State2Power":[2466, 2166, 1840, 1544, 1260, 1024, 816, 642, 538, 410, 342, 276, 224, 162, 104] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote" }, { "Name":"thermal-cpufreq-2", "Type":"CPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote", - "State2Power":[4920, 4614, 4092, 3684, 3198, 2820, 2354, 2184, 1862, 1476, 1338, 1110, 928, 738, 552, 450, 362, 188] + "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote" }, { "Name":"thermal-gpufreq-0", "Type":"GPU", - "WritePath":"/dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote", - "State2Power":[1925, 1528, 1258, 928, 795, 703, 573, 481, 396, 314, 236] + "WritePath":"/dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote" }, { "Name":"chg_mdis", From caeaff1444db900788dca6330f326bf31b3e467e Mon Sep 17 00:00:00 2001 From: "Peter (YM)" Date: Fri, 16 Aug 2024 06:26:10 +0000 Subject: [PATCH 20/27] thermal: read thermistor temp from sysfs - avoid wrong sensor value reading for thermalHAL Bug: 327327502 Test: Build to boot to home Flag: EXEMPT (bug 337358613) Change-Id: I93cbfa767a8d882eba526d72ce9ba3c389cd0a1e Signed-off-by: Peter (YM) --- thermal_info_config_charge_felix.json | 8 -------- thermal_info_config_felix.json | 8 -------- thermal_info_config_proactive_skin_felix.json | 8 -------- 3 files changed, 24 deletions(-) diff --git a/thermal_info_config_charge_felix.json b/thermal_info_config_charge_felix.json index b3731fc..2653344 100644 --- a/thermal_info_config_charge_felix.json +++ b/thermal_info_config_charge_felix.json @@ -3,20 +3,17 @@ { "Name":"neutral_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp", "Multiplier":0.001 }, { "Name":"quiet_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp", "Multiplier":0.001 }, { "Name":"skin_therm", "Type":"UNKNOWN", "HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -24,14 +21,12 @@ { "Name":"usb_pwr_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp", "Multiplier":0.001 }, { "Name":"usb_pwr_therm2", "Type":"UNKNOWN", "HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -39,19 +34,16 @@ { "Name":"inner_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"outer_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"gnss_tcxo_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp", "Multiplier":0.001 }, { diff --git a/thermal_info_config_felix.json b/thermal_info_config_felix.json index a0bc0f2..93c0849 100644 --- a/thermal_info_config_felix.json +++ b/thermal_info_config_felix.json @@ -9,20 +9,17 @@ { "Name":"neutral_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp", "Multiplier":0.001 }, { "Name":"quiet_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp", "Multiplier":0.001 }, { "Name":"skin_therm", "Type":"UNKNOWN", "HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -30,14 +27,12 @@ { "Name":"usb_pwr_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp", "Multiplier":0.001 }, { "Name":"usb_pwr_therm2", "Type":"UNKNOWN", "HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -45,19 +40,16 @@ { "Name":"inner_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"outer_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"gnss_tcxo_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp", "Multiplier":0.001 }, { diff --git a/thermal_info_config_proactive_skin_felix.json b/thermal_info_config_proactive_skin_felix.json index 5c10f4b..87a7be3 100644 --- a/thermal_info_config_proactive_skin_felix.json +++ b/thermal_info_config_proactive_skin_felix.json @@ -9,20 +9,17 @@ { "Name":"neutral_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp", "Multiplier":0.001 }, { "Name":"quiet_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp", "Multiplier":0.001 }, { "Name":"skin_therm", "Type":"UNKNOWN", "HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -30,14 +27,12 @@ { "Name":"usb_pwr_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp", "Multiplier":0.001 }, { "Name":"usb_pwr_therm2", "Type":"UNKNOWN", "HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"], - "TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp", "Multiplier":0.001, "PollingDelay":300000, "PassiveDelay":7000 @@ -45,19 +40,16 @@ { "Name":"inner_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"outer_disp_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp", "Multiplier":0.001 }, { "Name":"gnss_tcxo_therm", "Type":"UNKNOWN", - "TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp", "Multiplier":0.001 }, { From 5524ba6a07a9a73e73ad3403d56b21ac8f302b39 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Mon, 12 Aug 2024 17:15:25 +0800 Subject: [PATCH 21/27] gps: add CpEarlyFixGuardTimeSec to prevent earlyfix response delay Bug: 358041425 Test: verify pass Change-Id: Idddb3d7968b93ebb214d1dd2938be2b1aaff8ea9 --- location/gps.6.1.xml.f10 | 1 + location/gps.xml.f10 | 1 + location/gps_user.6.1.xml.f10 | 1 + location/gps_user.xml.f10 | 1 + 4 files changed, 4 insertions(+) diff --git a/location/gps.6.1.xml.f10 b/location/gps.6.1.xml.f10 index fbf2d67..69cb18e 100644 --- a/location/gps.6.1.xml.f10 +++ b/location/gps.6.1.xml.f10 @@ -49,6 +49,7 @@ LtoSyncThresholdDays="1" GnssYearOfHardware="2020" + CpEarlyFixGuardTimeSec="1" CpGuardTimeSec="1" CpLppGuardTimeSec="1" IgnoreInjectedSystemTime="true" diff --git a/location/gps.xml.f10 b/location/gps.xml.f10 index da3e110..b528a02 100644 --- a/location/gps.xml.f10 +++ b/location/gps.xml.f10 @@ -49,6 +49,7 @@ LtoSyncThresholdDays="1" GnssYearOfHardware="2020" + CpEarlyFixGuardTimeSec="1" CpGuardTimeSec="1" CpLppGuardTimeSec="1" IgnoreInjectedSystemTime="true" diff --git a/location/gps_user.6.1.xml.f10 b/location/gps_user.6.1.xml.f10 index e4f32da..db68a27 100644 --- a/location/gps_user.6.1.xml.f10 +++ b/location/gps_user.6.1.xml.f10 @@ -48,6 +48,7 @@ LtoSyncThresholdDays="1" GnssYearOfHardware="2020" + CpEarlyFixGuardTimeSec="1" CpGuardTimeSec="1" CpLppGuardTimeSec="1" IgnoreInjectedSystemTime="true" diff --git a/location/gps_user.xml.f10 b/location/gps_user.xml.f10 index 19842ca..f533015 100644 --- a/location/gps_user.xml.f10 +++ b/location/gps_user.xml.f10 @@ -48,6 +48,7 @@ LtoSyncThresholdDays="1" GnssYearOfHardware="2020" + CpEarlyFixGuardTimeSec="1" CpGuardTimeSec="1" CpLppGuardTimeSec="1" IgnoreInjectedSystemTime="true" From d37470ea6e0a684d05cf235075e168528efe6143 Mon Sep 17 00:00:00 2001 From: Chungkai Mei Date: Tue, 20 Aug 2024 11:01:01 +0000 Subject: [PATCH 22/27] powerhint: Raise minimum MIF frequency to 546 MHz during screen on It improved 55% surfaceflinger janks in photos_playgca30fpsvideo cuj test case. Test: Build and power measurement Bug: 336872050 Flag: NONE powerhint change does not support flags Change-Id: Idad3394e5ac9d1d275f144e2d1304a115b7dc3af Signed-off-by: Chungkai Mei --- powerhint.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/powerhint.json b/powerhint.json index 078beb9..d68ab92 100644 --- a/powerhint.json +++ b/powerhint.json @@ -21,7 +21,8 @@ "1539000", "1352000", "1014000", - "421000" + "421000", + "546000" ], "ResetOnInit": true }, @@ -884,6 +885,12 @@ "Duration": 50, "Value": "302000" }, + { + "PowerHint": "DISPLAY_INACTIVE", + "Node": "MemFreq", + "Duration": 0, + "Value": "421000" + }, { "PowerHint": "CPU_LOAD_RESET", "Node": "MemFreq", From 777bc1274fbd4f8e9815461f9284592d723cbc35 Mon Sep 17 00:00:00 2001 From: Ankit Goyal Date: Wed, 28 Aug 2024 22:52:54 -0700 Subject: [PATCH 23/27] Delete mapper4 manifest Bug: 362183626 Flag: EXEMPT manifest update Test: Boot to home on shiba Change-Id: I1882a688138455538418b01b38084b5dfb2dd802 --- manifest.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/manifest.xml b/manifest.xml index ae2f526..a287416 100644 --- a/manifest.xml +++ b/manifest.xml @@ -48,15 +48,6 @@ default - - android.hardware.graphics.mapper - passthrough - 4.0 - - IMapper - default - - android.hardware.graphics.composer hwbinder From a644ef2a33b47bdf937a47f362a71eb9d80a031a Mon Sep 17 00:00:00 2001 From: leonardian Date: Mon, 24 Jun 2024 04:24:02 +0000 Subject: [PATCH 24/27] cs40l26: Align Felix HAL dump logs with common HAL - Add driver, firmware, and tuning versions. - Increase HAL buffer size to 2048 lines. - Add F0, active ID, redc Bug: 348316804 Flag: EXEMPT bugfix Test: Checked HAL dumpsys Test: atest PTS, VTS, CTS Change-Id: I277d270533868cf2075388bdc329d77c9065801e --- vibrator/common/HardwareBase.h | 16 ++++-- vibrator/cs40l26/Vibrator.cpp | 93 +++++++++++++++++++++++++++++++--- vibrator/cs40l26/Vibrator.h | 2 + 3 files changed, 100 insertions(+), 11 deletions(-) diff --git a/vibrator/common/HardwareBase.h b/vibrator/common/HardwareBase.h index 448d29c..bff664f 100644 --- a/vibrator/common/HardwareBase.h +++ b/vibrator/common/HardwareBase.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -47,17 +48,19 @@ class HwApiBase { class Record : public RecordInterface { public: Record(const char *func, const T &value, const std::ios *stream) - : mFunc(func), mValue(value), mStream(stream) {} + : mFunc(func), mValue(value), mStream(stream), + mTp(std::chrono::system_clock::system_clock::now()) {} std::string toString(const NamesMap &names) override; private: const char *mFunc; const T mValue; const std::ios *mStream; + const std::chrono::system_clock::time_point mTp; }; using Records = std::list>; - static constexpr uint32_t RECORDS_SIZE = 32; + static constexpr uint32_t RECORDS_SIZE = 2048; public: HwApiBase(); @@ -169,9 +172,14 @@ template std::string HwApiBase::Record::toString(const NamesMap &names) { using utils::operator<<; std::stringstream ret; + auto lTp = std::chrono::system_clock::to_time_t(mTp); + struct tm buf; + auto lTime = localtime_r(&lTp, &buf); - ret << mFunc << " '" << names.at(mStream) << "' = '" << mValue << "'"; - + ret << std::put_time(lTime, "%Y-%m-%d %H:%M:%S.") << std::setfill('0') << std::setw(3) + << (std::chrono::duration_cast(mTp.time_since_epoch()) % 1000) + .count() + << " " << mFunc << " '" << names.at(mStream) << "' = '" << mValue << "'"; return ret.str(); } diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index b3ce88e..c04f7a3 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -71,6 +71,14 @@ static constexpr int32_t COMPOSE_PWLE_SIZE_MAX_DEFAULT = 127; // See the LRA Calibration Support documentation for more details. static constexpr int32_t Q14_BIT_SHIFT = 14; +// Measured ReDC. The LRA series resistance (ReDC), expressed as follows +// redc(ohms) = redc_measured / 2^Q15_BIT_SHIFT. +// This value represents the unit-specific ReDC input to the click compensation +// algorithm. It can be overwritten at a later time by writing to the redc_stored +// sysfs control. +// See the LRA Calibration Support documentation for more details. +static constexpr int32_t Q15_BIT_SHIFT = 15; + // Measured Q factor, q_measured, is represented by Q8.16 fixed // point format on cs40l26 devices. The expression to calculate q is: // q = q_measured / 2^Q16_BIT_SHIFT @@ -115,6 +123,10 @@ static uint16_t amplitudeToScale(float amplitude, float maximum) { return std::round(ratio); } +static float redcToFloat(std::string *caldata) { + return static_cast(std::stoul(*caldata, nullptr, 16)) / (1 << Q15_BIT_SHIFT); +} + enum WaveformBankID : uint8_t { RAM_WVFRM_BANK, ROM_WVFRM_BANK, @@ -592,9 +604,12 @@ Vibrator::Vibrator(std::unique_ptr hwApiDefault, std::unique_ptr h if (mHwCalDef->getF0(&caldata)) { mHwApiDef->setF0(caldata); + mResonantFrequency = + static_cast(std::stoul(caldata, nullptr, 16)) / (1 << Q14_BIT_SHIFT); } if (mHwCalDef->getRedc(&caldata)) { mHwApiDef->setRedc(caldata); + mRedc = redcToFloat(&caldata); } if (mHwCalDef->getQ(&caldata)) { mHwApiDef->setQ(caldata); @@ -1129,12 +1144,7 @@ ndk::ScopedAStatus Vibrator::alwaysOnDisable(int32_t /*id*/) { } ndk::ScopedAStatus Vibrator::getResonantFrequency(float *resonantFreqHz) { - std::string caldata{8, '0'}; - if (!mHwCalDef->getF0(&caldata)) { - ALOGE("Failed to get resonant frequency (%d): %s", errno, strerror(errno)); - return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); - } - *resonantFreqHz = static_cast(std::stoul(caldata, nullptr, 16)) / (1 << Q14_BIT_SHIFT); + *resonantFreqHz = mResonantFrequency; return ndk::ScopedAStatus::ok(); } @@ -1383,7 +1393,10 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) { dprintf(fd, "AIDL:\n"); + dprintf(fd, " Active Effect ID: %" PRId32 "\n", mActiveId); + dprintf(fd, " F0: %.02f\n", mResonantFrequency); dprintf(fd, " F0 Offset: base: %" PRIu32 " flip: %" PRIu32 "\n", mF0Offset, mF0OffsetDual); + dprintf(fd, " Redc: %.02f\n", mRedc); dprintf(fd, " Voltage Levels:\n"); dprintf(fd, " Tick Effect Min: %" PRIu32 " Max: %" PRIu32 "\n", mTickEffectVol[0], @@ -1448,7 +1461,73 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) { } } dprintf(fd, "\n"); - dprintf(fd, "\n"); + + dprintf(fd, "Versions:\n"); + std::ifstream verFile; + const auto verBinFileMode = std::ifstream::in | std::ifstream::binary; + std::string ver; + verFile.open("/sys/module/cs40l26_core/version"); + if (verFile.is_open()) { + getline(verFile, ver); + dprintf(fd, " Haptics Driver: %s\n", ver.c_str()); + verFile.close(); + } + verFile.open("/sys/module/cl_dsp_core/version"); + if (verFile.is_open()) { + getline(verFile, ver); + dprintf(fd, " DSP Driver: %s\n", ver.c_str()); + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26.wmfw", verBinFileMode); + if (verFile.is_open()) { + verFile.seekg(113); + dprintf(fd, " cs40l26.wmfw: %d.%d.%d\n", verFile.get(), verFile.get(), verFile.get()); + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26-calib.wmfw", verBinFileMode); + if (verFile.is_open()) { + verFile.seekg(113); + dprintf(fd, " cs40l26-calib.wmfw: %d.%d.%d\n", verFile.get(), verFile.get(), + verFile.get()); + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26.bin", verBinFileMode); + if (verFile.is_open()) { + while (getline(verFile, ver)) { + auto pos = ver.find("Date: "); + if (pos != std::string::npos) { + ver = ver.substr(pos + 6, pos + 15); + dprintf(fd, " cs40l26.bin: %s\n", ver.c_str()); + break; + } + } + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26-svc.bin", verBinFileMode); + if (verFile.is_open()) { + verFile.seekg(36); + getline(verFile, ver); + ver = ver.substr(ver.rfind('\\') + 1); + dprintf(fd, " cs40l26-svc.bin: %s\n", ver.c_str()); + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26-calib.bin", verBinFileMode); + if (verFile.is_open()) { + verFile.seekg(36); + getline(verFile, ver); + ver = ver.substr(ver.rfind('\\') + 1); + dprintf(fd, " cs40l26-calib.bin: %s\n", ver.c_str()); + verFile.close(); + } + verFile.open("/vendor/firmware/cs40l26-dvl.bin", verBinFileMode); + if (verFile.is_open()) { + verFile.seekg(36); + getline(verFile, ver); + ver = ver.substr(0, ver.find('\0') + 1); + ver = ver.substr(ver.rfind('\\') + 1); + dprintf(fd, " cs40l26-dvl.bin: %s\n", ver.c_str()); + verFile.close(); + } mHwApiDef->debug(fd); diff --git a/vibrator/cs40l26/Vibrator.h b/vibrator/cs40l26/Vibrator.h index 8f89713..b469b77 100644 --- a/vibrator/cs40l26/Vibrator.h +++ b/vibrator/cs40l26/Vibrator.h @@ -232,6 +232,8 @@ class Vibrator : public BnVibrator { float mLongEffectScale{1.0}; bool mIsChirpEnabled; uint32_t mSupportedPrimitivesBits = 0x0; + float mRedc{0.0f}; + float mResonantFrequency{0.0f}; std::vector mSupportedPrimitives; std::vector mPrimitiveMaxScale; std::vector mPrimitiveMinScale; From 3e925e43493da1a716523f0f7e5352927dad33db Mon Sep 17 00:00:00 2001 From: Robin Peng Date: Fri, 6 Sep 2024 07:35:11 +0000 Subject: [PATCH 25/27] Symlink current prebuilt folder to android root The Android are now based on Trunk Stable world and Pixel prebuilts CLs also needs to reply with this which controlled by the flag which results: - the flag value might be different on each branches - the flag value are mostly different on each release configuration - for local builds, ENGs' needs to figure out the correct location of current prebuilts by checking through entire prebuilt textproto files To alleviate this problem, create an symlink file under android root indicates current prebuilt path after invoke the android lunch cmd. Bug: 364831620 Flag: EXEMPT export current prebuilt path Change-Id: I08d009b79c5d15c078bfbeb3f191271e154cd508 Signed-off-by: Robin Peng --- felix/BoardConfig.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/felix/BoardConfig.mk b/felix/BoardConfig.mk index fdd4c79..98459d7 100644 --- a/felix/BoardConfig.mk +++ b/felix/BoardConfig.mk @@ -39,6 +39,7 @@ USES_IDISPLAY_INTF_SEC := true include device/google/gs201/BoardConfig-common.mk -include vendor/google_devices/gs201/prebuilts/BoardConfigVendor.mk +include device/google/gs-common/check_current_prebuilt/check_current_prebuilt.mk -include vendor/google_devices/felix/proprietary/BoardConfigVendor.mk include device/google/felix-sepolicy/felix-sepolicy.mk include device/google/felix/wifi/BoardConfig-wifi.mk From a42bff793844e594b315149f8c7d775fbebe7215 Mon Sep 17 00:00:00 2001 From: Koli Lin Date: Thu, 5 Sep 2024 08:19:35 +0000 Subject: [PATCH 26/27] Update product id for Felix Test: manual Bug: 316248308 Flag: EXEMPT prop value only update Change-Id: I57bbf91eb9ce9c35a103cfc54f9a6f2002eba54a --- device-felix.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/device-felix.mk b/device-felix.mk index 0812269..69e4375 100644 --- a/device-felix.mk +++ b/device-felix.mk @@ -447,5 +447,6 @@ PRODUCT_PACKAGES += \ AvoidAppsInCutoutOverlay # Bluetooth device id +# Felix: 0x410C PRODUCT_PRODUCT_PROPERTIES += \ - bluetooth.device_id.product_id=20494 + bluetooth.device_id.product_id=16652 From 7c1f13c5a9e120adb0d9aa89ef9fe27e77fc48dc Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Thu, 19 Sep 2024 23:05:42 +0800 Subject: [PATCH 27/27] gps: set default SUPL SSL method to SSLv23 Bug: 363886476 Test: verify SUPL NI test pass (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ea53f43031e0ca9930f145feff56221f041afa5c) Merged-In: I56f0139c748a3a04df9f3998653121948846c8fe Change-Id: I56f0139c748a3a04df9f3998653121948846c8fe --- location/gps.6.1.xml.f10 | 2 +- location/gps.xml.f10 | 2 +- location/gps_user.6.1.xml.f10 | 2 +- location/gps_user.xml.f10 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/location/gps.6.1.xml.f10 b/location/gps.6.1.xml.f10 index 69cb18e..a753dd0 100644 --- a/location/gps.6.1.xml.f10 +++ b/location/gps.6.1.xml.f10 @@ -18,7 +18,7 @@ SuplLogFullName="/data/vendor/gps/suplflow.txt" tlsEnable="true" - SuplSslMethod="SSLv23_NO_TLSv1_2" + SuplSslMethod="SSLv23" SuplEnable="true" SuplUseApn="false" SuplUseApnNI="true" diff --git a/location/gps.xml.f10 b/location/gps.xml.f10 index 92d3316..3ce7975 100644 --- a/location/gps.xml.f10 +++ b/location/gps.xml.f10 @@ -18,7 +18,7 @@ SuplLogFullName="/data/vendor/gps/suplflow.txt" tlsEnable="true" - SuplSslMethod="SSLv23_NO_TLSv1_2" + SuplSslMethod="SSLv23" SuplEnable="true" SuplUseApn="false" SuplUseApnNI="true" diff --git a/location/gps_user.6.1.xml.f10 b/location/gps_user.6.1.xml.f10 index db68a27..7a43bf5 100644 --- a/location/gps_user.6.1.xml.f10 +++ b/location/gps_user.6.1.xml.f10 @@ -17,7 +17,7 @@ SuplLogFullName="/data/vendor/gps/suplflow.txt" tlsEnable="true" - SuplSslMethod="SSLv23_NO_TLSv1_2" + SuplSslMethod="SSLv23" SuplEnable="true" SuplUseApn="false" SuplUseApnNI="true" diff --git a/location/gps_user.xml.f10 b/location/gps_user.xml.f10 index 9ddd3aa..65f3ef0 100644 --- a/location/gps_user.xml.f10 +++ b/location/gps_user.xml.f10 @@ -17,7 +17,7 @@ SuplLogFullName="/data/vendor/gps/suplflow.txt" tlsEnable="true" - SuplSslMethod="SSLv23_NO_TLSv1_2" + SuplSslMethod="SSLv23" SuplEnable="true" SuplUseApn="false" SuplUseApnNI="true"