Commit Graph

5249 Commits

Author SHA1 Message Date
Linux Build Service Account
2994baf458 Merge "gpu: ion: Fix fragmentation message log condition" into msm-3.0 2012-04-25 09:02:45 -07:00
Lynus Vaz
e91e001acf msm: kgsl: Cancel events before context is freed
Make sure the context is intact when the events are canceled. Since
the timestamps are now per-context, readtimestamp requires a valid
context.

Change-Id: I0c917a77f2e39594a5f5b69985f639de1fb53206
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2012-04-24 21:01:22 +05:30
Jeremy Gebben
8b253bf2c4 msm: kgsl: use correct 2d ringbuffer offset in resume
The 2d timestamp is used as an index into the ringbuffer.
Now that z180_dev->current_timestamp is preserved across
resume, make sure that ADDR_VGV3_NEXTADDR is set to the
gpu address that corresponds to the current timestamp.

CRs-Fixed: 347025
Change-Id: Ib7dc4579943ab24e04279ede1555539ec21adabd
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-04-23 16:23:51 -06:00
Linux Build Service Account
df28e9c349 Merge "ion: support creation of mm heap in a fixed place" into msm-3.0 2012-04-21 18:26:06 -07:00
Jordan Crouse
f7370f8e2a msm: kgsl: Control power savings features from userspace
Sometimes, the userspace driver has a need to disable some of the
power savings features in the kernel for a brief period.  Add a
property to control nap and DCVS from the user space driver via
KGSL_IOCTL_SETPROPERTY.

Change-Id: Ic0dedbad5dbc2f027b0c3316e29f620b8ea127fd
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-21 12:23:07 -06:00
Larry Bassel
2d8b42d31f ion: support creation of mm heap in a fixed place
The multimedia firmware on 8960 will always be
loaded into a fixed address, and all callers into
this firmware must be no more than 256M above the
start of this firmware.

This implies that the the mm ION heap and its associated heaps
(mm_fw and mfc) must also be created in a fixed place.

This version of the patch keeps the mm fw heap size
to 2M for compatibility with the current tip. This
will eventually be reduced to 1M.

Change-Id: I35f89b8c60165fb0adbb9d04412e0e200117beb9
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-04-20 09:57:59 -07:00
Jordan Crouse
7501d450f5 msm: kgsl: Cleanup a superfluous structure in kgsl_device.h
struct kgsl_memregion was used to store the MMIO and GMEM
addressing for KGSL and adreno but it didn't serve much
purpose other than another level of redirection in the
structures.  Remove it and add the necessary pointer and
size members directly to the KGSL and adreno structs.

Change-Id: Ic0dedbad8ec3f0a2c63383fa451cc39a25cab087
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-20 09:38:48 -06:00
Jordan Crouse
cafb63a555 msm: kgsl: Record the queued context timestamp in the snapshot
Record the last issued timestamp for each context in the snapshot.
With per context timestamps, each context has its own timestamp
sequence so it is important to know the last timestamp issued by
the context so we can reconstruct the failing frame in the snapshot
output.

Change-Id: Ic0dedbad9cd402aad4fb30a798a8ff5ab2a34950
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-20 09:38:48 -06:00
Jordan Crouse
c659f38e57 msm: kgsl: Read the queued timestamp from the device
Add KGSL_TIMESTAMP_QUEUED to the list of timestamp types that can be
queried from the device specific readtimestamp. QUEUED returns the
last timestamp ID that was initiated by issuing a command buffer to
the ringbuffer.

Change-Id: Ic0dedbad780cbc9f7d4cf5cf2ffc11a7d9d2d3e5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-20 09:38:47 -06:00
Jordan Crouse
17d6d8b1f5 msm: kgsl: Improve robustness of snapshot and map frozen GPU objects
Improve the IB parser to be more robust when dealing with terribly
corrupted buffers.  Also, make sure that the frozen GPU objects are
mapped in the kernel prior to being dumped.

Change-Id: Ic0dedbad49c52b9a41915ab36430770cb7b0025c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-20 09:38:47 -06:00
Linux Build Service Account
73fb58ca78 Merge "msm: kgsl: Fix snapshot dump for hangs involving legacy context switch" into msm-3.0 2012-04-20 02:54:28 -07:00
Lucille Sylvester
67b4c537b5 msm: kgsl: Allow SLEEP/SLUMBER/SUSPEND states to wake to nominal voltage
Waking in turbo drains power while the high nominal frequency of 300MHz is
generally enough to handle rapid requests.

Change-Id: I01a8261b6431556b483e59d1c2ae539ff094c751
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-19 23:04:22 -06:00
Linux Build Service Account
2811dd59a2 Merge "msm: kgsl: Use default hardcoded value for CP's ROQ queue size" into msm-3.0 2012-04-19 19:48:12 -07:00
Linux Build Service Account
1115b31068 Merge "msm: kgsl: Create ion client in the probe function" into msm-3.0 2012-04-19 19:48:09 -07:00
Olav Haugan
d710ed18cf gpu: ion: Fix fragmentation message log condition
If an ion allocation fails because of memory fragmentation a debug
message should be printed. However, the logic that decides whether
the debug message should be printed or not is incorrect causing
the debug message to not be printed when it should.

Change-Id: I6537171db0a47ba072d182e9bb3125cac5513ff9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-04-19 14:23:04 -07:00
Jeff Boody
8614948c34 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.

CRs-Fixed: 347631
Change-Id: I63804b8aa2d51226b506254755f040032048865d
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
2012-04-19 14:20:05 -06:00
Harsh Vardhan Dwivedi
f48af7f2fc msm: kgsl: Create ion client in the probe function
Move the call for creating the ion client from kgsl_setup_ion to
kgsl_device_platform_probe. Keeping the create ion client call linked to
kgsl_ioctl_map_user_mem made the user process which first used this
ioctl be forever visible as an ion client in debugfs, even when the
process itself had terminated. Creating ion client in probe ensures that
kgsl appears as the ion client in debugfs and avoids confusion.

CRs-fixed: 349112
Change-Id: Ic4483224d6c48f76f85d48fa4d7768cf26920508
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-04-19 14:03:34 -06:00
Harsh Vardhan Dwivedi
d9fa3d511c msm: kgsl: Use default hardcoded value for CP's ROQ queue size
The command processor FIFO depth is different for A330 and A2xx GPUs.
It is best to let each GPU use the default value which is hardcoded in
the respective GPU.

Change-Id: I5db6a1c0671d0ad4253dcad7f386429d78a4bd62
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-04-19 13:24:26 -06:00
Linux Build Service Account
f8808fd0f5 Merge "msm: kgsl: Change name of vmalloc allocator" into msm-3.0 2012-04-19 08:41:21 -07:00
Jordan Crouse
233b2091ae msm: kgsl: Fix snapshot dump for hangs involving legacy context switch
The IBs stored by legacy context switch are not stored as part of the
nominal mem_entry accounting that the rest of the process has.  As a
result we cannot freeze the legacy context switch IBs for dump.  Instead,
dump them into the snapshot as IB sections.  Also, store the offset for
the frozen objects to avoid trying to read the gpuaddr of the memdesc after
it had been freed.

Change-Id: Ic0dedbadda43a3025f938b31140d5be19c4706b2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-19 09:31:52 -06:00
Linux Build Service Account
67d6e8fd71 Merge "msm: kgsl: Add a helper function for getting device platform data" into msm-3.0 2012-04-18 15:25:24 -07:00
Linux Build Service Account
491ad16a28 Merge "msm: kgsl: Add ftrace for A3XX interrupts" into msm-3.0 2012-04-18 13:12:09 -07:00
Harsh Vardhan Dwivedi
f99c263b56 msm: kgsl: Change name of vmalloc allocator
Change the vmalloc allocation name to something more appropriate since
we do not allocate memory using vmalloc for userspace driver. We
directly allocate physical pages and map that to user address space. The
name is changed to page_alloc instead of vmalloc. Add sysfs files to
track memory usage via both vmalloc and page_alloc.

Change-Id: I239087435f4599b62b7da71ecea0a5878cda5037
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
2012-04-18 13:35:34 -06:00
Linux Build Service Account
7ca1fb21db Merge "msm: kgsl: Remove duplicate soptimestamp memory write call" into msm-3.0 2012-04-18 10:18:36 -07:00
Jordan Crouse
d8aa4be5a0 msm: kgsl: Add a helper function for getting device platform data
Add a simple helper function to make it easy to get the platform device
data from a kgsl_device pointer.

Change-Id: Ic0dedbad334aa86e8c8fe4150303bca494693778
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-18 09:35:09 -06:00
Linux Build Service Account
be8ee19082 Merge "msm: kgsl: Make use of the new clock APIs." into msm-3.0 2012-04-18 05:53:46 -07:00
Linux Build Service Account
c2866887fa Merge "msm: kgsl: Add functions for enabling / disabling a powerscale policy" into msm-3.0 2012-04-18 05:53:41 -07:00
Lucille Sylvester
5b7e57bb07 msm: kgsl: Make use of the new clock APIs.
Use the split clock APIs to do low latency actions (enable/disable)
frequently.  Use the high latency functions (prepare/unprepare)
sparingly to help performance.

CRs-fixed: 351696
Change-Id: Iaf9ed2117a1647e38be8658c60a365d377c968a4
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-18 00:35:59 -06:00
Carter Cooper
ae4c7bc808 msm: kgsl: Remove duplicate soptimestamp memory write call
This soptimestamp write is not needed twice after hang recovery.

Change-Id: I117ecdc8651bf8b9410a245e0582c1f672d3ca6d
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-04-17 15:35:14 -06:00
Linux Build Service Account
bc1a6373c5 Merge "msm: kgsl: Search setstate memory descriptor" into msm-3.0 2012-04-16 22:07:30 -07:00
Linux Build Service Account
38d3969d23 Merge "msm: kgsl: Ensure glitch free changing of the GPU frequency" into msm-3.0 2012-04-16 20:08:43 -07:00
Shubhraprakash Das
9a1409749a msm: kgsl: Search setstate memory descriptor
When searching for a memory descriptor for a given gpuaddr search
for the setstate memory descriptor as well.

Change-Id: Ib5cbc797bbfddd35b89fbba64196c226c0995fa1
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2012-04-16 17:37:19 -06:00
Lucille Sylvester
8d2ff3b4b7 msm: kgsl: Ensure glitch free changing of the GPU frequency
If there are requests to skip levels while the clocks are on
be sure to hit the intermediate frequencies.

Change-Id: Ib69bcbc7eb87532c090b4ede28d967e4cd0f08ec
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-16 14:59:47 -06:00
Carter Cooper
b769c91dc5 msm: kgsl: Add ftrace for A3XX interrupts
Add ftrace logging to help with debugging and profiling on A3XX

Change-Id: I626c5d694e66e6d6c062b31fc56794c3e7c58522
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-04-16 09:33:29 -06:00
Olav Haugan
c57a61ec5e gpu: ion: Add check for addr out of bounds
Add check for out of bounds condition when clients perform cache
operations on the System ION heap. Return error if client
tries to do a cache operation outside the valid range.

Also add check to make sure we don't dereference a null-pointer
when converting a page to its physical address.

Change-Id: Idacff0f36a9d872485e7e74ee1a355ec1e33fb2c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-04-14 07:12:04 -07:00
Linux Build Service Account
98bc5242a3 Merge "msm: kgsl: Add per context timestamp" into msm-3.0 2012-04-14 01:59:13 -07:00
Jordan Crouse
db8175846a msm: kgsl: Add functions for enabling / disabling a powerscale policy
Sometimes you want to enable or disable a policy for a bit without
actually swapping out the policy.  These functions allow the kernel
to control the policy functionality.

Change-Id: Ic0dedbad4406e5fffe1ebd8e8ba4e6bf84d82203
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2012-04-13 09:35:21 -06:00
Carter Cooper
1bb929254e msm: kgsl: Fix A3XX_INT_CP_DMA macro typo
Should be capital X's, not lowercase in the macro

Change-Id: Ic545d00017c0ffcd045284651805549374459eab
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-04-13 09:25:42 -06:00
Carter Cooper
7e7f02ed0a msm: kgsl: Add per context timestamp
Add new ioctls for per context timestamps.
Timestamp functions (read/write/wait) will now be context
specific rather than only using the global timestamp.
Per context timestamps is a requirement for priority
based queueing.

Change-Id: I5fdfb816480241b9552ecf90ed1bb22db3a652b5
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-04-13 08:26:07 -06:00
Linux Build Service Account
4fd4911c67 Merge "msm: kgsl: Don't call through pwrscale functions when entering SLUMBER" into msm-3.0 2012-04-12 23:03:09 -07:00
Linux Build Service Account
9da82a0ebc Merge "msm: kgsl: Fix when GMEM is saved for A2xx" into msm-3.0 2012-04-12 19:09:34 -07:00
Linux Build Service Account
40ffa74c90 Merge "msm: kgsl: Write the retired timestamp on resume" into msm-3.0 2012-04-12 17:15:56 -07:00
Linux Build Service Account
12ff32fed2 Merge "msm: kgsl: enable DCVS on 8064" into msm-3.0 2012-04-12 17:15:51 -07:00
Linux Build Service Account
44af2ce8e7 Merge "msm: kgsl: Resolve conflicts in state changes" into msm-3.0 2012-04-12 17:15:41 -07:00
Carter Cooper
ec549da5df 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.

Change-Id: I743a7287f105dd50955727c4f0dcaf8de363a1dc
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2012-04-12 10:58:22 -06:00
Lynus Vaz
68dba7b544 msm: kgsl: Write the retired timestamp on resume
Write the retired timestamp into the expected location. This fixes
userspace crashes after resume when the retired timestamp is read
as 0 instead of the expected last timestamp.

CRs-Fixed: 350556
Change-Id: Iaa487ba8be427c29b9f7e9b30b251cf26fcff95a
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2012-04-12 11:16:49 +05:30
Suman Tatiraju
3bd641ee4f msm: kgsl: enable DCVS on 8064
Change the idle timeout to 100 msec so that we dont
sleep as often.This is to avoid performance hit with
50msec

Change-Id: I3fb1b2508ad15a030480e9af40ebca4dbaf4bff0
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2012-04-11 16:16:33 -07:00
Lucille Sylvester
e4a7c1a365 msm: kgsl: Resolve conflicts in state changes
Only check requested state once, and fully transition to that
specific state.  This will resolve any conflicts arising from
changes to the requested_state as the state transition occurs.

Change-Id: I0836877d7d93d469158f7bfba5556fc082ebfe2a
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-11 12:17:38 -06:00
Jeremy Gebben
7018a21bf2 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.

Change-Id: I4d6b688fc4a9f04d4bf8e3215d51bac32bf8e9fd
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2012-04-11 10:27:41 -06:00
Lucille Sylvester
b2679c000e msm: kgsl: Don't call through pwrscale functions when entering SLUMBER
No additional calls to pwrscale idle or busy should be allowed when
transitioning to SLUMBER state.

Change-Id: I9488569758d263752c9778b8603f8e80bbc41ea1
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2012-04-11 09:05:05 -06:00