Logo Search packages:      
Sourcecode: guidance-power-manager version File versions

def guidance-power-manager::PowerManager::checkCpuFreq (   self  ) 

Adjust CPU frequency policy according to current state 

Definition at line 892 of file guidance-power-manager.py.

00892                           :
        """ Adjust CPU frequency policy according to current state """
        if not self.powermanager.hasCpuFreqGovernors:
            return ""

        if self.powermanager.onBattery():
            policy = str(self.config.readEntry("batteryFreqPolicy"))
            policy = str(self.config.readEntry("poweredFreqPolicy"))
        if policy == "":
           policy = 'dynamic'

        # check if specified policy is supported by HW
        if not policy in self.cb_freq:
            print "Warning: policy from config file not supported: ", policy
            return ""

        current_policy = self.powermanager.getCpuPolicy()
        if current_policy != policy:
            debug("Switching CPU policy from %s to %s." % (current_policy, policy))
            return self._policyChangeMessage(policy)
        elif current_policy == 'dynamic':
            debug("Dynamic policy -> update policy (conservative/ondemand)")

        debug("CPU policy will stay %s" % current_policy)
        return ""

    def powerHasBeenUnplugged(self):

Generated by  Doxygen 1.6.0   Back to index