msm: kgsl: Fixes from caf 3.5

msm: kgsl: Get reference to process private when attaching mem entry

When a memory entry is attached with to a process private list then
increment the refcount of the process private structure so that the
structure is valid as long as the entry is around. The context
structure is also handled in similar manner. Also, the refcount to
the entry needs to be decremented when the handle that created the
entry goes away and not when the process private structure is
destroyed.

Conflicts:
        drivers/gpu/msm/kgsl.c

Change-Id: I225698ad4081947a93eb553104e5259bbf31f293
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl.c

msm: kgsl: avoid vmap failure while allocating big buffers

Limit the amount of pages vmapped at one time during allocation,
to avoid requesting more vmalloc space than is likely available.

CRs-Fixed: 445005
Change-Id: Icee5912687edf4da585d88308ee0e1c971964785
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>

Conflicts:
	drivers/gpu/msm/kgsl_sharedmem.c

msm: kgsl: Fix page align allocation overflow

KGSL does alignments for all user memory requests. If the
request is large enough the alignment operation will overflow
resulting in a valid request of size 0. It's just a matter of
time until the kernel or user tries to then do something useful
with this buffer resulting in a hang. Perform a sanity check
after doing the alignments to ensure the overflow did not occur.

Change-Id: I68f0f2c7dfdfb117e6d1320ec594cbdf75407a3e
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>