sync: Squash of sw_sync driver code

Squash the following commits to bring the sync driver into the kernel:

sync: Add synchronization framework

not run through checkpatch yet.

Change-Id: I209f9db2824e0313f467f11ab09e5f54f0a4a6b5
Signed-off-by: Erik Gilling <konkers@android.com>

sw_sync: add cpu based sync driver

Change-Id: I1042851f5e30f9fdc2f35bdad84123bcf108560f
Signed-off-by: Erik Gilling <konkers@android.com>

sync: add timestamps to sync_pts

Change-Id: I2ad855072b86873880769a09a3176e85aa1199d7
Signed-off-by: Erik Gilling <konkers@android.com>

sync: add debugfs support

Change-Id: I8a7ea63e454fbeee1ecf17e6c3caff7c43b24734
Signed-off-by: Erik Gilling <konkers@android.com>

sw_sync: add debug support

Change-Id: Ibcc5fa8cb36e283cdf0e3308064876722e2675fc
Signed-off-by: Erik Gilling <konkers@android.com>

sync: add ioctl to get fence data

Change-Id: I71410aef7e03a52562f7cb15b993ac8441b1fa12
Signed-off-by: Erik Gilling <konkers@android.com>

sw_sync: add fill_driver_data support

Change-Id: Ib3812d282db56362d82f5ccc9a12b7d2100ab93a
Signed-off-by: Erik Gilling <konkers@android.com>

sync: add poll support

Change-Id: I294e481bba92658e6dd26f157ddbf0e9ff4ce8a5
Signed-off-by: Erik Gilling <konkers@android.com>

msm: display: Buffer sync point support

Add MSMFB_BUFFER_SYNC ioctl for the communication of
the acquired and released fence fd between kernel and hwc.

Wait for acquired fence before pan display.
Signal the previous released fence after pan display

(cherry picked from commit fd384f86cd5214a9359c56dc93affe95f2d802a4)

Change-Id: I30a7b33f523acc6e42978c8cbd0fa526808a06ed
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

sync: driver commits

- Revert "base: sync: signal a sync pt when not adding to the
active_list"
- sync: Fix error paths
- sync: add tracepoint support
- sync: refactor sync debug printing
- sync: use proper barriers when waiting indefinitely
- sync: update new fence status with sync_fence_signal_pt
- sync: dump sync state of fence errors
- sync: protect unlocked access to fence status
- base: sync: signal a sync pt when not adding to the active_list
- sync: improve timeout dumps
- sync: use correct signed type when handling SYNC_IOC_WAIT
- sync: dump sync state to console on timeout
- sync: clean up compiler warnings
- sync: fix erase-o in sync_fence_wait
- sync: change wait timeout to mirror poll semantics
- sync: add reference counting to timelines
- sync: add internal refcounting to fences
- sync: optimize fence merges
- sync: reorder sync_fence_release
- sync: export sync API symbols
- sync: allow async waits to be canceled

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

Adding support for trace events for sync point driver

Change-Id: Icdbe176f1c651e6a0805ef63b9b7f143ab06a350
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
video: remove duplicate vidc entry

Change-Id: I1f84e591e0b33bef565586926b760569aeb4b666
msm_fb: display: add support for HTC display_on function

Change-Id: Ib20c0019b6a55b1bc53c9b8ca3e8ff8d626e881b
msm: HTC 8960: update panel code for CAF display code

Change-Id: Ie3c19793afe69f24c79298e9b8964ac620bbbd52

Conflicts:
	arch/arm/mach-msm/board-elite.c
	arch/arm/mach-msm/display/board-elite-panel.c
	arch/arm/mach-msm/display/board-ville-panel.c
fmem: clean up tmem metadata before leaving T-state

In a misguided effort to reduce the latency for
the transition from T-state to C-state, clean up
of tmem metadata was postponed until we attempted
to enter T-state again. However, since some of
this metadata was stored in fmem, it was sometimes
overwritten while in C-state, causing panics and hangs.

Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 653c46c43fb7e7c4f1e7647f277b2a16509af41f)

Change-Id: I19150646d3cc750a1175b1ea7e8b57c80c3ac9c2
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: iommu: Do not register API on unsupported SoC versions

In addition to not registering IOMMU devices, do not
register the IOMMU API on SoC versions which do not support
it. This will allow iommu_found to work properly.

Change-Id: I103fc4ff910bee3eb4039e19de52f36cd1778861
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/devices-iommu.c

Conflicts:
	arch/arm/mach-msm/devices-iommu.c
msm: iommu: Discontinue use of clk_set_min_rate()

Support for the proprietary clk_set_min_rate() API is being removed from
the clock driver. Replace it with a clk_round_rate() and clk_set_rate().

Change-Id: Icd62a8768d99cf007cf899c705626f8eacbaa7c8
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
msm: iommu: use sg_dma_address() in iommu_map_range()

Ion carveout and content protect buffers do not have
a struct page and thus sg_phys() cannot be used on them.
Try sg_dma_address() first and if it returns 0 then
use sg_phys().

Change-Id: I95ccb8f5a3c86cd09ecf2a2737c260f4996059ac
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
(cherry picked from commit 74e57d4eb3b37fbf57145573c5cb3892c89d8bc0)

Conflicts:
	arch/arm/mach-msm/iommu.c
iommu: Fix flags passed to iommu map functions.

iommu map functions requires clients to specify whether
the mappings should be read only or read-write (write only
is not supported). Ensure clients specify the appropriate
flags when calling map functions.

Change-Id: If42b4b0367b4311aa36d3063979ef04af3a43fc6
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
(cherry picked from commit bcf5ae04a9bf744a7a3d119c93d439a682404877)