GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_mali-driver.git
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>
5 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 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>
6 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

6 years agogpu: fixed the fence struct since 4.9.68
Jiyu Yang [Fri, 5 Jan 2018 02:44:01 +0000 (10:44 +0800)]
gpu: fixed the fence struct since 4.9.68

PD#151803
Change-Id: I5617acd8880666cf4ad24812ab248b904de58e52

6 years agogpu: update midgard r21p0 kernel driver
binqi.zhang [Fri, 1 Dec 2017 12:46:06 +0000 (20:46 +0800)]
gpu: update midgard r21p0 kernel driver

PD#156681

TX041-BU-00000-r21p0-01rel0

Change-Id: I141ffc605a294b0234b4e533b1a80f43e2aa2d94

6 years agoRevert "sync: fix dEQP-EGL*get_frame_timestamps* "
binqi.zhang [Fri, 8 Dec 2017 06:35:55 +0000 (14:35 +0800)]
Revert "sync: fix dEQP-EGL*get_frame_timestamps* "

This reverts commit 2b2fcd586ad75743cca351105a8e98c8ad094deb.

Change-Id: I9228249130e3fd4185d0509c3339f9c9503b3cd6

6 years agogpu: update t83x prebuilt so
Jiyu Yang [Tue, 5 Dec 2017 12:58:47 +0000 (20:58 +0800)]
gpu: update t83x prebuilt so

Change-Id: I9c3a323e131b8fcffc3387f4b498430613aa4da7

7 years agosync: fix dEQP-EGL*get_frame_timestamps* [3/3]
binqi.zhang [Thu, 30 Nov 2017 12:13:52 +0000 (20:13 +0800)]
sync: fix dEQP-EGL*get_frame_timestamps*  [3/3]

PD#153134

kept/used no matter the fence is signaled or not

Change-Id: I6302426681728c3ad9ca87700e257f2df33d764e

7 years agoMerge "sync: fix ui issue [1/1]" into r6p1
Simon Zheng [Wed, 29 Nov 2017 14:59:20 +0000 (06:59 -0800)]
Merge "sync: fix ui issue  [1/1]" into r6p1

7 years agosync: fix ui issue [1/1]
binqi.zhang [Fri, 17 Nov 2017 07:54:18 +0000 (15:54 +0800)]
sync: fix ui issue  [1/1]

PD#154866

revert fix_null_draw_call patch
Change-Id: I0603a3b0807ee37b9c14bcc4f573bd46f5ce49f5

7 years agogpu: use _mali_osk_time_mstoticks instead of using raw jiffies [1/1]
sky zhou [Fri, 10 Nov 2017 07:58:22 +0000 (15:58 +0800)]
gpu: use _mali_osk_time_mstoticks instead of using raw jiffies [1/1]
PD #150542: use mali internal api to convert ms to jiffies.

Change-Id: Ic59c319cea9413160eacf937792957653519e0a5

7 years agogpu: update EGL_KHR_wait_sync
binqi.zhang [Fri, 17 Nov 2017 03:26:59 +0000 (11:26 +0800)]
gpu: update EGL_KHR_wait_sync

PD#153134

Change-Id: I0c1cd43f5984b2f4b85cf7a5a0b146c2150cb1af

7 years agogpu: fix mali null drawcall
binqi.zhang [Thu, 9 Nov 2017 07:32:22 +0000 (15:32 +0800)]
gpu: fix mali null drawcall

PD#153134

deqp cases -- get_frame_timestampsRendering* report error "complete times not monotonic"

Change-Id: If0fbbb6f5183de9df6055c696ea7f4fc197a0155

7 years agogpu: remove sync_pt_list non-empty warn when release mali fence.
sky zhou [Mon, 13 Nov 2017 07:59:28 +0000 (15:59 +0800)]
gpu: remove sync_pt_list non-empty warn when release mali fence.

PD#154231: remove sync_pt_list non-empty warning.
When fence is not signaled, the sync_pt_list is not empty.
So the sync_pt_list non-empty is legal, don't need to warn it.

Change-Id: I6b50292fe0939e8d7397983b566481aa6f1ceeac

7 years agogpu: mali will report GL OOM to hwui when alloc_page fail [1/1]
binqi.zhang [Fri, 3 Nov 2017 05:53:14 +0000 (13:53 +0800)]
gpu: mali will report GL OOM to hwui when alloc_page fail [1/1]

PD# 152678

add GFP_KERNEL flag to alloc_page if alloc_page fail and try alloc again

Change-Id: I9bc87ed2e00c9525231eb2aaa3b3971cf0ac8ed8

7 years agogpu: check def_clk when probe
Jiyu Yang [Wed, 1 Nov 2017 08:20:26 +0000 (16:20 +0800)]
gpu: check def_clk when probe

PD#152825:

Change-Id: I9fb943fb13a0c3644d9247ce63eb394a0bcd1dbf
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
7 years agoMerge "gpu: seperately set gp0_pll before changed to 744M" into r6p1
Simon Zheng [Tue, 31 Oct 2017 11:55:31 +0000 (04:55 -0700)]
Merge "gpu: seperately set gp0_pll before changed to 744M" into r6p1

7 years agogpu: update EGL_KHR_wait_sync
Jiyu Yang [Thu, 26 Oct 2017 07:24:45 +0000 (15:24 +0800)]
gpu: update EGL_KHR_wait_sync

PD#153119
add EGL_KHR_wait_sync and remove EGL_KHR_reusable_sync
EGL_KHR_wait_sync which Server-side waits and reusable syncs are
mutually exclusive in the Mali Linux DDK, you
can only enable one at a time.

Change-Id: Id16f5403090337b5966a8c4ef0def733af8d4e07

7 years agogpu: seperately set gp0_pll before changed to 744M
Jiyu Yang [Sat, 28 Oct 2017 09:44:03 +0000 (17:44 +0800)]
gpu: seperately set gp0_pll before changed to 744M

PD#151164: seperately set gp0_pll before changed to 744M
Change-Id: I1550f2e5a3d2b0eea84770eacb36e81fe3a99248
Signed-off-by: Jiyu Yang <Jiyu.Yang@amlogic.com>
7 years agogpu: add null check for mali session memtrack [1/1]
Jiyu Yang [Thu, 21 Sep 2017 10:06:33 +0000 (18:06 +0800)]
gpu: add null check for mali session memtrack [1/1]

use default value if null

Change-Id: Ia725afb83c9fa33a3a8c3e9e487273aeeb245f7c

7 years agogpu: fixed sync leak in AOSP common kernel or LTS kernel 4.10
Jiyu Yang [Wed, 27 Sep 2017 11:42:17 +0000 (19:42 +0800)]
gpu: fixed sync leak in AOSP common kernel or LTS kernel 4.10

PD#151104
Change-Id: I1d1b1481b4579be486525c44378205326c372dd4

7 years agogpu: r8p0-01rel0 release
Jiyu Yang [Wed, 20 Sep 2017 03:56:17 +0000 (11:56 +0800)]
gpu: r8p0-01rel0 release

PD#151266
also add treble support
Change-Id: Ia1a1ba8bf5083d195e9095f7d62bbbbf271b8bb7

7 years agoMerge "gpu: limit the dump function due to kernel version [1/1]" into r6p1
Simon Zheng [Thu, 21 Sep 2017 05:17:00 +0000 (22:17 -0700)]
Merge "gpu: limit the dump function due to kernel version [1/1]" into r6p1

7 years agogpu: limit the dump function due to kernel version [1/1]
binqi.zhang [Tue, 22 Aug 2017 09:19:09 +0000 (17:19 +0800)]
gpu: limit the dump function due to kernel version [1/1]

PD# NONE

limit debug function

Change-Id: I3e294967436e024752b517454416b66ce9009f69

7 years agogpu:optimize the GPU performance [1/1]
binqi.zhang [Thu, 14 Sep 2017 06:02:58 +0000 (14:02 +0800)]
gpu:optimize the GPU performance [1/1]

PD# 150352

mv hw_get_module function out of eglCreateImageKHR

Change-Id: I53639a66ac74f359d8717f14edba0080f85aad14

7 years agogpu:replace the magic number with msecs_to_jiffies [1/1]
Jiyu Yang [Thu, 7 Sep 2017 03:15:42 +0000 (11:15 +0800)]
gpu:replace the magic number with msecs_to_jiffies [1/1]

PD#150542:replace the magic number with msecs_to_jiffies.

Change-Id: I6c5859ddcd487cf458acd3219d7469d13f6dd78e

7 years agosync: add sync_file patch [2/3]
Jiyu Yang [Tue, 5 Sep 2017 11:22:05 +0000 (19:22 +0800)]
sync: add sync_file patch [2/3]

PD#149525
Change-Id: Iaec0450be6ef4094665b9d3d2477be417a5cf374

7 years agogpu: mv gpu lib and mod to vendor [1/2]
Jiyu Yang [Mon, 4 Sep 2017 08:58:57 +0000 (16:58 +0800)]
gpu: mv gpu lib and mod to vendor [1/2]

PD#NONE
default path is system/lib if GPU_MOD_OUT not set
Change-Id: Ic300f7c8eee06251aec6b88781c144c1e894f49b

7 years agogpu: update r8p0 patch [6/7]
Jiyu Yang [Thu, 31 Aug 2017 13:57:24 +0000 (21:57 +0800)]
gpu: update r8p0 patch [6/7]

PD#149525
Change-Id: Ia207984ef4b84dbf6dd3f251f824b04ed7dc8414

7 years agogpu: dump meminfo when mali can't alloc memory [1/1]
Jiyu Yang [Thu, 17 Aug 2017 09:11:00 +0000 (17:11 +0800)]
gpu: dump meminfo when mali can't alloc memory [1/1]

PD# NONE

add debug info

Change-Id: I342dcd3e0600afdf7c77c118430252b0a49ef6b0

7 years agogpu: mali r8p0-00dev0 release [2/2]
Jiyu Yang [Fri, 11 Aug 2017 02:17:56 +0000 (10:17 +0800)]
gpu: mali r8p0-00dev0 release [2/2]

PD#148957
Change-Id: Idce52b46293f2947c342f846f015c0a78b97e69f

7 years agoNEEDLEPLAT-3051: map the scaled videobuffer instead of allocated. [1/1]
Jiyu Yang [Fri, 11 Aug 2017 14:55:58 +0000 (22:55 +0800)]
NEEDLEPLAT-3051: map the scaled videobuffer instead of allocated. [1/1]

PD#148923

[Problem]
AIV started with jittery playbak and then video froze (with audio running)
this problem was introduced in NEEDLEPLAT-1097.

[Solution]
map the scaled video buffer instead of the previous skip map which caused
the mali_mem growing larger and lead to the create EGLImage fail

[Platform]
needle, stark

Change-Id: I8ddbe51698bbec51e5a53afb43c5a9383df6a9db

7 years agoNEEDLEPLAT-2845: Coordinate SF and app rendering, Prevent SF grab gpu source. [1/1]
stark li [Tue, 1 Aug 2017 18:19:21 +0000 (11:19 -0700)]
NEEDLEPLAT-2845: Coordinate SF and app rendering, Prevent SF grab gpu source. [1/1]

PD#148617
[Problem]
IAP purchase dialog gets stuck and unable to make IAP purchases.

[Solution]
Coordinate SF and app rendering, Prevent SF grab gpu source.

[Platform]
needle, stark

Change-Id: I742e9ce825617fe7c1a149f79d66d24c9194b32c

7 years agogpu: fixed o-pdk compile error on r6p1
Jiyu Yang [Tue, 20 Jun 2017 05:49:13 +0000 (13:49 +0800)]
gpu: fixed o-pdk compile error on r6p1

PD#147955
Change-Id: I0088c737927b7901aba37c70e80dbe71e6c65fdf

7 years agoMerge "gpu: fixed min_state of thermal" into r6p1
Simon Zheng [Fri, 21 Jul 2017 07:33:33 +0000 (00:33 -0700)]
Merge "gpu: fixed min_state of thermal" into r6p1