Commit Graph

468 Commits

Author SHA1 Message Date
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
4520a7c383 msm: kgsl: cancel events from kgsl_release
Events need to be cancelled when an fd is released,
to avoid possible memory leaks or use after free.

When the event is cancelled, its callback is called.
Currently this is sufficient since events are used for
resource management and we have no option but to
release the lock or memory. If future uses need to
distinguish between the callback firing and
a cancel, they can look at the timestamp passed to
the callback, which will be before the timestamp they
expected. Otherwise a separate cancel callback can
be added.
2012-06-23 18:52:06 +08:00
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
5c1047c767 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().

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.
2012-06-23 17:02:28 +08:00
a7bb935abb revert the pmem size to default configration 2012-06-23 17:01:57 +08:00
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
8c39724a75 remove zImage before compile 2012-06-22 16:48:37 +08:00
47e6ec131b reverse the GENLOCK 2012-06-22 16:20:22 +08:00
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
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
a19d2698cc msm: kgsl: Add ION as an external memory source
Allow ION buffers to be attached via IOCTL_KGSL_MAP_USER_MEM
2012-06-22 15:24:51 +08:00
91bbe54c4f msm: kgsl: Fixup per-process memory statistics
Make the framework for reporting per-process memory statistics a little bit
more generic.  This should make it easier to keep track of more external
memory sources as they are added.
2012-06-21 13:41:21 +08:00
9d909cf27b msm: kgsl: Make sure kmemleak tool does not report incorrect mem leak.
Certain memory allocations are not properly tracked by kmemleak tool,
which makes it to incorrectly detect memory leak. Notify the tool by using
kmemleak_not_leak() to ignore the memory allocation so that incorrect leaks
report are avoided.
2012-06-21 13:01:23 +08:00
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
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
aa5de9cfcb msm: kgsl: increase valid timestamp range
The existing timestamp_cmp function returns a different
result depending on the order of the input parameters due to
having an asymetric valid window. When no rollover is
detected the window is 2^31 but when a rollover is detected
the window is 25000. This change makes the rollover window
symmetric at 2^31.
2012-06-21 12:34:57 +08:00
d319fcfbbd msm: kgsl: flush outer cache for alloc_page() pages
The outer cache needs to be flushed for these pages
after they are allocated so that the GPU and CPU
have a consistent view of them.
2012-06-21 12:30:20 +08:00
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
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
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
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
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
8be096244d msm: kgsl: Fix when GMEM is saved for A2xx
Saving GMEM is set when doing context switching and should not
be set when creating the gmem shadow.
2012-06-19 21:46:18 +08:00
2f3f4d14f9 msm: kgsl: Add support for the preamble context flag
Userspace will set a flag in the context if preambles are in use. If
they are, we can safely skip save and restore commands for the
context. GMEM save/restore is still required.  To improve performance,
preamble commands are skipped when the context hasn't changed since
the last issueibcmds.

from Code Aurora
2012-06-19 14:00:07 +08:00
cad19fbe99 change the build batch file 2012-06-19 01:38:16 +08:00
83cf3269bc add more sf_pmem to prevent memory full 2012-06-19 01:37:29 +08:00
758812c3aa fixed the adsp pmem is too low for camera 2012-06-18 23:52:45 +08:00
1bd0e44d7a reduced the pmem size to save memory for userspace, TEST ONLY!! 2012-06-18 20:31:47 +08:00
4f50d63951 msm: kgsl: fix format of the rbbm read error message
msm: kgsl: Assign a valid context only after one has been restored
2012-06-18 20:28:17 +08:00
d0bde07fa4 set ALLORNOTHING allocator for mdp heap 2012-06-05 00:12:26 +08:00
32f796ad5c compress boot and system dir only 2012-06-02 16:34:51 +08:00
aacc150509 add auto build script 2012-06-02 16:26:49 +08:00
a7c3c3727b enable the 2700mAh battery for my private use only 2012-06-02 15:35:33 +08:00
b38b808efb enable fast charge 2012-06-02 15:33:41 +08:00
c3fcc46456 updated README. 2012-06-02 00:45:50 +08:00
e512b34cde htcleo: updated htcleo_defconfig to tytung_HWA_r2.5 2012-06-01 01:16:56 +08:00
db81187e55 msm: htcleo: export the real WiFi and Bluetooth MAC addresses.
(Credits go to marc1706)
2012-06-01 01:16:20 +08:00
8505d01410 drivers: mtd: devices: htcleo_nand: leave only correct candidates for WiFi and Bluetooth MAC addresses.
(Credits go to Rick_1995, aka zeusk.)
http://forum.xda-developers.com/showpost.php?p=26579738&postcount=4
2012-06-01 00:33:19 +08:00
a979a22695 drivers: mtd: devices: htcleo_nand: find the real unique WiFi and Bluetooth MAC addresses.
(Credits go to Franck78 <fbourdonnec@chez.com>)

http://forum.xda-developers.com/showpost.php?p=26556691&postcount=3
2012-06-01 00:21:07 +08:00
5ff4526737 htcleo: updated htcleo_defconfig to tytung_HWA_r2.4-uniMAC 2012-05-22 19:52:16 +08:00
2c73e1566d Revert "msm: htcleo: removed the real WiFi MAC address for SD build and used new unique WiFi MAC address, so that we have the same WiFi MAC address on NAND and SD."
This reverts commit 9ab858cdb2.

Revert it because new unique WiFi MAC patch only works for NAND ROM and MAGLDR SD boot, not works for WM users using Clrcad & Haret to boot SD build.
2012-05-22 19:51:10 +08:00
88e7e8a6d2 drivers: usb: gadget: update some usb drivers for USB Tethering. 2012-05-19 19:33:14 +08:00
50abfc6c2d Merge pull request #4 from zeusk/ics_HWA
[KGSL] update to msm-kgsl3d0 v3.8
2012-05-13 21:49:47 -07:00
be86226379 [KGSL] add missing files for last commit 2012-05-14 02:47:02 +05:30
8afb87a6ea [KGSL] update to msm-kgsl3d0 v3.8 2012-05-14 01:49:10 +05:30
1e3f6a9266 updated README. 2012-05-13 20:34:11 +08:00
ac0378e146 htcleo: updated htcleo_defconfig to tytung_HWA_r2.2-uniMAC 2012-05-13 11:49:13 +08:00
14509b73e8 msm: htcleo: cleanup 2012-05-13 03:45:08 +08:00
dfac1a861b Merge pull request #3 from zeusk/ics_HWA
Backport android and MSM parts from caf
2012-05-12 12:18:37 -07:00
daf542e57e Backport android and MSM parts from caf 2012-05-12 16:56:17 +05:30