So, a new one for me. I’m building a rom for the H811, the T-Mobile variant of the LG G4. Currently building the tried and true AOKP 7.1.2 that I have used for my other phones, and I ran into an error:

[CODE]
target thumb C: power.msm8992_32 <= device/qcom/common/power/power-8992.c
device/qcom/common/power/power-8992.c:211:17: error: use of undeclared identifier 'POWER_HINT_LAUNCH_BOOST'; did you mean 'POWER_HINT_CPU_BOOST'?
if (hint == POWER_HINT_LAUNCH_BOOST) {
^~~~~~~~~~~~~~~~~~~~~~~
POWER_HINT_CPU_BOOST
hardware/libhardware/include/hardware/power.h:71:5: note: 'POWER_HINT_CPU_BOOST' declared here
POWER_HINT_CPU_BOOST = 0x00000110,
^
1 error generated.
[/CODE]

The suggested option was to change POWER_HINT_LAUNCH_BOOST to POWER_HINT_CPU_BOOST, but I didn't like that, since just a dozen lines later in the code, there was already an if/then statement for POWER_HINT_CPU_BOOST. Esentially, we need to either declare POWER_HINT_LAUNCH_BOOST, or get rid of it in our code. In this case, I decided to scrap it because if it was needed, then it would have existed already. Strange logic perhaps, but what we see is that if it is not called, it will not return anything anyways. If it is called, it just supplies some information that I think we can live without.

[/CODE]
// WJH was POWER_HINT_LAUNCH_BOOST
// WJH if (hint == POWER_HINT_LAUNCH_BOOST) {
// WJH launch_boost_info_t *info = (launch_boost_info_t *)data;
// WJH if (info == NULL) {
// WJH ALOGE("Invalid argument for launch boost");
// WJH return HINT_HANDLED;
// WJH }

// WJH ALOGV("LAUNCH_BOOST: %s (pid=%d)", info->packageName, info->pid);

// WJH int duration = 2000;
// WJH int resources[] = { SCHED_BOOST_ON, 0x20C };

// WJH start_prefetch(info->pid, info->packageName);
// WJH interaction(duration, ARRAY_SIZE(resources), resources);

// WJH return HINT_HANDLED;
// WJH }

if (hint == POWER_HINT_CPU_BOOST) {
int duration = *(int32_t *)data / 1000;
int resources[] = { SCHED_BOOST_ON };
………….EDITED FOR SPACE…………….
[/CODE]

That will cut it out of the loop, which means the loss of a feature, but I think it is one we can live without.

Linux – keep it simple.

3 Replies to “undeclared identifier ‘POWER_HINT_LAUNCH_BOOST’”

Leave a Reply

Your email address will not be published. Required fields are marked *