static void power_hint(struct power_module *module, power_hint_t hint, void *data) { /* Check if this hint has been overridden. */ if (power_hint_override(module, hint, data) == HINT_HANDLED) { /* The power_hint has been handled. We can skip the rest. */ return; } switch(hint) { case POWER_HINT_VSYNC: break; case POWER_HINT_INTERACTION: { int resources[] = {0x702, 0x20F, 0x30F}; int duration = 3000; interaction(duration, sizeof(resources)/sizeof(resources[0]), resources); } break; case POWER_HINT_VIDEO_ENCODE: process_video_encode_hint(data); break; case POWER_HINT_VIDEO_DECODE: process_video_decode_hint(data); break; } }
static void power_hint(struct power_module *module, power_hint_t hint, void *data) { pthread_mutex_lock(&hint_mutex); /* Check if this hint has been overridden. */ if (power_hint_override(module, hint, data) == HINT_HANDLED) { /* The power_hint has been handled. We can skip the rest. */ goto out; } switch(hint) { case POWER_HINT_VSYNC: case POWER_HINT_INTERACTION: case POWER_HINT_CPU_BOOST: case POWER_HINT_SET_PROFILE: break; case POWER_HINT_VIDEO_ENCODE: process_video_encode_hint(data); break; case POWER_HINT_VIDEO_DECODE: process_video_decode_hint(data); break; case POWER_HINT_AUDIO: process_audio_hint(data); break; } out: pthread_mutex_unlock(&hint_mutex); }