Commit graph

444 commits

Author SHA1 Message Date
Sunil Khatri
4cbaccd42f msm: kgsl: Relocate the pagefault tracepoint
During a pagefault we print trace with the fault
information which gets delayed by unacceptable
time. It happens due to the the code that searches the
faulty address in the recently freed addresses for a matching
entry.

Moving it to new position wont have any impact on debugging
instead trace is dumped without any delay.

Change-Id: I11487798b60742096e06605cf3046b4cfc8cc057
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
2017-01-29 21:32:19 -08:00
Rajesh Kemisetti
832c38f730 msm: kgsl: Check GPMU presence before accessing power counters
Some targets do not have GPMU block in GPU and register read
or write into those registers is not valid.

To prevent this, check GPMU presence and then proceed.

Change-Id: I0992125af8cda4b8235aedb64f6ef8868ae95f20
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-27 08:44:35 +05:30
Deepak Kumar
3a798eea0b msm: kgsl: refcount irq to avoid racing against idle check
Current irq handler clears the pending interrupt bits in interrupt
status register before serving the interrupts. This leads to a race
condition with the idle check which checks the interrupt status
register to determine whether any interrupt is pending or not. As
the interrupt status register is already cleared, idle check goes
ahead and switch off the GPU clocks even when irq is yet to be served
causing NOC errors.

This change refcounts each irq handler call and uses this reference
count to determine if any irq is still pending or not along with
interrupt status register to avoid this race condition.

Change-Id: I030d52c52055f836ea4c7519ce2d8db94a2a09a0
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2017-01-25 01:36:39 -08:00
Linux Build Service Account
5b5a6be59f Merge "msm: kgsl: Dump preemption record only if it is enabled" 2017-01-23 04:04:06 -08:00
Linux Build Service Account
5bf6056e40 Merge "msm: kgsl: Try lower order mempools incase of mismatch" 2017-01-23 04:04:05 -08:00
Linux Build Service Account
ae4c40372b Merge "msm: kgsl: Clean up power-related members if probe fails" 2017-01-20 13:48:28 -08:00
Rajesh Kemisetti
1664a92367 msm: kgsl: Try lower order mempools incase of mismatch
Try to allocate pages from lower order mempools incase
if requested memory size order does not match with the
available mempools.

Change-Id: Idbe4dae3b8bb2a3165199b6959ad4fbf36559964
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-20 18:00:38 +05:30
Rajesh Kemisetti
3619a61f04 msm: kgsl: Dump preemption record only if it is enabled
During GPU snapshot dump path, a5xx_snapshot() tries to
capture preemption record without really checking on the
availability of preemption feature.

Add a check for preemption feature and then proceed.

Change-Id: I6ee23a1d8006ba18a25fb341bb88d8944ff054b7
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-20 17:40:31 +05:30
Rajesh Kemisetti
761d7536e1 msm: kgsl: Enable HW clockgating and preemption for SDM660 GPU
Enable HW clockgating and preemption for A512 GPU to save power
and for better context switching.

Also update proper size for CP MERCIU size.

Change-Id: If3e5101c2695b1f06d650d320bc8d3bebac29f6f
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-16 21:55:02 +05:30
Lynus Vaz
6c68a94c53 msm: kgsl: Clean up power-related members if probe fails
If power-related initialization fails during device probe, clean up
the kgsl structure members. This is useful if the device probe is
retried later.

Change-Id: I75aeb199da685bb5055ba5a8a0bb552656951674
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2017-01-10 19:29:19 +05:30
Linux Build Service Account
a999a488bf Merge "msm: kgsl: Remove BUG_ON from the map global" 2017-01-09 12:42:34 -08:00
Rajesh Kemisetti
bf63100b11 msm: kgsl: Add Zap shader name for A512 GPU on SDM660
This is needed to clear out the internal memories of
GPU while moving from secure to unsecure mode.

Change-Id: I9ef4848212246a2ed45395ef97c7f755784cb635
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-05 00:16:44 +05:30
Hareesh Gundu
8b20da6ffc msm: kgsl: Remove BUG_ON from the map global
Return error instead of BUG_ON on map global failure.
This will avoid crashing the entire system.

CRs-Fixed: 1106621
Change-Id: I693dc196bb7a2e01f6a033f5fbbf7b454108108d
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-01-02 22:52:54 +05:30
Rajesh Kemisetti
5cb2ca205f msm: kgsl: Enable Content Protection for A512 GPU
Enable CPZ feature for A512 GPU on sdm660.
This is required to process secure conent by GPU.

Change-Id: Iaaedde4e56e331379be0b44b23527df0d5807f55
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2017-01-02 16:12:06 +05:30
Prakash Kamliya
a088541fb5 msm: kgsl: Do a midframe sampling of power stats if enabled
Currently we sample power stats at the expiry of
cmdbatch. In cases where cmdbatch takes a long time
to finish the job, it delays power stats sampling,
in effect it delays DCVS decision for changing the
frequency. Do a midframe power stats sampling and
feed it to DCVS if it is enabled.

Change-Id: I547d792b38649aa1d60525b0dc335791b37989fd
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
2016-12-22 20:55:12 +05:30
Linux Build Service Account
86fb073705 Merge "msm: kgsl: Get pages from the system incase mempool is not configured" 2016-12-20 23:45:15 -08:00
Linux Build Service Account
4eadfaf5f8 Merge "msm: kgsl: Add Bind objects to dispatcher draw queue" 2016-12-18 14:47:58 -08:00
Hareesh Gundu
6b8b2d1a05 msm: kgsl: Get pages from the system incase mempool is not configured
Allow driver to get pages from the system incase mempool configuration
is not defined from the device tree. This will fix kgsl driver probe
failure for without gpu mempool configuration devices.

Change-Id: I3142a5d2e13ed40f643c91594fd868c37620ce54
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-12-14 09:01:22 -08:00
Linux Build Service Account
cfd61208ea Merge "ARM: dts: msm: Add GPU coresight properties for msm8998" 2016-12-09 19:59:21 -08:00
Tarun Karra
c71cda2d10 msm: kgsl: Add Bind objects to dispatcher draw queue
kgsl_ioctl_gpu_sparse_command() is added to for user to
specify list of binds/unbinds for a memory entry
and syncpoints they depend on. If user specifies both
create a sync object for syncpoints and bind object for
binds/unbinds and add them to dispatcher draw queue. Sync
object should be inserted before the bind object in the
draw queue. Once the bind object reaches the head of
draw queue the corresponding binds/unbinds are performed.
kgsl_ioctl_gpu_sparse_command() only accepts commands from
context created with flag KGSL_CONTEXT_SPARSE, commands
from all other context types will return an error.

Change-Id: Ib0a2361f854ae01d0d8090cdd48cfa96308daf93
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2016-12-07 10:33:16 -08:00
Lokesh Batra
256de04b8d msm: kgsl: Add trace ID support for graphics coresight
Add the support for trace ID for coresight. This ID is
will be defined in the respective device tree file.

Change-Id: I78ba05ed05b54fdc0f4d4f55c468f90f39c821f1
Signed-off-by: Lokesh Batra <lbatra@codeaurora.org>
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-12-07 08:57:09 -07:00
Rajesh Kemisetti
58b88b8933 msm: kgsl: Dump VBIF and few GPU registers before crash dumper
Triggering Crash Dumper might actually change the values of
few GPU registers including VBIF. Hence dump those registers
ahead and skip them from the list which goes to crash dumper.

Change-Id: I37a53983a65bd8abfefa780053819de71df7f24f
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-12-05 00:42:46 -08:00
Rajesh Kemisetti
edccdc6e41 msm: kgsl: Add support to disable CP Crash Dumper
By default A5xx GPUs use CP crash dumper to get GPU
snapshot in case of any fault.

At times it is required to disable crash dumper
in case of any abnormalities, add support to do so.

Change-Id: Iea6497778bcd711e769f0e509103bd3bd0fd8574
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-12-05 00:42:30 -08:00
Linux Build Service Account
337e994ce3 Merge "msm: kgsl: Reserve a context ID slot but don't populate immediately" 2016-12-02 09:02:28 -08:00
Rajesh Kemisetti
8a706cbc3d msm: kgsl: Check MMU type for memory and pagetable operations
Check MMU type for below operations to make NOMMU functional:

- adreno_iommu_set_pt_ctx() tries to set pagetable during context
  switch without really checking on type of MMU.
- skip tracking of gpuaddr in case of NoMMU during
  kgsl_mem_entry_track_gpuaddr().
- In case of nommu the function kgsl_allocate_global() should
  always allocate contiguous memory from CMA.

Change-Id: I8cb59e1475376167c7a8a60c54df0939597f5083
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-12-01 23:25:18 -08:00
Harshdeep Dhatt
c0d96c8a76 msm: kgsl: Update ringbuffer timer when preemption completes
Ringbuffer timer should always be reset whenever we finish
preempting to that ringbuffer. Currently, there is a case where
wptr in the hardware and the kgsl are identical and thus
the timer isn't reset. Reset the timer regardless if they are
identical or not.
There is one special case when we shouldn't reset the timer.
This happens when we try to figure out next ringbuffer to preempt
but the next ringbuffer is the same one as current. In that case,
if nothing new got submitted to this ringbuffer, then don't reset
the timer.

Change-Id: I6b5aea46f1769021b39ba6e135bef780719a92e7
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-11-29 09:33:09 -07:00
Jordan Crouse
eed663a48b msm: kgsl: Reserve a context ID slot but don't populate immediately
When creating a context allocate an ID but don't populate the slot
with the context pointer until we are done setup up the rest of the
process. This avoids a race if somebody tries to free the same
identifier before the create operation is complete.

Change-Id: Ic0dedbadca5b4cc4ce567afad48a33078b549439
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Dumpeti Sathish Kumar <sathyanov14@codeaurora.org>
2016-11-29 12:32:52 +05:30
Linux Build Service Account
2eeb169184 Merge "Revert "msm: kgsl: Enable limits management on A540v2"" 2016-11-25 17:46:57 -08:00
Oleg Perelet
5efab93887 Revert "msm: kgsl: Enable limits management on A540v2"
This reverts commit 691ddba4ee ("msm: kgsl: Enable limits
management on A540v2"). The GPU does not hit the voltage
limits at 670mhz so there isn't any need to enable
limit management.

CRs-Fixed: 1056661
Change-Id: If225dc4ec2c2e3eb8996f49f4fdf6acd31a50680
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-22 13:18:54 -08:00
Rajesh Kemisetti
eb0234d008 msm: kgsl: Add support for A512 GPU
Add new GPU ID, corresponding VBIF and
initial settings for A512.

Change-Id: Id30415ce0ea73012125ced35771b9aae9f941c22
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-11-22 03:50:16 -08:00
Linux Build Service Account
2f088241d7 Merge "msm: kgsl: Make sure USE_CPU_MAP + MAP_USER_MEM work together" 2016-11-18 01:55:04 -08:00
Linux Build Service Account
efcb7b1d55 Merge "msm: kgsl: Fix pagetable member of struct kgsl_memdesc" 2016-11-18 01:55:03 -08:00
Linux Build Service Account
a58828453e Merge "msm: kgsl: preserve ISENSE registers across GPU power collapse" 2016-11-17 10:08:36 -08:00
Linux Build Service Account
ff25044ed2 Merge "msm: kgsl: Fix pt NULL pointer dereference" 2016-11-15 04:07:29 -08:00
Linux Build Service Account
5587de21d7 Merge "msm: kgsl: Fix overflow in sharedmem cache range operation function" 2016-11-14 21:54:05 -08:00
Oleg Perelet
eeb34111fa msm: kgsl: preserve ISENSE registers across GPU power collapse
After wakeup from power collapse restore ISENSE registers from
internal buffer.

CRs-Fixed: 1075694
Change-Id: I9cf2f94892bdeb83fab0068902419b1603520364
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-14 10:09:42 -08:00
sathish
293989e540 msm: kgsl: Fix pt NULL pointer dereference
Add a NULL check for pt pointer variable in
a4xx_submit_preempt_token(), to avoid NULL
pointer dereference.

CRs-Fixed: 1083045
Change-Id: I6f8abe55f3d99d2ff46e4bb2a8cd11a067be7508
Signed-off-by: Dumpeti Sathish Kumar <sathyanov14@codeaurora.org>
2016-11-14 03:01:06 -08:00
Linux Build Service Account
48247bb879 Merge "msm: kgsl: add egl_surface/egl_image usage count in debugfs" 2016-11-10 22:49:43 -08:00
Linux Build Service Account
b584568fe7 Merge "msm: kgsl: Change device-type memory mapping to Normal-NC" 2016-11-10 22:49:22 -08:00
Linux Build Service Account
c819db3dd1 Merge "msm: kgsl: use seq_file for mem_entry debugfs" 2016-11-10 15:14:39 -08:00
Linux Build Service Account
d654f842d9 Merge "msm: kgsl: Add qcom,gpu-quirk-disable-lmloadkill" 2016-11-10 15:14:21 -08:00
Linux Build Service Account
31ce266c3f Merge "msm: kgsl: Enable retention for gpu core clock" 2016-11-09 16:25:01 -08:00
Linux Build Service Account
67dc1ae411 Merge "msm: kgsl: Ignore EAGAIN when programming perfcounter" 2016-11-09 16:24:58 -08:00
Linux Build Service Account
2d01b7daf1 Merge "msm: kgsl: Increase fault detection threshold value" 2016-11-09 16:24:57 -08:00
Linux Build Service Account
cc699c3f57 Merge "msm: kgsl: Declare iomem addresses as void" 2016-11-09 16:24:54 -08:00
Linux Build Service Account
04fa73f4a4 Merge "msm: kgsl: Correct the merciu size for a540" 2016-11-09 16:24:53 -08:00
Santhosh Punugu
4dbfc38081 msm: kgsl: add egl_surface/egl_image usage count in debugfs
Add more information to the debugfs kgsl/proc/<pid>/mem which
will allow memtrack to correctly assign allocated ion buffer
memory to a process. The additional columns show the number of
kgsl_mem_entries which have a usage of egl_image (or) egl_surface.

When attaching a dma_buf to kgsl, use the dma_buf_attachment's
(void*)priv to point back to the kgsl_mem_entry. This makes it
possible to iterate through all attachments on a dma_buf and
gather statistics from each kgsl_mem_entry associated with the
dma_buf.

CRs-Fixed: 1073673
Change-Id: I1ef3bd0da3f74fa41074021699b2226c48bde9c3
Signed-off-by: Santhosh Punugu <spunug@codeaurora.org>
2016-11-09 21:37:54 +05:30
Harshdeep Dhatt
00e0494320 msm: kgsl: Add qcom,gpu-quirk-disable-lmloadkill
Add a quirk to set LMLOADKILLDIS bit in A5XX_VPC_DBG_ECO_CNTL
and clear LMLOADKILLDIS bit in A5XX_HLSQ_DBG_ECO_CNTL registers.
This is done to avoid a VPC corner case with local memory(LM)
which leads to corrupt internal state on A540 and its derivatives.

CRs-Fixed: 1036444
Change-Id: I31008433f19924bb35560d3e35fe0665e73751d5
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-11-08 15:15:25 -07:00
Linux Build Service Account
135b2c6882 Merge "msm: kgsl: Add speed bin read capabilities for A306a GPU" 2016-11-08 11:19:04 -08:00
Linux Build Service Account
3b37b07413 Merge "msm: kgsl: Enable limits management on A540v2" 2016-11-08 11:18:48 -08:00