gpu: ion: fix locking issues in debug code

There are a few places in Ion where we are iterating over volatile rb
trees without proper locking. In some places the proper locking cannot
be added since it would require us to take locks in a different order
than they are taken in other places in Ion. Fix this by re-working some
of the debug code so that we can take locks in an allowed order.

One side-effect of the re-work is that the memory maps will now show
every client that has a handle to a particular region of memory, rather
than just showing the first one that we encounter. This will allow for
more accurate accounting and will give better insight as to who is
actually using the memory.

CRs-Fixed: 571918
Change-Id: Ia43e4dbc412cd480c828173f8c20b5095d87d858
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: add locking to traversal of volatile rb tree

In ion_debug_heap_show we're iterating over an rb tree (dev->clients)
that could change while we're iterating. Fix this by taking the lock
that is used to control access to this tree.

CRs-Fixed: 571918
Change-Id: I6832e1e98e2d2a69fc653451d3752d43ec3ef269
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: Add pooling of CMA allocations

CMA provides excellent memory utilization but at the cost of
being much slower than permanently reserving the memory. Most
clients of this memory end up needing to do allocations on the
fast path. These clients may be aware of allocations on the slow
path but may not be able to actually make those allocations until
the fast path. Add support for pooling CMA allocations and allowing
prefetching into the heap. This memory may be stored until either
allocated/freed or drained via a shrinker.

Change-Id: I2f15bc9c72e5f79ffa6edbeb454fd41121efd8fc
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>