msm: add extra cpu detection function stubs

Change-Id: I4b4c78a84ce04172a9dd305e1a3b45fdfd94feb2
fs: proc: don't use non-existant kgsl_alloc_size

Change-Id: Ic11214d12798c457b9a671c6c521ec2e599ca8e0
iommu/core: Add fault reporting mechanism

Add iommu fault report mechanism to the IOMMU API, so implementations
could report about mmu faults (translation errors, hardware errors,
etc..).

Fault reports can be used in several ways:
- mere logging
- reset the device that accessed the faulting address (may be necessary
  in case the device is a remote processor for example)
- implement dynamic PTE/TLB loading

A dedicated iommu_set_fault_handler() API has been added to allow
users, who are interested to receive such reports, to provide
their handler.

Change-Id: Id049671b7a0df27476c3cad451c2505e9b260ab6
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
iommu/core: export iommu_set_fault_handler()

commit 4f3f8d9 "iommu/core: Add fault reporting mechanism" added
the public iommu_set_fault_handler() symbol but forgot to export it.

Fix that.

Change-Id: Iabca2af05bd75fec899d668ee2338a15df8aa503
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
iommu/core: let drivers know if an iommu fault handler isn't installed

Make report_iommu_fault() return -ENOSYS whenever an iommu fault
handler isn't installed, so IOMMU drivers can then do their own
platform-specific default behavior if they wanted.

Fault handlers can still return -ENOSYS in case they want to elicit the
default behavior of the IOMMU drivers.

Change-Id: I4cb7d6566f9d0f4329c37e890fee6c113edeb981
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
iommu: Initialize domain->handler in iommu_domain_alloc()

Since it is not guaranteed that an iommu driver initializes in its
domain_init() function, it must be initialized with NULL to prevent
calling a function in an arbitrary location when iommu fault occurred.

Change-Id: I1001bc6382cfe1e6cf8f311a822380f4151f8391
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
[stepanm@codeaurora.org: rebased to before the file moved]
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
msm: iommu: revert HTC changes to iommu resources

Change-Id: I51a68ae24c62ac73f035a7416ee132eb47cf5649
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: Clean up IOMMU platform data

Statically assign the IOMMU platform data to the IOMMU
platform devices rather than adding it at probe time, to
make the code easier to maintain.

Change-Id: I59ceec62d5b07acf97f021934f38ce00e79baeb4
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
msm: iommu: Clean up IOMMU initialization code

Now that platform data is statically added to IOMMU
platform devices, clean up the initialization code to use
platform_add_devices directly.

Change-Id: If36fd89127c7183f118ea00339989e263a07c39f
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
msm: iommu: Reorganize per-target device initialization

Organize the code to add IOMMU devices into per-target
blocks to make the code easier to maintain.

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

Conflicts:
	arch/arm/mach-msm/devices-iommu.c
msm: iommu: Enable use of TTBR1 register of IOMMU

Add a new platform data in iommu devices to indicate whether ttbr1
should be used which also dictates how the address space should be
split between ttbr0 and ttbr1.

Change-Id: Iab3aac74256bd4d49f47f89e6638f014e6e539e9
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: iommu: Use ttbr1 for graphics 2d devices

Split the virtual address between ttbr0 and ttbr1 for
2d devices of graphics

Change-Id: I6f5751c0586cfd16e01f2e324b544463efdd54d2
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: display: Attach MDP IOMMU during first update after boot

For continuous splash support to work properly, attach the MDP IOMMU
device at a later point during boot to allow display use the
splash image from bootloader

Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
Change-Id: Ife9a2afae1e9b9140ee74af0cc7dcf7ad945d4de

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_dtv.c
	drivers/video/msm/mdp4_overlay_lcdc.c
msm_fb: Correct mdp_iommu array size to avoid scribbling

The mdp_iommu array was undersized. This resulted in scribbling of
nearby data structures which, through a long series of events,
lead to invalid pointer dereferences in the workqueue framework's
process_one_work() function on (at least) the 8930 SoC.

CRs-Fixed: 357011
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Change-Id: Idb360e687c4cf050b6e73e575a13eba4b9d3c150
msm: vidc: Downloads firmware using pil_get.

Downloads video codec firmware using pil_get
for secure sessions only. Firmware is not
downloaded using pil_get for non-secure
sessions.

Conflicts:

	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c

Change-Id: I84b7a1d70ed1f505838930a192e5d1afdbfc54c1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/board-8960.c
	arch/arm/mach-msm/devices-msm8x60.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_utils.c
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker_api.h
	drivers/video/msm/vidc/720p/resource_tracker/vcd_res_tracker.c
	drivers/video/msm/vidc/720p/resource_tracker/vcd_res_tracker_api.h
msm: Enable all IOMMU's

Enable video, camera, display, and rotator IOMMU's so
that virtual contigious memory can be used by these
devices. Physical contigious carveout regions can
be reduced so that more memory is available to the
rest of the system when not in use by multimedia.

Change-Id: Ibfad7d6a55e04490be9e39a5539780657f6727e0
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/iommu_domains.c
vidc: Adjust core timeout based on current core frequency.

Core timeout value is calculated based on the current core
clock rate during video play back.

Change-Id: I52f38560eda71dd0eaf208da68b4c3f74955661b
CRs-fixed: 354069
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>

Conflicts:

	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker_api.h

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

Conflicts:
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_helper.c
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_shared_mem.h
	drivers/video/msm/vidc/1080p/resource_tracker/vcd_res_tracker_api.h
vidc:1080p: Set video core timeout value for Thumbnail mode

Video core timeout value is set only for thumbnail mode.
For normal playback senario default value is set.

CRs-fixed: 367222
Signed-off-by: Mohan Kumar Gubbihalli Lachma Naik <mgubbi@codeaurora.org>
(cherry picked from commit 740d5ad28484b42ae675721a66a1bd93081712c8)
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>

Change-Id: I32ee573b21fd79d44d578a773294ba9973f1c00d
Signed-off-by: Zhoulu Luo <zluo@codeaurora.org>
msm: vidc: Fixes bug in handling duplicate frames.

Fixes bug while closing encoder which supports
duplicate input frames. This fix decrements
the reference count of original frames
appropriately.

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

Change-Id: Icf36d82e78588bf4b5becf480bdccd4c7cda94a5
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit c4cee17571e07afd6c0fe0c50c8934ccfef50ae2)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>