Commit graph

444 commits

Author SHA1 Message Date
Linux Build Service Account
93529fd59f Merge "msm: kgsl: Add MEMDESC_MAPPED back to for legacy mappings" 2016-11-08 11:18:22 -08:00
Hareesh Gundu
f84d6e3c6c msm: kgsl: Add speed bin read capabilities for A306a GPU
A306a GPU have the two different frequency plans. The frequency
plan needs to be loaded dynamically based on the speed bin
information. Add support for A306a gpu to read the speed bin
information and choose frequency plan dynamically.

Change-Id: Iba53d4381d61f23ce1195a147493b0d292cd3723
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-11-07 22:07:36 -08:00
Harshdeep Dhatt
c2682f2a06 msm: kgsl: Increase fault detection threshold value
The current value is leading to spurious fault interrupts
from the GPU. Increase the threshold 4 times so that hardware
fault detection won't be triggered as quickly.

CRs-Fixed: 1073836
Change-Id: Ie780cec4de818c94a407461580f9d80de7e4ec84
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-11-07 16:17:04 -07:00
Harshdeep Dhatt
8a7ca4ded7 msm: kgsl: Ignore EAGAIN when programming perfcounter
When programming perfcounter via gpu commands, we may encounter
-EAGAIN because of cancelling rb events either due to soft reset
or when powering down the device. Ignore this error because we
have already set up the perfcounter in software and it will be
programmed in hardware by adreno_perfcounter_restore when gpu
comes back up.

CRs-Fixed: 1024199
Change-Id: I5dc3561d15fa50ac58646f96559cfd262020dda9
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-11-07 12:49:49 -07:00
Hareesh Gundu
0f6ff69a01 msm: kgsl: Allow mempools to configure from the device tree
Add driver support to configure mempools from the device tree.
This will enable mempools to configure per device specific and
reduces the high kgsl memory usage based on configuration.

CRs-Fixed: 1064046
Change-Id: I0a7e36b7e1fef9d42a4c0fe33d69a4debf15af2f
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-11-07 13:04:21 +05:30
Hareesh Gundu
71963395a5 msm: kgsl: Fix potential device NULL pointer dereferences
Ensure that device pointer isn't NULL before using it in
kgsl_snapshot_save_frozen_objs().

Change-Id: I676dfa5567b1d09427e3e7691045fabc71b53d43
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-11-04 21:46:22 -07:00
Oleg Perelet
691ddba4ee msm: kgsl: Enable limits management on A540v2
Add limits management to A540v2 GPU feature set.

CRs-Fixed: 1075694
Change-Id: Ib2680fb97fed1d297c9a96c95edb08dea620495b
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-04 09:53:49 -07:00
Sudeep Yedalapure
b63c4eb6c7 msm: kgsl: Fix overflow in sharedmem cache range operation function
There could be possibility of integer overflow on adding
size with maximum offset bytes and result in a value smaller
than maximum memdesc size.

CRs-Fixed: 1082914
Change-Id: Ie66b3a8ca2ca418a4a52f65987266b8d580c121f
Signed-off-by: Sudeep Yedalapure <sudeepy@codeaurora.org>
2016-11-04 22:16:13 +05:30
Jordan Crouse
b2949fa968 msm: kgsl: Make sure USE_CPU_MAP + MAP_USER_MEM work together
If one is mapping anonyomous user memory in the GPU with SVM enabled
we want to try to accommodate that request if possible. The memory
address was being set up correctly in the memory descriptor but
the GPU address was getting tripped up when getting mapped in the
process.  This is because the memory should be treated like SVM
memory so it needs to be registered in the memory tree and the
rest of the path needs to accept the address.

Change-Id: Ic0dedbad661143977a226d50263c26b5af579ce3
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-11-03 12:58:37 -06:00
Jordan Crouse
e141e85de7 msm: kgsl: Fix pagetable member of struct kgsl_memdesc
memdesc->pagetable is supposed to help ensure that memory gets
unmapped before it is freed, but the pagetable member is being
populated at create time not when the buffer gets mapped. This
forces the developer to ensure that the same pagetable is
used for both the create and map step. Instead, assign the
pagetable member when it is first used (to get a GPU address)
and put it away when the GPU address is released.

Change-Id: Ic0dedbad372fd9029b932dd99633a650049751ed
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2016-11-03 12:06:14 -06:00
Oleg Perelet
0f6fb12d6d msm: kgsl: Enable retention for gpu core clock
Enable memory retention for gpucc_gfx3d.

CRs-Fixed: 1083111
Change-Id: Ic695e5320d6acbe8d16e23851f752a7fa673f0da
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-02 13:46:17 -07:00
Linux Build Service Account
3b18362c95 Merge "msm: kgsl: Clear the interrupt immediately" 2016-10-31 13:04:00 -07:00
Santhosh Punugu
89462e2343 msm: kgsl: use seq_file for mem_entry debugfs
A process may have many kgsl mem entries in use. Outputing all of them
as a single debugfs seq_file record takes twice as long as necessary
because seq_file must retry higher order page allocations for the output
buffer until it is large enough to hold all mem entries.

Additionally, process_mem_print() currently holds the spinlock
private->mem_lock during this process. This is too much time to
disable interrupts, and prevents locking mutex in print_mem_entry.

Change the kgsl_mem_entry debugfs functions to output one entry at a
time. Then the seq_file only need to kmalloc one page regardless of
the number of kgsl_mem_entries.

CRs-Fixed: 1073673
Change-Id: I2907495b65e62d95a892741aed008048bb86aced
Signed-off-by: Santhosh Punugu <spunug@codeaurora.org>
2016-10-28 10:28:10 +05:30
Harshdeep Dhatt
e355a75ded msm: kgsl: Correct the merciu size for a540
During snapshot, dump 1024 bytes instead of 64 on a540.

Change-Id: I34ed23bdbbaedc73cae777a7df8a7c04efb3c0a8
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-20 16:13:08 -06:00
Harshdeep Dhatt
3cbe226c4d msm: kgsl: Declare iomem addresses as void
Readl/writel macros expect void pointers so declare the
addresses as void and not unsigned int.

Change-Id: I67cf15fa918832ebab56cb999265d02880682c5e
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-20 11:25:07 -06:00
Jonathan Wicks
16a93fae72 msm: kgsl: Add sysfs control for pwrscale
Add a sysfs entry to enable control of notifications
from pwrscale to devfreq.

Change-Id: Ife0a31e96975239bf4fefd59ac6266568c4db1a5
Signed-off-by: Jonathan Wicks <jwicks@codeaurora.org>
2016-10-19 09:43:53 -06:00
Harshdeep Dhatt
3dd9c42266 msm: kgsl: Clear the interrupt immediately
Sometimes an interrupt from GPU is ignored while we
are still executing the previous interrupt. In order
to service any interrupt that was fired while executing
the interrupt handler, clear the interrupt register
immediately.
Also, clear the ADRENO_INT_RBBM_AHB_ERROR bit not before
but after it's serviced in its respective handler. This
will avoid firing the main interrupt handler a second
time.

CRs-Fixed: 1072781
Change-Id: Ie6b5a511f5b3077adae7d464de437f2aa893b0c9
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-14 16:41:30 -06:00
Harshdeep Dhatt
fc078e8dee msm: kgsl: Remove DPM registers from snapshot
Remove the DPM registers from a5xx snapshot as they are
not needed for A540.

CRs-Fixed: 1074810
Change-Id: Ic4259821e1ee74e49068545208587ad66ac29679
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-13 14:00:28 -06:00
Carter Cooper
d1d60560c6 msm: kgsl: Add MEMDESC_MAPPED back to for legacy mappings
We still need to keep this internal flag for non-sparse
mappings. Add back so we don't map multiple times if
the range is already mapped.

Change-Id: Ifcf6073b5b778bcb535d26bc33990254ff48c406
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2016-10-13 10:08:42 -06:00
Linux Build Service Account
9a1986fea9 Merge "msm: kgsl: restructure GPU power initialization" 2016-10-11 22:32:46 -07:00
Linux Build Service Account
3fe3b20c5e Merge "msm: kgsl: Remove obsolete IOMMU domain attribute" 2016-10-11 01:16:53 -07:00
Linux Build Service Account
6a9cd0c699 Merge "msm: kgsl: Modify dispatcher to accept generic objects" 2016-10-10 18:28:35 -07:00
Linux Build Service Account
6ce9b4fee4 Merge "msm: kgsl: Remove GPU BCL and LMH support" 2016-10-10 18:28:19 -07:00
George Shen
19baa2bf45 msm: kgsl: restructure GPU power initialization
Move target specific initialization and setup into target
specific init functions. The change is required to port the GPU
driver to support future generation GPUs.

CRs-Fixed: 1053516
Change-Id: I808e247669fab61a6a64131858fe2f9e19754242
Signed-off-by: George Shen <sqiao@codeaurora.org>
2016-10-10 13:42:33 -07:00
Linux Build Service Account
7685c7eae7 Merge "msm: kgsl: Get GPU snapshot if wait for global timestamp timeout" 2016-10-07 22:15:42 -07:00
Linux Build Service Account
4eff38d585 Merge "msm: kgsl: Disable UCHE global filter" 2016-10-07 22:15:41 -07:00
Oleg Perelet
7ef8974606 msm: kgsl: Remove GPU BCL and LMH support
a540 hardware does not support BCL and LMH after all.

CRs-Fixed: 1075694
Change-Id: I09808145d20ded63b5043cae6510429560cb599e
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-10-07 14:45:26 -07:00
Hareesh Gundu
f5c29ace29 msm: kgsl: Get GPU snapshot if wait for global timestamp timeout
If the wait for global fails due to timeout then nothing after this
point is likely to work very well. Get GPU snapshot in addition to
BUG_ON(), to analyze the GPU fault.

CRs-Fixed: 1053780
Change-Id: I29930120a72a08533c859002f646af93e67c754f
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-10-06 23:18:46 -07:00
Linux Build Service Account
32993a9f74 Merge "msm: kgsl: Disable workaround on A540v2" 2016-10-06 19:45:45 -07:00
Linux Build Service Account
7108049392 Merge "msm: kgsl: Add A540v2 to adreno gpulist" 2016-10-06 19:45:44 -07:00
Linux Build Service Account
bc52b72052 Merge "msm: kgsl: Add and link gpu sysfs nodes" 2016-10-06 19:45:40 -07:00
Tarun Karra
1f2662704f msm: kgsl: Modify dispatcher to accept generic objects
Currently dispatcher accepts kgsl_cmdbatch object. This object
is a superset of all the types of objects dispatcher accepts.
Split kgsl_cmdbatch object to SYNC and IB/MARKER objects and
structure the code to make it easier for new type of objects
to be added to the dispatcher queue.

CRs-Fixed: 1054354
Change-Id: I2d482d1081ce6fdb7925243c88ce00ea6b864efe
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2016-10-06 15:54:39 -07:00
Linux Build Service Account
b62fac3210 Merge "msm: kgsl: Add facility to BUG_ON for a gpu fault" 2016-10-06 12:26:08 -07:00
Sunil Khatri
050ce1a558 msm: kgsl: Disable UCHE global filter
Disable UCHE global filter for invalidate/flush,
SP will handle the invalidate/flush for each SP
independently on A5XX GPUs.

CRs-Fixed: 1073853
Change-Id: I3daf3722cfbdfff080161f9a0248fd8096550328
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
2016-10-05 23:43:18 -07:00
Tarun Karra
2811b6d610 msm: kgsl: Rename cmdbatch to drawobj
Rename all cmdbatch to drawobj. This forms a platform
for future changes where cmdbatch is split into different
types of drawobjs.

CRs-Fixed: 1054353
Change-Id: Ib84bee679e859db34e0d1f8a0ac70319eabddf53
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2016-10-05 16:57:21 -07:00
Harshdeep Dhatt
a694afed7b msm: kgsl: Disable workaround on A540v2
Currently we have a workaround for A540 which inserts
WFI after every direct-render 3D mode and every 2D
mode draw. Add a check to enable this only on A540v1
as this workaround is not required for A540v2.

CRs-Fixed: 1072767
Change-Id: I679bbf68ee3dcc1aee30d56a646a42b6ff09fb6f
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-05 11:38:37 -06:00
Harshdeep Dhatt
eac51723e6 msm: kgsl: Add A540v2 to adreno gpulist
Also add adreno_is_a540v2 function

CRs-Fixed: 1072767
Change-Id: Ibf1d5058a1273e1f558afa3871e27c9d124956a5
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-05 11:38:21 -06:00
Harshdeep Dhatt
1cf6397fff msm: kgsl: Add and link gpu sysfs nodes
Add new sysfs nodes which satisfy a generic format requested
by customer. Also add a new node to track GPU temperature.
Create links to these nodes at a generic location:

/sys/kernel/gpu/

CRs-Fixed: 1064728
Change-Id: I414a07ff4f9ee14b8f882d15644b06a73d5fcf76
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-10-05 11:05:07 -06:00
Deepak Kumar
77f0fde9a3 msm: kgsl: Reschedule idle work in case transition to idle state fails
Reschedule the idle work in case transition to idle state is rejected
because the GPU is busy. This change avoids the condition where
transition to NAP state gets rejected due to a pending IRQ which is
currently getting served by IRQ handler because of which GPU remains
in active state even when GPU is idle.

Change-Id: I472a30b6a0e83cdd6957ed12eaa39d0c7731fcb5
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
2016-10-05 13:37:52 +05:30
Hareesh Gundu
641acaf018 msm: kgsl: Add facility to BUG_ON for a gpu fault
Few gpu faults need system level information like voltages,
interface clock etc. This information can't be extracted
through the snapshot dump. Add a facility to force panic
on gpu fault, which will help to extract additional
information from the ramdumps.

To trigger BUG_ON for a gpu fault:
echo 1  > /sys/class/kgsl/kgsl-3d0/snapshot/force_panic

Change-Id: I020b5518fcaedd4fecc572b580a989bf117f6ceb
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-10-03 00:04:19 -07:00
Linux Build Service Account
8bfc0b3d0a Merge "msm: kgsl: Change GPU clock gating sequence for A4XX and A5XX" 2016-09-30 18:24:01 -07:00
Linux Build Service Account
456cfbdf20 Merge "msm: kgsl: Fix dispatch_q NULL dereference" 2016-09-30 18:24:01 -07:00
Linux Build Service Account
0af03e722d Merge "msm: kgsl: Do not free gpuaddr range if unmap fails" 2016-09-30 18:23:50 -07:00
Hareesh Gundu
ed1836956c msm: kgsl: Change GPU clock gating sequence for A4XX and A5XX
Disable SP clock before programming the clock gating control
registers and enable back SP clock.

CRs-Fixed: 1061048
Change-Id: Ic19a8a67fe0e192c9c7c3f855c7eb33901ca2adc
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-09-30 10:52:19 -07:00
Hareesh Gundu
df7dd145f0 msm: kgsl: Fix dispatch_q NULL dereference
Add a NULL check for dispatch_q which will avoid
NULL pointer dereference in dispatcher_do_fault().

Change-Id: I429aa91f9c5fa92ce2e8b23cc4911454744f75c9
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-09-30 02:51:28 -07:00
Harshdeep Dhatt
3f25aa2b78 msm: kgsl: Do not free gpuaddr range if unmap fails
Currently, we free up the gpuaddr range whether unmap
succeeds or fails. If it fails and we free up the gpuaddr
range, there is a possibility that a later allocation will
overlap with this range. Mapping this new range leads to a
BUG_ON() in the iommu driver which thinks that we are
overwriting an existing mapping. To avoid this, we never
free the failing gpuaddr range, effectively removing it
from being re-used for any future mappings.

CRs-Fixed: 1072834
Change-Id: I57dfd6abe6c928dbe4df1bcc682d4093040ccb9f
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-09-29 14:40:50 -06:00
Linux Build Service Account
793392fb5f Merge "msm: kgsl: Add memory and periphery clock control for A540" 2016-09-29 11:21:00 -07:00
Mitchel Humpherys
0c46d7f488 msm: kgsl: Remove obsolete IOMMU domain attribute
The DOMAIN_ATTR_COHERENT_HTW_DISABLE IOMMU domain attribute is being
removed.  SMMU coherency will be configured through the SMMU device tree
nodes moving forward.  Remove the obsolete option.

Change-Id: I4bbbfb90fe172e048cc9504c4e6be5f36501b485
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-09-26 17:42:52 -07:00
Hareesh Gundu
2defccd495 msm: kgsl: Revisit the GPU snapshot dumping
Add a new linux header to support 64 bit pagetable address in Linux OS
section.
Add a new linux context header to support v2+ Linux version in Linux
context section.
Remove multiple register reads on CP IB registers and have a single
CP register read to get the active IB information.
Add Active IBs to obj_list in case static snapshot blob is not having
enough memory, so that it get dumped into dynamic blob.
Add a message in case any active IB is not getting dumped into snapshot
binary.

Change-Id: Icee01f6ba95e469acac9eed6bf2fdbc83947f5a8
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2016-09-26 10:21:27 -07:00
Harshdeep Dhatt
da71b33976 msm: kgsl: Disable rbbm countable on a540
The RBBM_ALWAYS_COUNT countable does not function properly
when top level clock gating is enabled. Return -EINVAL
when user requests this perfcounter.

CRs-Fixed: 1038778
Change-Id: I48d560ab2caa6ea467ac56bf0d323937a475cdde
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
2016-09-23 10:08:21 -06:00