msm: kgsl: Use a simpler algorithm to find SVM addresses
Currently the driver uses some unexported functions from mm to search for
a virtual address that works for both the GPU and CPU. This method had
some benefit for 32 bit applications that used a lot of the CPU
virtual address space but was generally overkill for 64 bit applications.
Instead, use a simpler approach that uses available symbols. For SVM
addresses, walk backwards through the SVM region looking for gaps in
the GPU address space. For each one, check if there are any CPU mappings
that intersect it. If not, the address can be used for SVM.
The worst case scenario for this would be to try to find space for a page
in a 32 bit process that had a lot of other pages already mapped for the
CPU. This is not as bad for 64 bit since the SVM has its own special region
and the CPU virtual addresses are more unlikely to intersect with it so the
only conflicts will come from SVM regions that have been recently freed
but not yet unmapped from the GPU.
Change-Id: Ic0dedbadb59501a86e018f21bd477e5c18664e5e
Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
Loading
Please register or sign in to comment