[Nexus 4 Android Development] xenyz:
root@mako:/ # grep retention init.mako.rc
write /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled 1
root@mako:/ #

Its a semi-well-known problem that C1/retention causes flickering on some devices, as has been illustrated today. :)

Power savings are questionable at best and cause screen artifacts at the worst. It is one setting you should leave up to the (power)user to enable.

Way back when I was testing this, you could usually get away with setting it on cpu1-3 but still not a safe default on stock.

#!/system/bin/sh

########### Retention States (C0,1,2 or 3) ###########

### C0 (WFI) - Shallowest Sleep (default enabled)
C0=1
echo "$C0" > /sys/module/pm_8x60/modes/cpu0/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu1/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu2/wfi/idle_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu3/wfi/idle_enabled

echo "$C0" > /sys/module/pm_8x60/modes/cpu0/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu1/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu2/wfi/suspend_enabled
echo "$C0" > /sys/module/pm_8x60/modes/cpu3/wfi/suspend_enabled

### C1 (Retention) - slightly deeper sleep
C1=1
#echo "$C1" > /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled

echo "$C1" > /sys/module/pm_8x60/modes/cpu0/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu1/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu2/retention/suspend_enabled
echo "$C1" > /sys/module/pm_8x60/modes/cpu3/retention/suspend_enabled

### C2 (Stand Alone Power Collapse) - deeper sleep
C2=1
echo "$C2" > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled

echo "$C2" > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
echo "$C2" > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled

### C3 (Power Collapse) - deepest sleep
C3=1
echo "$C3" > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu2/power_collapse/idle_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu3/power_collapse/idle_enabled

echo "$C3" > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
echo "$C3" > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled

############ eof ############