video: msm: Resolve post processing memory leaks

Allocate memory for post processing only once. Free post processing memory
when MDP is removed.

CRs-fixed: 366325
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit d60ac323a1e3e7086ef2d77c866d5ed482d2a4e9)

Change-Id: I14eacda2bd92c8f1fb89cfe4fdc1c9624b09a359
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
power: pm8921-charger: force 19.2Mhz clock before accessing registers

The charger was observed to be in locked up state upon booting up. The
initialization time configurations were being ignored causing charging
to not happen.

Fix this by forcing the charger to run from 19.2Mhz clock prior to
accessing any charger registers. This made the charger come out of the
locked up state and accept writes to it.

CRs-Fixed: 372383
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit c3695def3ba4d1b65bd8deb0beaded230463c873)

Change-Id: I5234ed71242880e87a37af161b1c62a19a6025fd
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Bluetooth: Update the scan state with Inquiry commands in non-LE case

Update the hdev scan state with Inquiry start/cancel commands in
non-LE case accordingly. And also there was no check to see the
SCAN_BR mode before sending inquiry cancel.Added a check to see
if the scan state is SCAN_BR,then send inquiry cancel

Signed-off-by: Bhasker Neti <bneti@codeaurora.org>
CRs-fixed: 359771
(cherry picked from commit 0976074df4de122b042c82a6b9c4df1ea05f0eb6)

Change-Id: Iffbe7286fdf59c43820f8fa0a346267e708c7080
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>

Conflicts:
	net/bluetooth/mgmt.c
msm: kgsl: Add draw workaround commands after every 50 context switches

We need to add a draw workaround command sequence after every 50 context
switches if the gmem has not been saved in those 50 switches. This
workaround is required to prevent the GPU from deadlocking. Since gmem
save commands have draw calls in them we only need to execute this
workaround if the gmem has not been saved. The number 50 was chosen
empirically.

CRs-fixed: 362302
Change-Id: I1a659c85736c47fe6f45030b20ce7a12851b0815
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>

Conflicts:

	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_a3xx.c

Signed-off-by: Anshuman Dani <adani@codeaurora.org>
USB: msm_otg: Add debouncing logic for PMIC id line status handling

Currently reading PMIC ID line status immediately once PMIC interrupt
is triggered. This leads to returning wrong ID line state sometimes
and causes not detecting connected devices. Hence add debouncing time
of 5msec for PMIC ID line state to settle down before reading PMIC
ID status.

CRs-Fixed: 371552
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
(cherry picked from commit 68d55cfa2ed1de84966fae66329a3aeca4ecc3a2)

Conflicts:

	drivers/usb/otg/msm_otg.c

Change-Id: I2f9cfa8d62341555a3269fe64cef34461c838f65
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm7627a: Enable Memory Compaction on 7x27a/8x25

Use memory compaction for reducing external memory fragmentation.

Signed-off-by: Prachee Ramsinghani <pracheer@codeaurora.org>
(cherry picked from commit 728b4665a94b3a3b2751344bfdec5eb5250185c5)

Change-Id: Ia1f6ec08be7a546ad3123ab340e351a5c269562b
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>

Conflicts:
	arch/arm/configs/kyle02_defconfig
	arch/arm/configs/msm7627a-perf_defconfig
msm7x27a: Enable SLUB allocator on 7627a and 8x25.

Use SLUB allocator for better memory management.

CRs-Fixed: 378682
Signed-off-by: Prachee Ramsinghani <pracheer@codeaurora.org>
(cherry picked from commit c62e4b0c7ca0f931708eba94390ef62abba50295)

Change-Id: I887e9243c3a0a994c153fc5c89d36beac76896d1
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>

Conflicts:
	arch/arm/configs/kyle02_defconfig
Revert "msm_fb: HDMI: Do not add HPD state timer during probe"

This reverts commit 98318da51af4d838b12d335938a8e0377686a7cc.

Change-Id: Idbc67408173af57af7f39b6300d23aa321840ddd
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Revert "msm_fb: HDMI: Start HDCP authentication only on device open"

This reverts commit 68398e5867e3b1b44941dadde2d093a8e4e6eb58.

Change-Id: Ibe9bf770b32a8b2a9fec5c6a2d14c62de33e88ed
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Revert "msm_fb: display: HPD rework for cleaner approach"

This reverts commit 9b0f56598165ab4b8fd463d529b94cdaf11ca04d.

Change-Id: If7c49cef6812f08e7e63d6d318de74e0c69e30d9
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
msm: kgsl: Issue packet to set shader bases on A20x/220 GPU

When GMEM save is not performed, the events to reuse shader space
can get dropped. This make the CP block to wait indefinitely
causing a hang. To unblock this, issue a packet to set shader bases.
This applies only to A20x/220 GPU.

CRs-fixed: 365465
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
(cherry picked from commit d71cfd6ee15626dfd66e2b94ed524fbd2488fe91)

Change-Id: I9a4bb72de7922e22f5c9a2d7972062e5ec15a187
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Revert "Revert "msm_fb: HDMI: Removing unnecessary HPD detection code.""

This reverts commit 90db3c440080346c2a5b3a2adc0850e3235127db.

Change-Id: I70b29a25b51a16b34b5cdcacecbe39a7063e687e
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Revert "Revert "msm_fb: HDMI: Do not add HPD state timer during probe""

This reverts commit 92d9f147ae3bb69f3478e2a392d033dbab4ccb53.

Change-Id: Ib5c5d1a95dc79a33942f23447f015721a3e40564
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: HDMI: Start HDCP authentication only on device open

Currently HDCP authentication is started for a default resolution
upon HPD connection event. With this change, HDCP authentication
is only triggered after the HDMI interface has been configured for
an appropriate resolution following the call to open the HDMI device.

CRs-Fixed: 368865
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 14db6b404f2b1627791dada77ea303ef970910a6)

Conflicts:

	drivers/video/msm/hdmi_msm.c

Change-Id: I4950be30128d6cb866b563e7ba450c4084bbf7ed
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Revert "Revert "msm_fb: display: HPD rework for cleaner approach""

This reverts commit 1427d091b273b4a081372ef85df8ac6821df32b4.

Conflicts:

	drivers/video/msm/hdmi_msm.c

Change-Id: Ic9f47d450523cca33eec96b658a3a4578b1daf55
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: hdmi: Do not turn on HPD at boot

HPD is getting turned on by userspace if HDMI is enabled.
We don't need to turn on the HPD from HDMI driver.

CRs-Fixed: 377899 368865

Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit 2f7f94cef2a64930e1476c09a5a402631bd39d99)

Change-Id: I0ff1c811bd6e819000f9610692eeeff869fc8921
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: HDMI: Fix for high HDMI sleep current

In certain cases, the HPD circuitry is not switched off when the
device goes to suspend state, resulting in high sleep current on
the HDMI power rail. This patch ensures that the HPD circuitry is
always turned off during suspend operation by removing an
unnecessary condition check.

CRs-fixed: 368865
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
(cherry picked from commit 3bb47a097c62b71c7f8f2be888a1f73c6cfb8142)

Change-Id: Ia7eec23d47e6380eff8516eb0f20d045f6ad4401
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: hdmi: Turn on switch dev when connect to HDMI

Audio is not routed to TV after deep sleep and resume.
Userspace is dependent on switch device to indentify audio
route. When HDMI is turned on, this switch needs to be turned
on as well.

CRs-Fixed: 377159 368865
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
(cherry picked from commit fd142681ad79a1b0e8ff007f146761ef8142e4c4)

Change-Id: Ibc717ceecba6ddc9191ad5b22a8b09900281f4d6
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
msm_fb: HDMI: Fix handling of HDMI PLL software reset

Whenever a software reset is asserted on the HDMI PLL, we should
wait for short time to wait for the PLL calibration to be
successful before checking to see if the PLL is locked.

CRs-Fixed: 378044 368865
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
(cherry picked from commit 53223912053984d6c8a33e7f93960f0e6fff02bc)

Change-Id: Ibd805939cdd14f48c78699e5fa7f3c3013a60cfa
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Revert "msm: gpio-v2: Fix spurious interrupts when gpio-irq is unmasked"

This reverts commit 81e87bb90265d13ffb7f0f1716af949ff561b2b8.

Change-Id: Ie5a419bc431bb83c776b762becef870b02a5ac92
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>