msm8960: squashed CM commits (2/4)
video: msm: Do not use disable_irq in the spin_lock_irqsave context

Both mdp_isr() and mdp_histogram_disable() uses the same
spin lock mdp_spin_lock variable.  One core waits for disabling
mdp_isr after acquiring mdp_spin_lock and other core in mdp_isr()
waits for spin lock mdp_spin_lock and dead lock between two cores.

Change-Id: I73a10494ab78e92fc88a348aed4f526091b51f89
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Pravin Tamkhane <pravint@codeaurora.org>

msm_fb: display: Correct dtv pipe black out

This change corrects the register values to black out
the dtv base pipe.

Change-Id: I80fefab3cc6dd006edbb673f41ccfe983af2cc3a
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

msm_fb: display: skip one vsync event after enabling mdp and vsync clk

Both mdp and mdp_vsync clks are disabled for command mode panel when
no new frames are being played. When they are re-enabled if new
requests come in, the first vsync event which is signaled by read
pointer interrupt arrives in a random time due to the sync between mdp
and panel, so skip it to maintain correct vsync timing.

Change-Id: I683b765e4a16d3d152b9270f5982234b94921f1e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

msm_fb: display: Proper pipes solidfill

For MPQ/hdmi as primary, solid fill the pipes only during suspend.
This change also take care of the solidfill of the pipes unset
during overlay and pan display at suspend.

CRs-Fixed: 421461
Change-Id: I15096df681cbd94ae3cea63ecbfe915e01b7387f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c

msm_fb: display: Fix blend configuration for command mode panels

For command mode panels, blend registers does not get configured
as per the use case. This leads to incorrect blending of layers
resulting in lower layers (eg. wallpaper or buttons in video
playback) to show above the upper ones, making overall user
experience to go bad. In order to resolve the issue, blend registers
are now configured properly by as per the use case.

CRs-Fixed: 410029
CRs-Fixed: 415553
Change-Id: Ibe7d594e0ad6a6f4d75ed2e59c7382c09b65d624
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm_fb: display: Add alpha enable check in blend

FIR and M/N scalar when used for downscaling, drops
alpha channel of the given layer. To notify this, alpha_drop flag
is updated accordingly. This flag need not be checked for layers
with no alpha plane. In some scenarios alpha_drop may get enabled
for the layers with no alpha plane and cause issues realted to blend
composition of layers. Check for setting alpha_drop only if source
ayer has alpha plane.

Change-Id: Ie64b30c045a78d0d68eb9efacc76902afae7850d
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm_fb: commit mixer stage for WFD during unset

Interfaces with Borderfill pipe as base layer needs to
be commited during unset which will reset the mixer cfg
structure. This is needed because overlay_commit will not
call stage commit as there is no buffer queued.

Change-Id: Ib3347e52ae437b20d5a85a09777f13aee2672edb
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

msm_fb: display: Do not use ION_IOMMU_UNMAP_DELAYED

Since iommu buffer will be un-mapped after two newer commits
had passed, there is no need to request iommu driver to further
delay un-mapping an iommu buffer.

Change-Id: I8cf8d406cf509908035d12c9a04f0add12f3c7c7
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: Removing extra disable irq in cmds_rx API's

Disable IRQ for DSI_CMD_TERM was already called in the isr.
Removing the extra call present in the cmds_rx API's.

Change-Id: I0000dd3166beb2a3b0c788327e1d7520e0c11a13
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

msm_fb: display: Add support for vsync driven composition on 7x30

This patch will queue multiple surfaces and commit those
surfaces into mdp at same instance so that surfaces will
be blended and displayed at same time for 7x30. Hardware vsync event
is delivered to the user space frame work via uevent. Both
queue and commit are controlled by frame work and synchonized
with vsync event. Therefore frame rate will match with vsync rate.

Change-Id: I2acb83f871f16c2278dc10cb958580a2826efe70
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp4_overlay.c

msm_fb: display: wake up system around vsync

To avoid frame drops due to power collapse,
wake up cpu right before vsync.

Change-Id: I63385eb329ae5e74cbac5256823fd3a213e0a0e1
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

msm_fb: display: change the location of wakeup timer call

There are two pathes (pan display and overlay commit) to commit
display buffer, so change the location of cpu timer wakup call to the
common pipe_commit function to make sure cpu get waked up around
vsync.

Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Change-Id: Idbe6049d740a7e17a6a90e28566f7a9c74e348f2

lib: genalloc: Change chunk allocation to vmalloc

Change the chunk allocation from kmalloc to vmalloc for
allocations greater than a page. This allows large
chunks to be allocated from physically non-contiguous
memory and increases the chance of the allocation
succeeding.

CRs-fixed: 387655
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
(cherry picked from commit 0614b96dc8e4c8a0dd0db41aec5a79daa3bdf091)

Conflicts:

	lib/genalloc.c

Change-Id: Ic0dedbad9d277d0842591b1f075ce3b80c8c05de
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

lib/sha1: use the git implementation of SHA-1

For ChromiumOS, we use SHA-1 to verify the integrity of the root
filesystem.  The speed of the kernel sha-1 implementation has a major
impact on our boot performance.

To improve boot performance, we investigated using the heavily optimized
sha-1 implementation used in git.  With the git sha-1 implementation, we
see a 11.7% improvement in boot time.

10 reboots, remove slowest/fastest.

Before:

  Mean: 6.58 seconds Stdev: 0.14

After (with git sha-1, this patch):

  Mean: 5.89 seconds Stdev: 0.07

The other cool thing about the git SHA-1 implementation is that it only
needs 64 bytes of stack for the workspace while the original kernel
implementation needed 320 bytes.

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Nicolas Pitre <nico@cam.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

arm: remove "optimized" SHA1 routines

Since commit 1eb19a12bd22 ("lib/sha1: use the git implementation of
SHA-1"), the ARM SHA1 routines no longer work.  The reason? They
depended on the larger 320-byte workspace, and now the sha1 workspace is
just 16 words (64 bytes).  So the assembly version would overwrite the
stack randomly.

The optimized asm version is also probably slower than the new improved
C version, so there's no reason to keep it around.  At least that was
the case in git, where what appears to be the same assembly language
version was removed two years ago because the optimized C BLK_SHA1 code
was faster.

Reported-and-tested-by: Joachim Eastwood <manabian@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

lib/sha1.c: quiet sparse noise about symbol not declared

Include <linux/cryptohash.h> to pickup the declarations for sha_transform
and sha_init to quite the sparse noise:

  warning: symbol 'sha_transform' was not declared. Should it be static?
  warning: symbol 'sha_init' was not declared. Should it be static?

Change-Id: I267e649aef59e2fe9f6bdf7bfff3c2e0421cb51b
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

msm_fb: display: blt always enabled for 720p,1080p, secure buf

Change-Id: Ifbf78b7f80978c4151d006eed6a375ac4819c448
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mipi_samsung_oled_video_hd_pt.c

msm_fb: hdmi: black out pipes on unset

For HDMI as primary case, we need to blackout the pipes
when they are unset so that any residue is not visible
on the DTV during suspend.

Change-Id: I2bf36f1002dd185c26fe6c4291977737daa73ae1
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb.h

video: msm: Remove dead code

 * Remove deprecated and unused Samsung-specific code that causes
   various problems and display glitches.

Change-Id: I911b5796a45dca236656e5d1527a8f50fc3c19b5

Conflicts:
	arch/arm/mach-msm/board-8960-display.c
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay_dsi_video.c

msm_fb: display: return fail if pipe still staged

Pipe is not un-staged from mixer when it is unset.
It expects a pan_display() to un-stage it out of mixer.
Return fail at overlay_set() if pipe was still stage
at mixer.

CRs-fixed: 399193, 393979
Change-Id: I562f6e133bb239b30f4f53669dbf1cc5ddf80d02
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

msm_fb: display: Add pseudo-planar 422 H1V2 support in the MDP4

Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation. Add changes to support MDP_Y_CRCB_H1V2
in MDP4.

CRs-Fixed: 371303
Change-Id: I8083bf44f9e2addf9e8732268147c1c3f6c0e2af
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm_fb: display: Program source address registers correctly

Scale filter FIR uses the adjacent pixels as part of the
processing. Source address registers should be program such that
they point to the first valid pixel so that non-ROI pixels are
ignored. This is done by making source x,y offsets to zero and
adding the computed offset to source address.

CRs-Fixed: 380020
Change-Id: I998fdd46f39dc67f32c422ec209da59d1add2e95
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm: rotator: Add pseudo-planar 422 H1V2 dst format for MDP4

For interleaved 422 inputs, rotator outputs MDP_Y_CRCB_H1V2
format on 90 degree rotation. Add support as destination format
for MDP4.

CRs-Fixed: 371303
Change-Id: Ie0f98d40f58bf2cb9bc3298a94cae9c4e89b2f7a
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm: display: Remove dead code

Change-Id: I8d61fab9b407849dca8c1f7c71a055f34011a6a9

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c

msm: display: Clear performance request data in turning on

In resume, previous cached request data needs be cleared as
they do not reflect the current hw status.

Change-Id: I325e5d9e3019b0d6cc5f21b1d9b689c06484f561
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c

msm_fb: display: add iommu mapping for mdp cursor buffer address

The mdp h/w cursor buffer physical address needs to be mapped to an
iommu virtual address when iommu domain is enabled.

Change-Id: I73b4492fc4d63632117074136e4d908f5089eb93
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

video: msm: More cleanups

Change-Id: Ica6545f17ada55ecb4edb29e47541387989a2f45

msm_fb: display:  add mdp bandwidth runtime calculation

Currently mdp bandwidth request logic is based on source image size
and number of layers. This logic can not support complicated mdp
usecases and it is not power efficient. The logic is improved by
calculating mdp bandwidth request at runtime from all pipes and mixers.

CRs-fixed: 425823
Change-Id: I63206f00f8d3017a2449f8ac617fce3ba2a4d36c
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_dsi.h

msm: cpuidle: Don't disable irqs again

cpu_idle() disables irqs before calling down into the cpuidle
driver via cpuidle_idle_call(). Disabling irqs again in
msm_cpuidle_enter() is wasteful and unnecessary. It also inhibits
our ability to determine the largest irq latency when the cpu
idles for extended periods of time because the irqsoff trace is
reenabled when the irqs are disabled in msm_cpuidle_enter().

Note that we still reenable irqs before returning, as is required
by the ARM idle loop.

Change-Id: I925478d8fef88ab490959622bc68303f59cc6e79
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

msm: cpuidle: Update C state time stats in the cpu idle device.

msm_pm_idle_enter function returns time spent by cpu in particular
C state. Update the cpu idle device last residency with the return
value which is required for cpuidle stats.

CRs-fixed: 391456
Change-Id: If9f1b59e05c233e53ba37ae0fe9399f12275f3d8
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>

msm: Remove idle stats and cpuidle hooks

Calling RCU functions from within the RCU quiescent state is
illegal and probably a bug. The idlestats code uses an atomic
notifier called from msm_cpuidle_enter() and that atomic notifier
takes an rcu read lock. We could fix this with a raw notifier,
but this code is unused so let's just remove the code entirely.

Change-Id: I319f0eabb56a8721c19a3b2b4bc9a7f416c88384
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/Makefile

msm_fb: display: add wfd clk ctrl in pipe_commit

mdp_clk_ctrl on is not called when commit is from overlay commit path
which can cause mdp hang. mdp_clk_ctrl off should be after mdp
overlay2 is done, so schedule a work in overlay2 done isr.

Change-Id: I94fd08da27cfda114f5cc0056a5103f0a9b772f6
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

video: msm: wfd: Don't signal HDMIDaemon to mirror on FB1

Remove obsolete code that signalled HDMIDaemon to mirror the
display on FB1.

Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
CRs-Fixed: 352830
(cherry picked from commit 4102d704243cf0ff297cdbe8d5b731da4c0bb9d5)

Change-Id: I07fabb754a49fe398813e864067f96c66a47f489
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:
	drivers/media/video/msm/wfd/mdp-subdev.c

video: msm: wfd: Send signal HDMI observer to mirror on  FB2.

 - Send KOBJ_ONLINE, KOBJ_OFFLINE events to HDMI observer
   to mirror on  FB2.

This reverts commit 4102d704243cf0ff297cdbe8d5b731da4c0bb9d5.

Change-Id: Ie5f0c4528ee43edf5ff8145520723a8095c0f542
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>

msm: Add switch node mechanism for wfd

Add switch node mechanism for WFD to indicate the
connection/disconnection event.

Change-Id: I7623e50ba8053602e4b2924d75c0e23b641e2b9a
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
msm8960: squashed CM commit (3/4)
video: msm: Handle MDP_REV_43 MDP identity

Earlier code improperly labeled MSM8960v3 devices as MDP_REV_42. When this
bug is fixed the devices fails to boot. Update checks that exclusively
check against MDP_REV_42 to allow MDP_REV_42 and greater.

Change-Id: I34909cd3cb4a6b937f641737328a0b2ea45a22fc
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

video: msm: Add logical display id for post processing

Define logical id for display backend processing.
These ids are independent with hw implementation, could be used
for MDP4, MDP5 and future ASICs. Kernel driver implementation will
also be abstracted to the post processing user.

Change-Id: I0ce92120e2e008f9acbb934fef0ff7654f27b39b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
(cherry picked from commit 6a431631728d2d217447079dd636bd1e26d56ac4)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

video: msm: Remove an ifndef from mdp_isr

Remove ifndef so later patch does not require adding more ifndefs.

Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 20582a5cf3fad8e9fda7ded6478ed8a32b376b97)

Change-Id: I5a19d3ef835281b209cda2487e4a1f25e3c36cd1

video: msm: Finish histogram collection framework for MDP blocks

The patch "Add Histogram collection framework for MDP blocks" was included
on this branch; however, it was an incomplete version. The additions are
more histogram function pointers and better comment formatting.

Change-Id: Id5fb20f07f2c50eb678fd8f57238f4ef3d77acb0
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit 7b8b64075ee4b61c15e28f3042672b26674e0b45)

msm_fb: Add histogram support for MPQ 8064

Currently, there is no support for histogram on MPQ 8064. Add
support for histogram ioctls to support histogram testing.

CRs-fixed: 375580
Change-Id: I24ccf73c6ea6d230da4624ea196cba2d8195f8b2
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
(cherry picked from commit c8430bd159039340c5a50e6897b256631f5dc7bb)
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

msmfb: Add Enable/Disable flag definition

Fix compilation error, due to mm-core library supporting MDSS HW.

Change-Id: I50afc5e85129172e6b1774a0bc6b8ceff2aad45a
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

msm: Ensure droop detectors do not affect krait PLLs

The Droop detector mechanism present in Glitch-Free (GFMUX)
goes to nondeterministic state during frequent
standalone power collapse operation. It affects
Krait PLL output so that the PLL won't lock to
required frequency.

Since Droop detector isn't used, set sc_pdn (PLL_CLAMP)
permanently high to ensure droop detector is off and it
does not affect Krait PLL.

CRs-Fixed: 381144
Change-Id: I94ee03e0e9439c5195909a8646ff9e3c3f667893
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
(cherry picked from commit 06e444f9cd8106816a2874886cb4c165d4b03b81)

msm: Ensure krait pll clamp is always set for CPU0

To turn off droop detectors in glitch free mux, the krait PLL clamp
is set permanently for secondary cores in platsmp secondary boot path.
Set the pll clamp for primary core as well.

Change-Id: I4b18e7781515c3c66ef629c3c8ca3457ca9b2874
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
(cherry picked from commit 8fd644a8f5f4fad013c502a4600f63374a464ccb)

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

msm_fb: display: fix frame rate wrong calculation

For cmd mode the frame rate calculation result is wrong. Also in mdp
driver there are several places to do the same calculation. So fix the
wrong calculation and use a single func to do calculation.

Change-Id: Iab498fb446a1d9b8295d710ffa82618d2ab6fc07
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

video: msm: Enable pixel repeat in X direction

Change-Id: I788ad04703699c043e86d01ebf23251c410b78f7

msm: rotator: Add pseudo-planar 422 H1V2 dst format for MDP4

Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation.Add changes to support MDP_Y_CRCB_H1V2,
MDP_Y_CBCR_H1V2 in MDP4.

CRs-Fixed: 371303
Change-Id: Ibd1cb9803b8cf8bede28bc1d9830320dd505f5be
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>

Revert "msm_fb: Clear real pipe attributes in the pipe free"

This reverts commit 3f281dd8ee93769d32a0a1ef102c707b328660a8.

Conflicts:
	drivers/video/msm/mdp4_overlay.c

Change-Id: Id4a68e0a9c4683b75d091c960de1ab17fffb513f

msm: display: sync point error handling

Increase timeout value for fence waiting
Handle file handle error in fence creation

Change-Id: I46db344172795998fd03a1676f90d9dcbd19d0a6
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

msm: kgsl: Remove incorrect check for current context

We remove an incorrect check for currently active context.
The intent of the original check was to ensure that the
current context is at least there/valid before we issue
a dummy command with a forced interrupt. However, this
check was implemented incorrectly, instead of checking
the context under which the function is running, the check
was probing the "drawctxt_active" which may not necessarily
be the same as the context for which the function was called.
We fix this by changing the check to instead look for the
context under which the kgsl_check_interrupt_timestamp() has
been called.

CRs-fixed: 426186
Change-Id: I6ac123d16888287b14e6e53028f482eb709f24c5
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>

msm: kgsl: Disable clock gating earlier during snapshot

Disable clock gating earlier when recording the GPU snapshot.
This will ensure that there are no issues when reading register
values from the GPU hardware.

Change-Id: I173655b419c958f0b8cdfa4609c712e512ff2487
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>

msm: kgsl: Remove last_expired_ctxt_id

last_expired_ctxt_id was used briefly for per context timestamps and now
can be removed as it is no longer used.

Change-Id: I51d3947fe6da366824d1b947ae3448bee3518477
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>

msm: kgsl: Make the GPU device aware of the next pending event

The adreno core needs to know what the next event pending for
any given context is so it can mark the interupt to be fired.
If this isn't done then some timestamps that don't have a
matching waittimestamp call won't fire an interrupt. This is
dangerous on the last interrupt/event before a context goes
away.

Change-Id: Ic0dedbad71f6de07b43b0656128c76509326d645
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

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>

video: msm: Add missing perf update in pipe commit

Change-Id: I3905693444b21afc5b88b1b121ef9de4919f3f3f

Revert "msm_fb: display: add per stage alpha drop detection"

This reverts commit da1b41d2b465d0fd3e8f7af037aa063be8bebf57.

Revert "msm_fb: display: remove background invert alpha option for alpha drop pipe"

This reverts commit fa561972df35df8acc87bc638e131134bbf193f1.

video: msm: Initialize screeninfo in pan_display

 * Commit aff691a66c0a1371307dbbe4daf8143a7f643b8a ("non-blocking for
   overlay update") refactored a couple of structs and moved the
   screeninfo to a different place. Previously, pan_display passed the
   screeninfo to the internal function as an argument, but this has
   changed. Initialize the struct in the new location correctly.
 * This fixes the "framebuffer skips every other frame" issue seen when
   MDP composition is not in use (recovery, etc).

Change-Id: I68cd201ed6a093362561a151be5a7a81f357980f

msm_fb: Use an exclusive semaphore for Vsync IOCTL

Vsync IOCTL runs in a separate thread context and is independent of the
other display IOCTLs. Right now, we have the same semaphore shared
for Vsync IOCTL along with other IOCTLs. This will cause performance
drop if a Vsync enable/disable IOCTL thread waits to acquire the
semaphore since composition might be happening through Overlay/Blit
IOCTL. Hence, use a different semaphore for the Vsync IOCTL.

Change-Id: I190505740b289b01812b2a46d237854a31d047e8
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

msm: display: fb blend setting via MSMFB_METADATA_SET ioctl

MSMFB_METADATA_SET ioctl is added for the fb user to pass
in additional infomation rather than using reserved
fields.
User can set pre-multiplied alpha for the frame buffer via this
ioctl, overlay blend setting will take this into account.

Change-Id: Ic2f6236d84691fb03174ec479874c6928489ea30
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay.c

msm_fb: display: check pipes queued before enter wait_for_completion

Timing generator will not be turned on if there are no pipes queued.
Therefore wait_for_completion may never be completed if there have
no pipes queued.

Change-Id: Iafba086e4ba20b31470c9fd385c4f5c474ecadcf
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>

msm_fb: display: free borderfill pipe when ref_cnt reach 0

Borderfill pipe need to be kept as baselayer which is not
suppose to be freed at suspend. It only be freed when
ref_cnt reach 0 by "adb stop".

CRs-fixed: 429196
Change-Id: Ibffe7960cc194162d1ba71e8dc8636393938483f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: Fix blending logic for formats with per-pixel alpha

Currently if a layer with per-pixel alpha (eg. RGBA) is fed
for composition with z-order as zero (FG), per-pixel alpha
blending is applied along with the BG frame present on frame
buffer and hence we see the previous frame on the panel. Hence,
apply constant alpha blending if these formats are fed as FG.

CRs-fixed: 405802
CRs-fixed: 435800
Change-Id: I4e00743e7f13189b1830d4d0e655f186ffa590cd
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

Revert "Revert "msm_fb: Clear real pipe attributes in the pipe free""

This reverts commit 06a5cd870e8b0ac6080a20aa4ac8da2599020662.

video: msm: Fix bus bandwidth calculation for Samsung's panel

 * The panel device on D2 requires significantly larger MDP bandwidth in
   order for underrun not to occur. Raise the factor by 3x in order to
   get rid of flickering.
 * Thanks to noobnl for finding the root cause.

Change-Id: Iad68e7dae5896467340bbe9cc53901cf365b14d0

video: don't need to set samsung oled mipi scaling factor

Change-Id: Ia9f1a837e975645cb0b390c159de3aefa64d3892

video: msm: Remove logspam

Change-Id: I02df48181ece375c7f24223c0a2cbe3aa8594003

msm: HTC 8960: set blt_ctrl = 1

Change-Id: I0956956620b4edaa5c5b85bbc870f6041fe16ca4

msm_rotator: add rotator ref count to cleanup code

Perform cleanup of rotator sessions only if reference count reaches 0,
this avoids closing rotator sessions from sibling threads.

Change-Id: I83add90cc04faa90c372dde09a096c7a07be528a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

msm: rotator: update user session parameters for all rotator start calls

Session parameters hold the dst format of rotator output, this is
currently passed to userspace only on new session, if session is reused
with different format session not updated and can cause incorrect
display output configuration.

CRs-Fixed: 349903
Change-Id: I5dd3f277b0d5fac145c805f4898c799ef4fb1b94
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

msm_fb: display: remove old code from mdp_busy_wait

Change-Id: I178ada2864100b3954c3a0f9aafc9d75f1778cd4

msm_fb: display: Evenly balancing load on MDP ports

Moving RGB1 and RGB2 to AXI port 1. This fixes underrun issues seen
on External display while connecting and disconnecting HDMI. This patch
evenly balancing pipe loads on each port.

Change-Id: I2dc1166d04bb938f9e233a6de52f1a8a3fdd29e2
CRs-Fixed: 435458
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

msm: vidc: Add extra data bit masks for MPEG-2

Add extra data bit masks for MPEG-2.

Change-Id: I7fd5ac232ea91b5ecb3c5795890e4c34f429c233
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>

msm: socinfo: Add support for detecting Krait and Krait Pass 2

Add APIs for checking whether the current CPU is Krait and
Krait Pass 2

Change-Id: I5b28e8ae76b2df64675a6808092d792833931544
Signed-off-by: Jin Hong <jinh@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

video: msm: Clean up a mismerge

Change-Id: If9d5bc3209a56a235125860efefbc15344c4535d

msm_fb: Handle histogram IRQ cleanly during suspend/resume

Currently, if the histogram disable IOCTL comes after panel
is turned off, we early return the IOCTL causing the interrupt
to be left enabled. This causes IPC issues during suspend. Fix
this issue by properly enabling/disabling the histogram interrupt
during suspend/resume scenario.

CRs-Fixed: 434491
Change-Id: I4d38776a43ea854aff3c10c8d9d5450af1d98c91
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

msm_fb: call complete for no_update timer after power flag is set

In Suspend case, after we complete for no_update timer and before
we set power down flag to false we might recyle the CABL sequence
which might cause do_hist to fail till resume

CRs-Fixed: 434491
Change-Id: I51f9f0d9edb26c7671d44162f55c01acdde8f3d7
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb.c

msm_fb: display: add satge commit without pipes queued

This patch allow satge commit without pipes queued to
allow a pipe to be un-staged from mixer immediately after
overlay_unset.

Change-Id: I03abb907c66cce3d0559743d3bb1eb26a88dc78a
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

msm: kgsl: Process all idle checks

Rather than ignore some categories of idle events,
bin the events with small timelines and process all
events with the GPU DCVS algorithm.

CRs-Fixed: 427559
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
Change-Id: I1a5e8d8af6020a08cf95a9daa934e825bc5f2854

msm_fb: display: turn mdp clock on at pipe_commit

mdp clock is controlled by frame work. There has
possibility that mdp clock had been turned off while
frame update still happen. In this case update
thread may stuck at wait4vsync since there has no
mdp clcok to trigger vsync interrupt. This patch
will enable mdp clock at pipe commit when mdp clock
is tunred off so that frame update can be completed.

Change-Id: I2d31b9a4b6f0cb9dd36516a80931988e23e8a545
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c

ASoC: msm: Fix issues in proxy port driver due to early afe port enable.

After recent movement of afe_start to prepare the interrupts start
coming earlier from proxy port.
This results in proxy port driver not ready for interrupts. Start the
timer later to ensure processing of packet once trigger start happens.

Change-Id: Ie82d982b6c147afdef46a8c7bfe7234dd14486f1
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>

msm: vidc: Add the change to prevent memory leak

Memory allocated for "buf_entry" and "sched_cctxt"
is not freed in case if error is returned. This
change prevents possible memory leak in video
decoder driver.

CRs-fixed: 432323
Change-Id: I1c8775fb701f1568f704b6ddbb4e835304d2a817
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>

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
Signed-off-by: Devin Kim <dojip.kim@lge.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>

msm: display: panel frame rate report

Add metadata ioctl for retrieving panel frame rate.
Get ready to remove reserved fields usage.

Change-Id: I51a4aed9d85efd5f83a184100b6a3dc682c7a67c
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

msm_fb: display: add mdp new update method

Enable new mdp update method which requires flush bit
to be set before updating mixer cfg register for both
smart and dump panel

Change-Id: I97b9d221da574a96707748ec83dd1acff6dcb654
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: replace msleep with wait4vsync

vsync is controlled by frame work which means vsync irq
off may happen at any instance. This patch use a reference
count to control vsync irq enable/disable so that
wait4vsync can replace msleep safely during suspend.

Change-Id: Ief84b1b421436e1f750288eb9a9760a9cb96c555
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: wait4vsync after timing generator is turned off

When continuous splash is enabled, timing generator is enabled at
bootloader, it then needs to be turned off at mdp4_dsi_video_on()
to switch displayed content from frame buffer. wait4vsync after
timing generator is turned off is necessary to make sure DMAP has
finished fetching splash logo from original splash buffer. Otherwise,
DMAP iommu page fault may happen.

Change-Id: I35f9fb9da76f93b60d4719d147aea3246c770c9f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm: HTC 8960: increase ION SF heap size

Change-Id: I9e28e68df31bbbd02871d8b4df8abf185ff0284c

fireball: update mipi_dsi_mdp_busy_wait function call

Change-Id: Idaf29186fac6d63031962ed5ab48da7c1d3f2d73

ville: increase panel refresh rate to prevent tearing

Change-Id: Ib7d75735ab7cbc517b211f78b70d586bbed1dfbd

Linux 3.0.62

Change-Id: I357f920a3775c404031a906aa438b7a8c95415a9

Revert "ASoC: msm: Fix issues in proxy port driver due to early afe port enable.

This reverts commit 52775d8.

Change-Id: Iedb4108aab1c854c846c8a4d687509676eb0dfd1

msm_fb: Check for panel power on after Unblank.

In Overlay_play , panel power on check was at wrong place
it has to be after Unblank.

Change-Id: If910f83ef57499b5f771bc7d3d1bdfa814d5c019
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>

msm: kgsl: Avoid NULL pointer in adreno setstate functions

Make sure the specified context_id returns a valid context
in adreno_gpummu_setstate and adreno_iommu_setstate and
silently return if it doesn't.

CRs-Fixed: 439367
Change-Id: Ic0dedbad1a91b53f19782b50380bd36842614351
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

msm: kgsl: Don't wake up gpu on kgsl_ioctl calls if not necessary

This is Iee3db5401bdad1808a09d104e0daecfc3716cbb4 change ported
manually from the msm-3.4/msm-3.7 branch to the jb_2.5 branch.

The current code wakes up gpu on all kgsl_ioctl() calls that need
to hold device->mutex. However there are some kgsl_ioctl() calls that
don't need that. That fix introduces a bit of info to mark such
functions, and don't wake up gpu calling them to save some power.

Change-Id: I86224d2405c42e3803c7e361c02fe1d02d4cdff1
CRs-Fixed: 438932
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>

android, lowmemorykiller: Sync with Google/CAF

Change-Id: I65f25a29696b6d051f55b548bd90ed5be0935383

msm: kgsl: initialize kgsl_sync_timeline_ops properly

Signed-off-by: Iliyan Malchev <malchev@google.com>

video: msm: Fix copyright attribution.

The copyright of these files should be attributed to the Linux Foundation.

Change-Id: I562447ed6e8ba500d8f68598d0a791bd4a1519c2
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

msm: vidc: Add ioctls for MPEG-2 extradata support

Add ioctls for MPEG-2 extra data support.

Change-Id: I529681c350e35a4b304675cc3d67181a7c7dc37a
Signed-off-by: Deepak Verma <dverma@codeaurora.org>

block: Adding ROW scheduling algorithm

This patch adds the implementation of a new scheduling algorithm - ROW.
The policy of this algorithm is to prioritize READ requests over WRITE
as much as possible without starving the WRITE requests.
The requests are kept in queues according to their priority. The dispatch
is done in a Round Robin manner with a different slice for each queue.
READ request queues get bigger dispatch quantum than the write requests.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: Add support for reinsert a dispatched req

Add support for reinserting a dispatched request back to the
scheduler's internal data structures.
This capability is used by the device driver when it chooses to
interrupt the current request transmission and execute another (more
urgent) pending request. For example: interrupting long write in order
to handle pending read. The device driver re-inserts the
remaining write request back to the scheduler, to be rescheduled
for transmission later on.

Add API for verifying whether the current scheduler
supports reinserting requests mechanism. If reinsert mechanism isn't
supported by the scheduler, this code path will never be activated.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: Add API for urgent request handling

This patch add support in block & elevator layers for handling
urgent requests. The decision if a request is urgent or not is taken
by the scheduler. Urgent request notification is passed to the underlying
block device driver (eMMC for example). Block device driver may decide to
interrupt the currently running low priority request to serve the new
urgent request. By doing so READ latency is greatly reduced in read&write
collision scenarios.

Note that if the current scheduler doesn't implement the urgent request
mechanism, this code path is never activated.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: compile ROW statically into the kernel

ROW is a new scheduling algorithm. Similar to the existing scheduling
algorithms it should be compiled to the kernel statically giving the user
the ability to switch to it without kernel recompilation.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

row: Adding support for reinsert already dispatched req

Add support for reinserting already dispatched request back to the
schedulers internal data structures.
The request will be reinserted back to the queue (head) it was
dispatched from as if it was never dispatched.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

row: Add support for urgent request handling

This patch add support for handling urgent requests.
ROW queue can be marked as "urgent". If an urgent queue was
un-served in a previous dispatch cycle and a request was added
to it - it will trigger issuing urgent request to the device driver.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: row: Add some debug information on ROW queues

1. Add a counter for number of requests on queue.
2. Add function to print queues status (number requests
   currently on queue and number of already dispatched requests
   in current dispatch cycle).

Change-Id: I1e98b9ca33853e6e6a8ddc53240f6cd6981e6024
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: row: Insert dispatch_quantum into struct row_queue

There is really no point in keeping the dispatch quantum
of a queue outside of it. By inserting it to the row_queue
structure we spare extra level in accessing it.

Change-Id: Ic77571818b643e71f9aafbb2ca93d0a92158b199
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: row: fix sysfs functions - idle_time conversion

idle_time was updated to be stored in msec instead of jiffies.
So there is no need to convert the value when reading from user or
displaying the value to him.

Change-Id: I58e074b204e90a90536d32199ac668112966e9cf
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

block: row: Aggregate row_queue parameters to one structure

Each ROW queues has several parameters which default values are defined
in separate arrays. This patch aggregates all default values into one
array.
The values in question are:
 - is idling enabled for the queue
 - queue quantum
 - can the queue notify on urgent request

Change-Id: I3821b0a042542295069b340406a16b1000873ec6
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

cpufreq: interactive: New 'interactive' governor

This governor is designed for latency-sensitive workloads, such as
interactive user interfaces.  The interactive governor aims to be
significantly more responsive to ramp CPU quickly up when CPU-intensive
activity begins.

Existing governors sample CPU load at a particular rate, typically
every X ms.  This can lead to under-powering UI threads for the period of
time during which the user begins interacting with a previously-idle system
until the next sample period happens.

The 'interactive' governor uses a different approach. Instead of sampling
the CPU at a specified rate, the governor will check whether to scale the
CPU frequency up soon after coming out of idle.  When the CPU comes out of
idle, a timer is configured to fire within 1-2 ticks.  If the CPU is very
busy from exiting idle to when the timer fires then we assume the CPU is
underpowered and ramp to MAX speed.

If the CPU was not sufficiently busy to immediately ramp to MAX speed, then
the governor evaluates the CPU load since the last speed adjustment,
choosing the highest value between that longer-term load or the short-term
load since idle exit to determine the CPU speed to ramp to.

A realtime thread is used for scaling up, giving the remaining tasks the
CPU performance benefit, unlike existing governors which are more likely to
schedule rampup work to occur after your performance starved tasks have
completed.

The tuneables for this governor are:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_time:
	The minimum amount of time to spend at the current frequency before
	ramping down. This is to ensure that the governor has seen enough
	historic CPU load data to determine the appropriate workload.
	Default is 80000 uS.
/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
	The CPU load at which to ramp to max speed.  Default is 85.

Change-Id: Ib2b362607c62f7c56d35f44a9ef3280f98c17585
Signed-off-by: Mike Chan <mike@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Bug: 3152864

cpufreq interactive governor save/restore IRQs around cpumask spinlocks

Need to use irqsave/restore spin locking for cpumasks since these
are accessed in timers and in thread context.

Change-Id: I4a53eaf0ced7e73b445feddba90ec11482de9126
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq interactive governor: fix crash on CPU shutdown

Don't reference the saved copy of the CPU's cpufreq policy
pointer after the governor has been stopped for the CPU.

When the governor is stopped for a CPU:

* Use del_timer_sync() to wait for a currently-running timer
function to stop.

* Delete the timer when the governor is stopped for the
associated CPU, not when the last CPU is stopped.

* Flush any speed down work ongoing.

* Reset the timestamp that is used to tell if the timer function
has had a chance to run since last idle exit.

Check the governor enabled flag for the CPU before re-arming the
timer from within the timer function and at idle exit (in case
stopping the governor at runtime).

Check the governor enabled flag for the CPU in the worker
function and thread before using the policy pointer.  (There is
still a tiny window in the thread that needs more work to close.)

Change-Id: Ifaddf7a495a8dae15a579a57bdc654f7c47f6ada
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq interactive: support shared CPU scaling

Change-Id: Id5267f04067bf023f6b140b4de2e88ef7287e941
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: remove debug trace code

Remove debug trace code in preparation of upstreaming

Change-Id: I0905885e75031f5e9d7cb06878fb68c1fd06d4fe
Signed-off-by: Allen Martin <amartin@nvidia.com>

cpufreq: interactive: use idle notifier

Convert interactive governor to use idle notifier instead of
hooking pm_idle directly.

Change-Id: I47e007f330468ac559240a0ae8a3cb06a89ccb67
Signed-off-by: Allen Martin <amartin@nvidia.com>
msm8960: squshed CM commits (4/4)
cpufreq: interactive: Add error checking on sysfs interfaces

This adds better error checking on tunable parameters on sysfs
interfaces.  Also fixes return value from these functions, previously
on success they would return 0 which would cause a infinite loop.

Change-Id: Ic05038492166f8673d007202092471f98a2f0dfa
Signed-off-by: Allen Martin <amartin@nvidia.com>

cpufreq: interactive: add sysfs control for timer rate

Add a new sysfs control that tunes the rate of the timer used to
increase cpu frequency

Change-Id: I1aa13ae54bb43aff5b3688984d2955f56aae1658
Signed-off-by: Allen Martin <amartin@nvidia.com>

cpufreq: interactive: cleanup checkpatch warnings

Cleanup some style warnings reported by checkpatch

Change-Id: Ie2e6903d52867fb3347e009d7efa3bc4ca755cea
Signed-off-by: Allen Martin <amartin@nvidia.com>

cpufreq: interactive: fix checkpatch warnings on long lines

Fix up checkpatch warning introduced by long lines in timer_rate
patch.

Change-Id: I22b105dafb1b49390799bb7577464da03f0f8afb
Signed-off-by: Allen Martin <amartin@nvidia.com>

cpufreq: interactive: Fix handling of SMP where CPUs must scale in tandem

The interactive governor relies on quirks of the Tegra 2 cpufreq
implementation for handling SMP systems where the CPUs do not have
separate rate controls.  It needs to determine the maximum rate
for all CPUs covered by the policy and set that speed.

Change-Id: I1ed9fa171e5a9c45a1fa5944e3fa823eb157e81f
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: fix possible Division by zero.

The following dump was seen sometimes while resuming,
the only division by zero on this function can happen after
delta_time is reassigned, since at the start of the
function, there is jump that protects against values
less than 1000.

After that, If delta_time and delta_idle == 0,
we will hit a div 0

Division by zero in kernel.
Backtrace:
[<c0057184>] (dump_backtrace+0x0/0x110) from [<c05d5ecc>] (dump_stack+0x18/0x1c)
r6:010f3000 r5:c113dfb0 r4:c004afb0 r3:c6ff0000
[<c05d5eb4>] (dump_stack+0x0/0x1c) from [<c00572cc>] (__div0+0x1c/0x20)
[<c00572b0>] (__div0+0x0/0x20) from [<c02195d4>] (Ldiv0+0x8/0x10)
[<c03dfd64>] (cpufreq_interactive_timer+0x0/0x2c0) from [<c00a7efc>] (run_timer_softirq+0x154/0x260)
[<c00a7da8>] (run_timer_softirq+0x0/0x260) from [<c00a0c8c>] (__do_softirq+0xc8/0x194)
[<c00a0bc4>] (__do_softirq+0x0/0x194) from [<c00a1008>] (irq_exit+0xb4/0xb8)
[<c00a0f54>] (irq_exit+0x0/0xb8) from [<c00584b4>] (ipi_timer+0x44/0x48)
r4:c004a040 r3:00000001
[<c0058470>] (ipi_timer+0x0/0x48) from [<c004c3e4>] (do_local_timer+0x68/0x84)
r5:c004ae2c r4:c07991e8
[<c004c37c>] (do_local_timer+0x0/0x84) from [<c0052948>] (__irq_svc+0x48/0xe0)

Change-Id: I639882db67b8d711c5710778ebc212f0f6a998e3

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Axel Haslam <axelhaslam@ti.com>

cpufreq: interactive governor: default timer 10ms, maxspeed load 95%

Modify default timer from 30ms to 10ms, sampling 2 jiffies after
idle exit on ARM as in Honeycomb.

Modify default go_maxspeed_load from 85% loaded to 95% loaded, for
use in phones where power savings is more important (tablets may be
best served overriding this).

Change-Id: I3361a6279979bfae1df5262666a2e30ea7a44328
Signed-off-by: Todd Poynor <toddpoynor@google.com>

power: cpufreq interactive governor: use default sample time 20ms

Lower the default time at which a higher speed is allowed to run
before lowering based on lower CPU load from 80ms to 20ms.  Most
Android devices should trade power for performance here,
although tablets and non-battery-powered devices may want to
override this default.

Change-Id: I1a4f7faeca12793c51d5b92db30a63cca8d4f1be
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive governor: apply intermediate load on current speed

Calculate intermediate speed by applyng CPU load to current speed, not
max speed.

Change-Id: Idecf598b9a203b07c989c5d9e9c6efc67a1afc2e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive governor: scale to max only if at min speed

Change-Id: Ieffb2aa56b5290036285c948718be7be0d3af9e8
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive governor: go to intermediate hi speed before max

* Add attribute hispeed_freq, which defaults to max.

* Rename go_maxspeed_load to go_hispeed_load.

* If hit go_hispeed_load and at min speed, go to hispeed_freq;
  if hit go_hispeed_load and already above min speed go to max
  speed.

Change-Id: I1050dec5f013fc1177387352ba787a7e1c68703e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive governor: default 20ms timer

Change-Id: Ie9952f07b38667f2932474090044195c57976faa
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq interactive governor: event tracing

Change-Id: Ic13614a3da2faa2d4bd215ca3eb7191614f0cf66
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: apply intermediate load to max speed not current

Evaluate spikes in load (below go_hispeed_load) against the maximum
speed supported by the device, not the current speed (which tends to
make it too difficult to raise speed to intermediate levels until
very busy).

Change-Id: Ib937006abf8bedb60891a739acd733e89b732ae0
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: set at least hispeed when above hispeed load

If load is above go_hispeed_load, always go to at least hispeed_freq,
even when reducing speed from a higher speed, not just when jumping
up from minimum speed.  Avoids running at a lower than intended
speed after a burst of even higher load.

Change-Id: I5b9d2a15ba25ce609b21bac7c724265cf6838dee
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: don't drop speed if recently at higher load

Apply min_sample_time to the last time the current target speed
was originally requested or re-validated as appropriate for the
current load, not to the time since the current speed was
originally set.  Avoids periodic dips in speed during bursty
loads.

Change-Id: I250bda657985de60373f9897cc41f480664d51a1
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: configurable delay before raising above hispeed

Change-Id: I4d6ac40b23a3790d48e30c37408284e9f955e8fa
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: adjust code and documentation to match

Change-Id: If59c668d514a29febe5c35404fd9d01df8548eb1
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: based hispeed bump on target freq, not actual

For systems that set a common speed for all CPUs, checking current
speed here could bypass the intermediate hispeed bump decision for
this CPU when another CPU was already at hispeed.  This could
result in an overly high setting (for all CPUs) in situations
where all CPUs were about to drop to load levels that map to
hispeed or below.

Change-Id: I186f23dcfc5e2b6336cab8b0327f0c8a9a4482bc
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: Separate speed target revalidate time and initial set time

Allow speed drop after min_sample_time elapses from last time
the current speed was last re-validated as appropriate for
current load / input boost.

Allow speed bump after min_sample_time (or above_hispeed_delay)
elapses from the time the current speed was originally set.

Change-Id: Ic25687a7a53d25e6544c30c47d7ab6f27a47bee8
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: Boost frequency on touchscreen input

Based on previous patches by Tero Kristo <tero.kristo@nokia.com>,
Brian Steuer <bsteuer@codeaurora.org>,
David Ng <dave@codeaurora.org>,
Antti P Miettinen <amiettinen@nvidia.com>, and
Thomas Renninger <trenn@suse.de>

Change-Id: Ic55fedcf6f9310f43a7022fb88e23b0392122769
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: remove unused target_validate_time_in_idle

Change-Id: I37c5085b91318242612440dfd775ad762996612f
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: Add sysfs boost interface for hints from userspace

The explicit hint on/off version.

Change-Id: Ibf62b6d45bf6fb8c9c055b9bdaf074ce9374c04f
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: set floor for boosted speed

Allow speed to drop to flooor frequency but not below, don't pin
to speed at last boost.

Change-Id: I0147c2b7a2e61ba16820605af6baaf09570be787
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: add boost pulse interface

Change-Id: Icf1e86d2065cc8f0816ba9c6b065eb056d4e8249
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: restart above_hispeed_delay at each hispeed load

Change-Id: I2e5b91d45e8806b0ab94ca2301ed671c9af9ab13
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: take idle notifications only when active

Register an idle notifier only when the governor is active.  Also
short-circuit work of idle end if the governor is not enabled.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: I4cae36dd2e7389540d337d74745ffbaa0131870f

cpufreq: interactive: keep freezer happy when not current governor

Fix a problem where the hung task mechanism was deeming the interactive
clock boost thread as hung.  This was because the thread is created at
module init but never run/woken up until needed.  If the governor is not
being used this can be forever.  To workaround this explicitly wake up
the thread once all the necessary data structures are initialized.  The
latter required some minor code shuffle.

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Change-Id: Ie2c058dd75dcb6460ea10e7ac997e46baf66b1fe

cpufreq: interactive: handle speed up and down in the realtime task

Not useful to have a separate, non-realtime workqueue for speed down
events, avoid priority inversion for speed up events.

Change-Id: Iddcd05545245c847aa1bbe0b8790092914c813d2
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: remove input_boost handling

Now handled in userspace Power HAL instead.

Change-Id: I78a4a2fd471308bfcd785bbefcc65fede27314cf
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: fix interactive bug during hotplug

When a new cpu is added and if does not enter idle
for long, the interactive timer is not started and hence
the cpu remains at lowest frequecny, despite the system
load. This impacts mainly benchmarks. Starting a timer
at governor start to handle low frequency.

Change-Id: I8ac9705b9f166a95715c985efacd2ae8ef387cb7
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>

cpufreq: interactive: always limit initial speed bump to hispeed

First bump speed up to hispeed_freq whenever the current speed is below
hispeed_freq, instead of only when the current speed is the minimum speed.
The previous code made it too difficult to use hispeed_freq as a common
intermediate speed on systems that frequently run at speeds between
minimum and hispeed_freq.

Change-Id: I04ec30bafabf5741e267ff289209b8c2d846824b
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: run at fraction of hispeed_freq when load is low

When load is below go_hispeed_load, apply the percentage of CPU load to
a max frequency of hispeed_freq instead of the max speed.  This avoids
jumping too quickly to hispeed_freq when it is a relatively low
percentage of max speed.  This also allows go_hispeed_load to be set to
a high percentage relative to hispeed_freq (as a percentage of max speed,
again useful when hispeed_freq is a low fraction of max speed), to cap
larger loads at hispeed_freq.  For example, a load of 60% will typically
move to 60% of hispeed_freq, not 60% of max speed.  This causes the
governor to apply two different speed caps, depending on whether load is
below or above go_hispeed_load.

Also fix the type of hispeed_freq, which was u64, to match other
speed data types (and avoid overhead and allow division).

Change-Id: Ie2d0668be161c074aaad77db2037505431457b3a
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: add boostpulse duration

This makes up for the portions missing that would've been written
by Narayanan Gopalakrishnan but they were missing (duration, and boost
time) and also adds the ability to set duration (which was originally
created by cyanogen)

Change-Id: I5428d4edb9e7c903435c368d3539f353234b083a

cpufreq: interactive: Enable CPU utilization statistics

 * Notify of CPU utilization on the speedchange task. This is required
   for MPDecision to properly consider hotplug scenarios.

Change-Id: If01a2efb7a7630544b16c782989406ac44865f61

cpufreq: interactive: pin timers to associated CPU

Helps avoid waking up other CPUs to react to activity on the local CPU.

Change-Id: Ife272aaa7916894a437705d44521b1a1693fbe8e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: use deferrable timer by default

Avoid wakeups only to handle the governor timer when the system is otherwise
idle.

For platforms where the power cost of remaining in idle at higher CPU
speed may outweigh the cost of a governor wakeup from idle to lower the speed,
set parameter cpufreq_interactive.governidle=1.

Change-Id: Id6c43eb35caecf9b0574fcdd5b769711bc7e6de6
Signed-off-by: LianWei WANG <a22439@motorola.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: kick timer on idle exit past expiry

The deferrable timer list isn't checked on all idle exits, such as when
hi-res timers expire or ISRs schedule workers.  If the idle loop is
exited and it's past time to run the governor load polling timer,
run it immediately.  This ensures we handle load spikes caused by actvity
that does not run the normal timer list.

Rename the field that timestamps the "time_in_idle" value to be more
accurate.

Change-Id: Ied590ecbefc83c9a9ec5eb9e31903557f6fa1614
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: trace actual speed in target speed decisions

Tracing adds actual speed since this is expected to be key to the
choice of target speed.

Change-Id: Iec936102d0010c4e9dfa143c38a9fd0d551189c3
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: change speed according to current speed and target load

Add a target_load attribute that specifies how aggressively the governor is
to adjust speed to meet the observed load.  New target speed is calculated
as the current actual speed (may be higher than target speed on SMP) times
the CPU load (as a fraction) divided by target load (fraction).

cpufreq_frequency_table_target() call use CPUFREQ_RELATION_L to set
the next higher speed rather than next lower speed.

Change-Id: If432451da82f5fed12e15c9421d7d27792376150
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: apply above_hispeed_delay to each step above hispeed

Apply above_hispeed_delay whenever increasing speed to a new speed above
hispeed (not just the first step above hispeed).

Change-Id: Ibb7add7db47f2a4306a9458c4e1ebabb60698636
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: allow arbitrary speed / target load mappings

Accept a string of target loads and speeds at which to apply the
target loads, per the documentation update in this patch.  For example,
"85 1000000:90 1700000:99" targets CPU load 85% below speed 1GHz,  90%
at or above 1GHz, until 1.7GHz and above, at which load 99% is targeted.

Attempt to avoid oscillations by evaluating the current speed
weighted by current load against each new choice of speed, choosing a
higher speed if the current load requires a higher speed.

Change-Id: Ie3300206047c84eca5a26b0b63ea512e5207550e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: remove load since last speed change

The longer-term load since last speed change isn't terribly useful,
may delay recognition of dropping load, and would need forthcoming
changes to adjust load for changing CPU speeds.  Drop it.

Change-Id: Ic3cbb0542cc3484617031787e03ed9bdd632dec1
Signed-off-by: Todd Poynor <toddpoynor@google.com>

Change-Id: Iac93e2540b42408e9c0d49e507635f352846c7ee

cpufreq: interactive: adjust load for changes in speed

Add notifier for speed transitions.  Keep a count of CPU active
microseconds times current frequency, converted to a percentage relative
to the current frequency when load is evaluated.

Change-Id: I5c27adb11081c50490219784ca57cc46e97fc28c
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: add timer slack to limit idle at speed > min

Always use deferrable timer for load sampling.

Set a non-deferrable timer to an additional slack time to allow prior to
waking up from idle to drop speed when not at minimum speed.  Slack value
-1 avoids wakeups to drop speed.  Default is 80ms.

Remove the governidle module param and its timer management in idle.  For
platforms on which holding speed above mimum in idle costs power, use the
new timer slack to select how long to wait before waking up to drop speed.

Change-Id: I270b3980667e2c70a68e5bff534124b4411dbad5
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: fix boosting logic

35a84de cpufreq: interactive: apply above_hispeed_delay to each step above hispeed

caused the speed choice logic to osciallate between boosting and not boosting.
Add back code to ensure speed does not drop below boost frequency while
boosting.

Change-Id: Id420068480fcc7f5c4989ff523e2a8d22e2f4db2
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: fix racy timer stopping

When stopping the governor, del_timer_sync() can race against an
invocation of the idle notifier callback, which has the potential
to reactivate the timer.

To fix this issue, a read-write semaphore is used. Multiple readers are
allowed as long as pcpu->governor_enabled is true.  However it can be
moved to false only after taking a write semaphore which would wait for
any on-going asynchronous activities to complete and prevent any more of
those activities to be initiated.

[toddpoynor@google.com: cosmetic and commit text changes]
Change-Id: Ib51165a735d73dcf964a06754c48bdc1913e13d0
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>

cpufreq: interactive: fix race on timer restart on governor start

Starting the governor, or restarting on a hotplugged-in CPU, can race
with the timer start in idle, triggering a BUG on timer already pending.
Start the timer before setting the enable flag, and use enable_sem to
protect the sequence (and ensure correct order of the update to the
enable flag).  Delete any existing timer for safety.

Change-Id: Ife77cf9fe099e8fd8543224cbf148c6722c2ffb0
Reported-by: Francisco Franco <francisco.franco@cloudcar.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: default go_hispeed_load 99%, doc updates

Update default go_hispeed_load from 85% to 99%.  Recent changes to the
governor now use a default target_load of 90%.  go_hispeed_load should
not be lower than the target load for hispeed_freq, which could lead
to oscillating speed decisions.  Other recent changes reduce the need
to dampen speed jumps on load spikes, while input event boosts from
userspace are the preferred method for anticipating load spikes with
UI impacts.

General update to the documentation to reflect recent changes.

Change-Id: I1b92f3091f42c04b10503cd1169a943b5dfd6faf
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: init default values at compile time

Change-Id: Ia4966e949a6c24c34fdbd4a6e522cd7c37e4108e
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: don't handle transition notification if not enabled

If multiple governors are in use then avoid processing frequency transition
notifications for CPUs on which the interactive governor is not enabled.

Change-Id: Ibd75255b921d887501a64774a8c4f62302f2d4e4
Reported-by: Francisco Franco <francisco.franco@cloudcar.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: fix deadlock on spinlock in timer

Need to use irqsave/restore spinlock calls to avoid a deadlock in calls
from the timer.

Change-Id: I15b6b590045ba1447e34ca7b5ff342723e53a605
Signed-off-by: Todd Poynor <toddpoynor@google.com>

cpufreq: interactive: fix race on governor start/stop

There is race condition when both two cpu do CPUFREQ_GOV_STOP and one cpu
do CPUFREQ_GOV_START soon. The sysfs_remove_group is not done yet on one
cpu, but sysfs_create_group is called on another cpu, which cause governor
start failed and then kernel panic in timer callback because the policy and
cpu mask are all kfree in cpufreq driver.

Replace atomic with mutex to lock the whole START/STOP sequence.

Change-Id: I3762b3d44315ae021b8275aca84f5ea9147cc540
Signed-off-by: Lianwei Wang <a22439@motorola.com>

msm: cpufreq: Implement suspend/resume for cpufreq driver

Cpufreq suspend variable get's updated in kernel pm notifier
callback which gets called in process context. This will create
window where cpufreq governor may try to change the frequency
before suspend variable is updated while resume.

Define suspend/resume for cpufreq driver to update suspend variable
in atomic context.

Don't update the policy->cur upon cpufreq driver failure.

CRs-fixed: 423791
Change-Id: Id78705f5c3b8bf801c6253e9362299280903769f
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>

msm: HTC 8960: use ROW scheduler as default

Change-Id: I3d591c55f22e260b36e871e2e0ef540d63600f16

msm: HTC 8960: set interactive governor as default

Change-Id: I1ebe90ffd163d2a790aa22f0fbe326d537aab09e

ville: increase panel clk_rate only

Increasing refx100 seems to have caused some choppiness.

Change-Id: If20769a3fe9aa43e25cd58f5c9f4547849ddca07

Linux 3.0.63

Change-Id: I65fc551ec0bc0c049c81bd789af22c6510a633d1

msm_fb:display: correct bus bw for downscale case

The check condition for updating bus bandwidth if downscaling is
needed was always FALSE.

Change-Id: Iec0a4d13c7737d86976d76e0dfd3ec45062799fd
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

msm: display: Fix blend configuration for video layer with MDP composition

With video layer in MDP composition, there is no need to apply destination
over blend rule, as z-order of layers take care of proper staging of layers
by default. Apply constant blend to the video layer when in MDP composition

CRs-fixed: 437965
Change-Id: I7476659f12cdf06018bf6ace829a836c86ae97e8
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

msm_fb: display: keep borderfill pipe's iommu info

Keep borderfill pipe's iommu info during base layer pipe
swap with original base layer pipe. Otherwise, borderfill
pipe's may contain original base layer pipe's iommu info
which cause iommu page fault due to same iommu buffer is
unmapped two times.

CRs-fixed: 436711
Change-Id: Ibdb792055287283c4449db07c2de2901aa4fe9b6
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: add mdp clock control to histogram enable/disable

Add mdp clock control to histogram enable and disable block to
prevent system from crashing when accessing register with mdp
clocks off.

Change-Id: Ide808b332b5456f3fc639fcbb0d03d5cad0e387f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: restore previous mdp bandwidth when resume

mdp resume bandwidth is set to the value when device was suspend, so
that the correct init value is set to avoid underrun.

CRs-fixed: 425823
Change-Id: Ie9b832f0eb5b5e1b6cb5e8979626986d896d340b
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Linux 3.0.64

Change-Id: Id535d176f113fcc4a3136bac822faa2f82e76338

Linux 3.0.65

Change-Id: I66c8db452ff5e6c880a92179ab4f56ad26eaf8ed

msm: rotator: clear rotator bus scale handler

rotator bus client will be not registered again without handler reset.

Change-Id: Id35c4e5ad481d0a4401bdb3ee4628ffa9a891467
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

msm: rotator: Support Fast YUV for 8960, 8064 and 8x30 targets.

Add Fast YUV support in rotator for 8960, 8064 and 8x30 based
targets to improve performance for YUV 420P and 420PP inputs.

CRs-fixed: 415246
Change-Id: Ib4cbbd0fd45a82b8d409e7f52ae8bf8420b2c4eb
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Revert "msm_fb: display: blt always enabled for 720p,1080p, secure buf"

This reverts commit cb76956b1bdde5475914eb57fd2fe0c952609c10.

Change-Id: If2116999a5bd959c9d9b4f249728022cb3ce064d

msm_fb: display: clean pipes from commit queue at suspend

There has possibility that pipes pending at queue and suspend
comes without commit executed. At resume, pipes pending at queue
will be committed with new pipes just added which may cause iommu
page fault due to pipes may had been move to other mixer. This
patch remove pipes from pending queue at suspend.

CRs-fixed: 440254
Change-Id: If6a142d4c55453c0ceacc677399f58570abe47b8
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Linux 3.0.66

Change-Id: Icb94b8d5c82c991150df40b8d3888d906aa3f1e7

msm: msm_bus: Add support for 64-bit bandwidth requests

With 8974, bandwidth requests are exceeding integer size.
Update ab and ib to ensure values over 4Gbps can be requested.
For 64-bit support, there are four changes in this patch:
Changes in the bus driver structures and functions to
update ab and ib values to uint64.
Updates in client drivers to ensure that the bus APIs
are called with the right types.
Updates to the device-tree. Device-tree nodes don't
provide a clean mechanism to read a combination of u32
and u64 variables within the same property name. So, the
ab and ib values must be specified in kbps instead of
bytes/sec from the device tree. The bus driver function
will convert the ab and ib values read from device-tree
to Mbps.
Change the existing property names to make them consistent
with the convention used by the new property  name, which
abides to the Device Tree convention.

Change-Id: Ib0a6db0e221af366c61c51cc21ac722f02cb7a34
CRs-Fixed: 408786
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>

msm_fb: display: check bus scale handler for registration

mdp bus client could be registered multiple times without the check.

Change-Id: I582741c75e815873357e62bc9bf0ff61a4cecf9f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

msm_fb: display: replace msleep with wait4vsync

vsync is controlled by frame work which means vsync irq
off may happen at any instance. This patch use a reference
count to control vsync irq enable/disable so that
wait4vsync can replace msleep safely during suspend.

Change-Id: Ief84b1b421436e1f750288eb9a9760a9cb96c555
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: wait4vsync after timing generator is turned off

When continuous splash is enabled, timing generator is enabled at
bootloader, it then needs to be turned off at mdp4_dsi_video_on()
to switch displayed content from frame buffer. wait4vsync after
timing generator is turned off is necessary to make sure DMAP has
finished fetching splash logo from original splash buffer. Otherwise,
DMAP iommu page fault may happen.

Change-Id: I35f9fb9da76f93b60d4719d147aea3246c770c9f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: wait4vsync before set suspend flag

Since wait4vsync checks suspend flag, wait4vsync needs to
be executed before suspend flag set to enforce wait happen.
Also, when timing generator is turned off, wait4vsync can
not be used anymore since the last vsync may have passed
before wait4vsync called. This patch fixed commit_comp
timeout cause fence timeout happen on hdmi plug and unplug
cases.

CRs-fixed: 449027
Change-Id: I0f5520538bb290643a648c937296b6bc097fe051
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

msm_fb: display: get mipi frame rate from panel file

If frame rate value for mipi video panel is coded in panel file it can
be directly used to avoid calculation error.

Change-Id: I6ad86226c81da4bcf36196385f9ff4bea0bef0ca
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

video: msm: Remove timeout from wait4vsync

Change-Id: I003b389ab5089025b089978a0861ca1cba10c5f9

msm_fb: display: fix compiler warning for uint64_t format

Change-Id: I010c43247239a5e310141dab3e6800f650ff332a

jewel: adjust refx100 to 6650.

Change-Id: Ic3102cfb87150028da4e4752ec42eb284b908710

display: evita: increase refx100 to reduce refresh line appearance
* Increased refx100 to 6650

Change-Id: Iff86d6b2cfc6e55ff8cdf7d3f0bdcef3afd0c5a9

ville: increase refx100 to reduce screen tearing

Change-Id: Ib1137ec381ee52e741f909225d6da3a515e5f378

Revert "msm_fb: display: fix compiler warning for uint64_t format"

This reverts commit 415bb26fce8608f03685c3de0fa43f56a7760bf8.

Revert "msm: msm_bus: Add support for 64-bit bandwidth requests"

This reverts commit 13aba771e3672dd8909a84395f19ae719ebfc468.

Revert "jewel: adjust refx100 to 6650."

This reverts commit d6cf6ae45a03d34d1c5b5d98d791e4b84001378f.
Linux 3.0.67

Change-Id: I6aeb84dec2e97ea8a0cb1254e89db2b8b5df5d5f