Commit Graph

3026 Commits

Author SHA1 Message Date
Herman Chen
ecf7531cf8 [mpp_dec]: Add batch_mode config to MppDecBaseCfg
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id0c247609e14a7f8d4042404783a6a5044d0a1c6
2021-06-04 09:43:40 +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
sayon.chen
7bf5ddae98 [rc_v2]: Fix struct read overflow
Change-Id: I53a1440b7921b7a6f656b936669131a9418549f0
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-04 08:49:05 +08:00
Herman Chen
a010011064 [osal]: Use strof_ function in mpp_service
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I059e79326f994fa9b172074a9f12f9f0a8c12c6b
2021-06-03 10:41:33 +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
3084d79375 [license]: Add apache license file
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I58c6e7bce3c906f5383082085a7c7f8f4985394b
2021-06-03 10:04:30 +08:00
Herman Chen
dc6e82f146 Move implement define to new header
Change-Id: Ic8bde5aa6ea9faf25793bb91a420bfeba0e9e9f7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-02 15:55:25 +08:00
sayon.chen
f53dfac47c [rc_v2]: Support hierarchical QP cfg
Change-Id: I0827689ee27a7007cb157b2990089e3c34c6ad50
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-02 15:24:24 +08:00
Yandong Lin
2a93497b33 [hal_vdpu34x]: Set hurry mode
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: If71e58971663edbcdb004382b58ad0fc99d67543
2021-06-01 16:30:54 +08:00
Herman Chen
587aebf97c [rc]: Fix gop frame count update error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia1231605c48e6ca504a90ebb2fcf7afe38a632ed
2021-06-01 11:01:35 +08:00
sayon.chen
aa57abeb40 [vpu_api_legacy]: Support format stride setup
Change-Id: I8d166fda19b8ed01c2824164a8ad3d5229f4b5ea
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-31 14:05:30 +08:00
Herman Chen
9ba242bb9c [mpp_enc]: Change thread name rule
Change-Id: Iddaa528e83828057de428e0076c253a0c7efae97
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-22 16:17:04 +08:00
Yandong Lin
33784aca30 [rkv_enc_cmd]: Fix check info err when enc_cfg_set
Fix issue frome github:
https://github.com/rockchip-linux/mpp/issues/201
Err message:
mpp_cfg: cfg h264:max_tid expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:max_ltr expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:prefix_mode expect RK_S32 input NOT RK_S32
mpp_cfg: cfg h264:base_layer_pid expect RK_S32 input NOT RK_S32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9dbd49a6ce04807455d1a7dc090cad96ae0f2c83
2021-05-21 15:41:11 +08:00
Yandong Lin
a0ec1ba235 [rkv_enc_cmd]: Fix check info err when mpp_enc_cfg_set
Err message:
mpp[16915]: mpp_cfg: cfg h264:poc_type expect RK_U32 input NOT RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_poc_lsb expect RK_U32 input NOT
RK_U32
mpp[16915]: mpp_cfg: cfg h264:log2_max_frm_num expect RK_U32 input NOT
RK_U32

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide77867beed2ee4e94df1179882713e600d3448b
2021-05-21 11:39:00 +08:00
Herman Chen
dbd2e2a77b [mpi]: Add mpp_start and mpp_stop
The purpose of mpp_start and mpp_stop is to break mpp_init_into two
stage.

Original mpp_init conbine the init and start for example mpp_dec_init
and mpp_dec_start then the global (or static) config which dominate the
fundamental working way can be only be set before mpp_init. That is
unreasonable. Another example is the encode memory prealloc flow.

The mpp_start is added to end global param receiving and do real
preparation of current operation in mpp_init.
The mpp_stop is the opposite of mpp_start.

Change-Id: I2bdcc29a9ff75777acc5c39c7e7f01477e597bb0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-20 10:24:25 +08:00
Caesar Wang
94a8f7dd95 [debian]: update changelog
Release v1.5.0 mpp for debian.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I5b1677a42dbbf6ac1a4145bd605a27d8f3b1514b
2021-05-20 10:18:50 +08:00
Herman Chen
b696216330 [mpp_enc_impl]: Cleanup hal_task on empty eos task
When empty eos frame input as last frame the hal_task packet len should
be clear.

Change-Id: Id25686a598853d0808105bf6eedb0b7e41247f16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-05-19 11:42:05 +08:00
Herman Chen
a8ac97e5a9 [mpp_time_test]: Add timer test case
Change-Id: I65d4da1431fb68d0e8482aafb30dbeb651156d28
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-17 20:04:33 +08:00
Johnson Ding
44e96b5fc0 [mpeg4d]: Fix eos mismatch problem
See https://redmine.rock-chips.com/issues/297503

Change-Id: I601f9161d73bdb499c10391738198f40a6e2b33c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-05-17 14:40:10 +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
Yandong Lin
bf6a59f67f [jpege]: Support jpeg enc dynamic setting rotation param
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id93d8f67f0eb7da920c84888f3e3c155107a6d03
2021-05-14 14:25:23 +08:00
Yandong Lin
ffe4ef768b [hal_vp8e]: Fix vp8e not support argb source issue
Configure the input format correctly

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I39317351c8905c28c0fb94d7378ec0615060387c
2021-05-14 10:36:47 +08:00
Yandong Lin
f9ffe330b8 [hal_h264d_vdpu34x]: Reduces the number of calls to mpp_put_bits()
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9115d8c55dedcbaf097b16df6615d6f46680765b
2021-05-13 17:49:13 +08:00
Ding Wei
7f1b5ab31a [h264d]: Optimize the sps&&pps reference codes
if sps_id&&pps_id has not change,then regards as not need to
refill spspps buffer data.

Change-Id: I7616d913800b1b4865999f11ce6fb7e71fabc41f
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-13 17:48:37 +08:00
Siyong Chen
3c317fedf3 [rc_v2]: Fix bitalloc size equal 0 cause div 0
1. Add moving_ratio check min value clip to 1
2. Add vi_sacle check min value clip to 16

Change-Id: I463db12610d9b1f97493f5d594e7eaf5c2ed5532
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-05-13 10:33:36 +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
Herman Chen
2204012fb3 [mpp_buffer]: Fix error on buffer group reset
At buffer create stage and ref_count is still zero if buffer group reset
happens the just created buffer will be marked discard and cause error.

Change-Id: Idc163f81edd055d8cc33ce6d80ca041adc973878
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-12 20:31:56 +08:00
Yandong Lin
825467160e [hal_vp9d_rkv]: Fix mv base offset err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I51dd75670b5a473624b441d49b66e1c071615469
2021-05-11 11:50:27 +08:00
Ding Wei
0c9718e266 [hal_h264d]: vdpu34x: simplify some put_buts writing
1. combine some fixed values when put_bits.
2. assign data value instead of put_buts 8 bits.

Change-Id: I153399194a35ad17e9a95e402725009b82b6a60e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-11 11:45:19 +08:00
Ding Wei
547ec685a1 [h264d]: optimize refer info relative process
1. add mvc flag for interview process.
2. reduce empty loop when init ref info.

Change-Id: Ie2745cbe1b78b26a8f26e97c02fb76d4bf6ca315
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-11 11:37:26 +08:00
sayon.chen
4d7d1b5b79 [h265d_parser]: Use new method for pps change check
Change-Id: I768631486e1b5d93ed4f7e498b455240872bc994
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-11 11:14:26 +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
507c36af90 [mpp_enc_cfg]: Fix chroma qp offset typos
https://github.com/rockchip-linux/mpp/issues/198

Change-Id: I5ba4fbf002ce1b07ae2bc829f845986639b9b91d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: imxys <532076008@qq.com>
2021-05-11 08:55:14 +08:00
sayon.chen
b75f833e74 [h265d_parser2_syntax]: Optimize syntax fill
Change-Id: Ia60e1b3df5e7b72d5c6c2f67a359669e3903b08c
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-10 15:51:33 +08:00
sayon.chen
a73905adae [h265d_34x]: Ps hal_buf not update every frame
Change-Id: If925584df1bff7efc2ce7f44268b1f3a2bcf3f7b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-10 15:50:49 +08:00
Ding Wei
25bd6716e2 [hal_h264d]: use memcpy instead of mpp_buffer_write
Change-Id: Ibc617789a3f7554993a3f5df1fd1ab7f1a7ca2b9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-10 14:28:57 +08:00
Ding Wei
d6d5670480 [h264d]: if scanlist is not enable, skip it
1. it not need to fill when init dxva_ctx.
2. it not nend to write and send scalist buffer in hal module.

Change-Id: I68e0a899eb1f5d29a9f5c06fdffc60b23e6bdedf
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-10 11:39:42 +08:00
Ding Wei
b6e11a5aae [h264d]: use impl's variable instead of mpp_frame_xx
Change-Id: I8c033940512bd00c9c65478bc3b47f47fbb63ada
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-05-10 10:32:40 +08:00
Yandong Lin
60ffcb9375 [mpp_mem_pool]: Fix put_pool err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3a36d5c709cd37b13d8b587074f1ab500e9c8017
2021-05-10 10:06:54 +08:00
Yandong Lin
14f93e251b [vp9d/vp8d/m2vd_parser]: Fix deinit MppFrame with mpp_free error
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ia50b5b8b802cf604251ee0076f2b89cba9b05017
2021-05-10 10:05:30 +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
sayon.chen
b2bf57c2f8 [h265d]: Fix slot->status.has_frame assert issue
fix generate_missing_ref slot_index not set SLOT_FRAME cause
get SLOT_FRAME_PTR assert has_frame

Change-Id: I6c0936efab8eb83a0d2acd6b5e94fbb7e1b987f5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-05-08 15:17:43 +08:00
Herman Chen
cee0762db9 [mpp_mem_pool]: Fix destruction error on Android
The Mutex is destroyed before MppMemService. Use get_lock() to avoid it.

Change-Id: Iba5852280ee2e5804fdfa45da008500fb1dc9225
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-07 15:58:04 +08:00
Herman Chen
b2bbadf045 [jpegd]: Fix deinit MppFrame with mpp_free error
Change-Id: Ie6570b4ff9f899c5d0684c4488c208480e1fb321
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-07 15:40:46 +08:00
Herman Chen
4d7b67bf6e [mpp_buf_slot]: Use preallocated log storage
Change-Id: I4e6711bcba64e867db22d5caa6fe6699449e3b42
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-06 14:54:47 +08:00
Herman Chen
90b1c01b55 [h264d]: Reduce malloc / free
Change-Id: Id33f6928d31de4832bad3807ad4a1c5e6a637853
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-06 14:03:32 +08:00
Herman Chen
c6d2144afa [mpp_buffer]: Use mem pool reduce malloc/free
Use mpp_mem_pool to reduce MppBufferImpl and MppBufferGroupImpl malloc
and free.

Change-Id: I6331aefddf7ee8eb578a638d86a276891aa61ee7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-06 14:03:32 +08:00
Herman Chen
ca0b9b8264 [mpp_mem_pool]: Add put_pool function
Change-Id: I8b0723c90969c781537f7ff1a7815c241c9f1481
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-05-06 14:03:32 +08:00
Johnson Ding
03f94da031 [h264d]: Revert 0250dab00c
The changes done by 0250dab00c will cause
dbp combination error. So revert it.

Change-Id: Ia1fd3157eafebe52332e3beacd979c1497008a75
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-05-01 16:27:05 +08:00