Commit Graph

9 Commits

Author SHA1 Message Date
Yabin Cui
b3b4b3bcd6 msm: kgsl: introduce CONFIG_CORESIGHT_ADRENO.
We want to build coresight drivers as builtin drivers. But
adreno-coresight.c in msm_adreno.ko calls coresight functions.
To avoid exporting new symbols in vmlinux and breaking the ABI, this
patch separates adreno-coresight.c into CONFIG_CORESIGHT_ADRENO.
CONFIG_CORESIGHT_ADRENO is only enabled when both coresight and adreno
are builtin drivers.

Bug: 167414982
Bug: 170753932
Signed-off-by: Yabin Cui <yabinc@google.com>
Change-Id: I7488293445ade738ba03cc457320e0d74f910886
2025-03-15 11:43:26 +05:45
Puranam V G Tejaswi
d52d205780 msm: kgsl: Make reclaim an adreno feature instead of a Kconfig option
Having process reclaim and the option of using SHMEM as Kconfig options,
makes it difficult to enable them on a per target basis as some targets
share the same set of configs. So remove them as Kconfig options and
turn them into adreno feature flags. Also enable the feature
ADRENO_PROCESS_RECLAIM for A702.

Change-Id: Iedb50fc4fa77ee5fc4f96a3607e7d8093ede8dd0
Signed-off-by: Puranam V G Tejaswi <pvgtejas@codeaurora.org>
2020-07-27 23:52:17 +05:30
Puranam V G Tejaswi
e45d69b8bb msm: kgsl: add support to reclaim pages of a process
To make kgsl pages reclaimable and to swap the pages, the already present
infrastructure of shmem is used. shmem provides the option of keeping
track of the swapped pages and getting the pages back when required.

At a given time, kgsl can make only those pages available for reclaim that
are not being used by GPU or by the user. The pages allowed to be reclaimed
should be chosen wisely, so that GPU or user do not use them immediately
after reclaim. Also, it is desirable that the swap out and swap in of pages
do not cause any performance impact on the active GPU use cases. Keeping
these in mind, making reclaimable all the pages of the processes that are
in background seems to be the best option. Here the pages are less likely
to be used any time soon and all the work is done while the process is
moving to foreground and no impact is seen when the process actually comes
to foreground and does something with the GPU. A sysfs node is exposed for
each process in /sys/class/kgsl/kgsl/proc/<pid>. The perf daemon that has
the knowledge about the process foreground and background communicates the
same to kgsl.

To make the pages reclaimable as part of PPR (Per Process Reclaim), kgsl
has to register to a notifier that would be called based on the system
wide memory pressure. The callback is necessary, as PPR works on the
process address space and all the pages that are not mapped to user space
will be left out, as PPR will never have the knowledge of the unmapped
kgsl pages. In the callback, kgsl decides if it can allow reclaim.

Allowing reclaim of too many pages will impact the next launch latency
of the application. So expose a node in /sys/class/kgsl/kgsl/ to set the
maximum limit that can be reclaimed per process. This is again set by
the perf daemon.

Expose a node /sys/class/kgsl/kgsl/proc/<pid>/gpumem_reclaimed to know
how much memory of the process has been reclaimed.

Change-Id: I94e8b6df0ace2ddc848c9d683c6b0d5314c7d309
Signed-off-by: Puranam V G Tejaswi <pvgtejas@codeaurora.org>
2020-07-02 02:23:17 +05:30
Puranam V G Tejaswi
64ae230861 msm: kgsl: use shmem for kgsl allocations
Use shmem for graphics allocations. This would help to make
kgsl pages moveable and also swappable to zram. By using
shmem we would forgo the benefit of using higher order pages
and pools. But the benefits we get from it in terms of getting
more free memory available in the system and getting larger
contiguous chunks of memory can outweigh what we forgo.

Change-Id: If613d721c581317967ea0603ea151fe85aca8afe
Signed-off-by: Puranam V G Tejaswi <pvgtejas@codeaurora.org>
2020-03-05 21:09:58 +05:30
Mohammed Mirza Mandayappurath Manzoor
2a3a44a51c msm: kgsl: Add support for efuse based LM ISENSE slope calculation
Slope value to calculate the sensor current for Limits Management feature
could be calculated and fused on devices. Pass this value to GMU firmware
to override the slope calculation during boot.

Change-Id: I9f9cf3cff90ed27bf52bf412291f9b2e9fc4139c
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <mmandaya@codeaurora.org>
2019-10-22 12:21:55 -07:00
Sharat Masetty
58280e454e msm: kgsl: Use nvmem to read the speed bin configuration
This patch uses the nvmem driver framework in the kernel to
read the speed bin efuse from qfprom. This was previously
read using raw register reads of ioremapped qfprom area.

Change-Id: I463471d35c9d02ab8e3ac3f8d961b1058698d430
Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
2019-06-27 10:33:24 +05:30
Jordan Crouse
2f61a834ec msm: kgsl: Fix circular dependency between KGSL and devfreq
If QCOM_SCM happens to not be selected we get into a funky little loop
between the devfreq governor and the KGSL driver since they depend on
each other.  Solve it by making KGSL always use QCOM_SCM (because it
does) and remove the dependency on QCOM_SCM from the governor and just
let it depend entirely on KGSL.

Change-Id: Ic0dedbadd703dcdb1e78a896585760132045cdf1
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2019-04-11 09:46:55 -06:00
Bryan Huntsman
9a702c565e Use 'GPL-2.0-only' as the SPDX-License-Identifier tag
s/SPDX-License-Identifier: GPL-2.0/SPDX-License-Identifier: GPL-2.0-only/

Change-Id: I0558c468c25d8229af2c8caade25c458875913f4
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2019-01-11 16:55:33 -08:00
Urvashi Agrawal
0a88312f6b msm: kgsl: Add Qualcomm GPU driver for kona
Add snapshot of GPU driver as of commit 9ac69cf (clk: qcom: gcc:
Support code for clock controller for sdxprairie).

Fixed compile errors,checkpatch issues, header refs and API changes:
	* Fix setup_timer API to use the new API
	* Add a missing argument to of_dma_configure
	* Rename cmd_db_get_aux_data
	* Change member name of tcs_cmd from complete to wait
	* Support new IDR_INIT API
	* Support new usage of llcc_slice_getd API
	* Remove the custom KGSL logging macros
	* Add utility functions for CP P4 identifiers
	  and CP protected mode
	* Add functions for GMU core operations
	* Add helper functions to request interrupts
	* Replace adreno_getproperty with an array
	* Remove module params
	* Fix Coccinelle warnings

Change-Id: Ifa57a94f2247fe90c713f1943882d75a60a554a5
Signed-off-by: Urvashi Agrawal <urvaagra@codeaurora.org>
2018-11-28 14:38:14 -08:00