msm: kgsl: Fix the extra draw packet on resume for A305

The extra draw command on resume was missing some state. Add the missing
state registers, to avoid stability issues.

Change-Id: Iad51cbe3be7b2951563c989625a690178491e0c8
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Don't refer the NULL context

This fix ensure the BIRT test case will not
cause any device crash.

Change-Id: Ibbcdca293f4da05b21d16674f605aac729905959
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: KlocWork fixes

KlocWork fixes to avoid NULL pinter dereference

Signed-off-by: Ananta Kishore K <akollipa@codeaurora.org>
Change-Id: Iaa193683bc0ea092ff37fe77ca6a4be88dd55214
msm: kgsl: Verify the user doesn't accidentally submit a zero length IB

Indirect buffers to be executed will not be (and cannot be) zero length.
Check and reject.

Change-Id: Ic0dedbadea429c4f7bd386c5e64603b51ea8af61
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Init log levels in device init

Device log levels should be initialized during device initialization,
removing this from debugfs init because customer could disable
debugfs.

Conflicts:

	drivers/gpu/msm/adreno.c
	drivers/gpu/msm/kgsl_debugfs.c

Change-Id: Ie1222be1d421405e0d7481c799045cb9876c2a91
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Init FT log level in device init

Currenlty FT log level is init in debugfs init, debugfs
could be removed from commercial software and we might
miss FT logs, initializing FT log level in device init
prevents this.

Change-Id: If6ea02735dd250ecb7579cc0b485145dddb1b6d6
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: kgsl: Use the kmalloc/vmalloc trick for the sharedmem page array

It was previously assumed that most GPU memory allocations would be
small enough to allow us to fit the array of page pointers into one
or two pages allocated via kmalloc.  Recent reports have proven
those assumptions to be wrong - allocations on the order of 32MB will
end up trying to get 8 pages from kmalloc and 8 contiguous pages
on a busy system are a rare beast indeed.

So use the usual kmalloc/vmalloc trick instead - use kmalloc for the
page array when we can and vmalloc if we can't.

CRs-fixed: 513469
Change-Id: Ic0dedbad0a5b14abe6a8bd73342b3e68faa8c8b7
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Do not try to resume the device from INIT state

If the device is still in INIT state there are no open instances
of it running.  Resume calls should be no-ops.  Do not attempt
to start the device at this point.

Change-Id: I1cb6d60581b0b5b0a2ab1b13418adc4ae3983c5e
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
msm: kgsl: Configure FT behaviour from sysfs instead of debugfs

FT behaviour is changed to be configured from sysfs
instead of debugfs. Sysfs control gives us the advantage
of configuring FT at bootup and also across bootups.
Persistant configuration across bootups helps
testing by configuring FT once and testing the FT
config across bootups.

Conflicts:

	drivers/gpu/msm/adreno.h
	drivers/gpu/msm/adreno_debugfs.c

Change-Id: Ia3378f214371a6a4b9f205f9f884976f58585971
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>