GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_mali-driver.git
4 months agomali-driver: Strip modules_install rules lineage-20 lineage-21 lineage-22.0
Bruno Martins [Sun, 7 Jul 2024 21:24:59 +0000 (22:24 +0100)]
mali-driver: Strip modules_install rules

There's no point in doing this.

Change-Id: I01d7963f3dfd8933c240e7c6b00c3c1e22d402f7

4 months agobifrost: Default to r32p1 driver version
Bruno Martins [Sun, 7 Jul 2024 21:19:04 +0000 (22:19 +0100)]
bifrost: Default to r32p1 driver version

Change-Id: I95f62c7dab56dd04b64a9fbce7581701b065eb18

4 months agomali-driver: Remove Android makefile with old-style build rules
Bruno Martins [Sat, 16 Dec 2023 22:51:32 +0000 (22:51 +0000)]
mali-driver: Remove Android makefile with old-style build rules

These build rules are no longer needed, devices now build the module
as a real external kernel module.

Change-Id: I11546f3dbfe40e8cbcf0653b0a7274a81a7ad328

13 months agomali-driver: Strip modules using llvm-strip
Bruno Martins [Fri, 20 Oct 2023 23:26:26 +0000 (00:26 +0100)]
mali-driver: Strip modules using llvm-strip

With this, the GCC dependency is gone for good.

Change-Id: If420868549f10a11d7c091751ca738b82bb48eef

21 months agoamlogic: Compile kernel modules with clang
Christian Hoffmann [Sat, 11 Feb 2023 10:55:39 +0000 (11:55 +0100)]
amlogic: Compile kernel modules with clang

Change-Id: Ibbf4e3da2ea827cfbd3ab0936c77103a94a4b6d2

23 months agoSplit mali gpu makefiles per GPU arch
Vitaliy Tomin [Fri, 27 May 2022 16:57:40 +0000 (00:57 +0800)]
Split mali gpu makefiles per GPU arch

* use TARGET_AMLOGIC_GPU_ARCH flag set to bifrost, midgard or utgard to
  select proper mali module to build

Change-Id: I1b32483fc32e2709688013a2941baa877484dee5

23 months agobifrost: Add missing EXTRA_FLAGS to Android.mk
Vitaliy Tomin [Tue, 3 May 2022 00:46:12 +0000 (08:46 +0800)]
bifrost: Add missing EXTRA_FLAGS to Android.mk

* it is set in gpu-v2.mk, but missing in Android.mk
* fixes kernel issues like:
 [  113.437969@0]d WARNING: CPU: 0 PID: 3478 at drivers/dma-buf/dma-buf.c:584 dma_buf_unmap_attachment+0x6c/0x7

Change-Id: Ie880908fd69d3cee80043a18e7d93477f3978bdf

23 months agoChange target to r32p1-bifrost by default
Nolen Johnson [Wed, 22 Dec 2021 03:28:46 +0000 (22:28 -0500)]
Change target to r32p1-bifrost by default

* Reflects g12 families Android S blob update.

Change-Id: I8659fe08b4a9afe546a91273c5aabd8804e96cef

23 months agoAdd makefile to build r21p0-bifrost module
Aaron Kling [Thu, 24 Jun 2021 21:22:02 +0000 (16:22 -0500)]
Add makefile to build r21p0-bifrost module

Change-Id: I308690d109deb06646f4e6a9d9ad2638115d8cef

2 years agoSplit mali gpu makefiles per GPU arch lineage-19.1 staging/lineage-20
Vitaliy Tomin [Fri, 27 May 2022 16:57:40 +0000 (00:57 +0800)]
Split mali gpu makefiles per GPU arch

* use TARGET_AMLOGIC_GPU_ARCH flag set to bifrost, midgard or utgard to
  select proper mali module to build

Change-Id: I1b32483fc32e2709688013a2941baa877484dee5

2 years agoFix private modules install path
Hongguang [Tue, 24 May 2022 02:25:39 +0000 (19:25 -0700)]
Fix private modules install path

Bug: 220644706
Test: make and find the private modules in dist.
Change-Id: I0a578770492117c16b8bd4c1dfb57b9faeea361e

2 years agoPrivate modules should be installed into private
Hongguang [Mon, 23 May 2022 23:16:35 +0000 (16:16 -0700)]
Private modules should be installed into private

Bug: 220644706
Test: make and find the private modules in dist.
Change-Id: Idbf193f544f7e971d1251d00f1c82961917adbab

2 years agobifrost: Add missing EXTRA_FLAGS to Android.mk
Vitaliy Tomin [Tue, 3 May 2022 00:46:12 +0000 (08:46 +0800)]
bifrost: Add missing EXTRA_FLAGS to Android.mk

* it is set in gpu-v2.mk, but missing in Android.mk
* fixes kernel issues like:
 [  113.437969@0]d WARNING: CPU: 0 PID: 3478 at drivers/dma-buf/dma-buf.c:584 dma_buf_unmap_attachment+0x6c/0x7

Change-Id: Ie880908fd69d3cee80043a18e7d93477f3978bdf

2 years agoChange target to r32p1-bifrost by default
Nolen Johnson [Wed, 22 Dec 2021 03:28:46 +0000 (22:28 -0500)]
Change target to r32p1-bifrost by default

* Reflects g12 families Android S blob update.

Change-Id: I8659fe08b4a9afe546a91273c5aabd8804e96cef

2 years agoAdd makefile to build r21p0-bifrost module
Aaron Kling [Thu, 24 Jun 2021 21:22:02 +0000 (16:22 -0500)]
Add makefile to build r21p0-bifrost module

Change-Id: I308690d109deb06646f4e6a9d9ad2638115d8cef

3 years agogpu: fix r32p1 build error on user version [3/14]
binqi zhang [Wed, 18 Aug 2021 09:26:46 +0000 (17:26 +0800)]
gpu: fix r32p1 build error on user version [3/14]

PD#SWPL-56978

Problem:
mali driver is not official for AndroidS

Solution:
update to r32p1 beta

Verify:
full verification tests on ohm

Change-Id: Ie689970b5a2e6aef6f03adbcc210e4f3d61c23fa
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
3 years agogpu: update r32p1 gpu driver [2/14]
binqi zhang [Thu, 12 Aug 2021 09:02:38 +0000 (17:02 +0800)]
gpu: update r32p1 gpu driver [2/14]

PD#SWPL-56978

Problem:
mali driver is not official for AndroidS

Solution:
update to r32p1 beta

Verify:
full verification tests on ohm

Change-Id: Id6cd1282e9f8f0743602224c763808700e56e9f9
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
3 years agoAdd makefile to build r21p0-bifrost module lineage-18.1
Aaron Kling [Thu, 24 Jun 2021 21:22:02 +0000 (16:22 -0500)]
Add makefile to build r21p0-bifrost module

Change-Id: I308690d109deb06646f4e6a9d9ad2638115d8cef

3 years agoadt3-S mali_driver source code [1/1]
Liang Ji [Tue, 15 Jun 2021 04:38:49 +0000 (12:38 +0800)]
adt3-S mali_driver source code [1/1]

internal tot CL:
mali450: add new version r10p1 for mali450 [1/1]

PD#SWPL-46060

Problem:
mali450 support for android-r

Solution:
upgrade mali450 to r10p1 base on r10p0

Verify:
einstein

Change-Id(I4e00c15cad463b0a138975b2bddab26f9c3bbe24)
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
Signed-off-by: Liang Ji <liang.ji@amlogic.com>
Change-Id: Ibd616da8fb67e32665170ac6c0c1c326dfe1b7d3

3 years agomali-driver: change the WARN info [1/1]
Dezhi Kong [Mon, 1 Feb 2021 10:52:00 +0000 (18:52 +0800)]
mali-driver: change the WARN info [1/1]

PD#SWPL-42494

Problem:
two may debug info result in crash reboot

Solution:
change the WARN_ON TO WARN_ONCE

Verify:
ah212

Change-Id: Ie5941ab1465f1196efb128295b5a6a90b6f423e8
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
3 years agomali-driver: fix makefile issue for r25p0 [1/1]
Dezhi Kong [Wed, 6 Jan 2021 03:25:11 +0000 (11:25 +0800)]
mali-driver: fix makefile issue for r25p0 [1/1]

PD#SWPL-40275

Problem:
gpu dvfs work abnormal.

Solution:
fix makefile issue.
sync r-tv-dev to mainline

Verify:
SM1-AC214

Change-Id: I0f8ff9048b330bb40bb1c9874d2f5bd68e584b4d
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
3 years agomali-driver: add t7 support on r25p0 [1/1]
Dezhi Kong [Mon, 14 Dec 2020 10:04:00 +0000 (18:04 +0800)]
mali-driver: add t7 support on r25p0 [1/1]

PD#SWPL-36458

Problem:
t7 gpu bringup

Solution:
add t7 support on r25p0
sync coding style with origin driver
mark pm-runtime-power-off which is no use for ic before T7

Verify:
ptm

Change-Id: I13b28c84e6013336cb353160e4a7a8f425dcc74e
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
4 years agoRevert "agpu: support clang and gcc build [1/8]"
binqi zhang [Mon, 2 Nov 2020 10:26:20 +0000 (05:26 -0500)]
Revert "agpu: support clang and gcc build [1/8]"

This reverts commit cc203182986c2765b1b3fa7da264a6bf609535f8.

Change-Id: I9f802ec1a7ca828c2059d68050f751f56e6bc8e0

4 years agoMerge "mali-driver: update build config for R [3/8]" into mainline
Sky Zhou [Mon, 2 Nov 2020 08:27:10 +0000 (00:27 -0800)]
Merge "mali-driver: update build config for R [3/8]" into mainline

4 years agoMerge "mali-driver: support standalone build for R [2/8]" into mainline
Sky Zhou [Mon, 2 Nov 2020 08:27:05 +0000 (00:27 -0800)]
Merge "mali-driver: support standalone build for R [2/8]" into mainline

4 years agomali-driver: update build config for R [3/8]
Ao Xu [Fri, 24 Apr 2020 09:49:51 +0000 (17:49 +0800)]
mali-driver: update build config for R [3/8]

PD#SWPL-35312

Problem:
nedd add dma buf map on demand config

Solution:
add CONFIG_MALI_DMA_BUF_MAP_ON_DEMAND

Verify:
newton

Change-Id: Ibd1bf64e4aede72592c3c84d9d5bcea226090cc8
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
4 years agomali-driver: support standalone build for R [2/8]
Xindong Xu [Sat, 4 Apr 2020 03:26:29 +0000 (11:26 +0800)]
mali-driver: support standalone build for R [2/8]

PD#SWPL-35312

Problem:
need to support modules standalone build

Solution:
support modules standalone build

Verify:
franklin

Change-Id: I15ea416649143da866bbfe351ba0b7aee894108b
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
4 years agoagpu: support clang and gcc build [1/8]
Jinping Wang [Sun, 8 Mar 2020 09:20:25 +0000 (17:20 +0800)]
agpu: support clang and gcc build [1/8]

PD#SWPL-35312

Problem:
need support build with clang
when switch build to clang, it throw many errors.

Solution:
there's some coding problem throw out by clang, clang
consider warning as error, so eliminate with -Wno-error
first. module owner need fix this issue, they're
potential bugs!

the coding issue need tracking in other thread.

Verify:
local and patchbuild

Change-Id: Iffee5be4f58bd97065b63110fa79792c3a77742c
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
4 years agogpu: update r25p0 for AndroidR [8/14]
binqi zhang [Fri, 14 Aug 2020 12:13:40 +0000 (20:13 +0800)]
gpu: update r25p0 for AndroidR [8/14]

PD#SWPL-31344

Problem:
mali driver is not official for AndroidR

Solution:
update to r25p0

Verify:
full verification tests on franklin、newton

Change-Id: Ib10f3820960ecc6ab962b566199e177ee01b7705
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
4 years agogpu: update gpu driver for t5 [1/1]
Dezhi Kong [Fri, 25 Sep 2020 12:44:31 +0000 (20:44 +0800)]
gpu: update gpu driver for t5 [1/1]

PD#SWPL-33677

Problem:
The mali poweron ack reg have been remove on T5
The read operation of AO_RTI_GEN_PWR_ACK0 will result in crash

Solution:
replace the gpu power on status with gpu internal reg value.

Verify:
ak326 socket board

Change-Id: If9ad2eac0ba5759dc91901b2e7e296caf04a25a5
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
4 years agogpu: check the null pointer [1/1]
Liang Ji [Tue, 2 Jun 2020 07:18:04 +0000 (15:18 +0800)]
gpu: check the null pointer [1/1]

PD#SWPL-31635

Problem:
mali crash because of null pointer

Solution:
add ctx check

Verify:
AH212

Change-Id: Ic712e9bc99d81a65b6c0dbad0ebcfb9378cc2b46
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
4 years agogpu: disable lazy map [1/3]
Dezhi Kong [Thu, 30 Jul 2020 12:30:14 +0000 (20:30 +0800)]
gpu: disable lazy map [1/3]

PD#SWPL-24588

Problem:
low score for mali450 offscreen

Solution:
rm CONFIG_MALI_DMA_BUF_LAZY_MAP which enable in SWPL-21801
add video layer flag check

Verify:
p244#117

Change-Id: Ifb8898381a0c73f3dc015f6d09c26833c3b038ff
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
4 years agogpu: add build script [1/1]
Jiyu Yang [Fri, 19 Jun 2020 06:59:12 +0000 (14:59 +0800)]
gpu: add build script [1/1]

PD#SWPL-25844

Problem:
no build script for bifrost

Solution:
add it

Verify:
newton
./gpu-build.h -h

Change-Id: I23c4b75247193080b45902965acea6b4a9b64179
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
4 years agogpu: update the gpu driver for sc2 [2/2]
Jiyu Yang [Wed, 3 Jun 2020 03:37:45 +0000 (11:37 +0800)]
gpu: update the gpu driver for sc2 [2/2]

PD#SWPL-25844

Problem:
no support for sc2

Solution:
compatible with g12a/b, tl1, tm2
add sc2 support

Verify:
ptm board1/3
gpu.fill_buffer pass
gpu.gl2_basic pass
compute_particles pass

Change-Id: I6143a2b401022733075cc79a35d4adcc376e3d70
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
4 years agogpu: support standalone build for 4.9 + R [3/4]
Jiyu Yang [Fri, 8 May 2020 07:03:02 +0000 (15:03 +0800)]
gpu: support standalone build for 4.9 + R [3/4]

PD#SWPL-23333

Problem:
need to support standalone build for 4.9 + R

Solution:
support standalone build for 4.9 + R

Verify:
franklin

Change-Id: I017adf7e637bda9e3ee30ee4326f10f143ae786d
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
4 years agogpu: update video texture [2/3]
Jiyu Yang [Fri, 24 Apr 2020 06:37:48 +0000 (14:37 +0800)]
gpu: update video texture [2/3]

PD#SWPL-24168

Problem:
no video texture update

Solution:
update it before gpu read

Verify:
P212BT15501

Change-Id: Id578f2df126f9051489aa6ff01ddb40f103b9860
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
4 years agogpu: lazy dma map [1/2]
Jiyu Yang [Wed, 8 Apr 2020 09:54:02 +0000 (17:54 +0800)]
gpu: lazy dma map [1/2]

PD#SWPL-21801

Problem:
there is many memory footprint on r10p0

Solution:
add CONFIG_MALI_DMA_BUF_LAZY_MAP

Verify:
P212BT15501

Change-Id: I5e24fb1a84b981c48a9e97be0965e818729ae0ba
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
4 years agogpu: change the clk setting on 5.4 [2/2]
Jiyu Yang [Wed, 19 Feb 2020 11:48:58 +0000 (19:48 +0800)]
gpu: change the clk setting on 5.4 [2/2]

PD#SWPL-19068

Problem:
no support for kernel 5.4

Solution:
add kernel5.4 support

Verify:
ac234#020

Change-Id: I0a67ceeee06b2d6815fed63cc7ef1b1e5350ae02
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
4 years agogpu: add mali450 support for Q [1/4]
Jiyu Yang [Wed, 15 Jan 2020 12:13:40 +0000 (20:13 +0800)]
gpu: add mali450 support for Q [1/4]

PD#SWPL-9341

Problem:
no Q version for ampere

Solution:
add r10p0 for ampere

Verify:
ampere

Change-Id: I434613e725f75905c3182a87c73c3fa350f7c486
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
4 years agogpu: MALI_DMA_BUF_MAP_ON_DEMAND by default [1/1]
Jiyu Yang [Mon, 2 Dec 2019 09:46:40 +0000 (17:46 +0800)]
gpu: MALI_DMA_BUF_MAP_ON_DEMAND by default [1/1]

PD#SWPL-18288

Problem:
kernel still use the legacy mode

Solution:
11.2 new DMA-BUF mapping from the Mali release note.
From r18p0-01rel0 version of the DDK the DMA-BUF memory
will be mapped for the GPU when it is imported into the DDK.
This will reduce the CPU load by avoiding unnecessary work
to build GPU page tables potentially every time the work using DMA-BUF memory
is submitted to GPU.

Verify:
ac213

Change-Id: I6405790d84196961f6fcbedf813f212ea61a16e2
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
4 years agomemtrack: fix wrong GL mem counting on AndroidP [2/3]
binqi zhang [Wed, 20 Nov 2019 10:24:34 +0000 (18:24 +0800)]
memtrack: fix wrong GL mem counting on AndroidP [2/3]

PD#SWPL-16844

Problem:
Lost ram caused by ion_page_pool_alloc

Solution:
count ion cached memory in other mtrack

Verify:
adb shell dumpsys meminfo
Confirm EGL entries

Change-Id: Ie9e5535089260ffb89568ec66774af25a3f694ec
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
5 years agogpu: init r21p0-01rel0 [1/3]
Jiyu Yang [Mon, 11 Nov 2019 15:46:02 +0000 (23:46 +0800)]
gpu: init r21p0-01rel0 [1/3]

PD#SWPL-16553

Problem:
arm released the latest r21p0

Solution:
add r21p0 patch

Verify:
ac213

Change-Id: I2c59b58c1c0b2bfd08371c5f94a6bd1946cdf080
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
5 years agogpu: reset keep_count when loading shake[2/3]
Jiyu Yang [Wed, 23 Oct 2019 17:10:38 +0000 (01:10 +0800)]
gpu: reset keep_count when loading shake[2/3]

PD#SWPL-15215

Problem:
preheat clk usually set before utilization is zero, which lead
stay_count go down from zero.

Solution:
1. reset stay_count when utilization in threshold
2. reset stay_count when preheat

Verify:
newton_BCM

Change-Id: Ia697fe129189c9481b5ec6180c65911866ed1a8d
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
5 years agogpu: update r16p0->r20p0 mali.ko patch [5/6]
haiyuan xiong [Fri, 20 Sep 2019 09:14:13 +0000 (17:14 +0800)]
gpu: update r16p0->r20p0 mali.ko patch [5/6]

PD#SWPL-14150

Problem:
arm released the latest r20p0

Solution:
add r20p0 patch

Verify:
verified on franklin & newton

Change-Id: I8de45b647deac5088f0af932b02b532d73b6f7cc
Signed-off-by: haiyuan xiong <haiyuan.xiong@amlogic.com>
5 years agogpu: add slt check node on r15/r16 [1/2]
Jiyu Yang [Wed, 18 Sep 2019 13:08:35 +0000 (21:08 +0800)]
gpu: add slt check node on r15/r16 [1/2]

PD#SWPL-14494

Problem:
gpu bad chip

Solution:
update filter case

Verify:
g12b_skt

Change-Id: I7ad0a811d69a69495127419bd9238548d7f247b3
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
5 years agobuild: Resolve array index out-of-bound warning [1/1]
Chia-hung Duan [Wed, 3 Jul 2019 06:43:57 +0000 (14:43 +0800)]
build: Resolve array index out-of-bound warning [1/1]

PD#SWPL-8241

Problem:
** SYNC FROM GOOGLE **
Build failed due to uninitialzed variable

Solution:
Add assertion as guard

Verify:
Build with Android prebuilt toolchain

Change-Id: Iaf84c857e23c9552bc44f4924bda0510c39e0a32

5 years agogpu: s912 update thermal [2/2]
Jiyu Yang [Fri, 12 Jul 2019 08:57:49 +0000 (16:57 +0800)]
gpu: s912 update thermal [2/2]

PD#SWPL-11152

Problem:
no thermal control device node

Solution:
enable thermal

Verify:
q201

Change-Id: I0ff3b028aa9d3cb8418d7b4f567ec639f37b3059
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
5 years agogpu: security patch for midgard [2/2]
Jiyu Yang [Fri, 5 Jul 2019 11:41:58 +0000 (19:41 +0800)]
gpu: security patch for midgard [2/2]

PD#SWPL-10710

Problem:
same as PD#SWPL-10285

Solution:
applied PD#SWPL-10285 patch

Verify:
q201

Change-Id: Ib45a2b31dfa5ff3d0fd17d1bc0d1a271efac146d
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
5 years agogpu: sync thermal driver from dvalin [1/2]
Jiyu Yang [Fri, 5 Jul 2019 11:36:48 +0000 (19:36 +0800)]
gpu: sync thermal driver from dvalin [1/2]

PD#SWPL-10710

Problem:
thernal cannot control the gpu

Solution:
enable thermal control for gpu

Verify:
q201

Change-Id: I002a41a67b3ae91e2b4e1ec770c4f7139dcb80d0
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
5 years agogpu: intergration of midgard r28p0 kernel driver [2/3]
binqi zhang [Wed, 29 May 2019 08:00:39 +0000 (16:00 +0800)]
gpu: intergration of midgard r28p0 kernel driver [2/3]

PD#SWPL-9046

Problem:
herz on AndroidP is using mali450 kernel driver

Solution:
update t82x GPU kernel driver for AndroidP
comment aml_thermal_min_update in driver tmporarily

Verify:
build pass
screencap ok with non-afbc config

Change-Id: I4ebf6364e642464f1f5131311a06eb64bc629c80
Signed-off-by: binqi zhang <binqi.zhang@amlogic.com>
5 years agoQ-bringup: fix gpu build error for Q [6/8]
Shuide Chen [Fri, 28 Dec 2018 06:39:02 +0000 (14:39 +0800)]
Q-bringup: fix gpu build error for Q [6/8]

PD#SWPL-3168

Problem:
cannot build Q source.

Solution:
fix build requirement for Q, as:
https://android.googlesource.com/platform/build/+/master/Changes.md
rearrange the module target

Verify:
locally and patchbuild.

Change-Id: Ie93f0a4baf0c2838d320ba6ad58214bab45e161c
Signed-off-by: Shuide Chen <shuide.chen@amlogic.com>
5 years agoMerge "gpu: fix halt gpu rendering [2/2]" into mainline
Sky Zhou [Wed, 3 Jul 2019 06:07:51 +0000 (23:07 -0700)]
Merge "gpu: fix halt gpu rendering [2/2]" into mainline

5 years agogpu: fixed fence handling error [1/2]
Jiyu Yang [Wed, 26 Jun 2019 06:02:13 +0000 (14:02 +0800)]
gpu: fixed fence handling error [1/2]

PD#SWPL-10285

Problem:
Security issue with fence handling error path on
Linux 4.9.68 and later

Solution:
Modify the function kbase_sync_fence_out_create() in file
drivers/gpu/arm/midgard/mali_kbase_sync_file.c to Insert
Lines as follows to ensure the dma_fence_put() call only happens on
Linux 4.9.67 or lower

Verify:
franklin

Change-Id: I5832be0b8a1065107e2ff092abfe43910e5ddad5
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
5 years agogpu: fix halt gpu rendering [2/2]
Jiyu Yang [Wed, 26 Jun 2019 06:12:24 +0000 (14:12 +0800)]
gpu: fix halt gpu rendering [2/2]

PD#SWPL-10285

Problem:
halt gpu rendering

Solution:
fixed possible gpu halt rendering

Verify:
franklin

Change-Id: Ifcd91dac6a8bf281d7c3d6639564eb34676f0a8a
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
5 years agoInitial empty repository
Inna Palant [Fri, 21 Jun 2019 20:52:38 +0000 (13:52 -0700)]
Initial empty repository

5 years agogpu: resolve dependency for build gpu module [2/2]
Shuide Chen [Tue, 28 May 2019 07:59:52 +0000 (15:59 +0800)]
gpu: resolve dependency for build gpu module [2/2]

PD#SWPL-9058

Problem:
Previous optee module not depend kernel build, which may introduce
problem. after resolve optee issue, found gpu also has such problem
and may break the build.
Previous optee will build kernel configure at Android.mk scanning
stage, even gpu not relies on kernel, the '.config' is ready when start
build gpu module. now changed optee, GPU must depend on kernel module.

Solution:
Let gpu module depend the real kernel target. which fix this problem.

Verify:
locally

Change-Id: I2203ae234d7715878b7dc7d785e5147ebd7e233c
Signed-off-by: Shuide Chen <shuide.chen@amlogic.com>
5 years agogpu: compile okay for 4.19 [1/2]
Jiyu Yang [Mon, 7 Jan 2019 07:35:54 +0000 (15:35 +0800)]
gpu: compile okay for 4.19 [1/2]

PD#SWPL-2873

Problem:
compile error on 4.19

Solution:
compile okay

Verify:
4.19, u200

Change-Id: I701476499854c495d372875b7419a88a28868681
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
5 years agographics: gpu: move android gpu binary to meson_mali git [1/2]
binqi.zhang [Tue, 5 Mar 2019 07:40:24 +0000 (02:40 -0500)]
graphics: gpu: move android gpu binary to meson_mali git [1/2]

PD#SWPL-4828

Problem:
gpu lib and gpu driver have different licenses

Solution:
move android gpu binary to meson_mali git

Verify:
build pass

Change-Id: Id4fb8fb27b0ddd2bbe038d5e48220ab029099b25
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
5 years agographics: gpu: fix dEQP-EGL.functional.render.* [1/1]
binqi.zhang [Thu, 14 Feb 2019 07:26:21 +0000 (02:26 -0500)]
graphics: gpu: fix dEQP-EGL.functional.render.* [1/1]

PD#OTT-34

Problem:
dEQP-EGL.functional.render.* fail

Solution:
fix AFBC issues for DDK r12p0

Verify:
all dEQP-EGL.functional.render.* pass

Change-Id: I29ad3169e7414ab5205e167cd953e989615a463d
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
5 years agogpu: update mali450 so for AndroiP [1/1]
binqi.zhang [Wed, 16 Jan 2019 08:59:08 +0000 (03:59 -0500)]
gpu: update mali450 so for AndroiP [1/1]

PD#SWPL-2987

Problem:
ampere compile error after update mali DDK

Solution:
update mali450 so for AndroiP

Verify:
compile pass
boot ok, can access in launcher;

Change-Id: I4b15384176cd58864a2c434b9d65d0537c1880ae
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
5 years agogpu: upgrade bifrost r16p0 GPU driver for AndroidP [1/1]
binqi.zhang [Tue, 25 Dec 2018 11:02:08 +0000 (06:02 -0500)]
gpu: upgrade bifrost r16p0 GPU driver for AndroidP [1/1]

PD#SWPL-2987

Problem:
Porting r16p0 GPU driver to android P

Solution:
Porting r16p0 GPU driver to android P
based on gralloc r12p0

Verify:
1.boot ok, can access in launcher;
2.mali porting sample run ok.
3.deqp pass.

Change-Id: I6fb52b0d683f883004b2588f05ad706368681144
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
5 years agogpu: fix occasional compile error [1/1]
binqi.zhang [Fri, 21 Dec 2018 05:11:02 +0000 (00:11 -0500)]
gpu: fix occasional compile error [1/1]

PD#SWPL-3488

Problem:
occasional compile error

Solution:
fix occasional compile error

Verify:
1. compile pass;
2. boot ok, can access in launcher;

Change-Id: I1997e418da8bf0447b2a1124305a0b74756e868c
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
5 years agogpu: add openCL support [1/1]
Jiyu Yang [Tue, 18 Dec 2018 06:47:50 +0000 (14:47 +0800)]
gpu: add openCL support [1/1]

PD#OP-7

Problem:
fill_buffer cannot work

Solution:
add openCL support

Verify:
tl1_skt,x301

Change-Id: Ice0e3473d637c7373301123528be0d04d33838ab
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
5 years agographics: gpu: fix dEQP-EGL.functional.choose_config* [1/2]
binqi.zhang [Tue, 6 Nov 2018 07:45:39 +0000 (15:45 +0800)]
graphics: gpu: fix dEQP-EGL.functional.choose_config* [1/2]

PD#OTT-34

Problem:
dEQP-EGL.functional.choose_config* fail

Solution:
open EGL extention EGL_EXT_pixel_format_float

Verify:
all dEQP-EGL.functional.choose_config* pass

Change-Id: Ib1a9c81efcf8c9e70521780b65ac35c3ed2aaf15
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
6 years agogpu: Porting r15p0 ddk to android P [1/1]
binqi.zhang [Fri, 16 Nov 2018 11:38:29 +0000 (06:38 -0500)]
gpu: Porting r15p0 ddk to android P [1/1]

PD#SWPL-2124

Problem:
Porting r15p0 ddk to android P

Solution:
Porting r15p0 ddk to android P

Verify:
1.boot ok, can access in launcher;
2.mali_vulkan_integration_suite can run;
3.some vulkan examples can run;

Change-Id: I09cd95b9be7d6b423f4c2ba5e7de3b3b7348ae18
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
6 years agogpu: license update [1/1]
Jiyu Yang [Fri, 16 Nov 2018 08:56:37 +0000 (16:56 +0800)]
gpu: license update [1/1]

PD#SWPL-2111

Problem:
license unclear

Solution:
declare the GPL license

Verify:
ampere

Change-Id: I58db53730c5032e54a70f5af12c4b3343248224c
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
6 years agogpu: license update [1/1]
Jiyu Yang [Fri, 16 Nov 2018 02:24:42 +0000 (10:24 +0800)]
gpu: license update [1/1]

PD#SWPL-2111

Problem:
license unclear

Solution:
declare the GPL license

Verify:
ampere

Change-Id: I64a5454d598bbe132f357200103925865a2df199
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
6 years agogpu: duplicate the max freq for S805Y [1/1]
Jiyu Yang [Fri, 2 Nov 2018 09:46:56 +0000 (17:46 +0800)]
gpu: duplicate the max freq for S805Y [1/1]

PD#SWPL-940

Problem:
S805Y only max support freq is 666M.
if dts was wrong, kernel panic.

Solution:
limit the freq to 666M

Verify:
s805y_p215

Change-Id: Id4f3c243041febfc0939d22705e749b70d41b551
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
6 years agogpu: limit the S805Y freq [1/1]
Jiyu Yang [Thu, 1 Nov 2018 08:24:48 +0000 (16:24 +0800)]
gpu: limit the S805Y freq [1/1]

PD#SWPL-940

Problem:
S805Y only max support freq is 666M.
if dts was wrong, kernel panic.

Solution:
limit the freq to 666M

Verify:
s805y_p215

Change-Id: Ie893c92120d239402b9933b486c520d6c54ace4a
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
6 years agoMerge "gpu: add 32bit kernel support [1/1]" into r6p1
Jian Xu [Wed, 24 Oct 2018 06:41:56 +0000 (23:41 -0700)]
Merge "gpu: add 32bit kernel support [1/1]" into r6p1

6 years agogpu: use DEBUG macro for trace_printk [1/1]
Jiyu Yang [Fri, 28 Sep 2018 05:55:38 +0000 (13:55 +0800)]
gpu: use DEBUG macro for trace_printk [1/1]

PD#SWPL-313

Problem:
use trace print in release driver

Solution:
remove the trace_printk

Verify:
run on the p321, there is no trace_printk debug info.

Change-Id: I9b6f4a5e9df41cf0dd3d4791e87d9b01ed4b43e2
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agogpu: add 32bit kernel support [1/1]
Jiyu Yang [Mon, 22 Oct 2018 07:21:58 +0000 (15:21 +0800)]
gpu: add 32bit kernel support [1/1]

PD#SWPL-684

Problem:
the 32 bit kernel can't work

Solution:
introduce FMODE_UNSIGNED_OFFSET to allow negative file offsets

Verify:
run on the u212, which can boot into home.

Change-Id: I9af133e945911c5f4287c9a566ea38524f665dab
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
6 years agogpu: use buffer's usage as the filter instead of width&height
binqi.zhang [Tue, 31 Jul 2018 09:02:59 +0000 (17:02 +0800)]
gpu: use buffer's usage as the filter instead of width&height

PD# NONE

prevent potential risk

Change-Id: Ib1a8cdf58bdefdc06baa6ba977ce038d3dfb428e

6 years agogpu:disable platform power down macro
Jiyu Yang [Wed, 29 Aug 2018 05:34:21 +0000 (13:34 +0800)]
gpu:disable platform power down macro

PD#173105: gpu:disable platform power down macro

Change-Id: I545cad6b5fe064a10b6a566f1acf071806498073

6 years agokasan: fix bug report in mali driver
tao zeng [Thu, 30 Aug 2018 06:08:18 +0000 (14:08 +0800)]
kasan: fix bug report in mali driver

PD#172700

When kasan enabled, following bug will report:
==================================================================
BUG: KASAN: use-after-free in mali_allocation_unref+0x1b8/0x350 [mali]
Read of size 8 at addr ffffffc04c0b6378 by task BootAnimation/3034

CPU: 3 PID: 3034 Comm: BootAnimation Tainted: G    B      O    4.9.113 #5
Hardware name: Amlogic (DT)
Call trace:
[<ffffff900908ecc0>] dump_backtrace+0x0/0x368
[<ffffff900908f0cc>] show_stack+0x24/0x30
[<ffffff900963bdb0>] dump_stack+0xa0/0xc8
[<ffffff90092ba140>] print_address_description+0x68/0x258
[<ffffff90092ba694>] kasan_report+0x264/0x338
[<ffffff90092b8cd4>] __asan_load8+0x84/0x98
[<ffffff900260bce8>] mali_allocation_unref+0x1b8/0x350 [mali]
[<ffffff900260ab74>] _mali_ukk_mem_free+0xcc/0x190 [mali]
[<ffffff900260e4a0>] mem_free_wrapper+0x110/0x1c0 [mali]
[<ffffff90026129c0>] mali_ioctl+0x210/0x4b8 [mali]
[<ffffff900935c8d8>] compat_SyS_ioctl+0xe0/0x1218
[<ffffff9009083f00>] el0_svc_naked+0x34/0x38

Allocated by task 3034:
save_stack_trace_tsk+0x0/0x268
save_stack_trace+0x24/0x30
kasan_kmalloc+0xd8/0x188
kasan_slab_alloc+0x14/0x20
kmem_cache_alloc+0x118/0x258
mmap_region+0x390/0x7a8
do_mmap+0x308/0x470
vm_mmap_pgoff+0x140/0x168
SyS_mmap_pgoff+0x98/0x118
el0_svc_naked+0x34/0x38

Freed by task 3034:
save_stack_trace_tsk+0x0/0x268
save_stack_trace+0x24/0x30
kasan_slab_free+0x88/0x188
kmem_cache_free+0x68/0x268
remove_vma+0x94/0xa8
do_munmap+0x340/0x500
SyS_munmap+0x58/0x80
el0_svc_naked+0x34/0x38

The buggy address belongs to the object at ffffffc04c0b62d0
which belongs to the cache vm_area_struct of size 176
The buggy address is located 168 bytes inside of
176-byte region [ffffffc04c0b62d0ffffffc04c0b6380)
The buggy address belongs to the page:
page:ffffffbf01302d80 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x851af00000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffffffc04c0b6200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc04c0b6280: 00 00 fc fc fc fc fc fc fc fc fb fb fb fb fb fb
>ffffffc04c0b6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffffffc04c0b6380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffffffc04c0b6400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc
==================================================================

Once UI have any update, this report will print. It is because
cpu_mapping.vma not cleared in mali_mem_vma_close hook and used
in mali_allocation_unref function.

Change-Id: Ic6319b6e6c6255324736d82cf0d386b6f61a39b8
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
6 years agogpu: fix mk build when rm tdk [1/2]
Ao Xu [Tue, 28 Aug 2018 08:09:39 +0000 (16:09 +0800)]
gpu: fix mk build when rm tdk [1/2]

PD#171503: gpu: fix mk build when rm tdk

Change-Id: If70ae3a8af8bba7f6fd7e1259e17a5c95cba5943
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
6 years agouse sync_file instead of the mali_internal_sync_fence [2/3]
Jiyu Yang [Mon, 30 Jul 2018 12:01:10 +0000 (20:01 +0800)]
use sync_file instead of the mali_internal_sync_fence [2/3]

PD#170298: use sync_file instead of the mali_internal_sync_fence
this is only a minimal change.
Change-Id: I848fc202dbcebbb46ce6908b41b02cf2b0404e97

6 years agoenable --strip-debug to reduce module size
Jiyu Yang [Tue, 17 Jul 2018 10:48:02 +0000 (18:48 +0800)]
enable --strip-debug to reduce module size

Change-Id: I494faba45e38226b94d46187f1b9be52c0d8e2db

6 years agogpu: fix img's crop_bottom&crop_right value when playing 4k2k video
binqi.zhang [Tue, 24 Jul 2018 13:40:04 +0000 (21:40 +0800)]
gpu: fix img's crop_bottom&crop_right value when playing 4k2k video

PD# 162923

Change-Id: I02f2151561b74e6f6680e29830e4c392861e3cfd

6 years agogpu: add libOpenCL symbol link under Android
Jiyu Yang [Fri, 6 Jul 2018 10:49:42 +0000 (18:49 +0800)]
gpu: add libOpenCL symbol link under Android

PD#168676: add libOpenCL symbol link under Android

Change-Id: Ibbad735a3786d7b8dab7c1d5261c73fc185dd354

6 years agogpu: update some mali patches
binqi.zhang [Wed, 20 Jun 2018 11:36:16 +0000 (19:36 +0800)]
gpu: update some mali patches

PD# 164260

1. when texture is created with a null pointer, utgatd DDK doesn’t clear the new buffer
2.fix mali null point issue

Change-Id: I66f60ff227de8b9ae66bea7ddc685e3ca76a618f

6 years agoadd r12p0 driver to support g12b [1/3]
Jiyu Yang [Wed, 20 Jun 2018 03:54:43 +0000 (11:54 +0800)]
add r12p0 driver to support g12b [1/3]

PD#168674: add r12p0 driver
Change-Id: I9c83ec80c7f2e9da6f8ff7bf22211ba850bf4442

6 years agomem: remove NORETRY flag, and fix possible deadlock.
sky zhou [Mon, 28 May 2018 07:01:37 +0000 (15:01 +0800)]
mem: remove NORETRY flag, and fix possible deadlock.

PD#168336

For low ram device, gpu may failed to alloc memory
with NORETRY flag.
Without NORETRY flag, allocation may be meet deadlock
when OOM killer triggered.

Change-Id: Ia93c16d387d524e4f9f078df1156da96800cc49a

6 years agoadd check node for slt[1/3]
Jiyu Yang [Mon, 23 Apr 2018 12:28:47 +0000 (20:28 +0800)]
add check node for slt[1/3]

PD#NONE
Change-Id: Iabe5491ca2f6be5130566bda703dc16920acce13

6 years agoFixed mem leak of fence on 4.9.68 and newer
Jiyu Yang [Thu, 12 Apr 2018 12:00:37 +0000 (20:00 +0800)]
Fixed mem leak of fence on 4.9.68 and newer

PD#163966
Relevant kernel commits:
30cd85dd6edc86ea8d8589efb813f1fad41ef233 for v4.10 (master)
3a83421d482e7d7c6f4251dcd825548e5262c054 for v4.9.68

Change-Id: I30870fbeeaebd6e84e4a2929ac22a7d065beb20b

6 years agocooldev: fix gpu cooldev.
Huan Biao [Fri, 23 Mar 2018 09:00:00 +0000 (17:00 +0800)]
cooldev: fix gpu cooldev.

PD#160967: cooldev: add g12a gpu cooling devices.

Change-Id: I9f3b4c4e3af74f9dab75e47517e4e011dc0a5778
Signed-off-by: Huan Biao <huan.biao@amlogic.com>
6 years agoPD#161216: cooldev: fix k49 and k314 config change.
Huan Biao [Fri, 23 Mar 2018 11:24:13 +0000 (19:24 +0800)]
PD#161216: cooldev: fix k49 and k314 config change.

Change-Id: I58fddf3ea8c12b8e4589b2bd95eef2d26d9ca348
Signed-off-by: Huan Biao <huan.biao@amlogic.com>
6 years agoupdate different prebuilt so for different gralloc[1/1]
Jiyu Yang [Thu, 8 Mar 2018 06:41:48 +0000 (14:41 +0800)]
update different prebuilt so for different gralloc[1/1]

PD#161903
Change-Id: Ia68ecd73c9f270b4904540bef9096fea9af51374

6 years agoMerge "gpu: update so since gralloc usage has been changed [2/4]" into r6p1
Simon Zheng [Mon, 19 Mar 2018 14:54:08 +0000 (07:54 -0700)]
Merge "gpu: update so since gralloc usage has been changed [2/4]" into r6p1

6 years agogpu: update so since gralloc usage has been changed [2/4]
binqi.zhang [Fri, 16 Mar 2018 15:28:51 +0000 (23:28 +0800)]
gpu: update so since gralloc usage has been changed [2/4]

PD#162471

Change-Id: Iaa31a1eef903a3bdb91f8252c6c8be52ea1b96ed

6 years agogpu: mali internal fence wait signaled when return -ENOENT
Jiyu Yang [Tue, 13 Mar 2018 03:33:03 +0000 (11:33 +0800)]
gpu: mali internal fence wait signaled when return -ENOENT

PD#160990
Note that the callback can be called from an atomic context.  If
fence is already signaled, this function will return -ENOENT (and
*not* call the callback)
Change-Id: I347e082b7b7639f8122f65734467977494a53445

6 years agoset gp0 clock to the proper rate when init
Jiyu Yang [Thu, 8 Mar 2018 08:25:56 +0000 (16:25 +0800)]
set gp0 clock to the proper rate when init

Change-Id: I5976fdacf485822212fd85ab7f2b04635ff9e4ad

6 years agogpu: fixed hiu bus addr on 4.9 kernel[1/2]
Jiyu Yang [Mon, 22 Jan 2018 06:18:03 +0000 (14:18 +0800)]
gpu: fixed hiu bus addr on 4.9 kernel[1/2]

PD#159303: this may cause the suspend to ram crash at mali modules

Change-Id: Ic328f8abca4a39bdb1321f379fbfc63626f6e875

6 years agogpu: fixed the fence struct since 4.9.68
Jiyu Yang [Thu, 11 Jan 2018 04:53:06 +0000 (12:53 +0800)]
gpu: fixed the fence struct since 4.9.68

PD#151803

Change-Id: I265692a3c6fa4ad3ea4dda8b79c6dcd28f8a4ac5

6 years agodvalin: change the default boost index
Jiyu Yang [Tue, 6 Mar 2018 07:52:44 +0000 (15:52 +0800)]
dvalin: change the default boost index

PD#161518
Change-Id: Ia2136bc006e28e1c9426dbd277440ab44479c43a

6 years agogpu: dvalin bringup based on amlogic-pd-156734 [2/5]
Jiyu Yang [Tue, 27 Feb 2018 09:06:43 +0000 (17:06 +0800)]
gpu: dvalin bringup based on amlogic-pd-156734 [2/5]

PD#156734
Change-Id: Id9da6f8728af76738955f456c5b312a5d305567a

6 years agogralloc1: update for gralloc1 [1/5]
Jiyu Yang [Tue, 5 Dec 2017 08:25:04 +0000 (16:25 +0800)]
gralloc1: update for gralloc1 [1/5]

PD#154776
Change-Id: Iec0fd7b51dfbaa42db7ddda96641a12ceff47439

6 years agogpu: fix GL 0x505 issue for utgard r8p0
binqi.zhang [Thu, 25 Jan 2018 11:58:11 +0000 (19:58 +0800)]
gpu: fix GL 0x505 issue for utgard r8p0

PD#157391

Change-Id: I3a9138667fe0f55083915c561115a665919eb620

6 years agoPD#133451 add l2_max_reads for custom
Jiyu Yang [Thu, 4 Jan 2018 06:32:28 +0000 (14:32 +0800)]
PD#133451 add l2_max_reads for custom

/sys/class/mpgpu/l2_max_reads
AX_READ Register bit assignments
Bits Name Function
[31:5] - Reserved, read as zero
[4:0] Max_Reads Limit the number of outstanding read transactions to this amount

Change-Id: Idae8fa0a8e85f90749a62f6972b5bbe176008cd2

6 years agomv to vendor/amlogic [2/5]
Jiyu Yang [Wed, 20 Dec 2017 08:31:48 +0000 (16:31 +0800)]
mv to vendor/amlogic [2/5]

PD#157243

Change-Id: I11d11f89ad58d0e65a10686f7895e4f91393deb4