Age | Commit message (Collapse) | Author |
|
CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV
CL_MEM_USE_HOST_PHYSICAL_ADDR_VIV will use host physical memory directly, logical address is zero.
gckOS_UnlockPages will check Logical address and return invalid parameter,
that causes memory leak in OpenCL user library, need remove this check.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 85a7c0f80d4f44d990f9ba85ecf2b6baea06053c)
(cherry picked from commit d3f9bbb64cc198f06a92676eb536a7b4c0f08eeb)
|
|
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>
(cherry picked from commit 7ba5a24fc46a7f50d8406d9ae9ca6ce75c2a71ba)
|
|
cat /sys/bus/platform/drivers/galcore/gpu3DClockScale
echo 16 > /sys/bus/platform/drivers/galcore/gpu3DClockScale
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
Fix GPU memory allocation issue on 4GB DDR imx8mm_evk
board.
Change-Id: I39a1abcaa3e85935fec47862b86903d0a9b9a487
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
CONFIG_ZONE_DMA32 enable
When CONFIG_ZONE_DMA32 kernel configure enabled, use __GFP_DMA32 to ensure
allocated memory within 4GB, then dma, cma and gfp allocators all can be used.
Previous CMA LIMIT solution has limitation, only CMA allocator can ensure the
allocated memory within 4GB and only with CMA LIMIT flag can use CMA allocator,
some memory allocate fail due to no CMA limit flag but CMA still has much memory.
This patch will back compatible, if enable CONFIG_ZONE_DMA32 use __GFP_DMA32, else
keep previous CMA LIMIT logic.
4.19 kernel default enable CONFIG_ZONE_DMA32 by commit "ad67f5a6545f7fda8e",
this enable CONFIG_ZONE_DMA32 patch can be cherry-picked to 4.14 kernel.
Memory allocate fail cases due to without CMA LIMIT flag (can't use CMA memory) and
_GFPAlloc fail due to system does not have enough continue memory:
[ 3199.603326] gckOS_AllocatePagedMemoryEx(3171) cmafsl 7ea flag = 13 allocator->capability = c000011
[ 3199.612463] gckOS_AllocatePagedMemoryEx(3171) gfp 7ea flag = 13 allocator->capability = 300001b
[ 3199.644893] _GFPAlloc fail, 375, Allocator=ffff80083af76980 Mdl=ffff80082171a000 NumPages=2026 Flags=0x13
[ 3199.712954] gckOS_AllocatePagedMemoryEx(3171) cmafsl 7f8 flag = 1 allocator->capability = c000011
[ 3199.721925] gckOS_AllocatePagedMemoryEx(3171) gfp 7f8 flag = 1 allocator->capability = 300001b
[ 3199.735073] _GFPAlloc fail, 375, Allocator=ffff80083af76980 Mdl=ffff80006f6aff00 NumPages=2040 Flags=0x1
Change-Id: I56b93bfa06590bea1e0707c41b40009bd133fecb
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
UI operation will very slow when install more applications and enter
one by one. The reason is system free memory very low, allocate memory
from system will trigger kswapd to do reclaim, but there is no much
free memory in system, CMA still have free memory but can't be used.
Below two patches has side effect, revert them from p4 main branch.
Revert "MA-13450-1 [#ccc] Switch layer memory allocation to virtual pool to improve performance."
This reverts commit 32d2126c353dd87dee77f4076422361a87766d32.
Revert "MA-13450-2 [#ccc] Switch layer memory allocation to virtual pool to improve performance."
This reverts commit 4bcff5472fc11a9379a7e6c72e0c8e0fdd9f636e.
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
Default tilestatus filler value is not correct in gralloc for M815,
it didn't account for gcvFEATURE_128BTILE, refine related code.
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
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>
|
|
should check imx8-gpu instead of imx8x-gpu string for i.mx8 gpu sub-system
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
CID: 5781508
device pointer should not be used before null check
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
kernel process(with zero pid) has no mdl mapping,
skip kernel process to avoid invalid mdl access.
also remove memory barrier to avoid rcu issue.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
Galcore kernel panic when reading from sysfs during modprobe,
This issue occurs when gc sysfs entries are read while the modprobe
of the galcore module is in progress.
Register the GC debugfs attributes in sysfs after the driver data-structures
have been initialized, instead of before.
Add defensive sanity checks in all _show() functions used by debugfs
attributes, to check for NULL pointers before dereferencing them.
Return -ENXIO in case of NULL pointers.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
it is caused by "avoid oom killer in gpu kernel driver",
only enable __GFP_ATOMIC for contiguous allocator.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
when system memory is low, gpu kernel will kill application often,
use __GFP_ATOMIC to avoid out of memory killer in gpu kernel driver.
__GFP_ATOMIC also disable system memory reclaimation to GPU freeze.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
include critical gpu bug-fixings for Android 9.0
commit-id 20ea99e9db80e834c7970568a6122f11327dd5dc
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
Disable the depth compression on device tree for 8qm/8qxp/mscale
when the ddr4 is enabled.
Date: Dec 11, 2017
Signed-off-by Yuchou Gan yuchou.gan@nxp.com
Signed-off-by Xianzhong Li xianzhong.li@nxp.com
(cherry picked from commit 3d5a50e7cbf371037dc7fe3bfb952ff67b95b081)
|
|
The signal id is missed when set to fence.
Then signal structure will not be freed at last.
Set correct signal id to fence to fix this issue.
Change-Id: I6a67dac0f6979183796cb8e9f2ac7aef6623ac00
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
performance.
Add DRM_VIV_GEM_VIRTUAL_POOL flags.
Switch to virtual pool when this flag is set.
Change-Id: I6e1e799cd0b4f81ed1ffbfdabe8f105325fa9644
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
- Fix GPU-viv drivers to build without SMP
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
|
|
Unable to handle kernel paging request at virtual address 1000100
[<ffff000008274ed8>] prefetch_freepointer.isra.37+0x8/0x14
[<ffff0000087bd3b0>] sync_file_create+0x28/0xc0
[<ffff000008b7c7e4>] gckOS_CreateNativeFence+0x74/0x110
[<ffff000008b89a78>] gckKERNEL_Dispatch+0xa54/0x15b0
[<ffff000008b8a8b8>] gckDEVICE_Dispatch+0x2e4/0x2f8
[<ffff000008b81160>] drv_ioctl+0x110/0x21c
[<ffff0000082b4478>] do_vfs_ioctl+0xb8/0x8b0
[<ffff0000082b4cf4>] SyS_ioctl+0x84/0x98
The reference count should be increased in one spin lock cycle.
Move spin lock out of _QueryIntegerId function.
Move signal reference count to gckOS_CreateNativeFence.
Change-Id: I1bf89b4de6055e5d0009baf7287f600696c4a529
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
CID 3925877: Resource leak (RESOURCE_LEAK)
14. leaked_storage: Variable pages going out of scope leaks the storage it points to.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
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>
|
|
display on 8mq.
BUG: scheduling while atomic: swapper/0/0/0x00010002
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.62 #1
Call trace:
[<ffff00000808b2e0>] dump_backtrace+0x0/0x414
[<ffff00000808b708>] show_stack+0x14/0x1c
[<ffff000008fbd00c>] dump_stack+0x90/0xb0
[<ffff00000810b8fc>] __schedule_bug+0x50/0x6c
[<ffff000008fd3b18>] __schedule+0x720/0x8a8
[<ffff000008fd3cd8>] schedule+0x38/0x9c
[<ffff000008fd40f0>] schedule_preempt_disabled+0x20/0x38
[<ffff000008fd51d8>] __mutex_lock.isra.9+0x4dc/0x4fc
[<ffff000008fd5208>] __mutex_lock_slowpath+0x10/0x18
[<ffff000008fd5240>] mutex_lock+0x30/0x38
[<ffff000008b79960>] gckOS_DestroySignal+0x30/0xcc
[<ffff000008baa3b8>] viv_fence_release+0x24/0x38
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb55c>] dma_fence_array_release+0x78/0xac
[<ffff0000087babcc>] dma_fence_release+0x38/0xf4
[<ffff0000087bb748>] irq_dma_fence_array_work+0x40/0x4c
[<ffff0000081d2878>] irq_work_run_list+0x68/0xa8
[<ffff0000081d28dc>] irq_work_run+0x24/0x40
[<ffff000008092440>] handle_IPI+0x300/0x330
[<ffff00000808197c>] gic_handle_irq+0x8c/0x184
Replace signal mutex lock with spin lock to handle signal in irq.
Change-Id: Id18e68f03bcb96c2aaf3ca8a0055fe6a64e8d10a
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
These case will generate a huge command object, which was divided into 33 Command Buffers to commit.
It will introduce a context switch within a command object. So add a mutex to avoid the Context switch.
Date: 23th Otc,2018
Signed-off-by Ya Zhou <ya.zhou@nxp.com>
|
|
remove the duplicate code with gckGALDEVICE_QueryFrequency,
gckHARDWARE_QueryFrequency has correct fix for power management.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
GPU memory initialization will cause large boot time with 40ms.
If GPU memory is allocated from CMA, memset in cma kernel driver,
It is not necessary to add duplicated memset in GPU kernel driver.
Only GFP allocator need trigger a page fault with a simple write.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
it is not necessary to query frequency when hardware initialize,
there are two cases which really need to query frequency,
1. application query (such as openCL initialization) with ioctl,
2. debugfs with "cat /sys/kernel/debug/gc/clk"
removed the query from driver probe, no impact on real cases.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
Fix uint64_t to pointer conversion issue on 32bit platform.
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
gckOS_MapPhysical is only used for contiguous memory to do map.
Actually LockVideoMemory already get the virtual address.
Remove gckOS_MapPhysical to support non contiguous memory.
Signed-off-by: Ivan.liu <xiaowen.liu@nxp.com>
|
|
No need to add extra ref count for the dma fence in the API viv_fence_create.
Incrence the ref-count in dma_fence_init and sync_file_create
decrease the ref-count in gckOS_Signal and close(fd).
Signed-off-by Yong Gan <yong.gan@nxp.com>
|
|
Fill tile status node with tillStatusFiller first time.
Refine surface cache mode related code to make sure it is immutable.
Test cases:
mirada_AA: GPU Hang when run Filrate case on 8mscale_O81
Change-Id: I44a00b07bec7bdf8af7408877d9e0f95316dd88b
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
CL172719 fix debugfs bugs and kernel panic fix ARTPEC7-31
cherry-pick patch:
6.2.4.p3-0106-CL172719-fix-debugfs-bugs-and-kernel-panic-fix-ARTPE
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit a8bff203ae6b83a301af6b946f990b7d373ace77)
|
|
CL167496 fix kernel panic caused by out-of-memory fix panic
issue in bug #20884 comment #12
cherry-pick patch:
6.2.4.p3-0044-CL167496-fix-kernel-panic-caused-by-out-of-memory-fi
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit f3a1c75a48e16441a939f20824fe1e2ebd5cc83d)
|
|
CL165804 fix read register when internal clock off 1. For
shared IRQ, read register may be called and that's not our
irq. 2. In some condition, when ISR handled normal FE/PE,
PM thread could trun off internal clock before ISR read
register of async FE. And then IRQ handler will call read
register with internal clock off. So here we need to skip
read in such case. This is simple fix.
cherry-pick patch:
6.2.4.p3-0019-CL165804-fix-read-register-when-internal-clock-off-1
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
VSI missing this patch in gpu6.2.4.p2, it will cause
drm_gem_object_unreference_unlocked(gem_obj) call two
times in function viv_ioctl_gem_unlock.
Kernel panic log:
[ 38.419720] [<ffff00000860cac0>] drm_gem_object_release+0x40/0x48
[ 38.419853] [<ffff0000013d4804>] viv_gem_free_object+0x64/0x98 [galcore]
[ 38.419861] [<ffff00000860c524>] drm_gem_object_free+0x20/0x50
[ 38.419868] [<ffff00000860c5f0>] drm_gem_object_unreference_unlocked+0x50/0x11c
[ 38.419975] [<ffff0000013d505c>] viv_ioctl_gem_unlock+0xbc/0x108 [galcore]
[ 38.419981] [<ffff00000860dc44>] drm_ioctl+0x1e0/0x468
[ 38.419992] [<ffff000008264b7c>] do_vfs_ioctl+0xb8/0x8d4
[ 38.419997] [<ffff00000826541c>] SyS_ioctl+0x84/0x98
[ 38.420005] [<ffff000008083780>] el0_svc_naked+0x34/0x38
Change-Id: I799c84e9f71e46012dd6befc02f7d3d694ed57e3
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
|
|
Fix potential Resource leaks and memory illegal access issues.
Signed-off-by Yong Gan <yong.gan@ncp.com>
|
|
them in the first place
Commit 7103962dbc8362d1ea76fd7 would return success even though we
don't have a OPP array (i.e., i.MX6). This patch completes that
in de-register part.
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
|
|
Add delay time and retry to make sure the Power state was changed.
Signed-off-by Yong Gan <yong.gan@ncp.com>
(cherry picked from commit 59a836f35807f5c09c98cf3be318ac49526bcf69)
|
|
Allocate the real size of the buffer instead of whole page to aviod GPU
overwrite.
Date: 10th Aug, 2018
Signed-off-by: Ella Feng <ella.feng@nxp.com>
|
|
Added a flagbits in soc_platform to workaround Soc platform. Add a
check for memory address beyond 4G for 850d mscale.
Date: 10th Aug, 2018
Signed-off-by: Ella Feng <ella.feng@nxp.com>
|
|
Support the kernel 4.9.y in fsl_6.2.4.p2.
Signed-off-by: Yong Gan<yong.gan@nxp.com>
|
|
6sx gpu need reserve command to flush cache before power-off,
there is no way to perform force sync in power broadcast mode.
command buffer will be exhausted with repeat suspend/resume,
need pull up power to flush command buffer before suspend.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
On 8QP we don't have the OVERDRIVE governor, only NOMINAL and
UNDERDRIVE. We set the current initial governor to OVERDRIVE, but also
display incorrect governor names relative to the clocks assigned in OPP
tuples. This patch address this situation by determining which governor
should be used at start-up and fixes displaying the governors
available for use.
This patch also sets the initial clock rate, in case the assigned-clock
rates for the cores are different than the ones found in the
operating-points (OPP). While this shouldn't be a real use-case this
allows testing different OPP tuples to mimic a OPP array for 8QP.
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
|
|
Fixed the build break for android platform.
set ANDROID_NATIVE_FENCE_SYNC to be 2.
Date: Aug 6, 2018
Signed-off-by: Yong Gan<yong.gan@nxp.com>
|
|
fix memory overwrite since out of range in last page,
remove dma_sync_single_for_device to avoid over-touch.
this fix QM gpu crash with test_buffers stress case.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
not a problem without operating-points in gpu device entry,
need disable error message for frequency scaling failure.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
only add the padding pages for user pageable memory,
Revert "MGS-4022 [#imx-1070] fix kernel panic with opencl test_buffers"
This reverts commit 9253786bcfd2fa17132c5057a18eb75b10ea3336.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
fix read buffer fence node for hw copy,
add cpu cache line check for write buffer,
invalidate cache after pipeline complete,
flush head and tail pages for user memory.
fix 630a849f3a4087a98b0425c261f474d178150307
"MGS-3255-39 [#ccc] fix opencl cache issue"
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
the user memory will add the padding pages to meet hardware alignment,
need set non-contiguous flag to avoid contigous mapping in GPU MMU.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
|
|
Rename fence interfaces to dma_fence to match with the upstream
commit, f54d1867005c ("dma-buf: Rename struct fence to dma_fence"),
changes.
Fix compile issue sync_timeline_create is not defined.
Change-Id: I0f89a089f11131070f96a5ddc922938f4b28615f
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
|