Snap for 11348195 from 2693ba0f60
to 24Q2-release
Change-Id: Ib8d146ae6efa025e96a60a38f5bcf4aa33ff0e46
This commit is contained in:
commit
3947f149bd
3 changed files with 40 additions and 9 deletions
|
@ -784,6 +784,17 @@
|
||||||
"Type": "DoHint",
|
"Type": "DoHint",
|
||||||
"Value": "LAUNCH_EXTEND"
|
"Value": "LAUNCH_EXTEND"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PowerHint": "LAUNCH",
|
||||||
|
"Type": "DoHint",
|
||||||
|
"Value": "LAUNCH_PMU"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"PowerHint": "LAUNCH_PMU",
|
||||||
|
"Node": "PMU_POLL",
|
||||||
|
"Duration": 3000,
|
||||||
|
"Value": "0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"PowerHint": "LAUNCH_EXTEND",
|
"PowerHint": "LAUNCH_EXTEND",
|
||||||
"Node": "CPUBigClusterMaxFreq",
|
"Node": "CPUBigClusterMaxFreq",
|
||||||
|
@ -939,6 +950,12 @@
|
||||||
"Duration": 1000,
|
"Duration": 1000,
|
||||||
"Value": "4-7"
|
"Value": "4-7"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PowerHint": "CAMERA_LAUNCH",
|
||||||
|
"Node": "PMU_POLL",
|
||||||
|
"Duration": 1000,
|
||||||
|
"Value": "0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"PowerHint": "CAMERA_LAUNCH_EXTENDED",
|
"PowerHint": "CAMERA_LAUNCH_EXTENDED",
|
||||||
"Node": "CPUBigClusterMaxFreq",
|
"Node": "CPUBigClusterMaxFreq",
|
||||||
|
@ -963,6 +980,12 @@
|
||||||
"Duration": 2000,
|
"Duration": 2000,
|
||||||
"Value": "0"
|
"Value": "0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"PowerHint": "CAMERA_LAUNCH_EXTENDED",
|
||||||
|
"Node": "PMU_POLL",
|
||||||
|
"Duration": 2000,
|
||||||
|
"Value": "0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"PowerHint": "CAMERA_THERMAL_CPU_THROTTLE",
|
"PowerHint": "CAMERA_THERMAL_CPU_THROTTLE",
|
||||||
"Node": "CPUBigClusterMaxFreq",
|
"Node": "CPUBigClusterMaxFreq",
|
||||||
|
|
|
@ -110,7 +110,7 @@ class HwApi : public Vibrator::HwApi, private HwApiBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool setFFEffect(int fd, struct ff_effect *effect, uint16_t timeoutMs) override {
|
bool setFFEffect(int fd, struct ff_effect *effect, uint16_t timeoutMs) override {
|
||||||
if (((*effect).replay.length != timeoutMs) || (ioctl(fd, EVIOCSFF, effect) < 0)) {
|
if (ioctl(fd, EVIOCSFF, effect) < 0) {
|
||||||
ALOGE("setFFEffect fail");
|
ALOGE("setFFEffect fail");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -363,7 +363,8 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> h
|
||||||
mFfEffects[effectIndex] = {
|
mFfEffects[effectIndex] = {
|
||||||
.type = FF_PERIODIC,
|
.type = FF_PERIODIC,
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.replay.length = static_cast<uint16_t>(mEffectDurations[effectIndex]),
|
// Length == 0 to allow firmware control of the duration
|
||||||
|
.replay.length = 0,
|
||||||
.u.periodic.waveform = FF_CUSTOM,
|
.u.periodic.waveform = FF_CUSTOM,
|
||||||
.u.periodic.custom_data = new int16_t[2]{RAM_WVFRM_BANK, effectIndex},
|
.u.periodic.custom_data = new int16_t[2]{RAM_WVFRM_BANK, effectIndex},
|
||||||
.u.periodic.custom_len = FF_CUSTOM_DATA_LEN,
|
.u.periodic.custom_len = FF_CUSTOM_DATA_LEN,
|
||||||
|
@ -371,9 +372,11 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> h
|
||||||
// Bypass the waveform update due to different input name
|
// Bypass the waveform update due to different input name
|
||||||
if ((strstr(inputEventName, "cs40l26") != nullptr) ||
|
if ((strstr(inputEventName, "cs40l26") != nullptr) ||
|
||||||
(strstr(inputEventName, "cs40l26_dual_input") != nullptr)) {
|
(strstr(inputEventName, "cs40l26_dual_input") != nullptr)) {
|
||||||
|
// Let the firmware control the playback duration to avoid
|
||||||
|
// cutting any effect that is played short
|
||||||
if (!mHwApiDef->setFFEffect(
|
if (!mHwApiDef->setFFEffect(
|
||||||
mInputFd, &mFfEffects[effectIndex],
|
mInputFd, &mFfEffects[effectIndex],
|
||||||
static_cast<uint16_t>(mFfEffects[effectIndex].replay.length))) {
|
mEffectDurations[effectIndex])) {
|
||||||
ALOGE("Failed upload effect %d (%d): %s", effectIndex, errno, strerror(errno));
|
ALOGE("Failed upload effect %d (%d): %s", effectIndex, errno, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,7 +406,8 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> h
|
||||||
mFfEffectsDual[effectIndex] = {
|
mFfEffectsDual[effectIndex] = {
|
||||||
.type = FF_PERIODIC,
|
.type = FF_PERIODIC,
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.replay.length = static_cast<uint16_t>(mEffectDurations[effectIndex]),
|
// Length == 0 to allow firmware control of the duration
|
||||||
|
.replay.length = 0,
|
||||||
.u.periodic.waveform = FF_CUSTOM,
|
.u.periodic.waveform = FF_CUSTOM,
|
||||||
.u.periodic.custom_data = new int16_t[2]{RAM_WVFRM_BANK, effectIndex},
|
.u.periodic.custom_data = new int16_t[2]{RAM_WVFRM_BANK, effectIndex},
|
||||||
.u.periodic.custom_len = FF_CUSTOM_DATA_LEN,
|
.u.periodic.custom_len = FF_CUSTOM_DATA_LEN,
|
||||||
|
@ -411,9 +415,11 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> h
|
||||||
// Bypass the waveform update due to different input name
|
// Bypass the waveform update due to different input name
|
||||||
if ((strstr(inputEventName, "cs40l26") != nullptr) ||
|
if ((strstr(inputEventName, "cs40l26") != nullptr) ||
|
||||||
(strstr(inputEventName, "cs40l26_dual_input") != nullptr)) {
|
(strstr(inputEventName, "cs40l26_dual_input") != nullptr)) {
|
||||||
|
// Let the firmware control the playback duration to avoid
|
||||||
|
// cutting any effect that is played short
|
||||||
if (!mHwApiDual->setFFEffect(
|
if (!mHwApiDual->setFFEffect(
|
||||||
mInputFdDual, &mFfEffectsDual[effectIndex],
|
mInputFdDual, &mFfEffectsDual[effectIndex],
|
||||||
static_cast<uint16_t>(mFfEffectsDual[effectIndex].replay.length))) {
|
mEffectDurations[effectIndex])) {
|
||||||
ALOGE("Failed upload flip's effect %d (%d): %s", effectIndex, errno,
|
ALOGE("Failed upload flip's effect %d (%d): %s", effectIndex, errno,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
|
@ -795,9 +801,10 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect> &composi
|
||||||
if (header_count == dspmem_chunk_bytes(ch)) {
|
if (header_count == dspmem_chunk_bytes(ch)) {
|
||||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||||
} else {
|
} else {
|
||||||
mFfEffects[WAVEFORM_COMPOSE].replay.length = totalDuration;
|
// Composition duration should be 0 to allow firmware to play the whole effect
|
||||||
|
mFfEffects[WAVEFORM_COMPOSE].replay.length = 0;
|
||||||
if (mIsDual) {
|
if (mIsDual) {
|
||||||
mFfEffectsDual[WAVEFORM_COMPOSE].replay.length = totalDuration;
|
mFfEffectsDual[WAVEFORM_COMPOSE].replay.length = 0;
|
||||||
}
|
}
|
||||||
return performEffect(WAVEFORM_MAX_INDEX /*ignored*/, VOLTAGE_SCALE_MAX /*ignored*/, ch,
|
return performEffect(WAVEFORM_MAX_INDEX /*ignored*/, VOLTAGE_SCALE_MAX /*ignored*/, ch,
|
||||||
callback);
|
callback);
|
||||||
|
@ -1501,9 +1508,10 @@ ndk::ScopedAStatus Vibrator::getCompoundDetails(Effect effect, EffectStrength st
|
||||||
}
|
}
|
||||||
|
|
||||||
*outTimeMs = timeMs;
|
*outTimeMs = timeMs;
|
||||||
mFfEffects[WAVEFORM_COMPOSE].replay.length = static_cast<uint16_t>(timeMs);
|
// Compositions should have 0 duration
|
||||||
|
mFfEffects[WAVEFORM_COMPOSE].replay.length = 0;
|
||||||
if (mIsDual) {
|
if (mIsDual) {
|
||||||
mFfEffectsDual[WAVEFORM_COMPOSE].replay.length = static_cast<uint16_t>(timeMs);
|
mFfEffectsDual[WAVEFORM_COMPOSE].replay.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ndk::ScopedAStatus::ok();
|
return ndk::ScopedAStatus::ok();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue