Age | Commit message (Collapse) | Author |
|
Bug:
If app quits before FW is loaded to VPU, VPU driver will hang in vpu_release().
Root cause:
In that case, if BIT_BUSY_FLAG=1, vpu_release may reset VPU and run FW
init code, but FW has not been loaded.
Solution:
- Don't run FW init code after reset since VPU lib can load it next time.
- If PC=0, which means VPU never runs, don't check BIT_BUSY_FLAG
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
Some application may exit without calling neccessay API to wrap up VPU
after it receives error message.
This could lead to system hang because driver will power off VPU
(vpu_release) while VPU may still be busy.
We require application to strictly follow the API call sequence even in
error handling case. Meanwhile, we enhance VPU driver to protect against
such abnormal abort, to prevent system hang at least.
If the last instance is closed, VPU will gate off or power off only if
VPU is idle.
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
1. Refine VPU suspend/resume according to open_count to completely
fix bug: ENGR00230203 [Android_MX6DL_SD] Gallery: System hang
after resume from suspend during video playback. 20%
open_count == 0 case can be simplified because VPU is released
(all instances are freed), so
- clock is already off
- context is no longer needed
- power is already off on MX6
VPU reset is removed from resume because power is ensured to be off
before entering resume on MX6 by calling regulator API.
2. Fix bug: VPU always busy after suspend/resume
Error log (VPU refused to suspend due to VPU busy):
pm_op(): platform_pm_suspend+0x0/0x54 returns -11
PM: Device mxc_vpu failed to suspend: error -11
PM: Some devices failed to suspend
Root cause:
- Suspend happened during vpu_Init(), somewhere after VPU lib started
to download FW (when PC == 0), but before run FW. (BIT_BUSY_FLAG=1,
BIT_CODE_RUN=1).
- In such case, VPU resume downloaded FW and run VPU to idle because
suspend was triggered after VPU was opened (active).
- vpu_Init run VPU again with BIT_BUSY_FLAG=1. So VPU was trapped in
idle loop but BIT_BUSY_FLAG was never cleared. VPU lib regarded VPU
as always busy.
Solution (in VPU resume):
- run VPU FW only if VPU was opened and PC before suspend is not 0
- restore host register is required
- download FW is required, because program memory is lost after power
off.
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
1. Fix ENGR00230203 [Android_MX6DL_SD] Gallery: System hang
after resume from suspend during video playback. 20%
2. Fix ENGR00231830 [MX6DL/S_SD] VPU: VPU encode can't
finish and print "VPU blocking: timeout." if suspend/resume. 100%
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
If VPU is working before suspend, we need to disable its regulator
to make sure regulator can be off before suspend, then enable
its regulator before resume to work, we check vpu's open_count
to determine whether to disable/enable its regulator.
Signed-off-by: Anson Huang <b20788@freescale.com>
|
|
add vpu regulator management including enable/disable in vpu driver. Mainly
in open/release and suspend/resume.
Signed-off-by: Robin Gong <b38343@freescale.com>
|
|
Increase VPU frequency to 352Mhz for TV box, use pll2_pfd_400M.To avoid impact
other code which assume ARM clock sourcing from pll2_pfd_400M, change cpu
setpoint of 396M to 352M. and disable bus freq adjust.
add CONFIG_MX6_VPU_352M to choose it, default is disabled.
Signed-off-by: Robin Gong <B38343@freescale.com>
|
|
Original design is VPU lib API StartOneFrame() enables clock, and VPU
driver disables clock after codec done interrupt has been received.
However there are known issues of interrupt handling as below:
- VPU interrupt handling callback is not scheduled in time causing work
queue overflow
- JPU done interrupt is not received because JPU issues it while JPU
buffer empty interrupt is still being served
- VPU finishes a frame (!vpu_IsBusy) but VPU done interrupt is not
received
All above will cause clk_disable in interrupt handling not called,
thus VPU clock count increases by 1.
So I plan to resolve clock unbalance issue first by removing
clk_disable from VPU driver interrupt handling. Interrupt problem
will not affect clock issue any longer.
1. Driver: remove clk_disable from vpu_worker_callback
2.1. Lib: remove clk_enable from API GetOutputInfo
2.2. Lib: avoid disabling VPU clock when VPU is busy in SWReset
3. Test: replace GetOutputInfo with SWReset in decoder_close /
encoder_close
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
Bug: VPU easily hang during suspend/resume standby mode i.MX6Q/i.MX6DL
Fix: standby mode doesn't power off/on PU but changes voltage instead, thus
VPU requires a reset cause there's always chance some cell is on
unstable state after voltage change
suspend/resume DSM is OK because it power off/on PU and probably there is a
power-on-reset sequence embedded in SOC
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
Two reason:
1. VPU regulator is not enough stable,sometimes will cause system hang
2. GPU regulator is not ready, because GPU/VPU share PU LDO, so revert
the patch firstly.
Signed-off-by: Robin Gong <B38343@freescale.com>
|
|
this patch is adding a ioctl for vpu to check the phy addr before vpu
start using this addr, this use case is common in some Direct Render case,
the VPU 's framebuffer phy memory is allocate by GPU, if the address given
by GPU have some wrong, like pass a virtual address, vpu will hang the system.
Add this IOCTL to be the goalkeeper, this IOCTL can check whether the phy
address was virtual memory or the address is within phy memory of your DDR.
The phy memory valild check is now doing best effort:
1. check whether is was allocated by vmalloc(), which must be a phy un-continus
2. check whether is was beyound DDR's top address, usually the other driver
pass a virtual address as a phy address.
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
|
|
MXC_VPU will return 0 if IOCTL don't support, for user space, it think
this IOCTL success, but it's needs actually return a failed return
value.
Signed-off-by Zhang Jiejing <jiejing.zhang@freescale.com>
|
|
VPU driver will enable/disable PU LDO by calling regulator API
Enable PU LDO in vpu_open
Disable PU LDO in vpu_release
Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
|
|
The spinlock caused a bug warning when we enable the lock debug mechenism.
See the log:
"
BUG: sleeping function called from invalid context at mm/slub.c:847
in_atomic(): 1, irqs_disabled(): 0, pid: 6053, name: aiurdemux0:sink
INFO: lockdep is turned off.
no locks held by aiurdemux0:sink/6053.
[<80042f24>] (unwind_backtrace+0x0/0xfc) from
[<800f1dec>] (kmem_cache_alloc+0x114/0x180)
[<800f1dec>] (kmem_cache_alloc+0x114/0x180) from
[<800e425c>] (__get_vm_area_node+0x88/0x194)
[<800e425c>] (__get_vm_area_node+0x88/0x194) from
[<800e4b78>] (__vmalloc_node_range+0x68/0x1c8)
[<800e4b78>] (__vmalloc_node_range+0x68/0x1c8) from
[<800e4d18>] (__vmalloc_node+0x40/0x48)
[<800e4d18>] (__vmalloc_node+0x40/0x48) from
[<800e4f04>] (vmalloc_user+0x2c/0x74)
[<800e4f04>] (vmalloc_user+0x2c/0x74) from [<8038eb28>] (vpu_ioctl+0x204/0x8b0)
[<8038eb28>] (vpu_ioctl+0x204/0x8b0) from [<8010643c>] (do_vfs_ioctl+0x80/0x5e4)
[<8010643c>] (do_vfs_ioctl+0x80/0x5e4) from [<801069d8>] (sys_ioctl+0x38/0x60)
[<801069d8>] (sys_ioctl+0x38/0x60) from [<8003d500>] (ret_fast_syscall+0x0/0x3c)
"
Change the spinlock to mutex to fix this issue.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
VPU registers have been mapped with ioremap() at probe which
L_PTE_XN is 1, and the same physical address must be mapped multiple
times with same type when doing mmap() to user space, so also need
to set it to 1. Otherwise, there may be unexpected result in video
codec.
Here, Use new defined pgprot_noncachedxn for vm_page_prot in mmap().
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
This patch fix vpu cannot run issue after suspend/resume
with stop mode. Need to re-load vpu firmware if current PC
is zero.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Add VPU_IOC_QUERY_BITWORK_MEM and VPU_IOC_SET_BITWORK_MEM ioctls
implementation for registerring bitwork memory allocated from user
space to vpu driver.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
There may be more interrupt than PIC_DONE reported, we cannot disable
clock if picture isn't done since vpu is still in busy in the status.
This patch will check interrupt reason before clock is disabled.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Update code to be nicer, use platform_get_resource_byname() function to
get platform resource, and use platform_get_irq_byname() to get irq.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Add vmalloced memory for multi-instances shared memory, vpu lib
will call mmap for accessing the memory.
VPU_IOC_GET_SHARE_MEM ioctl is still reserved for some time since
vpu lib still uses it for mx5x now. Will remove it after mx5x changes
to this new added memory later.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Fix the issue of missing to increase open_count when vpu_open.
This is due to the patch of removing mx31 and mx37 code.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Add vpu driver support for mx6q.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
The vpu code in driver for mx32/mx37 is out of date already, and
we won't support the platforms, so clean the code for removing it.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
One kernel image is requested, however, we need to enable iram
for performance improvement on mx53, and disable it on mx51 due
to known issue. So use platform data to pass vpu iram disable/enable
flag. And considering requested iram size also can be different per
requirement, iram size is also set in platform data.
Signed-off-by: Sammy He <r62914@freescale.com>
|
|
Add drivers/mxc
Add drivers/video/mxc
Add drivers/media/mxc
fb device: change acquire_console_sem to console_lock
And release_console_sem to console_unlock
Add DMA Zone support
Add TVE driver, add regulator
Add hdmi support
Add VPU
Fix build error
ioctl --> unlocked_ioctl
DECLARE_MUTEX --> DEFINE_SEMAPHORE
Signed-off-by: Jason Chen <b02280@freescale.com>
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
|