Commit Graph

5197 Commits

Author SHA1 Message Date
Linux Build Service Account
0a2f143618 Merge "msm: kgsl: Stop the device during sleep" into msm-3.0 2012-04-10 20:15:05 -07:00
Linux Build Service Account
77c8500664 Merge changes Ic0dedbad,Ic35e6fbf,Ibf3c6d1e into msm-3.0
* changes:
  msm: kgsl: Use kzalloc to allocate scatterlists of 1 page or less
  msm: kgsl: fix 2d IB processing
  msm: kgsl: rework ib checking
2012-04-10 14:39:52 -07:00
Linux Build Service Account
e6f546f7e0 Merge "msm: kgsl: Use highest perf level on wake-up from sleep" into msm-3.0 2012-04-10 05:07:07 -07:00
Linux Build Service Account
703585148a Merge "msm: kgsl: Do not dereference pointer before checking against NULL" into msm-3.0 2012-04-10 03:08:51 -07:00
Linux Build Service Account
2d7754a796 Merge "msm: kgsl: Cleanup header file macros" into msm-3.0 2012-04-10 03:08:41 -07:00
Lynus Vaz
fe4bede74b msm: kgsl: Stop the device during sleep
For 7x27, 7x27A and 7x25A, stop the kgsl device during sleep.This
improved PDT stability results and 72hrs stability on customer devices.

Change-Id: I2f0941080363b06b3a0ead59daf0ef3659000b49
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Signed-off-by: Sudhakara Rao Tentu <srtentu@codeaurora.org>
2012-04-09 15:56:15 -07:00
Jordan Crouse
a652a07b0d msm: kgsl: Use kzalloc to allocate scatterlists of 1 page or less
The majority of the scatterlist allocations used in KGSL are under 1
page (1 page of struct scatterlist is approximately 1024 entries
equalling 4MB of allocated buffer).  In these cases using vmalloc
for the sglist is undesirable and slow.  Add functions to check the
size of the allocation and favor kzalloc for 1 page allocations and
vmalloc for larger lists.

Change-Id: Ic0dedbad99b60111677dd56b74edd8cedcac17f0
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-09 15:50:09 -06:00
Jeremy Gebben
d27b09f388 msm: kgsl: fix 2d IB processing
The 2d hardware handles ringbuffer and IB commands as
a series of gotos. At the end of each IB, there must
be a goto command back to the ringbuffer, which must
be "monkey patched" into the IB by the driver.
Fix this code to use a proper kernel mapping.

Change-Id: Ic35e6fbf6baeef51dbc2497f1702c7ccd6997579
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-04-09 15:50:09 -06:00
Harsh Vardhan Dwivedi
8cb835b656 msm: kgsl: Allocate physical pages instead of using vmalloc
Replace vmalloc allocation with physical page allocation. For most
allocations we do not need a kernel virual address. vmalloc uses up
the kernel virtual address space. By replacing vmalloc with physical
page alloction and mapping that allocation to kernel space only
when it is required prevents the kgsl driver from using unnecessary
vmalloc virtual space.

Change-Id: Idc716c8366f837f06a61b154deacec65a3a0662e
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-04-09 15:50:08 -06:00
Jeremy Gebben
d0ab6adeea msm: kgsl: rework ib checking
Separate ib parse checking from cffdump as it is useful
in other situations. This is controlled by a new debugfs
file, ib_check. All ib checking is off (0) by default,
because parsing and mem_entry lookup can have a performance
impact on some benchmarks. Level 1 checking verifies the
IB1's. Level 2 checking also verifies the IB2.

Change-Id: Ibf3c6d1e0d7522e75b41e1a6dbb92020ae9ace8d
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-04-09 15:50:08 -06:00
Jordan Crouse
ed7dd7f660 msm: kgsl: Add KGSL_IOCTL_SETPROPERTY
Add KGSL_IOCTL_SETPROPERTY to allow certain features to be enabled in
the kernel driver via userspace.

Change-Id: Ic0dedbadcbf3bfd451db947cec5d997261b12915
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-07 01:19:22 -06:00
Linux Build Service Account
41ed1b28cb Merge "msm: kgsl: Fix type0 packet parsing" into msm-3.0 2012-04-06 20:32:19 -07:00
Linux Build Service Account
61ba869ccd Merge "msm: kgsl: Dump the entire ringbuffer to the snapshot" into msm-3.0 2012-04-06 20:32:16 -07:00
Linux Build Service Account
bad9401e80 Merge "msm: kgsl: Store process mem entries in a rbtree" into msm-3.0 2012-04-06 20:32:15 -07:00
Linux Build Service Account
e949b1a002 Merge "msm: kgsl: Create a separate pool for mapping kgsl allocations" into msm-3.0 2012-04-06 20:32:09 -07:00
Linux Build Service Account
9343b215c1 Merge "msm: kgsl: Add markers to identify IB sequence start and end" into msm-3.0 2012-04-06 20:32:06 -07:00
Jordan Crouse
7f24c71f56 msm: kgsl: Fix type0 packet parsing
The snapshot code was incorrectly parsing type0 packets in
indirect buffers which ended up with the snapshot code trying
to dump random values as valid GPU addresses.  There were other
failsafes in place to make sure we didn't actually try to read
the memory, but it still made for a incomplete snapshot and lots
of annoying error messages.

Change-Id: Ic0dedbad200ce0170a70c45a613e9717ff86658b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-06 11:31:26 -06:00
Jordan Crouse
e6b77622bb msm: kgsl: Dump the entire ringbuffer to the snapshot
Dump the entire ringbuffer to the snapshot and let the parser decide
what it wants to show.  This is a lot better then trying to make those
sorts of decisions in the kernel. Even if we are dumping the entire
ringbuffer it still only makes sense to dump the IBs for the hanging
frame so do the math to find the context switch before the
last submitted IB and dump only the IBs from there to rptr or the
next context switch whichever is first.

Change-Id: Ic0dedbad3fed6be1fca3ed8a320386f70a562d43
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-06 11:31:23 -06:00
Shubhraprakash Das
d23ff4bb47 msm: kgsl: Add markers to identify IB sequence start and end
Add nop packets in ringbuffer at the start and end of IB buffers
subnmitted by user space driver. These nop packets serve as markers
that can be used during replay, recovery, and snapshot to get valid
data for a GPU hang dump

Change-Id: Id080672b7c04a1b6cfbccbcf5d4591cb5f0b3058
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-04-06 11:31:21 -06:00
Jordan Crouse
c9559e461e msm: kgsl: Store process mem entries in a rbtree
The list of memory objects attached to a process gets searched quite
a lot during normal operation of the driver.  For processes with a
lot of memory allocations, the linear search through the list is O(N)
and uses a lot more CPU during critical loops than it should. Change
the mem entry list to a rbtree for faster search speeds.

Change-Id: Ic0dedbad1b25d9d77f56f93696b2fe933fbad333
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-06 11:18:41 -06:00
Shubhraprakash Das
84fdb11109 msm: kgsl: Create a separate pool for mapping kgsl allocations
Create a separate kgsl pool to map global allocations made in kgsl
when IOMMU is used. Also, set the ttbr1 to point to defaultpagetable.
This allows us to map the kgsl allocations only once to the
defaultpagetable instead of having to map it to every pagetable
created.

Change-Id: I70fc051e852bf6820e09a1113a63ac93f7e0a51b
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-04-05 17:15:31 -06:00
Shubhraprakash Das
528aa4661c msm: kgsl: Do not dereference pointer before checking against NULL
The pagetable pointer was checked against NULL after being used.
Check against NULL first and then dereference it.

Change-Id: I714de9e3b153f212cb92502a21c7d720dd4e1e37
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-04-05 13:56:38 -06:00
Lucille Sylvester
6e36241ec2 msm: kgsl: Add a pwrscale policy to interact with msm_dcvs
This pwrscale policy provides per-core idle information to the
msm_dcvs driver.  It accepts frequency updates from the msm_dcvs
driver and updates the core frequency as needed.

Change-Id: I201cfcb6ceedc19c27f7848781813d9c477f9f83
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-05 09:36:42 -07:00
Nilesh Shah
5a16aef4b6 msm: kgsl: Use highest perf level on wake-up from sleep
Allowing gpu to operate on highest perf level on
wake-up for better performance.

Change-Id: I0fd678359bd29a27fb218a506d1b307544ec5aae
Signed-off-by: Nilesh Shah <nsshah@codeaurora.org>
2012-04-05 14:46:10 +05:30
Linux Build Service Account
19949e3f2e Merge "msm: kgsl: flush cache otherwise memory will be uninitialized" into msm-3.0 2012-04-04 20:21:34 -07:00
Linux Build Service Account
8864b9399b Merge "msm:kgsl: set state as requested state when in NAP" into msm-3.0 2012-04-03 06:01:39 -07:00
Linux Build Service Account
98d1c4e4a8 Merge "msm: kgsl: Properly enable the A3XX GPU busy power counter" into msm-3.0 2012-04-03 06:01:39 -07:00
Linux Build Service Account
dec48e80ec Merge "msm: kgsl: Revert changes done for 8930 Phase2 bringup" into msm-3.0 2012-04-03 06:01:39 -07:00
Suman Tatiraju
9b6110bb38 msm:kgsl: set state as requested state when in NAP
Fix the state to requested state so that when both ISR and
timer fire at the same time, the state is set as SLEEP

Change-Id: Ibeeaa8e586481eef0143f3cdb16bb8273ba2cc80
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2012-04-02 15:30:14 -07:00
Sudhakara Rao Tentu
daebac26d6 msm: kgsl: Revert changes done for 8930 Phase2 bringup
msm8930 Phase3 bringup done with A305 GPU. So reverting workarounds done
for 8930 phase2 bringup with 8960 using A2xx GPU which are not valid now.

This is equivalent to revert of 8eea9cf9b0

Change-Id: Ib7b830a8fcaf45ca5e17f101061e841b03ee537f
Signed-off-by: Sudhakara Rao Tentu <srtentu@codeaurora.org>
2012-04-02 15:07:25 -07:00
Jordan Crouse
77e6607245 msm: kgsl: Properly enable the A3XX GPU busy power counter
Fix a typo in the a3xx_reg.h file and set the correct bit
in the A3XX power counter register to enable the GPU busy
counter for pwrctrl monitoring.

Change-Id: Ic0dedbaddbda0769073f76fa532552620638c630
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-02 16:07:18 -06:00
Harsh Vardhan Dwivedi
a9eb7cb933 msm: kgsl: Add KGSL_DEV_ERR_ONCE helper macro for logging
Add KGSL_DEV_ERR_ONCE macro to kgsl_log.h, with functionality
similar to pr_err_once() but output format of dev_err(). Add logging
for deprecated code usage, to kgsl_ioctl_sharedmem_from_vmalloc()
and KGSL_USER_MEM_TYPE_ADDR switch case from kgsl_ioctl_map_user_mem()

Change-Id: I43bbd5acfb4630b88170034d61f1d099fbe3f118
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-04-02 11:01:28 -06:00
Linux Build Service Account
cc09f5ebeb Merge "gpu: ion: Map a range into the IOMMU" into msm-3.0 2012-03-31 23:47:51 -07:00
Rohit Vaswani
a76e99abc5 Merge branch 'Linux 3.0.21' into msm-3.0
Merge Upstream's stable 3.0.21 branch into msm-3.0
This consists 814 commits and some merge conflicts.

The merge conflicts are because of some local changes to
msm-3.0 as well as some conflicts between google's tree and
the upstream tree.

Conflicts:
	arch/arm/kernel/head.S
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/mmc/core/core.c
	drivers/tty/serial/serial_core.c
	drivers/usb/host/ehci-hub.c
	drivers/usb/serial/qcserial.c
	fs/namespace.c
	fs/proc/base.c

Change-Id: I62e2edbe213f84915e27f8cd6e4f6ce23db22a21
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-03-30 00:09:34 -07:00
Olav Haugan
16cdb41acb gpu: ion: Map a range into the IOMMU
Instead of mapping 1 4K page at a time into the IOMMU create a
scatterlist and map everything at once. This will be more efficient.

Change-Id: I8e83066869dd6f7a479bad22a66e4c70cc5973b5
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-03-29 17:02:06 -07:00
Jeff Boody
358abd3d32 msm: kgsl: flush cache otherwise memory will be uninitialized
The memory is allocated by vmalloc_user which initializes the memory
to zero however the initialization was being discarded by the cache
invalidate before the memory was returned to userspace.

Change-Id: I4d44fb3c308bb04c6cb137f7d34cd38600980f42
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
2012-03-28 14:38:17 -06:00
Linux Build Service Account
161c07db73 Merge "msm: kgsl: make pm_qos vote to default when in slumber" into msm-3.0 2012-03-28 10:51:24 -07:00
Linux Build Service Account
cfb26ebcdf Merge "msm: kgsl: Return the correct A3XX GPU ID based on SoC type" into msm-3.0 2012-03-28 08:50:40 -07:00
Suman Tatiraju
3005cddf58 msm: kgsl: make pm_qos vote to default when in slumber
Change the pm_qos vote to default when the diplay goes
off. This allows the cpu to do idle power collapse after
display goes off.

Change-Id: Id7c3af50e66c9deab483da98cac2569f56cd21e4
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2012-03-28 02:21:24 -06:00
Linux Build Service Account
a354674bf9 Merge "msm: kgsl: Make idlestats pwrscale policy default for 7x27A" into msm-3.0 2012-03-27 22:56:21 -07:00
Jordan Crouse
54154c6436 msm: kgsl: Return the correct A3XX GPU ID based on SoC type
It turns out that A3XX_RBBM_HARDWARE_VERSION returns 0x0 for both A320
and A305.  This, combined with some faulty logic in the GPU list, caused
A320 to be reported as a A305.  This had the immediate effect of costing
A320 on apq8054 half the GMEM that it deserves and also triggering
instabilities in the user mode driver.  Instead of trying to read multiple
registers to figure out the GPU ID, make the reasoned assumption that for
now at least, GPU ID will match SoC ID. Construct the chip_id based on the
SoC ID for A3XX targets and fix up the reported chip_id so it matches what
user space expects.

Change-Id: Ic0dedbadc74cb08fd7bc0bfb523b710ad33ed78c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-03-27 17:39:50 -06:00
Jordan Crouse
6d76c4d0df msm: kgsl: Increase the virtual GPU range for the IOMMU
Instead of a fixed 256MB virtual range for both the GPUMMU and IOMMU, make
the virtual range a property of the MMU engine and set the IOMMU range to
2GB.  Technically we could go all the way up to 4G, but even 2G is far out
of the realm of possiblity in the current generation, and we wanted to
reserve some of the space for future enhancements.

Change-Id: Ic0dedbad2987beb162b6a1878dd65ffae8a78522
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-03-27 08:55:41 -06:00
Lynus Vaz
31754cbc8b msm: kgsl: Make idlestats pwrscale policy default for 7x27A
Idlestats powerscale policy is required for userspace GPU DCVS.
This change sets it as default, so that the GPU DCVS daemon can
be started without having to set it first.

Change-Id: Ia280c9f685262b2848f1b85d74876f15a2e6ad6f
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2012-03-27 16:49:30 +05:30
Sudhakara Rao Tentu
5746bdee80 msm: kgsl: Configure VBIF settings for GPU with dual SMMU
Use default VBIF seetings for single SMMU in case of 8x30 and
configure VBIF settings for dual SMMU in case of 8064.

Change-Id: I0e9522eecc687615f285d905d8bd6ae4341595c9
Signed-off-by: Sudhakara Rao Tentu <srtentu@codeaurora.org>
2012-03-25 14:55:16 -07:00
Jeremy Gebben
d01042d080 gpu: ion: set dma_address for contiguous heaps in ion_map_dma()
Ion carveout and content protect heap buffers do not
have a struct page associated with them. Thus
sg_phys() will not work reliably on these buffers,
so set dma_address on their scatterlists.

CRs-Fixed: 345257
Change-Id: Ifdad5ce497de170f47b4ee2f7a93563a5cbe1a96
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-03-25 13:39:39 -07:00
Jeremy Gebben
582fe31d27 msm: kgsl: set the dma_address field of scatterlists
Ion carveout and content protect heap buffers do not
have a struct page associated with them. Thus
sg_phys() will not work reliably on these buffers.
Set the dma_address field on physically contiguous
buffers.  When mapping a scatterlist to the gpummu
use sg_dma_address() first and if it returns 0
then use sg_phys().

Change-Id: Ie5f19986446be4383dfbfffa2534136b592e8e46
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-03-25 13:39:28 -07:00
Linux Build Service Account
eb51c3f8bd Merge "msm: kgsl: Do not take spinlock when mapping to IOMMU" into msm-3.0 2012-03-25 06:22:34 -07:00
Shubhraprakash Das
badaeda313 msm: kgsl: Do not take spinlock when mapping to IOMMU
The IOMMU driver takes a spinlock internally when mapping, so
do not take an additional spinlock when mapping to IOMMU table.

Change-Id: I772ffb09af95ed15dc2c3495affa9efd48e4af5b
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-03-25 02:03:44 -06:00
Wei Zou
c8c0163607 Revert "msm: kgsl: Add per context timestamp"
This reverts commit 2a811252c7.

Change-Id: Ic3018f19eb1a089ae67e0f3c253cc00e7d0285e3
Signed-off-by: Wei Zou <wzou@codeaurora.org>
2012-03-24 17:29:50 -07:00
Linux Build Service Account
672228892e Merge "msm: kgsl: Add per context timestamp" into msm-3.0 2012-03-24 00:24:56 -07:00