Commit Graph

194 Commits

Author SHA1 Message Date
Herman Chen
811e468f5a [mpp_device]: Add last flag to PollCfg slice info
Change-Id: I262f6a032015e1ce7a05db3dc4db6d01e14d81a7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-06-02 08:44:30 +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
da3fc7c4a8 [mpp_list]: Add more wait functions
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Icc8457ce1bff75eee7e5b8b8cc34360a339571a8
2022-04-29 09:52:22 +08:00
Herman Chen
f1324e29a2 [mpp_compat]: Add mpp compatible spec module
This module is for backward / forward compatiblity with external users.
1. Support compatible feature query.
2. Support update user program compatible feature update.

Change-Id: I7661f17c442eca0a0d0d57d2a35efdb5fd88be72
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-19 08:29:41 +08:00
Herman Chen
275705e088 [mpp_list]: Add wait function
NOTE: The wait function MUST be used with lock protection.

Change-Id: I14f48795d5833c9aedc311c56139775bf07f0e79
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-01 18:08:11 +08:00
Herman Chen
392ef8b8c2 [mpp_thread]: Add trylock return value
Change-Id: I3e5ac1e651535e247845f44c3730ea8dbb098c17
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-22 15:11:57 +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
Jeffy Chen
c07169d533 [misc]: Fix a few compile warnings and errors
Reported by llvm-clang.

Change-Id: I62f22fe5754d3e8d77405d213c81fda5d9f5e27d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2022-03-11 17:45:10 +08:00
Herman Chen
881f05c7cf [mpp_soc]: Add avs+ decoder to rk3588
Change-Id: Ia93c70a16c17d1202ae4b133f157c140d8c8668c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-03 16:38:49 +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
Yandong Lin
a4ece5df05 [hal_av1d]: Implement av1 decoder hal module
Change-Id: I9dc410b55cc614e7a4a6353d52a70c806e467b2e
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2022-01-21 11:20:02 +08:00
Herman Chen
69dfccfd12 [osal]: Add log disable/enable function
Change-Id: Iddd02b7c3d102a65a4c34a8fba89b7a28719e0a9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-12-23 15:53:14 +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
Yandong Lin
ea564af5c6 [mpp_list]: Add list_sort func
Porting from kernel lib/list_sort.c

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: If6b0e07a863a8e95b47f2b89a2941d21674c9108
2021-11-10 21:06:49 +08:00
Herman Chen
f0c57cde02 [mpp_lock]: Add gcc atomic macro define
Change-Id: I3e94cc7be9a51f5d674a132c0a2e6f7afba61d34
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-03 11:27:35 +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
0aeb6e46b6 [mpp_lock]: Fix compile error on bool type
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If856cebe92db7e982f9781dfbe12b978e88bfac3
2021-10-18 17:05:41 +08:00
Herman Chen
a96e644da8 [osal]: Add spinlock implement
Change-Id: Ib520e6732d007370545508ae18d6c74fa4d9d80f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-14 14:47:44 +08:00
Herman Chen
7256403b49 [mpp_callback]: Optimize callback module
1. Move callback module to osal for later mpp_device callback.
2. Make callback command a pre-defined value to avoid include issue.
3. Separate callback cmd and param to separate header.

Change-Id: Ibd5cf11650a1cd2a326baddb82dc60fa1767ac87
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-09 17:14:44 +08:00
Herman Chen
5598a015a7 [mpp_mem_pool]: Add debug flag
Change-Id: I562ccfe062546c9f4a20711fa1d3553ab100c7ce
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-30 17:29:18 +08:00
Herman Chen
6cc2ef5f75 [mpp_list]: Add list_mode and list_move_tail
Change-Id: I7be6f69a073eeedef1b0d9ff7e9a47b48df8a8fa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-17 11:11:43 +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
Herman Chen
b6c914a74d [osal]: Add osal_2str function
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4f97a0938baa5d62c405f79c326a18b3ff6478f0
2021-06-03 10:26:06 +08:00
Herman Chen
bbae9e98a7 [mpp_thread]: Add broadcast function
Change-Id: I33ad9e3b3a657f21d23dfd6f04abd864b4a883d6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-17 11:26:50 +08:00
Herman Chen
53a5653cc8 [mpp_list]: Update C macro
Change-Id: I05813bdc0f6047617d10654579949226900b781f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-17 11:26:50 +08:00
Herman Chen
d1366a4801 [mpp_mem_pool]: Move mpp_mem_pool to osal
Change-Id: I124f38bc58f791993515544af2c59169ee2c2402
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-12 20:47:36 +08:00
sayon.chen
891a416961 [mpp_thread]: Rewrite Autolock function
Add extra flag to disable Autolock

Change-Id: Ibbaf4b7a011f830728401facd49ac30ab0c7c9ad
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-11 10:00:33 +08:00
Herman Chen
f86fcc7663 [osal]: Add mpp_trace using ftrace
Change-Id: I6c6597d722f574524f1b993a18f6cd868b20fbab
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-10 09:15:41 +08:00
Yandong Lin
ed69e9077f [mpp_mem_pool]: Add common module MppMemPool
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id778f4395f457a773812db78164ecad4038b2ff4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-01 16:27:00 +08:00
Herman Chen
f026a238de [osal]: Add hash table implement
Change-Id: I190282e2236797f1b452176a82e72117b93cd64f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-21 14:39:38 +08:00
Herman Chen
a91439bef4 [mpp_buffer]: Add mem and buffer usage function
Change-Id: I356ef9311802868fe8d234dbff178ad8463985d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-20 14:39:52 +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
27a8f219d3 [mpp_service]: add msg flag for offset alone
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Ifba9f4da888e2229e3c36b7f6de0d35be4179e95
2021-03-03 13:46:27 +08:00
Herman Chen
4ecb7de25c [mpp_platform]: Add kernel version detection
Change-Id: Id2110213daeaca606bafe288a6d4cd970c112d4f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-02 20:21:29 +08:00
Herman Chen
0ce3ed3048 [mpp_list]: Use class inheritance
Change-Id: I3ef33ca9bdcfea80a6c05a8c69db2d4938a5d0eb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-01-19 17:06:16 +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
Herman Chen
11aa95e52f [mpp_log]: Update mpp_log macro
Change-Id: I0e46e93a9a8fa0a7cb7a0e86cec1748503bddcfb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-17 16:07:28 +08:00
Herman Chen
5f26c80d95 [hal_dec]: Remove old MppDeviceId
Change-Id: I8285a3f998bb3360dce4c71d0108411dd8bc6f21
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 19:42:53 +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
3be3d97054 [mpp_device]: Add regs offset helper function
This helper function is for address register setup its offset.

When offset is less than 4M (20bit) the offset and buffer fd (10bit) can
be filled in 32bit word.

When offset is larger than 4M the full offset should be sent by ioctl
MPP_DEV_REG_OFFSET.

Change-Id: I5f59f3c941e41cf85fa2ab8895d2a177f4412e64
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 17:48:09 +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
9956bdb1ac [mpp_service]: Add mpp_service device detection
Change-Id: Ie63d0dc9964801b1f85b3d0e289c84f89798ffb1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-25 14:11:49 +08:00
Herman Chen
5967c22284 [mpp_platform]: Add rk3566/rk3568 SOC definition
Change-Id: Ia1972cb95d5497cf95daab46504cfea9522b79e7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-10 14:19:41 +08:00
Herman Chen
ce7101f88c [mpp_device]: Add mpp_device_debug and set_info
1. Add mpp_device_debug.h
2. Add set_info handler in mpp_service.

Change-Id: I1ec83feadd4df79d5934182a35e0ed66f0f831ac
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-06 17:58:20 +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
Herman Chen
b845d7740d [mpp_device]: Fix cmd_butt check error
Change-Id: I247bb3573812903c6bc478cdad17c9e21f515104
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-28 15:41:41 +08:00
Herman Chen
6d2128f9f7 [mpp_device]: Separate kernel interface define
Move vcodec_service and mpp_service kernel ioctl interface definition
into different headers.

Change-Id: I1aa77d1073e7c51b48d18cf8d16fd76644d23d38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-28 15:20:06 +08:00