To make it possible that the both built-in midgard and bifrost device driver
could be both loaded.
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I8271a6d817dda3781d70fc69aaaccf3860354b48
rename.h could rename the symbols that have same name in midgard/ and bifrost/,
to make it possible to build in both midgard/ and bifrost/.
Change-Id: Ibca4e2beca8a4d8ea28f712a3e219cb2a403c7e2
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
This adds support to get simple_ondemand governor data from devicetree.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I6d44ba467d52bde191fb1b87bce02dc503055262
(kbdev->current_freqs[i] > freqs[i]) will be always false becasue kbdev->current_freqs[i]
has been updated to freqs[i], so we need save current_freqs[i] to old_freqs[i].
Change-Id: I3f8a06d474a359cf292460878c53592c4ce1472b
Signed-off-by: Liang Chen <cl@rock-chips.com>
This patch is from ARM via mail
"Fwd: 00209996 - [Rockchip][IMPORTANT] Cat A(rare)- Security bug in Mali DDK (16-Nov, 2020) Edit Subject"
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ife807e5e850274222db8aea0e4cac588e02a8e53
In addition, rename some configs that have been used in drivers/gpu/arm/midgard.
Change-Id: I5356d6b3f544195eb6bebe88927abe7c8bcb7dd1
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
In addition, rename some configs that have been used in drivers/gpu/arm/midgard.
Change-Id: I4244ea3ac7f039f182d5e58f677d9c31417188bf
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
make distclean
scripts/Makefile.clean:15: drivers/gpu/arm/midgard_for_linux/Makefile:
No such file or directory
Fixes: 25bb952677 ("MALI: rockchip: remove drivers/gpu/arm/midgard_for_linux/")
Change-Id: Ia47e2581d9679f3bcca809ad4506b61068e1710d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
rk3399/rk3288 Android and Linux devices are all using drivers/gpu/arm/midgard,
which is Midgard device driver on DDK r18.
Change-Id: Iac8484edf91d57c7b74d5b952c96e0bb03159791
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
In deed, Zhixiong Lin missed these codes when he picking source codes
from DDK r9 to port utgard device driver of r7 to kernel 4.19.
Change-Id: If140b478b4ea8a4f72d532b8e8216ab53856be08
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
This adds support to get simple_ondemand governor data from devicetree.
Change-Id: Ic897ad6227152c4ce695d6cee8085b4d303339bf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Fixes: b0ad177659 ("MALI: rockchip: upgrade Bifrost DDK to r20p0-01rel0, from r12p0-01rel0")
Change-Id: I2df7c7ddab0ae740e75579a0f620c3d918f0eed5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
I replace "sg_dma_len" with "MALI_SG_DMA_LEN"
and rename configs which have duplicated names in midgard/, as before.
Note that drivers/gpu/arm/bifrost on DDK r20
depends on drivers/base/memory_group_manager.
Change-Id: Ie51fda035a98b5151f25a0fcf7294b88d4ecc978
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Change-Id: Id38e4632f951242bcbebef3fba066c118d2203e3
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Change-Id: I355e2752197b0625123e3af61fcbd871a59f0c71
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Change-Id: Ic142e054b3366737f0fcdc34ac0a19fc7dcd78d6
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Change-Id: I8bc69ec067623e05a610b816990e128e853d01a6
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
According to
commit 8a31d9d942 ("PM / OPP: Update OPP users to put reference")
Change-Id: I2b342c28a0c1d44adebd589b48ea95c9dcd7182d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This would eliminate the repeating WARNING logs from dma_fence_set_error().
Change-Id: I3b319decb8899dfc0410f4975e31bb1c67f7ae9f
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Some relative codes,
such as 'zone_page_state_add(1, zone, NR_SLAB_RECLAIMABLE);',
caused compile errors, when compiled with clang.
The corresponding interface(NR_SLAB_RECLAIMABLE, et.) was changed
between kernel v4.4 and v4.19.
These codes were used to updates the cachelines with the statistics,
and are removed in Midgard DDK r22.
Here, I remove them too, in current Midgard DDK r18.
Change-Id: I3a7e789c0456f28eba623b20564ea8a97109051f
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
When the clients are 32 bits while the kernel is 64 bits,
we need to translate the memory address before accessing.
The previous commit was refreshed by ddk update.
Change-Id: I7f47ab94da258e9d170613252aae9b396623cf48
Signed-off-by: Randy Li <randy.li@rock-chips.com>
user_atom.atom_number can be indirectly controlled by user-space,
hence leading to a potential exploitation
of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
drivers/gpu/arm/midgard/mali_kbase_jd.c:1397 kbase_jd_submit() warn:
potential spectre issue 'jctx->atoms' [r]
katom = &jctx->atoms[user_atom.atom_number];
Fix this by sanitizing user_atom.atom_number
before 'katom = &jctx->atoms[user_atom.atom_number];'.
Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
Fixes: 5cf27d0b6090 ("Mali: midgard: changes to enlarge BASE_JD_ATOM_COUNT to 512, for defect 184210")
Change-Id: If52f30d29a80a06c6693ddadd5947ab9fe8fbc25
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
The source code of mali_so must be modified correspondingly.
Change-Id: I3f4bd03fa2d369d912e6bc05c53d2d3abefb92d3
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Parts of the modifications are borrowed from Mali Bifrost DDK r13.
Change-Id: I82c68041a3185063ae2d8a40a7a7c17feaab0733
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Mali sync timeline in Utgard DDK r7p0-00rel1 depends on CONFIG_SYNC.
But, CONFIG_SYNC is no longer supported by kernel v4.19.
This modification is from ARM release:DX910-SW-99002-r9p0-01rel0.tgz
Change-Id: I2f2b36c57132ebc49cc8235b2d071ed6ed540825
Signed-off-by: Zhixiong Lin <zhixiong.lin@rock-chips.com>
This adds support to get simple_ondemand governor data from devicetree.
Change-Id: Ica8cde1b28a81d5b7e2c5c8c109a2469311bcd8e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
The process to get current source code under midgard_for_linux/ :
1. On the status of commit 18166b65,
revert commit "91842c9 MALI: rockchip: upgrade midgard DDK to r18p0-01rel0",
which upgraded drivers/gpu/arm/midgard/ from DDK r14 to r18.
2. copy directory drivers/gpu/arm/midgard/ to drivers/gpu/arm/midgard_for_linux/.
It's ensured that changes of commits in drivers/gpu/arm/midgard/
from RK power management group early than commit 18166b65
are correspondingly remained in current drivers/gpu/arm/midgard_for_linux/.
Change-Id: I41463a8c160e5d25365d6872eef1049de4a317fb
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Just the same as in Midgard device driver.
This could resolve Defect #170228 and #184427 in RK redmine.
In addition, add err log for the case that alloc_page() returns NULL.
Change-Id: Ie1ddfae9429236900e4308e2cfecec2cd75a183a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Disable build mali driver when just git commit change.
Change-Id: Ie659e2da02260079ccd5d2873f28afbe7f2b2761
Signed-off-by: Tao Huang <huangtao@rock-chips.com>