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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This soptimestamp write is not needed twice after hang recovery.
Change-Id: I117ecdc8651bf8b9410a245e0582c1f672d3ca6d
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
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>
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>
Add ftrace logging to help with debugging and profiling on A3XX
Change-Id: I626c5d694e66e6d6c062b31fc56794c3e7c58522
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
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>
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>
Should be capital X's, not lowercase in the macro
Change-Id: Ic545d00017c0ffcd045284651805549374459eab
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>