CMParts: Allow CompCache size to be set by user - via % of total RAM

Use % instead of a set size - per suggestion from Cyanogen
Fix to integer instead of decimal being passed around - props to Nameless
Handle older versions changing enabled CC to Default CC size (25%)
Enable PerformanceSettings dialog to view new CC setup
Final cleanup and fix default values / bash arithmetic

Change-Id: Ie7525cfa1f8829bb037961a66620ab8664f39cec

German translation - Matthias Büchner
French translation - Sébastien Vaucher
This commit is contained in:
Wes Garner 2010-08-31 18:04:01 -05:00 committed by Steve Kondik
parent a7f97168bd
commit 2f1711de17
4 changed files with 14 additions and 5 deletions

View File

@ -62,6 +62,7 @@ CHANGELOG
* N1/Bravo/Supersonic: FM Radio support - MIUI - http://miui.com (graphics from Fitsnugly and HaXzAmaTiC) * N1/Bravo/Supersonic: FM Radio support - MIUI - http://miui.com (graphics from Fitsnugly and HaXzAmaTiC)
* N1/DS/Hero - Slightly better Gallery3D orientation fix - Jonas Larsson * N1/DS/Hero - Slightly better Gallery3D orientation fix - Jonas Larsson
* N1/DS - Kernel 2.6.35 based on Pershoot's repository * N1/DS - Kernel 2.6.35 based on Pershoot's repository
* DS: CompCache sizes can be adjusted through CMParts - Wes Garner
* Supersonic - Kernel 2.6.34 courtesy of Toast and Madcoder * Supersonic - Kernel 2.6.34 courtesy of Toast and Madcoder
* Bravo: Kernel 2.6.35 * Bravo: Kernel 2.6.35
* Espresso: Improve backlights - Wes Garner * Espresso: Improve backlights - Wes Garner

View File

@ -12,7 +12,7 @@ case "$1" in
start) start)
echo 3 > /proc/sys/vm/drop_caches echo 3 > /proc/sys/vm/drop_caches
modprobe $MODULE modprobe $MODULE
rzscontrol $DEV --init rzscontrol $DEV --disksize_kb=$2 --init
swapon $DEV swapon $DEV
;; ;;
@ -24,7 +24,7 @@ case "$1" in
rzscontrol $DEV --stats rzscontrol $DEV --stats
;; ;;
*) *)
echo "Usage: $0 {start|stop|stats}" echo "Usage: $0 {start <size>|stop|stats}"
exit 1 exit 1
esac esac

View File

@ -3,6 +3,13 @@
# Compcache handler # Compcache handler
# Decides whether or not Compcache is enabled # Decides whether or not Compcache is enabled
# #
MEMTOTAL=$( awk '{ if ($1 eq "MemTotal:") print $2 ;exit }' </proc/meminfo )
if [ `getprop persist.service.compcache` == 1 ];
then
PROP=`getprop ro.compcache.default`
setprop persist.service.compcache $PROP
fi
if [ -e /data/property/persist.service.compcache ]; if [ -e /data/property/persist.service.compcache ];
then then
@ -12,9 +19,10 @@ else
setprop persist.service.compcache $PROP setprop persist.service.compcache $PROP
fi fi
if [ $PROP == 1 ] if [ $PROP != 0 ]
then then
`dirname $0`/compcache start CCSIZE=$(($(($MEMTOTAL * $PROP)) / 100))
`dirname $0`/compcache start $CCSIZE
else else
`dirname $0`/compcache stop `dirname $0`/compcache stop
fi fi

View File

@ -33,7 +33,7 @@ PRODUCT_COPY_FILES += \
# Enable Compcache by default on D/S # Enable Compcache by default on D/S
PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_PROPERTY_OVERRIDES += \
ro.compcache.default=1 ro.compcache.default=25
# #
# Set ro.modversion # Set ro.modversion