bump gpu freq
gpu: ion: Add response to secure scm call

The API for securing buffers now requires a response buffer.
Pass in the appropriate buffer and size.

Change-Id: I25ed77f539e775b089c71a96120edf37132acd0d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Add extra metadata for secure buffers

Newer versions of content protection allow for securing of individual
buffers instead of the full heap range. Add extra metadata about
each allocated buffer for tracking information related to secure
state.

Change-Id: I326ce35a17cd27b61831b0bde4e7423f1ac3d106
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Make secure buffers 1MB chunks

Secure buffers have a requirement to be generated in 1MB
chunks. Change the sg_table generated to be an sg list of
1MB chunks of the contiguous buffer if the secure flag
is indicated.

Change-Id: Ia03d283cddfb978fc9e15975c2d80f138269b5ce
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Revert "Revert "Revert "ion: ion mini upgrade"""

This reverts commit 3da02e88763526cc58b4caafde4cd8fd7343449a.
gpu: ion: Add support for securing indiviudal buffers

Newer protection APIs allow individual allocations to be secured
instead of the entire heap. Add APIs to support securing individual
Ion handles. These APIs include a flag option to support delaying
the unsecure until the buffer itself is actually freed.

Change-Id: I01e2bc921a342e4bb6191a642942264a9613d6f9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ion: ion mini upgrade

Change-Id: I39a7743690cf5115f28495d1206746421073364c
gpu: ion: Change secure heap allocation restrictions

Currently, allocations for secure memory will fail if there
is any oustanding mapping present on a secure heap. This is
too restrictive for allowing protection of individual buffers
instead of the entire heap. The correct solution is to allow
secured allocations even if there are oustanding mappings on
the heap. The heap protect call should fail if there are
oustanding mappings. Any detection of oustanding mappings
when the heap is secured should be considered a bug.

Change-Id: I10668fdd961e02cbef8eba7bf85702ae7eabfe31
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
gpu: ion: Don't require buffers to be 1M aligned

When generating the scatter gather table, older secure
clients cannot support 1MB aligned allocations. Change
the code flow to only generate the sg_table with 1MB
chunks if the buffer is 1MB aligned. Checks are present
elsewhere which will prevent the buffer from being
secured if the allocation is not 1MB aligned.

Change-Id: Id2d1610ccbc90ca1c8427eeadbf1f702b808cd38
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
ion: update API stubs

The stubs for some of the Ion functions have gotten stale since the
last Ion API change. Update these to avoid compile errors when Ion is
not included in the build.

Change-Id: Idfe475c0f1990e5a9b5919434a27ae9dd63ffcb4
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: fix race condition in checking virtual address

Currently, on an Ion cache operation, there is a short period of time
between checking the validity of the virtual address range of the
operation and the actual cache operation. During this time another
thread could twiddle the vm areas, resulting in an invalid cache
operation. Fix this by holding mmap_sem of the active_mm of the
current thread across the address range check and the cache operation.

CRs-fixed: 418933
Change-Id: I859e2e3d888dea38a26d04958c1577522471a62c
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>