Speed up console framebuffer imageblit function

Especially on platforms with a slower CPU but a relatively high
framebuffer fill bandwidth, like current ARM devices, the existing
console monochrome imageblit function used to draw console text is
suboptimal for common pixel depths such as 16bpp and 32bpp. The existing
code is quite general and can deal with several pixel depths. By creating
special case functions for 16bpp and 32bpp, by far the most common pixel
formats used on modern systems, a significant speed-up is attained
which can be readily felt on ARM-based devices like the Raspberry Pi
and the Allwinner platform, but should help any platform using the
fb layer.

The special case functions allow constant folding, eliminating a number
of instructions including divide operations, and allow the use of an
unrolled loop, eliminating instructions with a variable shift size,
reducing source memory access instructions, and eliminating excessive
branching. These unrolled loops also allow much better code optimization
by the C compiler. The code that selects which optimized variant is used
is also simplified, eliminating integer divide instructions.

The speed-up, measured by timing 'cat file.txt' in the console, varies
between 40% and 70%, when testing on the Raspberry Pi and Allwinner
ARM-based platforms, depending on font size and the pixel depth, with
the greater benefit for 32bpp.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
OMAP4: SMC: Fix compiler warnings in omap4-common.c

arch/arm/mach-omap2/omap4-common.c:40: warning: 'l4_secure_clkdm'
	defined but not used

If SMC is defined, we use a different omap4_secure_dispatcher and
l4_secure_clkdm was being defined but not used in omap4-common.c. The
solution here is to wrap the declaration in same #ifdef as
omap4_secure_dispatcher.

Change-Id: Idd0a7c144c78f30d2ea7269390cad9112e218659
Signed-off-by: Bryan Buckley <bryan.buckley@ti.com>
omap2: usb: remove warning

Signed-off-by: Willi Ye <williye97@gmail.com>
 staging: Add Snappy compression library (v3)

Google's Snappy data compression library is a faster alternative to LZO,
optimized for x86-64. On compressible input it compresses ~2.5x faster than LZO
and decompresses ~1.5-2x faster than LZO. On incompressible input, it skips the
input at 100x faster than LZO and decompresses ~4x faster than LZO.
It is released under BSD license.
This is a kernel port from user space C++ code.
The current intended use is with zram (see next patch in series).

Signed-off-by: Zeev Tarantov <zeev.tarantov@gmail.com>
Signed-off-by: Willi Ye <williye97@gmail.com>

Conflicts:
	drivers/staging/Makefile

Conflicts:
	drivers/staging/Kconfig
	drivers/staging/Makefile
csnappy: Update to newest version

Pulled on 18/04/2013
Revert " Reduce the RAM used by the GPU as Frame Buffer."

This reverts commit 379d2a1669f8bce9005d16222320454ac33fc130.
Revert "ondemandplus governor: remove adaptive timer_rate logic"

This reverts commit 13e773dd328ac699162c7612071592387f48bd49.
Revert "ondemandplus: add and enable io_is_busy=2 option, adjust up_threshold and down_differential"

This reverts commit 292e98ac61068ef22804621dfe231e74c1f37cb7.
Revert "add ondemandplus governor"

This reverts commit b93293137b7c60e11f9a2d1d2e474a11625de5dd.

Conflicts:
	drivers/cpufreq/Kconfig
	include/linux/cpufreq.h
cpufreq/cpufreq_intellidemand: intellidemand cpufreq governor (version 3.1)

Intellidemand is inspired by ondemand governor. Its main features are:

 - auto cpu hotplugging based on runnable thread average calculations
 - detection of browsing mode (long screen on activities with moderate run
   queue depth =< 38 )
 - limit max frequencies when in browsing mode to conserve battery for long
   duration tasks

Browsing State Determination:
 1- Browsing state is enabled as power-on default. Browsing state is disabled
    when run queue depth is > 38 for 2 consecutive samples
    (very high instantaneous spikes)

Browsing State Limit Max Freq Logic (sliding window algorithm):
 1- While Screen is ON > 3 min, and average load of the CPU is < 35%, then
    CPU Max frequencies will remain power-on default
 2- While Screen is On, if average CPU load > 35%, both CPUs max frequencies
    will be limited to a lower user configurable max value
 3- While Screen is On, After both CPUs' Max is limited to lowered max, when
    the average CPU load has dropped down to less than < 25%, then both CPUs
    Max freq will be restored to back to power-on default

Runnable Thread Auto-hotplug (fast hotplug / slow unplug algorithm):
 1- When average number of running thread is < threshold, 2nd cpu will be
    unplugged.
 2- When > threshold, 2nd cpu will be hotplugged.
 3- The logic applies a fast hotplug and slow unplug algorithm so 2nd core
    will stay enabled longer to help deal with performance spikes

changes from Ver 3.0 -> Ver 3.1:
  - add run queue persistence to better determine browsing state
changes from Ver 2.0 -> Ver 3.0:
  - remove GPU Busy dependency for browsing state detection (this will make
    the governor more portable to other platforms without specific GPU
    architecture knowledge)

dependencies:
  -- Qualcomm's run queue average logic (SOC independent logic)
  -- TI's runnable thread average logic (SOC independent logic)

adapted for OMAP2 platform

Signed-off-by: Paul Reioux <reioux@gmail.com>

Conflicts:
	arch/arm/mach-omap2/omap2plus-cpufreq.c
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h

Conflicts:
	arch/arm/mach-omap2/board-tuna.c
	arch/arm/mach-omap2/omap2plus-cpufreq.c
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h
rq_stats: add run queue statistic collection to kernel tick scheduler

adapted from CAF reference for OMAP2 Platform

Signed-off-by: Paul Reioux <reioux@gmail.com>
Signed-off-by: Willi Ye <williye97@gmail.com>

Conflicts:
	arch/arm/mach-omap2/Kconfig
	arch/arm/mach-omap2/Makefile
	kernel/time/tick-sched.c

Conflicts:
	arch/arm/mach-omap2/Kconfig
Revert "cpufreq/cpufreq_intellidemand: intellidemand cpufreq governor (version 3.1)"

This reverts commit 9cadcde281e3914fcb652e84743587ed9ba23dc2.
Added ondemandX Governor

Conflicts:
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h
defconfig update