msm: kgsl: fix paren placement leading to fence timeout

The incorrect paren placement can lead to a fence timeout
because the last_timestamp is always written. As a result
the last_timestamp could be corrupted by writing an old
value leading to a future timestamp_cmp indicating that a
signaled sync pt was unsignaled.

Change-Id: I4650a467bfdd98a905f86fbec7d833596c67ba19
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
gpu: ion: Use writecombine for uncached mappings

When we map ion buffers as uncached we want to map them as
uncached but still be able to use buffering of transactions
since turning off buffering has a severe performance impact.

Change-Id: I5a09ac34bd3ce3f001d10d9efd71d140f632564d
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Add null-pointer check after allocation

Check for failed allocation and return appropritate
return code if memory allocation fails.

Change-Id: Iefb83b5e30c3cc581ccecaf6e59eae621be98083
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Align va address to biggest buffer size

Align the virtual address to the max buffer size to
allow IOMMU mappings at the biggest buffer size.

Change-Id: I74ba665c1782e2f0631274766c5caeeb192224e0
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Minimize allocation fallback delay

When we allocate from iommu heap we first try to allocate 1M pages. If
that fails we try 64K pages, which falls back to 4K pages. However,
we don't want to incur too much overhead when allocating with fallbacks
so we don't want the higher order page allocation to retry, perform
reclaim, or run memory compaction.

Configure the GFP flags to ensure that when we allocate pages greater
than order 0 we don't try to do any retries, reclaim, access emergency
pools, or run memory compaction. This will ensure lower memory allocation
latency for applications.

CRs-Fixed: 470389
Change-Id: Ibb3483dddbedbc733a1f7968821e7bc47bedffcd
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: enable the kmalloc heap

There are some Ion clients who would like to use the kmalloc
heap. Enable it.

Change-Id: Ie818be9e1211d52d489ad2cb63d94e2fddfc0f01
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: Do fallback when allocating large sizes

The preferred allocation of memory for kernel data structures in
ION is to use kmalloc. This is mainly for performance reasons. However,
we are not guaranteed to be able to allocate large sizes. So to keep
the code performing well and at the same time allow for larger allocations,
implement a fallback mechanism for allocation of memory for ION kernel data
structures.

CRs-Fixed: 488521
Change-Id: I8c6a13ad74cce69f590920d28c01a58f7a540fd2
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
[Resolved merge conflict]
Signed-off-by: Chintan Pandya <cpandya@codeaurora.org>

Conflicts:
	drivers/gpu/ion/ion_iommu_heap.c
ARM: mm: fix MMU mapping of CMA regions

Fix dma_contiguous_remap() so that it continues through all the
regions, even after encountering one that is outside lowmem.
Without this change, if you have two CMA regions, the first outside
lowmem and the seocnd inside lowmem, only the second one will get
set up in the MMU. Data written to that region then doesn't get
automatically flushed from the cache into memory.

Change-Id: I941c46baa951cb2a2c7aa151779fb48a4a488a74
CRs-Fixed: 467034
Signed-off-by: Chris Brand <cbrand@broadcom.com>
[extended patch subject with 'fix' word]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ARM: dma-mapping: add support for CMA regions placed in highmem zone

This patch adds missing pieces to correctly support memory pages served
from CMA regions placed in high memory zones. Please note that the default
global CMA area is still put into lowmem and is limited by optional
architecture specific DMA zone. One can however put device specific CMA
regions in high memory zone to reduce lowmem usage.

Change-Id: I92ae4a772f24e0ca90c5560a826207850618b506
CRs-Fixed: 467034
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
[lauraa@codeaurora.org: Context fixups]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ARM: dma-mapping: Allow highmem pages to not have a mapping

The DMA_ATTR_NO_KERNEL_MAPPING is used to make sure that CMA
pages have no kernel mapping. Add support to make sure that
highmem pages have no mapping.

Change-Id: Ife76df126ecfedf0dba81a35e0de8a1787355b3d
CRs-Fixed: 467034
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Revert "msm_fb: Correctly setup splash screen flag in MDP probe"

This reverts commit 59f82c36499efbd649419acbc1d89ee5a82c6e80.
monarudo: fix the hack to turn on the backlight on boot
Small manual changes to sync up msm video code