Commit graph

444 commits

Author SHA1 Message Date
Rajesh Kemisetti
5fb1b581d6 Revert "msm: kgsl: Update QoS settings for A508 VBIF as recommended"
This reverts commit ef93af2324.

To fix unexpected GPU hangs and TLB synctimeouts.

Change-Id: I66da6e92db4affe55557f4f84ee127f6babb08b7
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-06-07 17:22:42 +05:30
Linux Build Service Account
e0b49f46ed Merge "msm: kgsl: Use per page cache operation instead of bulk cache operation" 2017-06-01 16:56:02 -07:00
Linux Build Service Account
881828b004 Merge "msm: kgsl: Deal with a NULL pointer when creating default pagetable" 2017-05-26 14:09:09 -07:00
Linux Build Service Account
b52ce7f7b9 Merge "msm: kgsl: Update QoS settings for A508 VBIF as recommended" 2017-05-26 06:31:06 -07:00
Lynus Vaz
5ea16d78cc msm: kgsl: Deal with a NULL pointer when creating default pagetable
Return an appropriate error code if the default pagetable is NULL.

Change-Id: Ic88b066c40a8f840d95fd3fbc9ee9274c428b66a
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2017-05-26 05:37:37 -07:00
Deepak Kumar
7490d55401 msm: kgsl: Use per page cache operation instead of bulk cache operation
For any cache operation, the current code tries to map all pages to the
kernel using vmap in case sg table is not available and then performs
the requested cache operation. If vmap fails because of memory crunch
ioctl just returns failure.

This change avoids using vmap and performs per page cache operation
even when sg table is not available. This is done to avoid failures
because of vmap especially on 32 bit systems.

Change-Id: I123b46e6a55a62cbf934ab6a2a49dcd1f0d4c7d4
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-05-26 12:55:07 +05:30
Linux Build Service Account
c5685ec0f3 Merge "msm: kgsl: Return mementry only if pending_free is not set" 2017-05-25 15:52:15 -07:00
Rajesh Kemisetti
ef93af2324 msm: kgsl: Update QoS settings for A508 VBIF as recommended
Update QoS settings for A508 VBIF based on recommendation.
VBIF_GATE_OFF_WRREQ_EN register needs to be programmed by SW.

Change-Id: I7d41c8350ad09c595f288bd2a2b45fc2abef15f8
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-05-25 11:39:25 +05:30
Deepak Kumar
0e42ef24c9 msm: kgsl: Return mementry only if pending_free is not set
Return mementry from kgsl_sharedmem_find only if pending_free
is not set for that mementry. This is necessary to avoid use
of a mementry after it is already marked for free.

Change-Id: I23111e9c82a88ccbda2ab259074c38d91f9ff5cb
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-05-23 02:56:36 -07:00
Wenbin Wang
bd15fce5df msm: kgsl: Don't delete uninitialized preemption timer
If we delete uninitialized timer on CONFIG_DEBUG_OBJECTS
disabled build del_timer_sync() will block for ever. For
all A3xx targets preemption timer is not initialized, but
dispatcher fault handler is trying to delete the
uninitialized preemption timer. Fix this issue by adding
a preemption check before we delete it.

CRs-Fixed: 2023690
Change-Id: I2c51a0b2286b82bf2eb5ee68d923dd9585f07f00
Signed-off-by: Wenbin Wang <wwenbin@codeaurora.org>
Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org>
2017-05-22 21:57:50 -07:00
Deepak Kumar
281fcb5e18 msm: kgsl: Offload mementry destroy work to separate thread
Any memory free ioctl doesn't need to be blocked till the
corresponding mementry is destroyed. This change defers
the mementry put to unblock all memory free ioctls immediately.
This is done to reduce the time spent by user applications in
waiting for memory to be freed.

Change-Id: Iaa37ac5dbdedc3d02c41886c2bdf7f3d016176ac
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-05-11 17:48:44 +05:30
Linux Build Service Account
f1a10f1598 Merge "msm: kgsl: Perform cache operation with kernel address" 2017-05-01 00:11:58 -07:00
Hareesh Gundu
c1540a6bfe msm: kgsl: Perform cache operation with kernel address
Kernel should never access untrusted pointers directly.
If the address is not mapped to kernel, map to kernel
address space and perform cache related operation.

Change-Id: I433befcde620e51b8ec17954ddb710f6084e0592
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-04-26 11:00:09 +05:30
Hareesh Gundu
d689330ab5 msm: kgsl: Allow draw context to perform only replay on recovery
Robust context attempts to perform a rendering that takes too long
whether due to an infinite loop in a shader or even just a rendering
operation that takes too long on the given hardware. This type of
attempts can result into GPU faults. Robust context expect driver
to replay IB instead skip IB and if it fails on replay context has
to be invalidated.

KGSL_CONTEXT_INVALIDATE_ON_FAULT flag allows draw context to execute
only replay policy on GPU fault recovery instead of going to default
recovery policy. User space has to set this flag during the context
creation.

Change-Id: If42dc5afc7d5ed1226b73ae5abfa2648d7acf2c3
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-04-23 23:47:46 -07:00
Linux Build Service Account
a24ce2ce89 Merge "msm: kgsl: Fix the race between context create and destroy" 2017-04-14 07:28:52 -07:00
Sunil Khatri
1c4ddc4c7a msm: kgsl: Fix the race between context create and destroy
Hold the context lock before updating the context id in
param->drawctxt_id to avoid race condition between context
creation and context destroy.

Change-Id: Ic26d3e5b68078c02d15c38080b1a262ea4b1f7fe
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
2017-04-07 05:36:33 -07:00
Sunil Khatri
9ef4ee8e3d msm: kgsl: Fix kgsl memory allocation and free race condition
When allocating userspace memory keep reference to memory
allocation till it is completely initialized and info is sent back
to userspace.

Change-Id: Id72c82bf98c094ecbd4722813c732a998dcbb188
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
2017-04-07 05:33:56 -07:00
Lynus Vaz
341934ba38 msm: kgsl: Use legacy PM4 check instead of adreno version
Check for legacy PM4 commands instead of adreno version to calculate
ringbuffer space for PM4 commands that write to memory.

Change-Id: I5d1d4cfbc70bc73ddee9ee752de24aae154a04dc
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2017-04-05 03:07:24 -07:00
Linux Build Service Account
7ee506fbe9 Merge "msm: kgsl: Remove incorrect check to cap AB vote to IB vote" 2017-04-04 20:07:28 -07:00
Deepak Kumar
c1de946ab2 msm: kgsl: Disable memory retention for core clock before entering SLUMBER
Memory retention is needed only for NAP state but not for SLUMBER state.
Disables memory retention for core clock before entering SLUMBER to save
power.

Change-Id: I64a5ecec6fc90d662da8d9d793860e56b0c6473f
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-04-04 14:09:52 +05:30
Deepak Kumar
b3e7113283 msm: kgsl: Remove incorrect check to cap AB vote to IB vote
For dual channel DDR, IB vote from client is half of actual
IB vote as IB vote calculation on client side doesn't consider
number of DDR channels. ICB driver takes care of multiplying
the client IB vote with number of DDR channels.

This change removes the AB capping check to avoid the scenarios
where AB vote > actual IB vote/2 but gets capped to actual
IB vote/2 because client side IB vote is half of actual IB vote.

Removal of this check will not impact single channel DDR targets
because of the way AB value is calculated. In case of honest BW
voting, AB will always be less than IB as AB calculation doesn't
consider RAM wait value. In case of unhonest vote, AB value is
always caluclated as some percentage of IB vote and this percentage
value is always <=100%.

Change-Id: Icdca6118f6605665979a1bead35ba3ef631d50e8
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-03-30 13:06:40 +05:30
Linux Build Service Account
8a259eb1ca Merge "msm: kgsl: Map GPU QTimer through GPU IOMMU" 2017-03-10 02:07:11 -08:00
Hareesh Gundu
6439032d0b msm: kgsl: Improve GPU soft fault detection
Following changes been made to improve soft fault detection,
which will fix un clocked register access in dispatcher_do_fault()
and incorrect declaration of GPU soft fault.
i) Stop fault timer before entering to NAP state
ii) Don’t start fault timer if the dispatcher inflight count is zero
iii) Add ringbuffer empty check in _isidle()
iv)  Add device state check in dispatcher_do_fault()

CRs-Fixed: 2012731
Change-Id: I5ce498029f389eeeb428b4ac7fb07afd84d5764c
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-03-09 13:07:07 +05:30
Rajesh Kemisetti
236fb5f0cb msm: kgsl: Change GPU RAC hardware clockgating on SDM660
Disable GPU LRZ clock gating for A512 to avoid HW quirk.

Change-Id: I168d678ab2e08c6e2f16a63d6bc71e7f383f8f1b
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-03-01 17:25:17 +05:30
Linux Build Service Account
eee829e625 Merge "msm: kgsl: Add GPU Cx ipeak client support on SDM660" 2017-02-28 17:03:50 -08:00
Linux Build Service Account
f5ba6d1e77 Merge "msm: kgsl: Clean up device debugfs files on removal" 2017-02-28 17:03:47 -08:00
Jonathan Wicks
2e560ec3d0 msm: kgsl: Map GPU QTimer through GPU IOMMU
Map the GPU QTimer area as a global into the GPU
IOMMU so that the GPU can access the QTimer.

Change-Id: If50bd36681123adde7e3a37644c41316f101154c
Signed-off-by: Jonathan Wicks <jwicks@codeaurora.org>
2017-02-28 11:12:33 -07:00
Linux Build Service Account
993b116d8d Merge "msm: kgsl: Add efuse read capabilities for A508 GPU" 2017-02-27 23:37:28 -08:00
Linux Build Service Account
f32c41e6a5 Merge "msm: kgsl: Use init_utsname() instead of ustname() for kernel build info." 2017-02-27 15:16:32 -08:00
Rajesh Kemisetti
8aa55e6579 msm: kgsl: Add GPU Cx ipeak client support on SDM660
To handle Cx peak current limit on SDM660, GPU needs
to call Cx ipeak driver APIs when it switches between
threshold points.

Cx ipeak driver will throttle cDSP frequency if all
the clients are running at their respective threshold
frequencies to limit Cx peak current.

Change-Id: I5ffcf1a42523072d2b8b7bc0022eb3cc067acbb9
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-02-27 18:00:12 +05:30
Deepak Kumar
c2fb7b3e04 msm: kgsl: Add efuse read capabilities for A508 GPU
A508 GPU has multiple frequency plan, for loading a
specific frequency plan add speed bin read capability
for A508 GPU.

Change-Id: I32a030bec438edc74f1e78bfb2ea86e7a3f60dab
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-02-26 21:50:32 -08:00
Linux Build Service Account
690cee7544 Merge "msm: kgsl: Don't wait for context that has not submitted" 2017-02-26 04:44:58 -08:00
Deepak Kumar
e5f964228d msm: kgsl: Use init_utsname() instead of ustname() for kernel build info.
Using per uts namespace utsname() for kernel build information section
in snapshot dump was causing a kernel panic because it is accessing a
NULL nsproxy pointer. nsproxy was null because corresponding user task
got SIGKILL which triggered call to free_nsproxy. The patch fixes the
issue by using the global init_utsname() which is always valid.

Change-Id: I13b1b07557794a7fcedf0c9e6acfd3406fbb8989
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-02-24 12:06:16 +05:30
Linux Build Service Account
2647f6c8b6 Merge "msm: kgsl: Log mmap_base value on _get_svm_area failure" 2017-02-21 05:33:33 -08:00
Hareesh Gundu
599407841d msm: kgsl: Don't wait for context that has not submitted
A context may be detached without submitting any commands
to GPU ringbuffer. This may cause us to wait on a timestamp
that will never be retired. So return immediately from
adreno_drawctxt_wait_rb() if context has not submitted any
commands to GPU ringbuffer.

Change-Id: If8b3f8df92ec9b54a1a83d2f6704d4d15eb1b979
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-02-21 16:02:28 +05:30
Hareesh Gundu
9c6461b067 msm: kgsl: Log mmap_base value on _get_svm_area failure
_get_svm_area can fail to find available address range
from mmap_base which was adjusted by random factor.
By logging mmap_base value will help to identify
any issue with the VA randomization.

Change-Id: Ibdc3fac975adde02c30aa253b53d6533ee558161
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-02-20 11:17:32 +05:30
Lynus Vaz
7a842a7b47 msm: kgsl: Clean up device debugfs files on removal
Remove the kgsl device-specific debugfs files in the device removal
sequence, and also if probe fails.

Change-Id: I4d5e9ec33a887f29c14bac513c4faf75266e990b
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2017-02-16 17:35:48 +05:30
Hareesh Gundu
5967ecda8f msm: kgsl: Fix false timeout gpu faults
Sometimes ringbuffer timer is not getting updated due to
race with the preemption. This can cause  dispatcher to
detect false timeout gpu faults. Remove preempt state
check in adreno_dispatch_process_drawqueue(), which will
allow to update ringbuffer timeout value irrespective of
the preemption state.

If the preemption completes successfully, preemption logic
updates timer for new_rb. We don’t need to care if it is
not updated for prev_rb. If preemption in-progress timer
will be updated for cur_rb in adreno_dispatch_process_drawqueue().
In both cases we are taking care to update ringbuffer timer.
Hence we don’t need to check preemption state.

CRs-Fixed: 1095344
Change-Id: I0e0ec655e2262c4f499748ce35a8d710ed15b5e3
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-02-15 19:19:27 +05:30
Linux Build Service Account
aa5e93343f Merge "msm: kgsl: Fix Integer overflow in sparse_bind related functions" 2017-02-10 15:47:09 -08:00
Rajesh Kemisetti
e12ca1eb7b msm: kgsl: Add support for A508 GPU on SDM630
Add new GPU ID: A508 and corresponding VBIF and initial
settings on SDM630.

Change-Id: If1cd782beb50098a69a9d05acb083ef4b0465766
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-02-08 21:53:15 +05:30
Linux Build Service Account
c462c1320a Merge "msm: kgsl: Add NULL check for kgsl_midframe before accessing it" 2017-02-06 13:21:37 -08:00
Rajesh Kemisetti
9ea3e6ff51 msm: kgsl: Add NULL check for kgsl_midframe before accessing it
in kgsl_pwrscale_init(), add missing NULL check for kgsl_midframe
to avoid further accessing, in case if memory is not available.

Change-Id: If6a4e59d4675fe67aefc63d7f8251f4d28ddeec5
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-02-06 16:31:19 +05:30
Rajesh Kemisetti
ac6d567b7a msm: kgsl: Do required clock settings for SDM660 GPU
Enable retention of memory and periphery logics for
GPU core clock. If the setting is not done then GPU
might get stale data while switching from NAP to
ACTIVE and which leads to page faults or hangs.

Clock settings need to be handled by client drivers only
and hence do it in KGSL driver.

Change-Id: Iea3fd720e2a0eda9f6ee719177a8898bc2bd75e4
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-02-06 15:25:01 +05:30
Sudeep Yedalapure
f348e5caf2 msm: kgsl: Fix Integer overflow in sparse_bind related functions
There could be possibility of integer overflow on adding
offset with size and result into a value smaller than
memdesc size.

CRs-Fixed: 1109776
Change-Id: I3746f34c9fb8ada28a9b6ed438ca8c296b69e752
Signed-off-by: Sudeep Yedalapure <sudeepy@codeaurora.org>
Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org>
2017-02-03 18:29:13 +05:30
Linux Build Service Account
c0ce43f344 Merge "msm: kgsl: Add efuse read capabilities for A512 GPU" 2017-02-02 04:00:05 -08:00
Linux Build Service Account
154a46eb53 Merge "msm: kgsl: Relocate the pagefault tracepoint" 2017-02-02 04:00:02 -08:00
Linux Build Service Account
664d80e845 Merge "msm: kgsl: refcount irq to avoid racing against idle check" 2017-02-01 19:23:48 -08:00
Deepak Kumar
8945fe155e msm: kgsl: Add efuse read capabilities for A512 GPU
A512 GPU has multiple frequency plan, for loading a
specific frequency plan add speed bin read capability
for A512 GPU.

Change-Id: Iff207c31bc50748a6caaa405608252b78133fd83
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-02-01 14:18:16 +05:30
Linux Build Service Account
f9500f4705 Merge "msm: kgsl: Fix incomplete IB2 dump in the snapshot" 2017-01-30 07:05:35 -08:00
Hareesh Gundu
c557d3b6b0 msm: kgsl: Fix incomplete IB2 dump in the snapshot
If there is IB2 address overlap with IB object list,
driver is dumping pending dwords size of active IB2
data into snapshot. Fix this by updating IB2 size
while active IB1 parsing instead later point.

Change-Id: Ibb12a876ebf73846424232ef28e00d3dc9f9be59
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-01-30 03:29:07 -08:00