Commit Graph
7494 Commits
Author SHA1 Message Date
Linux Build Service Account c247cef80d Merge "gpu: ion: Don't assume that heaps must be removed" 2012-12-06 01:08:02 -08:00
Linux Build Service Account 58eaae039a Merge "gpu: ion: Flush new pages" 2012-12-05 23:06:42 -08:00
Linux Build Service Account a18fa4bb8a Merge "msm: kgsl: Remove incorrect check for current context" 2012-12-05 20:27:35 -08:00
Linux Build Service Account 0d2921b2f5 Merge "gpu: ion: Fix a contiguous system heap crash" 2012-12-05 18:01:17 -08:00
Laura Abbott 956de1908d gpu: ion: Don't assume that heaps must be removed
The current check on Ion heaps is too restrictive. It assumes that
all heaps specified with a base address (implying it is a carveout
like heap) must have memory removed with memblock_remove. This is
not a valid assumption. Newer memory managment techniques such
as CMA will not remove memory from the memblock. Ensuring that
memory is properly removed can and should be done elsewhere.
Remove this check entirely.

Change-Id: If2ef1fe2b7f1d3e34c7f48a1a48d2f566d916f93
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-05 17:35:26 -08:00
Laura Abbott 60c92c79ef gpu: ion: Flush new pages
When allocating pages that are intended to be used for
uncached allocations, we need to ensure the cache is coherent;
there may be outstanding data in the cache related to those
pages. Ensure cache coherency by flushing each of the pages.

Change-Id: I4b89c799b5c099f6c050d8ddd758bdb368c07c08
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-05 17:32:23 -08:00
Harsh Vardhan Dwivedi 9f40c990a9 msm: kgsl: Remove incorrect check for current context
We remove an incorrect check for currently active context.
The intent of the original check was to ensure that the
current context is at least there/valid before we issue
a dummy command with a forced interrupt. However, this
check was implemented incorrectly, instead of checking
the context under which the function is running, the check
was probing the "drawctxt_active" which may not necessarily
be the same as the context for which the function was called.
We fix this by changing the check to instead look for the
context under which the kgsl_check_interrupt_timestamp() has
been called.

CRs-fixed: 426186
Change-Id: I6ac123d16888287b14e6e53028f482eb709f24c5
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-12-05 11:11:49 -07:00
Jordan Crouse 3fe9bd49c3 msm: kgsl: Add a ftrace event for GPU busy
Log a ftrace event when the GPU statistics are collected so that
we can keep track of GPU busy along with the other statistics
in the ftrace stream.

Change-Id: Ic0dedbadb58b9bef6e8669a7634bf9ca87073bcb
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-12-05 10:30:10 -07:00
Jordan Crouse dd66ff2999 msm: kgsl: Remove an uneeded register write for A3XX GPUs
A3XX doesn't have the MH block and so the register at 0x40 points
somewhere else. Luckily the write was harmless but remove it anyway.

Change-Id: Ic0dedbadd1e043cd38bbaec8fcf0c490dcdedc8c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-12-05 09:27:51 -07:00
Jordan Crouse 0eb440a21e msm: kgsl: Add a ftrace event for register writes
It is interesting to know when and how we program the hardware so
add a tracepoint to monitor register writes.  Register reads are
not traced since they are done much more frequently and are somewhat
less interesting from a debug perspective.

Change-Id: Ic0dedbad8ee85f154b9ba8731fe2c14603351243
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-12-05 09:27:51 -07:00
Linux Build Service Account db2f75f925 Merge "msm: kgsl: Always set the active powerlevel when changing clock rates" 2012-12-04 23:27:39 -08:00
Linux Build Service Account 15359cb0ce Merge "gpu: ion: Add support for CMA allocations in cp heap" 2012-12-04 19:06:38 -08:00
Linux Build Service Account 5382dca4b1 Merge "gpu: ion: Add msm specific extensions to CMA heap" 2012-12-04 19:06:37 -08:00
Linux Build Service Account 7f1feb3092 Merge "msm: kgsl: Ensure context pointer exists before dereferencing" 2012-12-04 19:05:37 -08:00
Linux Build Service Account d828628289 Merge "msm: kgsl: Disable HLSQ register reads from snapshot" 2012-12-04 19:05:24 -08:00
Linux Build Service Account 5bf110a697 Merge "msm: kgsl: Disable clock gating earlier during snapshot" 2012-12-04 19:05:22 -08:00
Jordan Crouse c6650c7000 msm: kgsl: Always set the active powerlevel when changing clock rates
kgsl_pwrctrl_pwrlevel_change might be called when clocks are on or off.
If clocks are off we don't step the clock rate and the active_pwrlevel
won't be set to the new and correct level.  Set active_pwrlevel to its
new level before doing anything else.

Change-Id: Ic0dedbad84ce1cc1b3b8df97df32e39686b85671
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-12-04 17:15:06 -07:00
Laura Abbott 3180a5f862 gpu: ion: Add support for CMA allocations in cp heap
Extend the cp heap to allow memory to be allocated from
the contiguous memory allocator (CMA) instead of from
the standard carveout region. The option to use CMA or regular
carveout memory is configured via a parameter in platform
data.

Change-Id: Ie26a867f8355280b4086afd7631a934a7c4b1e21
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-04 16:09:13 -08:00
Laura Abbott 4979d9787b gpu: ion: Add msm specific extensions to CMA heap
A number of changes have been made to the Ion framework for the
msm target. Add the necessary changes on top of the CMA heap to
allow the CMA heap to be fully utilized.

Change-Id: Ie006dcd4c41481e4d914c67bafbf42d1afdb1a76
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-04 12:52:42 -08:00
Linux Build Service Account c53ca3c412 Merge "msm: kgsl: allow consistent CPU and GPU mappings" 2012-12-04 09:37:09 -08:00
Rohit Vaswani 35edc883e1 gpu: ion: Fix a contiguous system heap crash
map_kernel and unmap_kernel in kmalloc_ops should support
a contiguous heap. The existing functions
ion_system_heap_map_kernel and ion_system_heap_unmap_kernel
are geared towards discontiguous memory (supported via
vmalloc_ops) and crash while handling contiguous heaps. This
patch adds two new functions specific to contiguous system
heaps to initialize kmalloc_ops.

Change-Id: I48d30ca01c5a0b71af4e1e640c79a920a298aedb
Acked-by: Jennifer L. Zenner <jzenner@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2012-12-03 14:25:05 -08:00
Carter Cooper 02938eaae6 msm: kgsl: Disable HLSQ register reads from snapshot
Reading the A3XX HLSQ registers during a GPU hang recovery might cause
the device to hang.  Disable the the HLSQ register reads that would
cause recovery to fail until the failures are better understood.

Change-Id: I1553025fbd824bfacf91f062372d5731cd905cc4
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-12-03 14:41:01 -07:00
Carter Cooper 9bd2ed3e03 msm: kgsl: Disable clock gating earlier during snapshot
Disable clock gating earlier when recording the GPU snapshot.
This will ensure that there are no issues when reading register
values from the GPU hardware.

Change-Id: I173655b419c958f0b8cdfa4609c712e512ff2487
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-12-03 14:34:20 -07:00
Benjamin Gaignard 07b590eb0e add CMA heap
New heap type ION_HEAP_TYPE_DMA where allocation is done with dma_alloc_coherent API.
device coherent_dma_mask must be set to DMA_BIT_MASK(32).
ion_platform_heap private field is used to retrieve the device linked to CMA,
if NULL the default CMA area is used.
ion_cma_get_sgtable is a copy of dma_common_get_sgtable function which should
be in kernel 3.5

Change-Id: I9ae54a3a021cb3513c2b0e8c58b69f3ae118561b
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[lauraa: Fix context in ion_priv.h/ion.h and omit Makefile change for now]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:15 -08:00
Benjamin Gaignard 8dff0a6bc5 add private field in ion_heap and ion_platform_heap structure
copy private field from platform configuration to internal heap structure.

Change-Id: Ia7571d88fc2f72f5d655fb6f6b54fde389d96c85
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[laura: Rebase context fixes]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:14 -08:00
Benjamin Gaignard 63d8103955 fix ion_platform_data definition
fix ion_platform_heap to make is use an usual way in board configuration file.

Change-Id: I8686108a9fe0aa2ba9f9c84990d555f947f78f86
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[lauraa: Fixup msm board files]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:10 -08:00
Linux Build Service Account bc7052b0f5 Merge "msm: kgsl: Set requested power state to NONE after resume" 2012-12-03 01:36:33 -08:00
Carter Cooper 3dfe92e6bd msm: kgsl: Ensure context pointer exists before dereferencing
When trying to add commands to the ringbuffer command stream, ensure
that the context point is not NULL before dereferencing it.

Change-Id: I6d8217ed4b180454eb43f2db161c10e86bc207da
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-11-30 11:37:29 -07:00
Jeremy Gebben 0d6f148463 msm: kgsl: allow consistent CPU and GPU mappings
KGSL_GPUMEM_ALLOC_ID now takes a flag,
KGSL_MEMFLAGS_USE_CPU_MAP. When set, the GPU
mapping will be set up to match the CPU mapping
during mmap().  This feature is only supported when
using per process pagetables with the IOMMU. The
flags field of KGSL_GPUMEM_ALLOC_ID is copied back
to userspace and KGSL_MEMFLAGS_USE_CPU_MAP will
be cleared when this feature is not supported.

The IOMMU virtual address space has been adjusted
when perprocess pagetables is enabled so that the
entire userpace address range (0 to TASK_SIZE) can
have equivalent mappings on the IOMMU. For buffers
that do not have equivalent mappings, the address
range from PAGE_OFFSET to KGSL_IOMMU_GLOBAL_MEM_BASE
is used.

Change-Id: Ib61c03aa7453c3dd901c41e8fd297f66d402ae1a
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-11-30 09:27:17 -07:00
Jordan Crouse c3b866d874 msm: kgsl: Support user-specified caching hints
The user allocating memory can provide hints for the caching
settings when said buffer is mapped on the user side. Try
to obey the cache settings when applicable.  The user will
be responsible for handling cache management both to and
from the GPU so add a new ioctl IOCTL_KGSL_GPUMEM_CACHE_SYNC to
support both directions (the old IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE)
only handled flushing, not invalidating. The legacy ioctl still
works it just does what it says it does - a cache flush.

Change-Id: Ic0dedbad55ce82f2b01ebc56de30d4649e2e7311
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-11-30 09:27:16 -07:00
Jeremy Gebben 058cea0caf msm: kgsl: add IOCTL_KGSL_GPUMEM_ALLOC_ID
Previously, the gpu address has been used to uniquely
identify each memory allocation. Upcoming patches will
introduce cases where an allocation does not always
have a gpu address, so an additional id is needed.

IOCTL_KGSL_GPUMEM_ALLOC_ID allocates pages and returns
an id.

IOCTL_KGSL_GPUMEM_FREE_ID frees an id. KGSL_SHAREDMEM_FREE
can still be used to free by GPU address, if it exists.

The id can also be passed to mmap(), shifted left by
PAGE_SIZE to get a CPU mapping for the buffer.

IOCTL_KGSL_GPUMEM_ALLOC_GET_INFO can be called to retrieve
the id and other information about the buffer.

Change-Id: I4b45f0660cb9d4a5fb1323ccc6c4aa360791c1ec
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-11-30 09:27:14 -07:00
Linux Build Service Account cca3d90216 Merge "msm: kgsl: Add max and min power level controls in sysfs" 2012-11-27 21:37:51 -08:00
Linux Build Service Account 6243f0dcd7 Merge "msm: kgsl: Dump Clock registers in Postmortem Dump" 2012-11-27 21:37:35 -08:00
Vinay Roy 49e530f114 msm: kgsl: Set requested power state to NONE after resume
When GPU resumes from suspend requested state is not cleared to NONE.
Due to this idle reporting is not done and GPU stays at MAX freq. As
a fix if the current power state is already ACTIVE and request is
made for active power state then clear the requested state immediately.

CRs-fixed: 424682
Change-Id: I7f0d7fa819308f166cbbbf30b2c20aee73644cfb
Signed-off-by: Vinay Roy <vroy@codeaurora.org>
2012-11-28 06:41:54 +05:30
Jordan Crouse 25a79313f9 msm: kgsl: Add max and min power level controls in sysfs
Add min_pwrlevel, max_pwrlevel and thermal_pwrlevel to give a
privileged user more control over which power levels are considered
during DCVS power management.  max_pwrlevel is the maximum power
level that the system can go to at any time, min_pwrlevel represents
the lowest power level.  DCVS will chose any level between these
two extremes.  thermal_pwrlevel allows a daemon to set an absolute
top for frequency to prevent thermal issues. The effective maximum
power level is considered to be the lower of thermal or max.

Also added is num_pwrlevels that shows the number of active power
levels. This corresponds to the gpu frequencies in
available_gpu_frequencies.

Change-Id: Ic0dedbad20102d9a3c3350055e6fcd10358fc53d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-11-27 15:35:08 -07:00
Linux Build Service Account 2d7781e7ba Merge "msm: kgsl: Remove extra interrupts when setting MMU state" 2012-11-27 10:26:35 -08:00
Linux Build Service Account b9588db63c Merge "msm: kgsl: Make the GPU device aware of the next pending event" 2012-11-27 10:26:33 -08:00
Linux Build Service Account 3c82928cbb Merge "msm: kgsl: Add separate GPU shader memory mapping" 2012-11-26 17:16:54 -08:00
Linux Build Service Account 721ca597da Merge "msm: kgsl: Support user specified timeouts in adreno_waittimestamp" 2012-11-26 14:05:34 -08:00
Harsh Vardhan Dwivedi 623b9a2467 msm: kgsl: Add separate GPU shader memory mapping
Add separate kernel memory mapping for GPU shader memory.
Previously, both the register and the shader memory were mapped
as one entity, with the mapping length being equal to combined
size of register memory and shader memory. Now, we separate the
shader memory mapping to help in cases of GPU devices where the
shader and register memory may not be adjacent. This helps to
dump the shader memory in the postmortem snapshot. By having a
separate mapping for shader memory, the snapshot dump routine
simply reads in the shader memory range specified and dumps.

Change-Id: I30e59dffe849fefcfbbaf0e5245cc1024ccedcb1
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-11-26 11:35:12 -07:00
Ranjhith Kalisamy 4c76100e17 msm: kgsl: Dump Clock registers in Postmortem Dump
Clock registers hold critical information of clock state that is
crucial for hang analysis. Dump this information as part of postmortem
dump.

Change-Id: I210bdd087e1844d1485caa1712239fdcb4f38982
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2012-11-23 17:20:28 +05:30
Rajesh Kemisetti 13c81daecc msm: kgsl: Add cache flush for A20x
Adding extra cache flush command to make sure that CP block
gets event from RB all the time to avoid race conditions because of
clock switches. this is to improve stability on 8x25 target.

Change-Id: Ie411be46fa166864073d35c50085a8f2506d0eb8
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2012-11-22 10:56:32 +05:30
Shubhraprakash Das 98c9adffcc msm: kgsl: Remove extra interrupts when setting MMU state
The interrupts added to the ringbuffer on PTFLUSH and TLBUPDATE
were causing a major increase in the number of interrupts from the GPU.
This was leading to increase in power and loss of performance. Add a check
to turn off IOMMU clocks when going to SLEEP.

Change-Id: I41617dd3b7b3f7d9622523f2a1407b912dbd989e
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-11-21 12:33:09 -07:00
Jordan Crouse b00a370821 msm: kgsl: Make the GPU device aware of the next pending event
The adreno core needs to know what the next event pending for
any given context is so it can mark the interupt to be fired.
If this isn't done then some timestamps that don't have a
matching waittimestamp call won't fire an interrupt. This is
dangerous on the last interrupt/event before a context goes
away.

Change-Id: Ic0dedbad71f6de07b43b0656128c76509326d645
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-11-21 12:33:03 -07:00
Jordan Crouse 931b98c8fb msm: kgsl: Support user specified timeouts in adreno_waittimestamp
We have always allowed the user to specify a timeout in waittimestamp
but we never obeyed it. Reorganize the function to be less convoluted
and support a user specified timeout (or spin forever if 0 is passed).

Change-Id: Ic0dedbadbc368336d05b14d66829205631046515
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-11-20 17:43:29 -07:00
Jordan Crouse 34bc087fac msm: kgsl: Move the adreno WPTR poke logic to the hang detection
Sometimes a write to CP_WPTR fails to latch on A20x GPUs. In the past
we worked around this by writing to WPTR numerous times in the various
loops that waited for GPU activity.  Consolidate these disparate calls
by moving the poke into the hang detect function.  If the core is idle
but the RPTR != WPTR, then rewrite the WPTR and go back through the
loop again.

Change-Id: Ic0dedbad474c7884c2467fe050d8afe673588add
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-11-20 15:40:31 -07:00
Linux Build Service Account 21067b4173 Merge "gpu: ion: fix race condition in checking virtual address" 2012-11-16 11:26:50 -08:00
Linux Build Service Account 3045684e2b Merge "msm: kgsl: Add memfree_history debug feature" 2012-11-16 09:16:24 -08:00
Linux Build Service Account 7857c9e024 Merge "msm: dcvs: gpu minimum frequency levels" 2012-11-16 01:16:14 -08:00
Steve Muckle 682c7a01c1 msm: dcvs: gpu minimum frequency levels
System performance is enhanced if the gpu frequency is given a
minimum corresponding to various frequency levels of CPU 0.

Change-Id: Iba168d708524fc8ef164428bb5f4e0631a499342
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
2012-11-14 14:33:50 -08:00