Commit Graph

25 Commits

Author SHA1 Message Date
Ming Qian
b305ce6758 MA-22424-2: mxc: vpu: vc8000e: Use fixed-length types in ioctl parameters
To support 32bit application, we should use fixed-length types in ioctl
parameters, specifically avoid using the type long and unsigned long.

remove some unused ioctl cmd.
clear some building warning.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
2024-07-02 10:07:52 +09:00
TaoJiang
b0172d28d0 LF-8969: vpu : hantro_encoder: optimize 32 bit interface
1.optimzie some error reported by coverity
2.sanity test ok

Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
2023-10-30 15:58:09 +08:00
TaoJiang
de397ef5e1 LF-8969: vpu : hantro_vc8000e: optimize 32 bit interface
1.get user space data in ioctl
2.optimize 32 bit user pointer

Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
2023-10-30 15:58:09 +08:00
Zhou Peng
64c93a4203 arm64: imx8m: vpu: update class_create() usage
Cope with API change:
1aaba11da9 ("driver core: class: remove module * from class_create()")

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:08 +08:00
Li Yang
e17a1890a6 arm64: imx8m: vpu: update vm_flags with modifier calls
Deal with 1c71222e5f ("mm: replace vma->vm_flags direct modifications
with modifier calls")

Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-10-30 15:58:08 +08:00
Ming Qian
46080cc6d8 LF-7711-7: imx8m: vpu: unlock semaphore when encode/decode timeout
the semaphore is unlocked in isr in normal case,
if the interrupt is missed, and timeout is triggered,
there will be no change to unlock it

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2023-10-30 15:58:08 +08:00
Ming Qian
07326c1956 LF-7711-4: imx8m: vpu: request irq without shared flag
there is no need to share vpu irq

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2023-10-30 15:58:07 +08:00
Ming Qian
59b50d5f3b LF-7711-3: imx8m: vpu: don't disable irq
there is no need to disable irq

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2023-10-30 15:58:07 +08:00
Ming Qian
3e43c1f22c LF-7711-2: imx8m: vpu: remove unused mutex
the dev_mutex is only used for pm_rumtime_get_sync,
it's useless

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2023-10-30 15:58:07 +08:00
Ming Qian
cf5d8485eb LF-7711-1: imx8m: vpu: fix a typo in switching to blkctl
the node name of blkctl may be "blk-ctl" or "blk-ctrl"

Signed-off-by: Ming Qian <ming.qian@nxp.com>
2023-10-30 15:58:07 +08:00
Zhou Peng
914a53fda7 LF-7016-1: arm64: imx8m: vpu: change file mode to 644
Change file mode to 644 to comply with community rule.

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:06 +08:00
Zhou Peng
767ebdb504 LF-5670-4 imx8mp: vpu_enc: skip blk-ctrl operation in vpu
Since kernel verision 5.16, there has a blk-ctrl driver uniformly handle blk-ctrls,
so, don't need vpu driver handle it separately
keep original function to be compatiable with previous device tree.

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:05 +08:00
Zhou Peng
a63bbc3f89 LF-5789-3: arm64: vpu: 8mp: remove calling of force_uaccess_xxx()
Remove calling of force_uaccess_xxx() since set_fs was not supported again

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:05 +08:00
Jindong Yue
b869dfb049 MA-20005-12 hantro_vc8000e: Fix build error exposed by -Wunused-variable
Fix below two build errors:
drivers/mxc/hantro_vc8000e/hx280enc_vc8000e.c:149:30: error: unused variable 'asic_status' [-Werror,-Wunused-variable]
static volatile unsigned int asic_status;
                             ^

drivers/mxc/hantro_vc8000e/hx280enc_vc8000e.c:702:13: error: unused function 'hantroenc_ioctl32' [-Werror,-Wunused-function]
static long hantroenc_ioctl32(struct file *filp, unsigned int cmd, unsigned long arg)
            ^

Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
2023-10-30 15:58:04 +08:00
Shijie Qin
43cb4f799a MLK-25830-2 imx8mp: vpu_enc: use file handle indicate which instance is occupying encoder core
File handle is unique for each instance, it is more reasonable and safe
to use file handle to indicate which instance is occuping encoder core.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:03 +08:00
Shijie Qin
b191ea1963 LF-4670 arm64: imx8m: vpu: check regs.offset/size accurately
Directly check 'regs.offset + regs.size', instead of
'(regs.offset + regs.size) / 4', that has a risk if it isn't
multiple of 4.
(coverity ID 17802820)

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
2023-10-30 15:58:02 +08:00
Shijie Qin
727e8270ff MA-19423-1 arm64: imx8mp: vpu: vc8000e: add new ioctl to read/write HW registers
Userspace could select through the new ioctl to read/write VPU HW
registers, instead of through mmap HW registers.
This method generally used for secure mode that avoid userspace directly
access HW registers.

Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:02 +08:00
Zhou Peng
7de9dbf02c LF-3332-1: arm64: imx8: vpu: fix build errors due to API change
hantro g1/g2/h1/vc8000:
replace get_fs()/set_fs() with force_uaccess_xxx()

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:58:00 +08:00
Dong Aisheng
128586e3fb LF-1762-5 mxc: vpu: replace '---help---' in Kconfig files with 'help'
Update Kconfig to cope with upstream change
commit 84af7a6194 ("checkpatch: kconfig: prefer 'help' over
'---help---'").

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2023-10-30 15:58:00 +08:00
Zhou Peng
786312a01e MLK-24009-1 arm64: imx8mp: vpu: vc8000e: fix build issue as module
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>
(cherry picked from commit 099a3ae272)
2023-10-30 15:57:59 +08:00
Zhou Peng
1ac8cedb8c MLK-23377-2: arm64: imx8mp: vc8000e: fix system hang in suspend/resume operation
Add suspend related operation:
- add ioctl 'HX280ENC_IOCG_EN_CORE' to trigger HW in kernel
- backup/restore HW registers only after frame ready interrupt received
- notify application re-config HW to avoid unexpected HW behavior

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:57:59 +08:00
xiahong.bao
2519157cd9 MA-16211: imx8mp: vpu: Implement hantro vc8000e ioctl32
Implement hantro vc8000e ioctl32 for imx8mp

Signed-off-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:57:59 +08:00
Zhou Peng
ab848e68c1 MLK-23377: arm64: imx8mp: vc8000e: fix system hang in suspend/resume operation
One internal index variable 'i' was reused and lead to overflow of array

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:57:59 +08:00
Zhou Peng
61b4c30a4f MLK-23375: arm64: imx8mp: vc8000e: remove legacy ioremap_nocache interface
ioremap has provided non-cached semantics by default since the Linux 2.6

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
2023-10-30 15:57:59 +08:00
Zhou Peng
bc323c7897 MLK-23211-1: arm64: imx8mp: vpu: add vc8000e driver
Add vc8000e driver source code

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2023-10-30 15:57:59 +08:00