Commit Graph

292 Commits

Author SHA1 Message Date
Tao Huang
00a0a68f4e MALI: midgard: Fix compile warning when !CONFIG_DEBUG_FS
In file included from drivers/gpu/arm/midgard/backend/gpu/mali_kbase_mmu_hw_direct.c:22:
 drivers/gpu/arm/midgard/mali_kbase.h:600:9: warning: 'kbase_io_history_term' macro redefined [-Wmacro-redefined]
 #define kbase_io_history_term CSTD_NOP
         ^
 drivers/gpu/arm/midgard/rename.h:139:9: note: previous definition is here
 #define kbase_io_history_term midgard_kbase_io_history_term
         ^

In file included from drivers/gpu/arm/midgard/mali_kbase_core_linux.c:42:
 drivers/gpu/arm/midgard/mali_kbase_regs_history_debugfs.h:46:9: warning: 'kbasep_regs_history_debugfs_init' macro redefined [-Wmacro-redefined]
 #define kbasep_regs_history_debugfs_init CSTD_NOP
         ^
 drivers/gpu/arm/midgard/rename.h:326:9: note: previous definition is here
 #define kbasep_regs_history_debugfs_init midgard_kbasep_regs_history_debugfs_init
         ^

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I8de63444cdb8d5cf265f3d6a80ab0ad69bec3754
2022-07-26 14:49:34 +08:00
Finley Xiao
7d9a7b1eff MALI: bifrost: Fix NULL pointer dereference when only one regulator
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000078
Mem abort info:
  ESR = 0x96000005
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000005
  CM = 0, WnR = 0
[0000000000000078] user address but active_mm is swapper
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 159 Comm: kworker/u8:2 Not tainted 5.10.66 #1719
Hardware name: Rockchip RK3566 EVB2 LP4X V10 Board (DT)
Workqueue: devfreq_wq devfreq_monitor
pstate: 20c00009 (nzCv daif +PAN +UAO -TCO BTYPE=--)
pc : regulator_set_voltage+0x34/0xa0
lr : kbase_devfreq_opp_helper+0x194/0x364
sp : ffffffc014133b20
x29: ffffffc014133b40 x28: 000000000bebc200
x27: 0000000000000000 x26: ffffff8005486268
x25: 0000000000000001 x24: ffffff8005c522b0
x23: ffffff8005483800 x22: ffffff80054839e0
x21: 000000000000314c x20: 0000000000000000
x19: ffffff8005483a00 x18: ffffffc0140b5050
x17: 0000000000000000 x16: 0000000000000001
x15: 0000000000000000 x14: ffffffffffffffc8
x13: 0000000000000000 x12: 0000000000000014
x11: 0000000000000000 x10: ffffff8005486100
x9 : 00000000ffffffff x8 : f06ef41598ba9d00
x7 : 00000000000c96a8 x6 : 0000000000000001
x5 : 0000000000000001 x4 : 000000000bebc200
x3 : 0000000000000000 x2 : 000000007fffffff
x1 : ffffffc014133b20 x0 : 0000000000000000
Call trace:
 regulator_set_voltage+0x34/0xa0
 kbase_devfreq_opp_helper+0x194/0x364
 dev_pm_opp_set_rate+0x2ec/0x92c
 kbase_devfreq_target+0x7c/0xd0
 devfreq_set_target+0x80/0x200
 update_devfreq+0x114/0x148
 devfreq_monitor+0x30/0x12c
 process_one_work+0x1f4/0x490
 worker_thread+0x278/0x4dc
 kthread+0x13c/0x344
 ret_from_fork+0x10/0x30

Fixes: 98a9b2cbb4 ("MALI: bifrost: Add memory regulator support")
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ie2a1f0f86169facf31de3cfc9aba5d42092a5d41
2022-07-08 17:31:29 +08:00
Zhen Chen
ab86d8ad07 MALI: rockchip: upgrade bifrost DDK to g12p0-01eac0, from g11p0-01eac0o
Change-Id: Ifde51336daa7c735118a314fcfc2fde38d7132b3
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-06-21 11:27:08 +08:00
Finley Xiao
2598d85d44 MALI: bifrost: Add missing error code in kbase_devfreq_opp_helper()
Fixes: eb26be047e ("MALI: bifrost: Set intermediate rate before change read margin")
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Id4df3e3b990762bc737d1b78f44e95fa00d12aff
2022-06-06 15:24:53 +08:00
Zhen Chen
8fd4cab89d MALI: bifrost: kernel_map_user_io_pages(): log error if vmap() returns NULL.
Change-Id: Ie1d3682cc32fc191815210f19198b1b4922d830d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-06-06 11:10:53 +08:00
Zhen Chen
9eccd1f8a3 MALI: bifrost: prevent a rare null pointer exception in update_on_slot_queues_offsets()
The most recent situation is that the null pointer exception
is only reported from repeated reboot test on rk3588_EDGE_SDK,
not on rk3588_Linux_SDK or rk3588_Android_SDK.

Change-Id: I1e5ce9eb9fd32c29294e115e6014a8114c896754
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-06-06 11:09:35 +08:00
Finley Xiao
e7fd42c35e MALI: bifrost: disable regulator when pm status is suspended
The system calls pm_runtime_get_noresume() to prevent device
from entering to runtime suspend status when reboot, and the
pm_runtime_put_sync_suspend() is called in a delay work,
so when reboot the power domain may be power on,
but the regulator is disabled, it's not allowed.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ie25451ddf4fc866e93e7272a8d9a809919a96e1d
2022-05-12 18:59:23 +08:00
Finley Xiao
fe111758d6 MALI: bifrost: enable regulator when suspend
When system resume, all power domains will power on in
dpm_noirq_resume_devices(), if vdd gpu is disabled before system
suspend, the pd gpu will failed to power on when system resume,
the detail as follows:

rockchip-pm-domain fd8d8000.power-management:power-controller: failed to get ack on domain 'gpu', target_idle = 0, target_ack = 0, val=0x8080f
Kernel panic - not syncing: panic_on_set_idle set ...
CPU: 0 PID: 1947 Comm: Binder:352_2 Not tainted 5.10.66 #960
Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
Call trace:
 dump_backtrace+0x0/0x1c8
 show_stack+0x1c/0x2c
 dump_stack_lvl+0xdc/0x12c
 dump_stack+0x1c/0x64
 panic+0x150/0x3a4
 rockchip_pmu_set_idle_request+0x1f8/0x1fc
 rockchip_pd_power+0x11c/0x1e0
 rockchip_pd_power_on+0x28/0x38
 genpd_sync_power_on+0xf4/0x134
 genpd_resume_noirq+0x70/0xd0
 device_resume_noirq+0x1a8/0x410
 dpm_noirq_resume_devices+0x100/0x55c
 dpm_resume_noirq+0x18/0x34
 suspend_enter+0x33c/0x52c
 suspend_devices_and_enter+0xec/0x338
 enter_state+0x12c/0x3f8
 pm_suspend+0x60/0xcc
 state_store+0x108/0x148
 kobj_attr_store+0x1c/0x34
 sysfs_kf_write+0x40/0x58
 kernfs_fop_write_iter+0xf0/0x194
 vfs_write+0x328/0x390
 ksys_write+0x78/0xe8
 __arm64_sys_write+0x20/0x30
 el0_svc_common+0xc0/0x23c
 do_el0_svc+0x28/0x88
 el0_svc+0x14/0x24
 el0_sync_handler+0x88/0xec
 el0_sync+0x1a8/0x1c0
SMP: stopping secondary CPUs

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I89f80d37ab2cc61c715bce3f8a25c26552918922
2022-05-12 18:59:23 +08:00
Zhen Chen
5f5ce518ca MALI: bifrost: treat "Could not get a valid AS for group ..." as a debug log not warning
In mail 'RE: <rock-chips>: G610: Valhall Android DDK r36:
Does device driver warning log "Could not get a valid AS for group ..." matter?',
zhigang.yao@arm.com declared that it should not be a warning:

"This is expected behavior.
GPU has a limited present HW address space resource,
max is 16, and is implementation specific, (8 on Odin?).
So if there are more than 16 (8 on Odin) process,
some of it might not get a valid present address space,
and the warning would be printed as you have observed."

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ic8324c37461776672d516b472db66549d91fe552
2022-04-22 14:22:37 +08:00
Finley Xiao
cb62fa6675 MALI: bifrost: Change clock source to normal pll when suspend
When call pm_runtime_get_sync(), the runtime callback will change clock
source to normal pll, but now pm_runtime_get_sync() is called in a delay
work and the wakelock seems to be invalid on linux system,
so when suspend the pm_runtime_get_sync() may not be called.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I0a951b455c10158ca63d747e35e9001cdbdde91c
2022-04-01 09:33:18 +08:00
Finley Xiao
0f3739e0b7 MALI: bifrost: Kconfig: Don't select PM_DEVFREQ and DEVFREQ_THERMAL
If use savedefconfig to update defconfig, PM_DEVFREQ and DEVFREQ_THERMAL
will be removed, and dmc and opp_select also depend on PM_DEVFREQ,
enable them default.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ied5ac8e70fe195294df2752160ce6e56360f2db8
2022-03-11 11:00:00 +08:00
Zhen Chen
7c3725c8f1 MALI: bifrost: remove a verbose log
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I06184a601d5817d87433cbcde19b39bccc12f774
2022-03-03 18:19:25 +08:00
Finley Xiao
eb26be047e MALI: bifrost: Set intermediate rate before change read margin
Improve stability when change read margin.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I0ddb1d00c670cbc8e4c64f999382f1420a86c537
2022-03-03 18:01:38 +08:00
Finley Xiao
f5f2d23805 soc: rockchip: opp_select: Implement rockchip_get_read_margin()
In order to get target read margin and scmi clk earlier,
and it will also be used in later submissions.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I75bd79dc4963fa0dcc73d7c66a696e1cc0c177b7
2022-03-03 18:01:38 +08:00
Zhen Chen
643f7908a0 MALI: rockchip: upgrade bifrost DDK to g11p0-01eac0, from g10p0-01eac0
Change-Id: I0642ec37f151711b8b19c3206488d3301422971d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-03-01 19:53:20 +08:00
Zhen Chen
c019aa3cbf MALI: bifrost: Fix incorrect dmesg warning for unexpected GPU activities
The warning logs fixed are "GPU activity takes longer than time interval, ...".

This fix is provided as 496f5e3.diff by Zhigang.Yao@arm.com of support_mali.
The original commit message within 496f5e3.diff:
{
From 496f5e37a803266e71cbf7b6eb5871fe2fcd8931 Mon Sep 17 00:00:00 2001
From: Tu Vuong <tu.vuong@arm.com>
Date: Wed, 09 Feb 2022 09:31:20 +0000
Subject: [PATCH] GPUCORE-30123 Fix incorrect dmesg warning for unexpected GPU activities

The DVFS utilisation calculation detects when the GPU has expended more
cycles than expected compared to the actual time passed. This margin was
not sufficient as it didn't take into account the worst-case scenario
where samples are taken TIMER_DEFAULT_VALUE_MS apart.
}

Change-Id: I16bb904fd77006f6ab1e4419e44a9834550e4c07
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-02-16 11:37:51 +08:00
Zhen Chen
8556e654d6 MALI: bifrost: fix panic "stack is corrupted in: kbase_get_real_power_locked"
The panic was triggered
by running "cat /sys/kernel/debug/mali0/ipa_current_power".

It is fixed by enlarging KBASE_IPA_BLOCK_TYPE_NUM according to the fact
that we set 4 clks for GPU in rk3588 dts.

Change-Id: I3a87f6f2d25cf296d95d033d3d98c51666ea482d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-02-08 20:11:31 +08:00
Finley Xiao
f4639a388e MALI: bifrost: Add support to only calculate dynamic power
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I62047acb6a57652c9473d117651f4bf75fcbbb28
2022-01-21 20:29:48 +08:00
Zhen Chen
c7ac8c9aa3 MALI: bifrost: fix bug that GPU is not powered off after idle
The bug was found in the case of that system suspend process was broken off
for USB ADB being connected.

This fix is provided by Zhigang.Yao@arm.com of support_mali.

Related RK redmine case:
https://redmine.rock-chips.com/issues/334539

Change-Id: I4772ed901a7fe54884a79a53b3ca9f6fd7beed40
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-01-13 15:12:48 +08:00
Zhen Chen
3f89b26931 MALI: rockchip: upgrade bifrost DDK to g10p0-01eac0, from g9p0-01eac0
Change-Id: If5e4683a1da37e00eeaa5a16463206f6f45ecfb4
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-01-07 11:05:37 +08:00
Finley Xiao
5b7d19ca43 MALI: bifrost: Avoid crash when set rate and read margin
1. change clock rate and read margin only when pd is on.
2. change clock source to normal pll before power down pd.
3. change clock source back to pvtpll and restore clock rate
and read margin after power on pd.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I2028866fdd70909814aaba7ef6d3af3bf764eb87
2021-12-31 09:25:28 +08:00
Zhen Chen
3f8c57e4f0 MALI: bifrost: rk: add rk_context::lock and adjust orders of turning on/off vd, clk, pd
Turning on order: vd, clk, pd.
Off order: pd, clk, vd.

Change-Id: Ia932a3b572662a6b30e58cbb45fd1f1800283097
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-12-30 15:44:14 +08:00
Finley Xiao
6118992709 MALI: rockchip: Add opp info for system monitor
Add support to change memory read margin according to voltage when
register system monitor.

Change-Id: Id1d78432b6a83bbb09b4438146a0197dc914347b
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-12-29 22:01:14 +08:00
Zhen Chen
757826e997 MALI: rockchip: upgrade bifrost DDK to g9p0-01eac0, from g7p1-01bet0
In addition, fix a bug of calling KBASE_KTRACE_ADD() too early.

Change-Id: I843f340526275b50ae7d1ec6a7a68963e081e219
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-12-23 19:33:49 +08:00
Finley Xiao
34af47df70 MALI: bifrost: Implement rk3588_gpu_set_read_margin()
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I02ea2bc1feb987b94832182ee7ea94fd1b4ee6cf
2021-12-21 18:13:20 +08:00
Finley Xiao
b962421460 MALI: bifrost: change BASE_MAX_NR_CLOCKS_REGULATORS to 4
Add a new scmi clk for changing gpu clock rate.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ib2496a528a44a4106e1becf0d99335e207d85667
2021-12-21 18:13:12 +08:00
Finley Xiao
ddd6a0b49a soc: rockchip: opp_select: Add struct rockchip_opp_info
Add support to get soc info and set voltage read margin.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I254a92ba124655e3efc4922a7425c1f13d384adf
2021-12-21 15:01:01 +08:00
Tao Huang
8d6989ba85 MALI: bifrost: Fix -Wmissing-prototypes warnings
drivers/gpu/arm/bifrost/mali_kbase_core_linux.c:2955:6: warning: no previous prototype for function 'kbasep_ktrace_dump_wrapper' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_irq_linux.c:182:13: warning: no previous prototype for function 'kbase_gpu_irq_test_handler' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_irq_linux.c:210:5: warning: no previous prototype for function 'kbase_set_custom_irq_handler' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:241:5: warning: no previous prototype for function 'rk_kbase_device_runtime_init' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:246:6: warning: no previous prototype for function 'rk_kbase_device_runtime_disable' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:266:5: warning: no previous prototype for function 'kbase_platform_early_init' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:274:6: warning: no previous prototype for function 'kbase_platform_rk_shutdown' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:460:5: warning: no previous prototype for function 'kbase_platform_rk_init_opp_table' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/ipa/mali_kbase_ipa.c:399:5: warning: no previous prototype for function 'kbase_scale_static_power' [-Wmissing-prototypes]

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I47be45c9ac2b7f9eedec1977d358b535f7fbd795
2021-11-24 09:53:51 +08:00
Finley Xiao
98a9b2cbb4 MALI: bifrost: Add memory regulator support
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I95d3ceccc5cd14caefb96c1c3266d7b4d8520719
2021-11-23 16:34:03 +08:00
Caesar Wang
2084b9f118 MALI: bifrost: fixes wrong number of regulators
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Icb1e4a388e6e8720036b6a1d85a13b5e2491cf4d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-11-23 16:32:28 +08:00
Zhen Chen
583d67f999 MALI: bifrost: rk: add definition and implementation of CLK_RATE_TRACE_OPS
Picked from ./platform/devicetree/.

This makes GPU utilisation info available and resolve the warning log below:
[   19.641700][   T83] WARNING: CPU: 0 PID: 83 at drivers/gpu/arm/bifrost/csf/ipa_control/mali_kbase_csf_ipa_control.c:239 kbase_ipa_control_handle_gpu_power_off+0x128/0x198

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I7ce8d0f52d6340659b2c9ca9692c48043e1060c1
2021-11-17 17:00:34 +08:00
Zhen Chen
44194e5f13 MALI: bifrost: Kconfig: make MALI_CSF_SUPPORT selectable
remove depends on MALI_BIFROST=m

Change-Id: I3296839dd0f40e8fdfc6c66aa0d6f8f7155cdf68
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-11-14 19:39:22 +08:00
Zhen Chen
44a562051e MALI: bifrost: enlarge BASE_MAX_NR_CLOCKS_REGULATORS to 3
rk3588 actually has 3 clocks and 2 regulators to manage.

Change-Id: Ie0322fcce0f020fed7e51008e6fba34fe1350f49
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-11-10 14:39:48 +08:00
Zhen Chen
a42b57181b MALI: rockchip: upgrade bifrost DDK to g7p1-01bet0, from g6p0-01eac0
Including modifications under drivers/base/ from the new DDK.

Resolve lots of conflicts.

Fix compilation errors when CONFIG_DEBUG_FS is disabled.

Change-Id: I69f9ac87d927441d0b92b8dac8b704922aeb6a0a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Zhen Chen
8e59d03969 MALI: bifrost: fix a bug that makes vdd_gpu abnormally low
Change-Id: Ic0b785ead0da551e9e640c45b73f6686a1ec5cca
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Zhen Chen
404110b7de MALI: rockchip: upgrade bifrost DDK to g6p0-01eac0, from g2p0-01eac0
Include a new directory include/uapi/gpu/arm/bifrost/,
which includes some header files of bifrost device driver.
In the original part of g6, the path is include/uapi/gpu/arm/midgard/.
I changed the "midgard" to "bifrost", and modified the paths of the header files in .c files.

I resolved some conflicts between modifications form ARM and RK, manually.

In addition, introduce source files of protected_memory_allocator
that might be needed by bifrost_device_driver into build system.

Further more, to avoid errors when building in GKI mode,
add "WITH Linux-syscall-note" to SPDX tag of uapi headers.

Change-Id: I09d500a0fdbc5da352c81dc4fcfbffb5b7f907f5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Zhen Chen
9245f41397 MALI: remove drivers/gpu/arm/bifrost_for_linux/
Change-Id: Ib91cbcc1d1413bdd9510661ffdd38dd72d984c56
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-09-14 09:58:48 +08:00
Zhen Chen
a8c5470313 MALI: remove definitions of MALI_BIFROST_FOR_ANDROID and MALI_BIFROST_FOR_LINUX
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Idd03a830e62582fe738919b7ef4d43163e9cdcb1
2021-09-14 09:58:48 +08:00
Zhen Chen
766e61421d MALI: remove MALI_MIDGARD_FOR_ANDROID and MALI_MIDGARD_FOR_LINUX
Because they are no longer useful,
after rk3288/rk3399 Android and Linux device
use the same midgard_device_driver "drivers/gpu/arm/midgard".

Change-Id: I7ccc3c99fdfdde5a0ea12a7f3e1931fd5f1ce4cb
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-09-14 09:29:47 +08:00
Zhen Chen
ff6f00a18f MALI: midgard: use strncasecmp() to compare irq names
to adapt to current rk3399.dtsi.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ibe0906908ff50ed00c17d9dfd00a40f3898549c1
2021-08-26 14:15:35 +08:00
Zhen Chen
0b37ea6440 MALI: utgard: select DEVFREQ_GOV_SIMPLE_ONDEMAND when MALI_DEVFREQ enabled
MALI_DEVFREQ is enabled by default.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I8fdbcc2c45bba35c514ca6ddc58b0e9c6a38cf2c
2021-08-24 11:01:01 +08:00
Zhen Chen
dff8b42544 MALI: midgard: select DEVFREQ_GOV_SIMPLE_ONDEMAND when MALI_DEVFREQ enabled
MALI_DEVFREQ is enabled by default.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I1b86565fc72ab6678c0252ddba0d7098e4997bd3
2021-08-24 11:01:01 +08:00
Zhen Chen
c8999a3e17 MALI: bifrost: select DEVFREQ_GOV_SIMPLE_ONDEMAND when MALI_BIFROST_DEVFREQ enabled
MALI_BIFROST_DEVFREQ is enabled by default.

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I25b8af723f33d6d262bbaa30c69c16377eaaa3a4
2021-08-24 11:01:01 +08:00
Tao Huang
3d11013d8b MALI: midgard: Kbuild: Fix src path
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I50a809faee21afd66d8f2025d05602a8a85293df
2021-07-27 15:04:15 +08:00
Tao Huang
d94eb2767e MALI: utgard: Kbuild: Fix src path
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4e6d1f252e51956dc264e544ebbf7cf774a39c5d
2021-07-27 14:58:35 +08:00
Zhen Chen
6a2af737e9 Mali: midgard: Fix a runtime WARNING as below
[    4.128429] WARNING: CPU: 0 PID: 247 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:1772 kbase_mmap+0x380/0xa78
...

Treat VM_FAULT_NOPAGE as success of calling vmf_insert_pfn().
Take https://android.googlesource.com/kernel/hikey-modules/+/refs/heads/android12-5.10/midgard/mali_kbase_mem_linux.c as a reference.

Fixes: 970017f88e ("MALI: midgard: Fix all compile errors under kernel 5.10")
Change-Id: Ie0562d8024e58031ba8126aab42dc7005f08b071
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-07-16 20:26:19 +08:00
Tao Huang
eceea1a746 MALI: midgard: Add _mali_profiling_control to rename.h
FATAL: modpost: drivers/gpu/arm/mali400/mali/mali: '_mali_profiling_control'
exported twice. Previous export was in drivers/gpu/arm/midgard/midgard_kbase.ko

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ia75a4edce98dbf5f8d8cbc286c6e5c2faf99c295
2021-07-14 10:03:55 +08:00
Zhen Chen
f5f907a67f MALI: mali400: Fix all compile errors under kernel 5.10
Change-Id: Iee1e5bc609e703de0c1e7c1f781ba7059c4aa6ae
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-07-09 09:26:18 +08:00
Zhen Chen
970017f88e MALI: midgard: Fix all compile errors under kernel 5.10
Change-Id: I8672520b7c7118ab7622032481802eae72349f81
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-07-09 09:26:17 +08:00
Caesar Wang
18e3fba39e MALI: bifrost: fixes the bifrost built
dmesg log from bootup:
...
[    0.988106] mali fde60000.gpu: GPU identified as 0x2 arch 7.4.0 r1p0 status 0
[    0.988199] mali fde60000.gpu: No memory group manager is configured
[    0.989228] mali fde60000.gpu: Probed as mali0

[root@RK356X:/]# cat ./sys/devices/platform/fde60000.gpu/gpuinfo
Mali-G52 1 cores r1p0 0x7402

[root@RK356X:/]# ls /sys/class/devfreq/fde60000.gpu/
available_frequencies  governor  name              target_freq
available_governors    load      polling_interval  timer
cur_freq               max_freq  power             trans_stat
device                 min_freq  subsystem         uevent

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I1669385cd2609fbe8ba4507f777e904e1f6c6961
2021-07-07 14:23:02 +08:00