20 Commits

Author SHA1 Message Date
securecrt
121a2a91a5 msm: kgsl: Add GMEM size configuration in gpu list
To avoid msm or gpu specific code in the driver, added
GMEM size configuration parameter as a part of gpu list.
2012-07-25 20:39:13 +08:00
securecrt
15793c0aaa msm: kgsl: Find a mem_entry by way of a GPU address and a pagetable base
Given a pagetable base and a GPU address, find the struct kgsl_mem_entry
that matches the object.  Move this functionality out from inside another
function and promote it to top level so it can be used by upcoming
functionality.
2012-07-25 19:54:21 +08:00
securecrt
543247cd01 msm: kgsl: return correct error code for unknown ioctls
Unknown ioctl code errors are supposed to be ENOIOCTLCMD,
not EINVAL.
2012-07-25 19:35:35 +08:00
securecrt
1b6fa28430 msm: kgsl: Update the GMEM and istore size for A320
Set the correct GMEM and istore sizes for A320 on APQ8064.
The more GMEM we have the happier we are, so the code will
work with 256K, but it will be better with 512K.  For the
instruction store the size is important during GPU snapshot
and postmortem dump.  Also, the size of each instruction is
different on A3XX so remove the hard coded constants and
add a GPU specific size variable.
2012-07-25 19:14:12 +08:00
SecureCRT
0885149512 msm: kgsl: Add support for the A3XX family of GPUs
Add support for the A320, the first of the new generation
of Adreno GPUs.
2012-07-25 00:10:26 +08:00
SecureCRT
be4c38e2f5 msm: kgsl: handle larger instruction store for adreno225
This GPU has a larger instruction store, so more memory
needs to be reserved for saving shader state when context
switching.

The initial vertex and pixel partitioning of the
instruction store also needs to be different.
2012-07-24 23:30:19 +08:00
SecureCRT
b8450f4096 msm: kgsl: change timestamp frees to use kgsl_event
The timestamp memqueue was unsorted, which could cause
memory to not be freed soon enough. The kgsl_event
list is sorted and does almost exactly the same thing
as the memqueue did, so freememontimestamp is now
implemented using the kgsl_event list.
2012-06-23 19:03:55 +08:00
SecureCRT
f6acf3ab9f msm: kgsl: queue timestamp expired work more often
There are a some workloads where interrupts do not
always get generated, and as a result the timestamp
work was not triggered often enough.

Queue timestamp expired work from adreno_waittimestamp(),
when the timestamp expires while we are not waiting.
It is possible in this case that no interrupt fired
because no processes were waiting.

Queue timestamp expired work when freememontimestamp
is called, which reduces the amount of memory
built up by applications that use this api often.
2012-06-23 17:48:20 +08:00
SecureCRT
361e591fe7 msm: kgsl: remove readl/writel use for dma memory
For dma_alloc_coherent() you don't need writel/readl because
it's just a plain old void *. Linux tries very hard to make a
distinction between io memory (void __iomem *) and memory
(void *) so that drivers are portable to architectures that
don't have a way to access registers via pointer dereferences.
You can see http://lwn.net/Articles/102232/ and the Linus rant
http://lwn.net/Articles/102240/ here for more details behind
the motivation.

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.
2012-06-22 16:49:00 +08:00
SecureCRT
376f66c119 msm: kgsl: convert sg allocation to vmalloc
kmalloc allocates physically contiguous memory and
may fail for larger allocations due to fragmentation.
The large allocations are caused by the fact that the
scatterlist structure is 24 bytes and the array size
is proportional to the number of pages being mapped.
2012-06-22 16:08:12 +08:00
SecureCRT
b4c5202bec msm: kgsl: make cffdump work with the MMU enabled
The tools that process cff dumps expect a linear
memory region, but the start address of that region can
be configured. As long as there is only a single
pagetable (so that there aren't duplicate virtual
addresses in the dump), dumps captured with the
mmu on are easier to deal with than reconfiguring
to turn the mmu off.
2012-06-22 15:38:14 +08:00
securecrt
dcf924f072 msm: kgsl: Add a new property to IOCTL_KGSL_DEVICE_GETPROPERTY
Return the reset status of the GPU unit when
IOCTL_KGSL_DEVICE_GETPROPERTY is called with
type KGSL_PROP_GPU_RESET_STAT
2012-06-21 12:54:12 +08:00
securecrt
69555a62d1 msm: kgsl: Poke regularly in adreno_idle
Poking once during adreno_idle is not enough; a GPU hang may still happen.
Seen on 7x27A. Write a few times during the wait timeout, to ensure that
the WPTR is updated properly.
2012-06-21 12:46:57 +08:00
SecureCRT
97dd7fe6b5 msm: kgsl: Add a constant for adreno_ringbuffer_issuecmds flags
Use a #define constant instead of a bare constant for the flags
parameter of adreno_ringbuffer_issuecmds.
2012-06-21 00:32:58 +08:00
SecureCRT
ae32a212a5 msm: kgsl: fix error handling in adreno_waittimestamp()
This function was incorrectly reporting hangs when an
error such as ERESTARTSYS was returned by
__wait_event_interruptible_timeout().

msm: kgsl: Make sure WPTR reg is updated properly

Sometimes writes to WPTR register do not take effect, causing a
3D core hang. Make sure the WPTR is updated properly when waiting.

msm: kgsl: Set default value of wait_timeout in the adreno_dev struct

Set the initalization value of wait_timeout at compile time in the
declaration of the adreno_device struct instead of at runtime in
adreno_probe.
2012-06-21 00:02:15 +08:00
securecrt
73aff24078 msm: kgsl: fix size checking in adreno_find_region
This function is supposed to return the memdesc that
contains the range gpuaddr to gpuaddr + size. One of the
lookups was using sizeof(unsigned int) instead of size,
which could cause false positive results from this function
and possibly kernel panics in the snapshot or postmortem
code, which rely on it to do bounds checking for them.
2012-06-20 12:39:35 +08:00
securecrt
fd5e7d8237 msm: kgsl: let postmortem dump find context switch IBs
Because the IBs used for context switching are not allocated
by userspace, a separate search is needed to find them
in adreno_find_region.
2012-06-20 12:25:12 +08:00
SecureCRT
c5ac3240a5 msm: kgsl: improve postmortem and cff bounds checking
Some hangs are fooling the postmortem dump code into
running off the end of a buffer. Fix this by making
its bounds check logic work better by reusing the
logic from kgsl_find_region().
2012-06-19 23:30:34 +08:00
Shantanu Gupta
8afb87a6ea [KGSL] update to msm-kgsl3d0 v3.8 2012-05-14 01:49:10 +05:30
tytung
c6de4393cf Added the latest KGSL driver /dev/kgsl-3d0 for ICS HWA (Hardware Acceleration). (Credits to Securecrt and Rick_1995) 2012-05-01 13:12:22 +08:00