msm_fb: display: free dtv iommu buffer

Free iommu buffer after pipe is committed to hardware.

Change-Id: I00506d6fd55d99fec7921c02953fd755a7536d3e
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix fake iommu buffer drop

During pipe free, some content of pipe is backed up and then after
pipe is zeroed out, the content get restored, in between there should
be no actions to change the content since any change will be wiped out
by the restore.

Change-Id: Ia6da0162d1f9b614682e1fc36edab1db003b42ab
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: add stage commit before kickoff to WFD

Since stage commit had been splited out of stage up fucnction,
it needed to be called to stage pipes into mixer befroe
kickoff mixer. Add this function into overlay writeback for WFD.

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

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm: kgsl: Fix a logical error in the gpu hang detection code

Change the GPU hang detection code to avoid the normal case is
mistakely treated as GPU hang scenario.

Cherrypicked from 50ec337976319844106e8da129244a7538604461

CRs-Fixed: 378488
Change-Id: I567c57911bb8683e561a70f95177518b4dd1df6d
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
video: msm: wfd: Delay fill_buffer until START_DONE

VCD requires we do not give any output buffers to be given until
START_DONE is received. In the case that buffers are given, it
introduces race conditions in the vidc with respect to the SPS/PPS
buffer, which vidc assumes to be present on the first fill_buffer but
actually isn't present until START_DONE.

Change-Id: Ie4dec3ed41e0f248175fb7d9719b458d3b699539
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
arm: Don't disable interrupts during WFE fixup

Disabling interrupts during the Krait WFE fixup can result
in deadlock if a thread tries to acquire a spinlock that is
released from an interrupt context. Instead of disabling
interrupts, modify the interrupt handler to reset the fixup
condition to put the processor into a safe state in the
event that the interrupt came in during the fixup window.

CRs-Fixed: 383670
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit 1fd137804b489f7a0b4103d846cda13a07e26cdf)

Change-Id: Ie6d1adc42cc0a68bbbaeaa35f18cdda074d66cd5
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
 msm_fb: display: retrieve correct base layer pipe

Base layer pipe is cloned and cached at satge array.
Retrive the real base layer pipe before used it.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit f44fbf21a8066016d441d742ad2386ee382cc603)

Change-Id: I2bffc3070c2a33d3c265dae968c1645a5a2e076c
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: iommu: Disable access to global registers

Global IOMMU registers are not accessible to Linux kernel and
should not be read or written to.

Add Kconfig option to turn on configuration of the global IOMMU
address space but leave default turned off.

Change-Id: I5be2efcb21a5245011607103c7b6a889c038db78
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Revert "Revert "d2: Enable FMEM in board files""

This reverts commit 922e1b16c39218e8f1fd540786f47f5e70036381.
board-8064 msm: Overlap secure and non secure video firmware heaps.

Moves fixed area start address down, so that non secure
video firmware heap and secure video firmware area overlap.
Both use the region in a mutually exclusive manner.
ALso introduce a hole, that can be used by MM heap
lock down for content protection.

Change-Id: Ic240377da25e00423742ccb73dbb60a1ff037e37
Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit eadb7505134a23b8de3cd74c924fd31324978a7e)

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8064.c
gpu: ion: Fix fragmentation debug message cond.

If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when the amount of space
available in the heap is equal to the requested size.

Change-Id: Iaaf8cd6742aeffab7bcb4806e485326fb9690945
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: move fixed area start lower so that 768M systems work

The start of the fixed area was at 0xb0000000, but
on 768M 8960 systems this memory doesn't exist.
Since the start of the fixed area must be the
same on all 8960s, the fixed area start is
lowered to 0xa0000000.

Change-Id: Ia86513b08ebc4d37bd1afca7263d8a409d2a72bb
CRs-Fixed: 349125
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>

board-8960: Merge secure and non secure firmware heaps.

The secure and non secure firmware heaps are now merged
for a total of 2MB savings

CRs-Fixed: 365291

Signed-off-by: Deepak Kotur <dkotur@codeaurora.org>
(cherry picked from commit 6a309d3a5b559495ccfd5a273f12dad30e14c96f)

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

Conflicts:

	arch/arm/mach-msm/board-8960.c

msm: Fix for incorrect fmem and mm heap sizes on 8960

Introducing a overlap of secure and unsecure pil heap
overlap, needs to be propogated to fmem logic.
fmem reserved areas and base address need to be adjusted

Change-Id: Ia7b6fd8e1ce3c86d7dd3834c0e80d63575ff2368
CRs-fixed: 373054
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>

Conflicts:

	arch/arm/mach-msm/board-8960.c
d2: Import FMEM changes to board files

Change-Id: I8e1471aa7268424cde6ef427b681b1db22e09e57
Revert "net: wireless: bcmdhd: Add SETSUSPENDMODE command"

This reverts commit 2e2c2678c7bd0e544301be51cf09247ea1587429.
Revert "msm_fb: display: extend mdp debugfs with force blt enable"

This reverts commit 45d9438278405f2e5a86f61db3fadb4927d358a5.
msm_fb: display: Add BLT support to dsi command mode panel

At run time, mdp BLT (writeback) mode is enabled and disabled
base on performance level to avoid mdp underrun. Move BLT
enabled/disabled logic to pan display so that enabled/disable
is done per commit instead of per queue. Since all panels
are shared same logic, dsi video mode and lcdc panle BLT logic
have been changed accordingly.

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

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: clean pipe free or unlock calls

A few places have unnecessary mutex unlock calls, and iommu pipe free
depends on pipe parameters so move it before pipe is zeroed.

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

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: add dmap waiting before turn off timing generator

Wait for dmap done to turn off TG to avoid underruns before base
pipe setup and after constant splash during boot time.

Change-Id: I64bc3935d996af1d2d54db4c11319301ea454ced
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: display: Set max MDP bandwidths for larger primary resolutions

To avoid underruns for larger primary display resolutions,
set max MDP clock/bandwidths for dynamic boot parameter
cases with HDMI as primary and WUXGA panels

Change-Id: I1e020de0cbd4082edd26d4b03ebee4d4b976c26a
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: display: remove the predefined mdp clk rate tables

Mdp clk rate will be calculated during run time based on pipe
requirements, so the tables in board files are not necessary. Only the
max rate which is target specific is passed to display driver.

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

Conflicts:

	arch/arm/mach-msm/board-8960-display.c