Commit Graph

286 Commits

Author SHA1 Message Date
Xianzhong 13b3c46966 MGS-6108-3 [#imx-2416] fix gcdENABLE_VG logic issue
enable asynchronous unlock even if define gcdENABLE_VG

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-12-06 18:11:52 +08:00
Xianzhong ce27972ecb MGS-6108-2 [#imx-2416] fix vg kernel panic for command unlock
vg kernel does not suppport asynchronous event, uses sync unlock

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-12-06 14:42:12 +08:00
Xianzhong ea9340aac5 MGS-6108 [#imx-2416] fix GPU exception to access the freed MMU page
GPU hardware access cannot be guaranteed to complete after unlock memory,
Need perform asynchronous unlock to avoid GPU access the freed MMU page.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit f902173b8ece1f6367c30557498077c569db31ff)
2020-12-04 19:04:22 +08:00
Ming Qian 21929af532 MLK-24960: [8QM_MEK/8QXP_MEK]mxc:vpu_malone: move timestamp manager to
firmware

move timestamp to firmware, it will make our driver more easy to
upstream

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-11-19 17:34:13 +08:00
Ming Qian bf67b06529 MLK-24959: [8QM_MEK/8QXP_MEK]mxc:vpu_windsor: move timestamp handler to
firmware

move timestamp to firmware, it will make our driver more easy to
upstream

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2020-11-19 17:34:03 +08:00
Xianzhong ecd70f4a3b MGS-6060-2 gpu-viv: fix build break
kernel debug file is moved to linux osal part,
Fix: "MGS-6060 gpu-viv: sync 20201116 patch release"

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-11-19 13:31:13 +08:00
Xianzhong c561632ebd MGS-6060 gpu-viv: sync 20201116 patch release
include critical bug-fixings for 6.4.3.p1 driver

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-11-19 11:54:17 +08:00
Xianzhong 082c76fc34 MGS-6058 [#imx-2391] fix vivante drm build break for L5.10
fix drm header and function related changes for new kernel

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-11-19 11:54:17 +08:00
Xianzhong 0cbc4419bd MGS-4929 [#imx-2382] enable vivante drm for linux build
weston-simple-dmabuf-egl has failure without drm render node,
need enable vivante drm to fix dmabuf failure issue.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-11-19 11:54:17 +08:00
ya.zhou@nxp.com b61e64bb72 LF-2473 [#ccc] Coverity Issue:10281263
checked return value

Date:30th Oct,2020
Signed-off-by Ya Zhou <ya.zhou@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang 20e75a9063 LF-2492 [#ccc] check sscanf return value
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang 269106c4da LF-2480 [#ccc] rm DEBUG print as it print below like external mem
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang c9f470a8bf LF-2478 [#ccc] fix the dereferencing null pointer
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang 74a6e073f4 LF-2457 [#ccc] fix the Dereferencing null pointer
this also fix LF-2472
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang e94fab3823 LF-2461 [#ccc] use inline to fix multi-defination
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
Jiyu Yang 047793b8f3 LF-2466 [#ccc] fix the dereference issue
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-11-19 11:54:17 +08:00
ya.zhou@nxp.com 669f24ec94 LF-2473 [#ccc] Coverity Issue:10281263
checked return value

Date:30th Oct,2020
Signed-off-by Ya Zhou <ya.zhou@nxp.com>
2020-11-19 11:54:17 +08:00
Xianzhong 17e8d73135 MGS-6026-2 sync gpu database with formal 6.4.3.p1
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-11-19 11:54:16 +08:00
Xianzhong 9707e39f1b MGS-5990-4 [#ccc] fix the uninitialized variable
shall use the Bytes variable instead of heapBytes,
also fix bankSize assignment from heapBytes.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-28 10:17:00 +08:00
Xianzhong a8a7d970e2 MGS-5990-3 [#ccc] refine gpu memory bank configuration
default set two banks for large and small memory in 16:1,
there is no function impact for specified bank size.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-27 16:52:51 +08:00
Jiyu Yang 1e853b5e53 LF-2118-2 [#ccc] fixed Coverity Issue:6124050
[Solution] add Node null check
[Problem]CID 6124050 (#8 of 8): Dereference after null check (FORWARD_NULL)
14. var_deref_op: Dereferencing null pointer Node

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-10-27 16:51:42 +08:00
Jiyu Yang 0247c6ac91 LF-2118 [#ccc] fixed Coverity Issue:6124050
[Solution]add U prefix to declare it is uint32_t type
[Problem]CID 6124050 (#8 of 8): Dereference after null check (FORWARD_NULL)
14. var_deref_op: Dereferencing null pointer Node

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-10-22 16:48:39 +08:00
Jiyu Yang 1ff58a46ef MGS-6010 [#ccc] gpu: add GetSGT callback for reserved_mem
a GetSGT func callback was wanted when reserved_mem was exported

Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
2020-10-22 14:40:29 +08:00
Xianzhong 54e7aa7ca3 MGS-6012-6 [#imx-2337] refine mmap_sem fix for L5.10 kernel
avoid the duplicated kernel version check and messy copy

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-22 14:39:27 +08:00
Xianzhong 0fef6d7f67 MGS-6012-5 [#imx-2337] fix 6.4.3.p1 build break for L5.10
6.4.3.p1 introduced more build break with mmap_sem usage,
define current->mm->mmap_sem/lock with a macro.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-22 14:39:22 +08:00
Xianzhong 0e2540cf5e MGS-6026 mxc/gpu-viv: integrate 6.4.3.p1 kernel
add new feature for openvx 1.3 and vulkan 1.2.1

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-20 17:50:19 +08:00
Xianzhong b82adb38fd MGS-6025: sync GPU kernel driver with 20201015 version
include gpu database update, clock debug and kernel fix

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-10-18 15:25:50 +08:00
Richard Liu 8e07eb25b9 MA-18037 [#imx-2356] import vfs namespace to fix GPU module load errors
GPU galcore build as module will meet below error when do insmod
with latest android aosp 5.4 kernel.

Fix below module load errors:
galcore: module uses symbol (kernel_write) from namespace
VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver,
but does not import it.
galcore: Unknown symbol kernel_write (err -22)

Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
(cherry picked from commit 317ad82b310f740c436bdca2e73c556ac67041f6)
2020-10-16 10:17:42 +08:00
Xianzhong 3ebe2d7acb MGS-5972 [#imx-2089] 0038-KERNEL-SPACE-Update-gc_feature_database.h-to-295136
Update gc_feature_database.h to 295136

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-09-10 22:28:07 +08:00
Xianzhong 1228e06e0e MGS-5972 [#imx-2089] 0011-CL292878-KERNEL-SPACE-dev64x_234062-show-gpu-video-m
dev64x_234062: show gpu video
 memory free total size and fixed alloc/free counters in re-used processDB
 uninitialize issue.(CL258074)

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-09-10 22:28:07 +08:00
Richard Liu b6106c5de2 MA-17683 [#imx-2302] Fix video playback "rcu stall" issue on 8mq
Loop play a video AVC_1080p_24fps_90Mbps_bird90.m2ts met UI
freeze and "rcu stall". Enable CONFIG_DEBUG_SPINLOCK kernel
debug get below call stack, the reason is due to spin_lock
be used in IRQ interrupt and caused deadlock.

8mq board enabled Video overlay feature, there are two fences
enabled: out fence (represent frame on screen) and android out
fence (new added, represent frame off screen). When there are
two fences sync_file_set_fence() will call dma_fence_array_create()
to register irq_dma_fence_array_work(), then gckOS_DestroySignal()
will be called in IRQ which use spin_lock cause deadlock.

Fix solution is use spin_lock_irqsave() instead of spin_lock()
for Database->lock if it is not called in IRQ interrupt.

Call stack:
[  608.902810]  dump_backtrace.cfi_jt+0x0/0x4
[  608.906914]  show_stack+0x18/0x24
[  608.910237]  dump_stack+0xb8/0x114
[  608.913644]  spin_bug+0xb0/0xb4
[  608.916788]  do_raw_spin_lock+0xac/0x124
[  608.920714]  _raw_spin_lock+0x20/0x2c
[  608.924384]  gckOS_DestroySignal+0x6c/0x170
[  608.928572]  viv_fence_release+0x28/0x40
[  608.932502]  dma_fence_release+0x13c/0x280
[  608.936603]  dma_fence_array_release+0x74/0x98
[  608.941049]  dma_fence_release+0x13c/0x280
[  608.945150]  irq_dma_fence_array_work+0x6c/0x9c
[  608.949690]  irq_work_run_list+0xb4/0x148
[  608.953702]  irq_work_run+0x20/0x40
[  608.957193]  handle_IPI+0x10c/0x180
[  608.960686]  efi_header_end+0x13c/0x15c
[  608.964526]  el1_irq+0x104/0x200
[  608.967761]  radix_tree_lookup+0x38/0x84
[  608.971686]  gckOS_WaitSignal+0x54/0x258
[  608.975615]  gckKERNEL_Dispatch+0x1460/0x1754
[  608.979977]  gckDEVICE_Dispatch+0x1a0/0x1a4
[  608.984165]  drv_ioctl+0xb8/0x184
[  608.987487]  do_vfs_ioctl+0x3a0/0x6f0
[  608.991154]  __arm64_sys_ioctl+0x78/0xa4
[  608.995082]  el0_svc_common+0xb4/0x18c
[  608.998834]  el0_svc_handler+0x74/0x98
[  609.002589]  el0_svc+0x8/0xc

Change-Id: Idf16a5707add70246c74d2f1446f7dbb7037f5f0
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2020-09-04 10:15:05 +08:00
Richard Liu 9ef46bda52 MA-17341-2 [#imx-2211] Fix kernel panic when do stop on android
There is kernel panic when stop android or kill surfaceflinger
after enable framebuffer tile compression on 8mq board.
The root cause of the issue is dcss driver not api to receive
ts fd, gpu driver will set the ts_dma_buf in _SetVidMemMetadata(),
dcss driver get the ts buffer physical address from ts_dma_buf,
when stop android framebuffer and matched ts buffer will free,
previous ts_dma_buf get from ts_fd will be invalid, when dcss
driver use this ts_dma_buf will cause problem. It is a common
issue, if Linux Weston do the similar stop should also meet
the same panic issue.

Keep a reference for ts_dma_buf in _SetVidMemMetadata(),
decrease the reference in _dmabuf_release() can avoid the
panic issue.

Kernel panic log:
[   41.007431] kernel BUG at drivers/gpu/drm/drm_gem.c:154!
[   41.139375] Call trace:
[   41.141824]  drm_gem_object_init+0xb8/0xbc
[   41.145920]  drm_gem_cma_prime_import_sg_table+0x84/0xdc
[   41.151233]  drm_gem_prime_import_dev+0xe8/0x194
[   41.160036]  dcss_plane_atomic_set_base+0x31c/0x3d0
[   41.164915]  dcss_plane_atomic_update+0x450/0x46c
[   41.164923]  drm_atomic_helper_commit_planes+0x130/0x31c
[   41.182255]  dcss_drm_atomic_commit_tail+0xcc/0x150
[   41.187139]  dcss_commit_work+0x10/0x1c
[   41.197322]  process_one_work+0x2d8/0x580
[   41.201333]  worker_thread+0x28c/0x518
[   41.205085]  kthread+0x14c/0x15c
[   41.208316]  ret_from_fork+0x10/0x18

Change-Id: I385851b436d1fead1131ce25f496bdd5d3d14264
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2020-09-04 10:14:50 +08:00
Richard Liu 54baa89690 MA-17341 [#imx-2211] Remove ts_address code to keep align with Linux
Android pass ts_address to dcss to fix kernel panic issue
reported in ticket MA-12928, this fix solution is not formal.
Remove ts_address code to keep align with Linux, if android
still meet panic issue for corner case we need check root
cause and do formal fix.

Change-Id: I04a6294f237e0c1ed5544dce1dc13e5a6ac232ab
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2020-09-04 10:14:45 +08:00
Ming Qian 454af55229 MLK-24593:[8QM_MEK/8QXP_MEK]mxc:vpu_windsor: support change bitrate dynamically
update the encoder parameters when bitrate is changed

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-31 13:32:01 +08:00
Xianzhong a35d890d52 MGS-5943 [#imx-2089] 0091-KERNEL-SPACE-Update-gc_feature_database.h-to-290561
Update gc_feature_database.h to 290561

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:06:19 +08:00
Xianzhong e7e9d5b9e7 MGS-5943 [#imx-2089] 0081-BUG27413-CL290463-KERNEL-SPACE-64x_234062-ocl-fix-th
fix
 the bug#27413. no need to switch hardware object to query the name and chip
 info of the chip.

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:06:09 +08:00
Xianzhong 1d1356c052 MGS-5943 [#imx-2089] 0079-CL290440-KERNEL-SPACE-6.4.x-Always-enable-gcdIGNORE_
6.4.x: Always enable
 gcdIGNORE_DRIVER_VERSION_MISMATCH for NXP tree.

Signed-off-by: Ke Feng <ke.feng@verisilicon.com>

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-22 02:05:35 +08:00
Ming Qian 5e629abba0 MLK-24499: [8QM_MEK/8QXP_MEK]mxc:vpu_windsor: set low latency mode through set bframe
use bframe to control low latency mode by default
deprecate the ctrl V4L2_CID_MPEG_VIDEO_H264_ASO

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-19 13:30:29 +08:00
Xianzhong 9707d26d9d MGS-5928-3 [#ccc] fix Android kernel crash problem
user may not sync cache before free the cacheable memory,
when GPU allocate the non-sync memory for non-cacheable map,
it will lead to the unstable issue if cache sync is missing.

revert previous optimization to sync cache for each request,
need work out other idea to reduce the memory consumption.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-18 16:54:51 +08:00
Ming Qian b287e45d99 MLK-24477-4:[8QM_MEK/8QXP_MEK]mxc:vpu_malone: report color space by try_fmt
gst will depend on the try_fmt api
if driver don't report the correct color space in try_fmt
gst may return fail

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-17 11:26:25 +08:00
Xianzhong ca331e5a4a MGS-5928-2 [#ccc] support virtual memory in normal zone
opencl conformance encounters out of memory on 6qp often

Normal free:223540kB, free_cma:180280kB
0 pages HighMem/MovableOnly

currently GPU virtual memory allocate highmem only,
change to try normal zone first, then go highmem.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:22:45 +08:00
Xianzhong 59501b0f9c MGS-5928-1 [#ccc] allocate auxiliary memory for cacheable map
create dma mapping and scatter list pages for cachable memory,
also move the auxiliary memory allocation into map/unmap.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:20:58 +08:00
Xianzhong b9d2070f87 MGS-5933-1 [#ccc] reenable m865s gpu TX clock gating
Disabled TX clock gating can not fix GFXBench hang on M865,
128B L2 cache mode for reading texture can fix that.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-14 18:20:36 +08:00
Shijie Qin 31b92c7ddf LF-2111: mxc: vpu_windsor: Avoid hide parameter
Fix declaration hides parameter 'attr'.
(coverity ID 5572378)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-08-13 17:20:32 +08:00
Shijie Qin 2f7a8e07a3 LF-2138: mxc: vpu_malone: change typedef of 'valid_ts_received' to unsigned int
Bit field of 'valid_ts_received' is 1, change its typedef to
unsigned int. (coverity ID 9000734)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2020-08-13 17:20:32 +08:00
Xianzhong eda396f8bc MGS-5849 Integrate VSI GPU 6.4.3.p0 kernel driver
6.4.3.p0 new feature list:
 - OpenGL ES 3.2.6.1
 - Vulkan 1.1.6.3
 - OpenVX 1.2 NN extension

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2020-08-13 11:06:14 +08:00
Ming Qian c9f7364dc4 MLK-24477-3:[8QM_MEK/8QXP_MEK]mxc:vpu_malone: improve get/set color api
use the v4l2 api instead of custom api

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-12 16:02:21 +08:00
Ming Qian f36e9e62bd MLK-24477-2:[8QM_MEK/8QXP_MEK]mxc:vpu_windsor: enable color description in vui
1. enable color description in vui when encoding.
2. improve the get/set color description api

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2020-08-12 16:02:07 +08:00
Zhou Peng 85b5d239b0 MLK-24373-2 arm64: imx8mp: vpu: g1/g2: fix potential deadlock issue
Replace spin_lock() with spin_lock_irqsave() to avoid potential deadlock

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-07-17 15:25:53 +08:00
Zhou Peng 742c7adea8 MLK-24373-1 arm64: imx8mp: vpu: g1/g2: fix blocking issue in suspend
HW enable and disable are shared with the same function, driver need to
check the parameter to identify whether HW is enabled or not

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2020-07-17 15:25:53 +08:00