Revert "mako LCD: keep RGB custom colors alive after screen off/on"

This reverts commit 0ff13ddcc5286c5247913576ec839e2d3179357c.
Makefile: add -Ofast
workqueue: silence 'warning: array subscript is above array bounds'
defconfig: trying -Ofast flag really quick
msm_mpdecision: add input event boost [read more]

This adds an input event boost to mpdecision.
It will basically boost the min freq of all cpus to predefined values if an
input event is detected.
Devices that qualify as boosters must fullfill one of these conditions:
- contain touch in their name
- contain keyboard in their name
This also boosts cpus independently from each other. Meaning:
If a cpu is hotplugged after the boost of another cpu was initiated the next
boost pulse will boost that cpu too.

Sysfs interface underway.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
msm_mpdecision: add sysfs interface for input event boost

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
msm_mpdecision: input event boost: fix not resetting boost if cpu was unplugged before

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
msm: kgsl: Do not check for hang when graphics core is idle

GPU hang detection logic checks register values every 2 seconds
and determines a hang if there is no change in the register values
after 2 seconds. When GPU core is idle the register values do not
change, hang detection logic should be disabled to prevent
false hangs being detected.

CRs-fixed: 402818
Change-Id: I6bd9085879fcafda9ca322221ba93e6a6ca5043c
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
msm: kgsl: Fix adreno idle detection during hang

Adreno idle detection during a hang was being obstructed when
called from adreno_waittimestamp(). The variable active_cnt which
was meant to protect the device from going into suspend while
doing a waittimestamp was being set and was preventing the
check of rbbm_status register which was leading to a false hang
detection, where, if the rbbm_status register value had been
probed the device would have been found to be idle. We fix this by
having a separate function is_adreno_rbbm_status_idle() which checks
this register and report whether the core is idle or not. And we call
this function instead of the generic adreno_isidle() inside
adreno_hang_detect(). Doing this fixes at least one scenario of false
hang detection.

CRs-fixed: 406631
Change-Id: Ibe80a91513af184bd95c9a710fa696432544621a
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
msm: kgsl: Add GFP_NORETRY to the page_alloc flags and handle errors

The most important thing for the memory allocator is to not crash
or otherwise behave badly during low memory situations. Adding
GFP_NORETRY keeps the OOM killer from being invoked.

Change-Id: Ic0dedbad00de1fc840bbfe91002d2fcb2730ebfc
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl_sharedmem.c
msm: kgsl: Invalidate base pointers when tlb is flushed

Invalidate the base pointer even when tlb is flushed. For
gpummu the base pointers are invalidated even after just
a tlb flush, with IOMMU do the same.

Change-Id: I11c7d4b841e5f8becd30a087bcabc0ae69c3fee5
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
msm: kgsl: Move the adreno WPTR poke logic to the hang detection

Sometimes a write to CP_WPTR fails to latch on A20x GPUs. In the past
we worked around this by writing to WPTR numerous times in the various
loops that waited for GPU activity.  Consolidate these disparate calls
by moving the poke into the hang detect function.  If the core is idle
but the RPTR != WPTR, then rewrite the WPTR and go back through the
loop again.

Change-Id: Ic0dedbad474c7884c2467fe050d8afe673588add
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
msm: kgsl: Support user specified timeouts in adreno_waittimestamp

We have always allowed the user to specify a timeout in waittimestamp
but we never obeyed it.  Reorgaize the function to be less convoluted
and support a user specified timeout (or spin forever if 0 is passed).

Change-Id: Ic0dedbadbc368336d05b14d66829205631046515
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>

Conflicts:
	drivers/gpu/msm/adreno.c
msm: kgsl: Remove extra interrupts when setting MMU state

The interrupts added to the ringbuffer on PTFLUSH and TLBUPDATE
were causing a major increase in the number of interrupts from the GPU.
This was leading to increase in power and loss of performance. Add a check
to turn off IOMMU clocks when going to SLEEP.

Change-Id: I41617dd3b7b3f7d9622523f2a1407b912dbd989e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
msm: display: non-blocking for overlay update

Display commit will work as overlay commit when
MDP_DISPLAY_COMMIT_OVERLAY flag is set. It will be
non-blocking if wait_for_finish is false.

Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Change-Id: Ibd143dbfcd2fdd7a8fab3038c5af4e2fbc9ea198

Conflicts:
	drivers/video/msm/msm_fb.c
msm_fb: display: update var in display commit

Need the value of var in display commit to update the double buffers.
If not, double buffering doesn't work in minui (eg. recovery and off-charger
mode)

Change-Id: I1fba52243cc781f18742131759245911d32c9b18
fix error

Signed-off-by: Harsh Bhanvadia <harsh.slade@gmail.com>

Conflicts:
	net/bluetooth/smp.c
msm: kgsl: Do not save context if it is being destroyed

No need to save a context if it is being destroyed since
it will no longer be used at all. This is better for
performance and also avoids the use of legacy kgsl
context save code for contexts that use preambles

Change-Id: I19a64e82188b4132f353bb61c21e4ed2281092fc
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: Do not allocate space in ringbuffer for hung context

If a hang is detected when allocating space in ringbuffer and
if the context for which the space is being allocated is hung
then do not allocate space at all.

Change-Id: Ia5ade2341fe5016119d8c140413860420c5c3a3d
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: unprepare clocks when we move from NAP to SLEEP

The existing code leaves clks prepared when we transition from
NAP to SLEEP. We fail to reach Vdd_min as voltage scaling has
moved to prepare/unprepare.

Change-Id: I509f4c6bd217ead985890147819236dd2c5d03ce
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>