Commit Graph

25 Commits

Author SHA1 Message Date
Yanjun Liao
3b118f75cf feat[mpp_soc]: Support rv1126b soc
Change-Id: Ifedb67d4a4f7f2c4107f94dc53e14c2b446aa76a
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-02-18 09:02:16 +00:00
Johnson Ding
53abf03bf2 fix[hal_jpeg_vdpu1]: fix dec failed on RK3036 problem
For kernel 4.4 and before, if VPU only has decoder, register size is
101. Thus extra size append at offset of 164*4 will be ignored by
kernel.

Change-Id: Idf4524099615b8ffd46766f55c9c0ea481f7cb76
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-06-06 18:13:00 +08:00
Herman Chen
8d27cb798e feat[mpp_dev]: Add fd attach/detach operation
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4ef09ee8d866eccbbaf3f5668ceefe81e3dc26c0
2024-03-29 10:02:00 +08:00
Yanjun Liao
3cbb906673 feat[mpp_soc]: support rk3576 soc
Change-Id: I49bd3ccbc643b3c95db5ba3ca692f365c9425440
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-02-20 09:45:25 +08:00
Chen Jinsen
4b45330c50 [mpp_soc]: Add rk3567 soc support
Change-Id: I6d02f021544a9ba4d7ff96e5aad47f5fe1f87fb3
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2023-10-13 09:30:04 +08:00
Yandong Lin
193309a852 [driver]: add MPP_CMD_SET_ERR_REF_HACK api
support hack for err ref check for decoder

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib61336b50dde626d85f9f6bb25950ea70149ea49
2023-05-10 18:24:13 +08:00
Herman Chen
2b35cee0ce [mpp_log]: Add more log helper function
1. Move mpp_log.h to inc for external user.
2. Add mpp_debug.h for mpp internal logging.
3. Fix some warning.
4. Add log level setup function.
5. Check env log_level value in mpp_get_log_level call.

NOTE:
1. mpp internal module should use mpp_debug.h and mpp external user
should use mpp_log.h
2. Use mpp_get_log_level to update mpp_log_level when the env changed.

Change-Id: I90a55a02a72db177533013280dfe111ca3479229
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-20 11:42:10 +08:00
Herman Chen
03e1d86b08 [mpp_device]: Add MppDevPollCfg to poll function
Change-Id: I53ded32c3ebd70ba3842459b507782f3bd50105b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-21 09:59:14 +08:00
Herman Chen
fe11f99415 [osal]: Add multi register offset config function
Add new multi config mode function.

Change-Id: I37c9c319e93e96fbd3d2bb5d598aef8d1b8fe2c8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-10 16:42:05 +08:00
Herman Chen
fb3390cbdd [osal]: Use SET_SESSION_FD to implement batch cmd
1. Add SET_SESSION_FD cmd.
2. Support new delimit interface to send multi request in one ioctl.

Change-Id: I07980cc9c70b5e31585254d1ffde7bc56a3007e2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-01-27 18:01:47 +08:00
Herman Chen
5e396e03d5 [mpp_soc]: Add AVS2 type
1. Add AVS2 coding type.
2. Add AVS2 support on rk3588.

Change-Id: Ifa677830d3f8c1625a4c351a6e008c09098f5122
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-20 18:34:30 +08:00
Herman Chen
6beec8ce65 [mpp_soc]: Add rk3588 support
Change-Id: I9a8829a1f0910c6de2062cd1c6b95d0c7ef71803
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-12 12:29:03 +08:00
Herman Chen
8ae47457a0 [mpp_server]: Add device callback to mpp_server
Change-Id: I985d48e6625d3656e080614ab958e26dfc54a2c8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-21 15:30:56 +08:00
Herman Chen
5b05a3c5e9 [misc]: Add O_CLOEXEC flag on file open
When /dev/mpp_service is opened and be forked to another thread the
leaked fd will increase file refcnt in kernel.
Then the codec kernel session will be leaked on mpp_destroy.

Change-Id: I5bb682792c8e58591ec3a21af36e3f8a967f77fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-25 10:32:04 +08:00
Herman Chen
16ce9d1f6b [mpp_server]: Add mpp_server module for batch mode
Batch mode will send multiple task to kernel at one time. And its
non-block poll is triggered by timer and looper.

This mode will reduce the ioctl overhead on ultra multi-instance case.

Main features and some notes:
1. Each client type has independence batch server.
2. Each mpp_device can attach or not attach to server independently.
3. When a device is attached to server all its tasks will be sent to
kernel through the server session not original client session.
4. The tasks are sent non-block and wait in block or non-block.
5. The batch mode can only be switch on/off when hardware is not
working.

Change-Id: I07462d852cb002259d2873e13c12f6f8a489ba8e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-04 09:02:30 +08:00
Yandong Lin
5b1156a47b [vcodec_service]: Fix array out of bounds issue
Note:
1. In kernel 4.4 and previous version, the array may cross the boundary
and cover an unknown memory address
2. The array is out of bounds caused by the following submission:

 commit 5be47f31f0
  Author: Yandong Lin <yandong.lin@rock-chips.com>
  Date:   Wed Feb 24 19:44:32 2021 +0800

      [hal_vdpu]: Support fd and offset to be set separately

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie3fc4324dde497732424cf3023ce81997401fd96
2021-04-09 11:12:56 +08:00
Yandong Lin
f2231d1473 [mpp/vcodec service]: Check whether the offset is configured repeatedly
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I217a138b62a7a17f7f371d76a591a02852950a10
2021-03-12 11:39:27 +08:00
Yandong Lin
5be47f31f0 [hal_vdpu]: Support fd and offset to be set separately
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I38214c5d692fce76b60fe71536fab9863605e64e
2021-03-05 14:22:35 +08:00
Ding Wei
0d6a0e28d5 [mpp_device]: add MPP_DEV_RCB_INFO for rkvdec34x
Change-Id: I0fe59f27f74fdd6a5eafd91b91870fdbf1253e33
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-01-13 18:25:28 +08:00
Johnson Ding
873f509da9 [osal]: Fix encoder not working problem at vepu2
For vepu2, kernel 4.4 and previous version, '/dev/vepu' should be used
rather than '/dev/vpu_service'.

Change-Id: I2efd4a219bbd7dd3cebf226c8ebcede9bcff9823
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-12-23 10:10:11 +08:00
Herman Chen
c106a5bdd0 [mpp_soc]: Add mpp_soc with more detail feature
1. Add soc definition structure to replace old one.
2. Use mpp_soc.h to replace soc detection in mpp_platform.h.
3. Add vcodec_type to each device definition.
4. Add check on soc info init.

Change-Id: Iecc44bd79e6fd09c58afbc1b5c526ecf31acc663
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 19:42:53 +08:00
Herman Chen
2f2e4224b9 [mpp_platform]: Move codec_type detection
1. Move codec_type detection code to vcodec_service.
   Only vcodec_service needs to detect vcodec_type. Mpp_service will
   report this flag from kernel.

2. Remove kernel device detection code when soc type not detected.

3. Add mpp_soc.h for soc definition.

Change-Id: Ic83897bddbcf0fceb0c5d19a05491f75231092c1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-25 15:11:28 +08:00
Herman Chen
af6938b235 [mpp_device]: Move mpp_device to osal
Change-Id: Ia196f01945d47c24e821da8935f3694834afa839
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-06 11:47:53 +08:00
Herman Chen
3f8e880a39 [hal]: Use new mpp_device interface in hal
Switch all hal module to new api.

Change-Id: I066da7e06c999a01b80ee193365c5752e9bb19aa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-06 11:47:53 +08:00
Herman Chen
44443dd7ee [mpp_device]: Add new mpp_device for kernel driver
1. Change mpp_device into a new layer for kernel drvier.
2. Separate mpp_service driver and vcodec_service driver.
3. Add mpp_service.c for /dev/mpp_service driver support.
4. Add global mpp_service info query interface.
5. Remove unused function in mpp_device.c

Change-Id: I3f53bba3aef525ad3b1f450bb55830d1eeaf29a6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-03 16:09:19 +08:00