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>
(cherry picked from commit b6106c5de2529b01ce5bb3380fd93328b55d5528)
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>
(cherry picked from commit 9ef46bda523088bfba51b7432acd2c1e21e547d5)
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>
(cherry picked from commit 54baa89690f61101c8182cd4fed2177941476587)
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>
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>
(cherry picked from commit 9707d26d9daece1d8a821e1d530e0c422ea527a0)
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>
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>
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>
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>
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>
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>
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>
If 'pm_runtime_get_sync()' fail, need to reset device power usage_count
to '0'. Otherwise, the usage_count always bigger than '0' and not do
'runtime_suspend()' actually.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
If 'pm_runtime_get_sync()' fail, need to reset device power usage_count
to '0'. Otherwise, the usage_count always bigger than '0' and not do
'runtime_suspend()' actually.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
shall trigger dummy draw when update gpu mmu setup,
the problem is caused by 8mp vip errata workaround.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Those files need have GPL license align with linux kernel. This is introduced by
VIP HW errata workaround.
Removed VSI private license and add GPL license.
Signed-off-by: Ella Feng <ella.feng@nxp.com>
there may be some redundant data before the encoded frame,
generally it won't bring any problem.
but on android, the redundant data may affect the mux,
can cause the mp4 can't be decoded.
so delete the redundant data in the driver.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
In probe stage, setting "emvsim_dev.parent = &pdev->dev" after error
report which is unreasonable, this patch fixes this issue.
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Add error check when enable clk and register misc device at the end of
probe stage. This patch just improve and clean up the code, no function
change.
Fixes: commit d494420149 ("MLK-23793-2 mxc: emvsim: add runtime pm support")
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Fix resource leak issue in VIP PM HW workaround, set pointer to NULL before release funcCmd
since they point to the same memory.
Signed-off-by: Ella Feng <ella.feng@nxp.com>
Coverity reprot: CID = 4159427
side_effect_free: Calling emvsim_check_baud_rate(&emvsim->baud_rate)
is only useful for its return value, which is ignored.
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
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>
This SW workaround insert a small program after power-on reset.
The small program is similar to a hardware bare-metal test pattern.
It is target to initialize registers by performing short operations in the NN, TP and PPU modules
by doing simple convolution, connected layer, tensor add operations
Signed-off-by: Ella Feng <ella.feng@nxp.com>
L4.19 SCFW introduced LP mode, clk_set requires power-on,
fixed GPU govern to conform with the latest SCFW change.
remove redundant clk_set_rate in probe to fix LP clock.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
For more readable, use a handler table to insert scode for
each format.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
The payload header of sequence / picture / slice are the
same operation, could unify them in a function.
payload size = data_size - payload_header_size - start_code_size
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
Correct VP8 ivf frame header
firmware just parse 64-bit timestamp(8 bytes).
As not transfer timestamp to firmware, use default value(ZERO).
No need to do anything here.
Refine the function of set vp8 ivf sequence header.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
The seq payload size should is 20+12.
Refine the function of set rcv header.
Refine the function of create nal header.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
1. the mu won't be really power off,
so we need restore the mu but not initialize it
2. the vpu is shared with vpu windsor,
so we don't do vpu reset when remove module.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
delay the creation of video device node in order to avoid inmod failure
in probe function, if create video node in a early stage,
the video node may be created before initialize the vpu dev,
and in such case, open video node,
the mu mailbox may be not requested,
then it will led to download firmware fail.
so create the video device node at the end of the probe function.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
1. the mu won't be really power off,
so we need restore the mu but not initialize it
2. the vpu is shared with vpu malone,
so we don't do vpu reset when remove module.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
delay the creation of video device node in order to avoid inmod failure
in probe function, if create video node in a early stage,
the video node may be created before initialize the vpu dev,
and in such case, open video node,
the mu mailbox may be not requested,
then it will led to download firmware fail.
so create the video device node at the end of the probe function.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
change module device table name to fix build error as module
rename the c source name to avoid conflict with h1
release clk avoid memory leak
fix typo error in core index
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>