Commit Graph

636 Commits

Author SHA1 Message Date
Xianzhong
9457db7d49 MGS-5458 [#imx-1708] fix GPU/VIP coreIndex issue
coreInfoArray use offset as coreIndex, not use hardware core

Fix: 8744fe58453c("MGS-5372 [#imx-1708] Fix the VX/CL apps hang for 865 GPU/VIP
")

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:03 +08:00
Xianzhong
438b697ff3 LF-408-2 [#imx-1873] disable 1M page for dynamic mapping
1M GPU MMU pages are used for flat mapping by default,
there is no performance benefit for dynamic mapping.

disabled 1M MMU page to fix unstable GPU problems.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:03 +08:00
Richard Liu
d24ba04018 MA-16168 [#imx-1903] Fix GPU driver build error and not work issue on 5.4 kernel
Some drm common code changed, gpu driver need do the matched update on 5.4 kernel.
1. Some drm API name changed.
   drm_gem_object_unreference_unlocked() rename as drm_gem_object_put_unlocked().
   drm_dev_unref() rename as drm_dev_put().
2. Drm/prime remove DRIVER_PRIME, driver needs do the matched update.
3. API gem_prime_export remove input parameter "struct drm_device *dev".

Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2023-10-30 15:55:03 +08:00
Xianzhong
20f090fbe6 MGS-5064 [#imx-1868] 0010-BUG25711-CL244484-Android-CTS-some-cases-fail-in-gle
BUG25711 CL244484 Android CTS: some cases fail in gles2/gles3
 group on imx815 AndroidP/wayland BUG25710 CL244484 [vkcts1.1.3]:fail when run
 "dEQP-VK.glsl.limits.near_max.fragment_input.*" on 815 wayland BUG25646
 CL244484 [vkcts1.1.3]:dEQP-VK.glsl.limits.near_max.fragment_input.* fail on
 815 wayland

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:03 +08:00
Xianzhong
f23890a484 MGS-5064 [#imx-1868] 0006-CL244297-align-gc_feature_database
CL244297 align gc_feature_database

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:03 +08:00
Xianzhong
55c6c0e37b MGS-5064 [#imx-1868] 0003-CL244120-Prepare-for-NXP-backwards-compatible-requir
CL244120 Prepare for NXP backwards compatible requirement.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:03 +08:00
Minjie Zhuang
2da63b1a18 MGS-5226 [#imx-1746] add REG_DisableVIP bit 1
add REG_DisableVIP bit 1 in gpu-viv/hal/kernel/inc/gc_feature_database.h

Signed-off-by: Minjie Zhuang <minjie.zhuang@nxp.com>
2023-10-30 15:55:03 +08:00
Yong Gan
623673f065 MGS-5326 [#imx-1803] 0058-align-gc_feature_database
align gc_feature_database

Signed-off-by: Yong Gan <yong.gan@nxp.com>
2023-10-30 15:55:03 +08:00
Ella Feng
7a21f6fc3b MGS-5372 [#imx-1708] Fix the VX/CL apps hang for 865 GPU/VIP
Add VIP HW type to avoid GPU/VIP command mess when run VX/CL apps.

Date: 4 Dec, 2019
Singed-off-by: Ella Feng <ella.feng@nxp.com>
2023-10-30 15:55:03 +08:00
Xianzhong
f9279b78ef LF-84 [#imx-1834] remove gpu coherent_dma_mask setting
gpu_probe set coherent_dma_mask with 40BIT configuration,
L5.4 dma_alloc_wc will return physical address beyond 4GB,
that will cause GPU hang and kernel panic problem on QM.

default coherent_dma_mask is 32BIT, can meet GPU requirement,
this patch remove coherent_dma_mask setting from GPU driver.

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Ya Zhou
418aa303ee MGS-5245 [#imx-1755] [8MN_EVK] VTK: fix the gpu dump when enable vProfile
fix the gpu dump when enable vProfile on 8MN_EVK

Date: 7th Nov ,2019
Signed-off-by Ya Zhou <ya.zhou@nxp.com>

(cherry picked from commit 053c97c0387673c4e730d9b2f780f8cde5fcdf5b)
2023-10-30 15:55:02 +08:00
Xianzhong
1d8cec7b55 MGS-5307 gpu: integrate 6.4.0.p2 driver
Port M815 GPU patches from 6.2.4.p4 to 6.4.0,
More bug-fixings for vulkan 1.1.3 and NNCTS 1.2.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Yuantian Tang
f0b7451d23 QSDK-5959 [#ccc] update the platform driver to support layerscape soc
Update the imx platform gpu driver to accommodate layerscape soc,
so that both platform can share the same platform driver.

Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
b40b6cd744 MGS-5261 [#imx-1771] fix dummy draw hang for 8MM GPU
dummy draw is required for 8MM GPU errata - HBN1285,
this fix shall be applied for GPU power-up transition,
otherwise GPU shader hang with the unnecessary flush.

check GPU MMU state to enable dummy draw fix only.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
c5abb24467 MGS-5284 [#imx-1786] fix GPU panic with vm_mmap failure
When vm_mmap fail, code jump to OnError with error status and userLogical variable != 0.
Then _CMAFSLUnmapUser is called with a invalid virtual address (MdlMap->vmaAddr) and cause panic.

Check userLogical to avoid GPU kernel panic for error handling.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
b6816faf4c MGS-5283 [#imx-1784] fix GPU AXI bus error
Fix GPU safe memory with gcvALLOC_FLAG_4GB_ADDR

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
70af32da56 MGS-5283 [#imx-1238] fix GPU memory without CMA
Fix GPU memory problem when disable CMA allocator,
set LINUX_CMA_FSL=0 in gc_hal_kernel_platform_imx.config

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
8f9210aa65 MGS-4376 [#imx-1238] fix low performance with CMA allocator
there are lots of PFNs busy message when run GPU tests:
 [  622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
 [  626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy

this problem is related with CMA migration for fragments,

move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.

can improve CTS and gpubench benchmarks on M850D.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit ad77ed61b72c8362b04361acd2deb685fee15436)
2023-10-30 15:55:02 +08:00
Ella Feng
fd350680ad MGS-5176-2 [#imx-1744] Need free the pages if malloc memory failed
When alloc NonContiguous1MPages, if malloc fail, need free the pages to avoid memory leak

Date: 24 Oct, 2019
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
2023-10-30 15:55:02 +08:00
Ella Feng
b007aff26e MGS-5176 [#imx-1744] Coverity issue of 6.4.0.p1.
The intension of this code is that, if current core is null, go to get the next one.
If it's already the last one, no need to do this.

Date: 23 Oct, 2019
Signed-off-by: Ella Feng <ella.feng@nxp.com>
2023-10-30 15:55:02 +08:00
Xianzhong
bce765a89c MGS-5252 Integrate Vivante 6.4.0.p1 GPU driver
Fix Coverity high impact and Vulkan 1.1.3 issues

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:01 +08:00
Leonard Crestez
66f4882c9c gpu-viv: Fix writecombine/wc build error
Upstream removed the _writecombine aliases

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
2023-10-30 15:55:01 +08:00
Minjie Zhuang
c3c2412b8e gpu:Remove dma.h to avoid Linux 5.x build problem
Log:
    ../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:87:17:
fatal error: dma.h: No such file or directory
     #include <dma.h>
                     ^
    compilation terminated.
    ../scripts/Makefile.build:280: recipe for target
'drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o' failed
    make[4]: ***
[drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o] Error 1

Signed-off-by: Minjie Zhuang<minjie.zhuang@nxp.com>
2023-10-30 15:55:01 +08:00
Dong Aisheng
ac9e888edf gpu: fix build break due to dma headfile include
It's caused by GPU upgrade overwrite the former fix.

Log:
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:87:17: fatal error: dma.h: No such file or directory
 #include <dma.h>
                 ^
compilation terminated.
../scripts/Makefile.build:280: recipe for target 'drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o' failed
make[4]: *** [drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o] Error 1

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:01 +08:00
Minjie Zhuang
4600d7485a gpu:Integrate 6.4.0 kernel driver for Linux L5.x
Containing update SCU API and upgrade kernel to 640 driver for Linux L5.x

drivers/mxc/gpu-viv/*

Signed-off-by: Minjie Zhuang<minjie.zhuang@nxp.com>
2023-10-30 15:55:01 +08:00
Minjie Zhuang
1cd41ace9c gpu: Update SCU API and change the method to distinguish 8QM/8QXP from other boards
The SCU API used in this file is for 4.19 kernel version and need to upgrade,
Need to modify the method to distinguish 8QM.8QXP by compatible string

drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c
2023-10-30 15:55:01 +08:00
Dong Aisheng
daf001a9a4 MLK-21876-11 gpu: fix build for next-20190524 upgrade
Failed on imx v6_v7 build.

../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:86:17: fatal error: dma.h: No such file or directory
 #include <dma.h>
                 ^
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:01 +08:00
Dong Aisheng
acd3f337ea gpu: imx: fix gpu boot hang by defer driver register time
GPU driver can't support DEFER_PROBE well.
So let's defer the driver register time to make booting ok first.

[    1.255193] galcore: clk_get clk_core failed
[    1.259741] Galcore version 6.2.4.190076
[    1.342888] Unable to handle kernel NULL pointer dereference at virtual address 00000000000001a0
[    1.351377] Mem abort info:
[    1.354134]   ESR = 0x96000004
[    1.357160]   Exception class = DABT (current EL), IL = 32 bits
[    1.363078]   SET = 0, FnV = 0
[    1.366116]   EA = 0, S1PTW = 0
[    1.369244] Data abort info:
[    1.372101]   ISV = 0, ISS = 0x00000004
[    1.375932]   CM = 0, WnR = 0
[    1.378887] [00000000000001a0] user address but active_mm is swapper
[    1.385234] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.390781] Modules linked in:
[    1.393823] Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____))
[    1.400515] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.1.0-rc5-next-20190418-00708-g2e89357-dirty #159
[    1.409892] Hardware name: Freescale i.MX8QXP MEK (DT)
[    1.415020] pstate: 60000005 (nZCv daif -PAN -UAO)
[    1.419808] pc : __pm_runtime_resume+0x20/0x74
[    1.424233] lr : _SetPower+0x48/0x54
[    1.427786] sp : ffff00001005b670
[    1.431088] x29: ffff00001005b670 x28: ffff80083bbd1a20
[    1.436387] x27: 0000000000000000 x26: 0000000000000000
[    1.441686] x25: 0000000000000000 x24: 0000000000000001
[    1.446985] x23: 0000000000000001 x22: 0000000000000001
[    1.452285] x21: ffff80083ad42800 x20: ffff80083ad42800
[    1.457584] x19: 0000000000000000 x18: 0000000000000030
[    1.462884] x17: 0000000080000000 x16: ffff000012c80000
[    1.468183] x15: ffff7e0020eb9040 x14: ffff80083f9eff80
[    1.473482] x13: 0000000000000000 x12: 00000000ffffffc1
[    1.478782] x11: 0000000000000005 x10: 0101010101010101
[    1.484081] x9 : 0000000000000000 x8 : ffff80083ad19798
[    1.489380] x7 : 0000000000000000 x6 : 000000000000003f
[    1.494680] x5 : 0000000000000040 x4 : 0000000000000000
[    1.499979] x3 : 00000000000001a0 x2 : ffff000011680470
[    1.505278] x1 : 0000000000000004 x0 : 0000000000000000
[    1.510580] Call trace:
[    1.513017]  __pm_runtime_resume+0x20/0x74
[    1.517099]  _SetPower+0x48/0x54
[    1.520312]  gckOS_SetGPUPower+0x6c/0x148
[    1.524311]  gctaOS_SetGPUPower+0x1c/0x24
[    1.528306]  gctaHARDWARE_Construct+0x8c/0x390
[    1.532733]  gcTA_Construct+0x6c/0x148
[    1.536474]  gckGALDEVICE_Construct+0x364/0x8f8
[    1.540989]  drv_init+0x1ec/0x34c
[    1.544291]  gpu_probe+0x1fc/0x244
[    1.547680]  platform_drv_probe+0x4c/0xb0
[    1.551675]  really_probe+0x1f8/0x2c8
[    1.555323]  driver_probe_device+0x58/0xfc
[    1.559406]  device_driver_attach+0x68/0x70
[    1.563578]  __driver_attach+0x94/0xdc
[    1.567312]  bus_for_each_dev+0x64/0xc0
[    1.571134]  driver_attach+0x20/0x28
[    1.574698]  bus_add_driver+0x148/0x1fc
[    1.578519]  driver_register+0x68/0x120
[    1.582342]  __platform_driver_register+0x4c/0x54
[    1.587035]  gpu_init+0x54/0x94
[    1.590162]  do_one_initcall+0x58/0x1b8
[    1.593985]  kernel_init_freeable+0x1cc/0x288
[    1.598329]  kernel_init+0x10/0x100
[    1.601802]  ret_from_fork+0x10/0x18
[    1.605367] Code: aa0003f3 361000e1 91068263 f9800071 (885f7c60)
[    1.611458] ---[ end trace e1dc4ddcfc5850c0 ]---
[    1.616118] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.623695] SMP: stopping secondary CPUs
[    1.627606] Kernel Offset: disabled
[    1.631078] CPU features: 0x002,20002008
[    1.634985] Memory Limit: none
[    1.638031] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:01 +08:00
Dong Aisheng
3b51c8fd0f gpu: more build fix
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:01 +08:00
Dong Aisheng
72fabbeffd gpu: fix totalram_pages build error
../drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c: In function ‘_AdjustParam’:
../drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c:1520:46: error: invalid operands to binary * (have ‘long unsigned int (*)(void)’ and ‘long unsigned int’)
         ((Args->baseAddress + totalram_pages * PAGE_SIZE) > 0x100000000))

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:00 +08:00
Dong Aisheng
0afb7ef680 gpu: fix do_gettimeofday build error
This api was removed from kernel. Use new instead.

../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c: In function ‘gckOS_GetTime’:
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:3006:5: error: implicit declaration of function ‘do_gettimeofday’ [-Werror=implicit-function-declaration]
     do_gettimeofday(&tv);

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:00 +08:00
Dong Aisheng
4fa1a00df6 gpu: fix access_ok build error
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:55:00 +08:00
Xianzhong
5f4d8229bc MGS-4530-3 [#imx-1314] include dma-direct.h to fix gpu build for L4.19
error: implicit declaration of function ‘dma_to_phys’; did you mean ‘virt_to_phys’? [-Werror=implicit-function-declaration]
     page = phys_to_page(dma_to_phys(&Allocator->os->device->platform->device->dev, mdl_priv->physical));
                         ^
./include/asm-generic/memory_model.h:54:40: note: in definition of macro ‘__pfn_to_page’
 #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                        ^~~
./include/asm-generic/memory_model.h:78:30: note: in expansion of macro ‘PHYS_PFN’
 #define __phys_to_pfn(paddr) PHYS_PFN(paddr)
                              ^~~~~~~~
./arch/arm64/include/asm/memory.h:255:41: note: in expansion of macro ‘__phys_to_pfn’
 #define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
                                         ^~~~~~~~~~~~~
gc_hal_kernel_allocator_cma.c:237:12: note: in expansion of macro ‘phys_to_page’
     page = phys_to_page(dma_to_phys(&Allocator->os->device->platform->device->dev, mdl_priv->physical));
            ^~~~~~~~~~~~

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:00 +08:00
Xianzhong
4877b1bbe1 MGS-4530-2 disable busfreq-imx to fix L4.19 dash build
gc_hal_kernel_platform_imx.c:90:14: fatal error: linux/busfreq-imx.h: No such file or directory
 #    include <linux/busfreq-imx.h>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:00 +08:00
Xianzhong
a0029f0b90 MGS-4530-1 add 6.2.4.p4 gpu driver for L4.19
add mxc config to include drivers/mxc/gpu-viv

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2023-10-30 15:55:00 +08:00
Robby Cai
236d24081f media: mipi csi: add IPU CSI driver
add IPU MIPI CSI driver, used by imx6qdl

Signed-off-by: Robby Cai <robby.cai@nxp.com>
[ Aisheng: squash fixes ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:28:18 +08:00