scm_call2() API can block indefinitely if another client is using
this API. This is due to a mutex in this API to serialize calls to
the TZ. This blocks the GPU wake up which in turn can result in
kgsl fence timeouts. Since CPZ register programing is handled at
the hypervisor, we can safely avoid this serialization by using
scm_call2_atomic() API which doesn't block.
Change-Id: I48ba3e1a682e1027463a1c6b067e6cfcb4a0e8bc
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
We missed updating index for internal IBs like setstate
or power-on fixup.
The index value was never updated after that, so all the
IBs after that index were never parsed, and are missing
from the snapshot.
Change-Id: I61db75f33630db322fe5ee1adce9f120987d32ee
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
Unload zap shader during device hibernation and reload it
during resume otherwise scm calls during post hibernation
GPU initialization will fail as there is possibility that
TZ driver is not aware of the hibernation.
Change-Id: I1f62fb97cbc8e6c3e3536d4d5260a543ca15b685
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
Signed-off-by: Thomas Yun <wyun@codeaurora.org>
Invoke kgsl_suspend and kgsl_resume during hibernation
of KGSL.
Change-Id: I8e1a8ad8b9293d568950a9e71667d1088ff6fbba
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
Signed-off-by: Thomas (Wonyoung) Yun <wyun@codeaurora.org>
In Snapshot path, GPMU register offsets are being dumped on all A5xx
devices. But some targets on A5xx does not have GPMU. So accessing GPMU
registers would cause device fault.
Allow the GPMU register access only on targets with GPMU.
Change-Id: I2885dbdaf1cc95f960dcfacad52d6ded1dc9ac1d
Signed-off-by: Venkateswara Rao Tadikonda <vtadik@codeaurora.org>
Modified conditional checks to read lm_sequence so as to avoid
the possibility of pointer overflow.
CRs-Fixed: 2212443
Change-Id: I72b30e35996c40f23fc81739e27724b1188f1c05
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
This patch ensures device resumes successfully after
XO shutdown without any KGSL error.
Change-Id: I9eb8e281bc62793dc7521ba72aaeecf946860851
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
Add new GPU ID and required initial settings
to support Graphics functionality on SDM636.
Change-Id: If8a801c20c7f60618797ccd440d2d739f6817708
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Enforce a limit of 200 contexts per process. This is done so
that a process cannot use up all the available contexts and
prevent other processes from starving.
Change-Id: I6eda123128381a213315561cd42335e0944f1f55
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
Increase the memstore size to 32k. Memstore has for long
been limited to 200 contexts and now it will be 814.
Change-Id: I1287669f0be38afe13ff8e386f5296e8f4e77627
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
A bad user can pass memory type parameter value greater than 255.
Limit the memory type value to valid range before updating memory
descriptor flags to avoid incorrect flag update.
Change-Id: I23ce69584d1e2c9969583461ee942c5046e7cdbc
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
Added proper checks while reading lm_sequence array so that it
is not accessed beyond lm_size.
CRs-Fixed: 2175951
Change-Id: I639b07fba275aad0f62cc03fa11201c126e24812
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Add a check to set the pending_free flag if it is not already
set before freeing sparse memory entry. This is required to
prevent multiple ioctl threads from freeing the same sparse
memory entry.
Change-Id: I4e2bbe6fcd98c58d36340c4f87cdff27fc1de22e
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
The user can pass bad data into kgsl_ioctl_gpuobj_sync(). If
_copy_from_user() fails do to bad data, undo any current
references taken through this ioctl call.
Change-Id: I56195520b9dadba20ee419658fc2cbb282b8449c
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: samit vats <svats@codeaurora.org>
rbbmtimer_clk hardwired fixed XO frequency 19.2Mhz. clock_round_rate()
for RBBM timer clock fails with -EPERM as it is fixed. So added a
check to make sure that rbbmtimer_clk clk_set_rate() has valid
frequency. This avoids warning message in the driver log.
Change-Id: I8f8bcec88e6a39e1550bb67590e6b66dba8e7a27
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
KGSL memstore GPU address should be 32bit value for user mode
graphics driver to successfully mmap device memstore.
Move global memory base to 0XFC000000 from 0X100000000 for 64bit
kernel to allow user mode graphics driver to successfully mmap
memstore.
Change-Id: Iadfbde5e2b13c1be943a272e424f6c5f05cc1b97
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
On a 64bit kernel, a 32bit user application is not
restricted to 3GB limit of virtual memory. It is
allowed to access complete 4GB range.
Move global memory region to 0x100000000 outside of
32bit range on 64bit kernel to increase the virtual
memory range for a 32bit application running on a
64bit kernel. This will also move secure memory
region to 0xF0000000.
Change-Id: I017ac0c052b4d9466f9f1a66af4a83f0636450cb
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
The shader block size is in dwords. Make sure we copy out all the
bytes that we want.
Change-Id: I42364350ee6314b4830ed11cc06e61d854122543
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
The kobject used for the process's sysfs node did not provide a
release function, so it did not correctly implement the refcounting.
Add a release callback so that we keep the process structure valid
as long as the kobject is alive.
Change-Id: I6db54092ed29ecd4d2f157188a4f1a5fc70f1edf
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Take the bind lock when we dump information about sparse memory
allocations through the debugfs node.
Change-Id: I955d64d06a259a2bbe4d85a33d68887ee01aad07
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Add kernel pointer restriction while printing the global
page table entries through the debugfs.
Change-Id: Ia2ef4243248ece477e3f679c0027379686670928
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
The dispatcher timer should be updated if preemption is not in
progress. This schedules the dispatcher work in case the command
does not make progress.
Change-Id: I9ef55b12d7a4f07a3c5bba650e37453bd8f86ce3
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Vulkan memory types are added into UMD.
Print Vulkan memory type as an int value.
CRs-Fixed: 2119633
Change-Id: Idf5d58a6a02dbef6ef8cf6663e7819d221bf3e11
Signed-off-by: Young Hwan Kwak <ykwak@codeaurora.org>
Add the property to determine the current command timeout
value which is used by the clients via KGSL IOCTL.
Change-Id: Ifd6b373d211ebd78dc3a8032ede073258487d689
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
Before calling kgsl_pwrctrl_clk_set_rate(), make sure the
RBBM timer clock is available. This avoids warning messages
in the driver log.
Change-Id: I0cd21b7253c802e8522d570056c8aeda02729267
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
There is no check before cache ops if the memory is marked secure.
This leads to stage 2 pagefault if a secure memory is passed to
IOCTL_KGSL_GPUMEM_SYNC_CACHE ioctl because kernel is not allowed to
do cache ops on secure memory. This can be avoided by returning
success immediately if the memory is marked as secure.
Change-Id: I215d77d2a488cdb00e8e18cfd38cddd9632fd9f6
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
Use the appropriate lock when adding sparse bindings, to protect the
list of sparse bindings from concurrent updates by multiple threads.
Change-Id: Ice9750c96fca42f4049ed352533f4722b5166221
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
If we find that a different thread has already added bindings at the
same offset we wanted to add to the sparse object, don't get stuck in
an infinite loop, and return with an error.
Change-Id: I6b17c91eccb14c07e13cae24135dfe7b13f3301d
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
During firmware load, there could be data over reads
due to calculation of lm_size and lm_sequence from
block and block_size. Added bounds checking to prevent
this and improved the size calculation.
CRs-Fixed: 2107981
Change-Id: Ib4283951b0d6c8fb699af1f85e657981ad4c0318
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
After the crashdumper runs once, and the user sets the
snapshot_crashdumper sysfs node to 0, it is possible that stale data
is saved off into the snapshot. Check the value of the sysfs node at
the appropriate place to force a re-read of the data through the
legacy path.
Change-Id: Icf27c39b68d786003c33fd0eb22bd3e8b9a036be
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
During firmware data read, it may leads to cross the max
range. Add a check to validate data size with in the max
range.
Change-Id: I12b3c1761214a7d2af2c45ad73bf61954c8398b6
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>
If context wait for global timeouts in detach path there is
no use to process its pending commands. Hence to handle context
detach timeout failure,invalidate the context and remove all
the pending commands from that context. So that other context
commands proceed successfully after the context detach timeout
fault recovery.
Change-Id: Ie4ff0ed5d08312d345b248a2404ce085552b0b09
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Uninitalized kernel variable passes to userspace, it may have data
from stack. To avoid data leak from kernel to userspace initializes
struct kgsl_gpuobj_import_useraddr to zero.
CRs-Fixed: 2096006
Change-Id: Ib79b030cd5e3edd7279632af20dc3fac95eb73d4
Signed-off-by: Archana Obannagari <aobann@codeaurora.org>