Commit graph

239 commits

Author SHA1 Message Date
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
Hongjin Li
b2479a59ec [mpp_dec]: Fix the field video pts is abnormal issue
The number of input field video frames to the decoder
is half of the number output frame video frames.
When the sorting pts is turned on, only half of the
pts cache is taken out from the pts linked list.

So when decoding field video, only half as many pts are cached.

Change-Id: If9055480365b776475861add1470d68210b65971
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-05-20 08:55:15 +08:00
Herman Chen
e66e69d389 [mpp_dec]: Diable fast mode when hal not support
Change-Id: Ibf1263968ed29b369f079655721046d2d73bad5a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-13 16:48:22 +08:00
Herman Chen
de864932e3 [h265d]: Fix error of reset on info change
Change-Id: I31c5e7a0888da0ff0e7363929d0bd45369149178
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-11 16:47:30 +08:00
Hongjin Li
4f4c73a7ae [h264d_dpb]:Fast play is disabled by default
Flip disable_fast_play to enable_fast_play,
Fast play is disabled by default.

Change-Id: I168e02a9d84590c3b2b92fe75b2b37c655c8c63e
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-04-22 09:59:18 +08:00
Hongjin Li
98ac9b259b [h264d_dpb]: Fix h264 video flicker issue
When the poc of the idr frame is 0, the subsequent frames with poc<0 are
discarded, which will cause the screen to flicker.
Add parameters in mpp as switches for immediate output of idr frames.

Change-Id: I522334dd1e81fc6aeeb60e71404f3a7071a5ecae
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2022-03-09 10:22:16 +08:00
Herman Chen
2e25db1a7d [mpp/mpp_enc]: Add async encoder flow
Change-Id: I0e040b8e9b1cdb40be996afc818a7ffb16802d09
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-03-02 15:20:57 +08:00
Herman Chen
fc8c86154e [hal_task]: Change hal_task to info with status
1. Split encoder and decoder hal_task defs and infos.
2. Change hal_task to a general info list with status.

Change-Id: I6f26035eeee4772d1ef99a21d85716e9c33eb9a6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-02-18 15:35:56 +08:00
vic.hong
ee10b27c68 [mpp_dec]: Fix the problem of screen flutter when decoding mpeg4
Modify the processing of pts in the decoding process

Change-Id: I80b911c19eb345744333d3ec4d8e22e8c86fc857
Signed-off-by: vic.hong <vic.hong@rock-chips.com>
2021-12-22 14:29:23 +08:00
vic.hong
8f0ca9fbbe [mpp_dec]: Fix hor_stride_pixel is zero issue
Set hor_stride_pixel in function mpp_buf_slot_set_prop

Signed-off-by: vic.hong <vic.hong@rock-chips.com>
Change-Id: I832b7d4e9f0d5fda81816e4c42e75ec1ef2d841a
2021-11-18 08:40:35 +08:00
Yandong Lin
1c03947d59 [mpp_dec]: Optimize sort pts function
Record every pts of pkt to link, and sort link by pts.
When output the frame, remove the pts from the link and set to frame.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Id987dea0195c24d2bd573416e80a3ef2f58d6a31
2021-11-10 21:07:43 +08:00
Herman Chen
6e0f898707 [mpp_dec]: Optimize decoder flow
Change-Id: I98805ad6f9595d1a0339c466fddebb7c44348a16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-03 15:54:25 +08:00
Herman Chen
3aad89dee8 [mpp_dec]: Add mpp_dec_callback
NOTE: The MppCtx should be restored for external user.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2a4241ddacb14196f43b29a59b46658131ebfcee
2021-10-13 17:17:56 +08:00
Herman Chen
0589fb5bd3 [mpp_dec_cfg]: Add external notification callback
Add callback on two events:
1. packet ready and wait for new packet input.
2. frame ready and wait for output frame poll.e

NOTE:
Add callback command param for version compatible sync between user
and mpp library.

Change-Id: Ic41d495a06cf653acb6b5100699f1b7f5f735f2e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-10-13 15:42:11 +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
db487e5d7f [mpp_dec]: Add MPP_DEC_GET_CFG cmd implement
Add MPP_DEC_GET_CFG call before setup decoder config in mpi_dec_test.

Change-Id: I1ed8c2be44be9de0e4b1364a1401a81a9ecfd6e1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-17 11:11:43 +08:00
Herman Chen
436209226b [mpp]: Add jpeg hw_type config implement
1. Add dec cfg update before mpp_init.
2. Add hw_type eheck and process on hal_jpegd init.
3. Disable soc cap error log.

Change-Id: Idb5929bf1eace77d4b09205b60d0c1f0e0eb50b5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-15 12:21:03 +08:00
Johnson Ding
0faeb9413f [hal_jpegd]: Check output format before decoding
Change-Id: I035297695a4ff027814507e829adba1a767f61e8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-08-23 14:30:31 +08:00
Herman Chen
27fcbaf199 [mpp_dec]: Add more check on decoding mjpeg
https://github.com/rockchip-linux/mpp/issues/210

Change-Id: I13e4406dd4730a5f4da8d62b9c35eadf4527ccfd
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-08 09:44:46 +08:00
sayon.chen
9eb347a5ae [h264d]: Support hw resolution capability check
Add hw capability to parser and check resolustion based on hardware
capability.

Change-Id: Id9b719b238c74d6b77f78fd8d583a3de854a94f4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-18 08:56:57 +08:00
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
c6f2c43afa [mpp_dec]: Add more detail debug log
Change-Id: Ic5516a5e6746f563cfeb77f415d0f98d2fd6f453
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-13 16:44:08 +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
Herman Chen
6b5ee5a122 [mpp_dec]: Implement put_packet by dequeue/enqueue
1. Use dequeue/enqueue to implement decoder put_packet interface.
2. Change task check on deinit. Only check the metadata size in task.
   If MppTask is destroyed with valid metadata just should warning.
3. Reserve one task at input queue for eos packet.

Change-Id: Ib445b148bb5a10c588104ee1fd96bad6f52f1388
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
914d28a9e1 [mpp]: Rename I/O port
Change-Id: Ieb154da4802873d5f534aba6fd38a90e2ffaa9fc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
d3ed1d9e6e [mpp_task]: Add positive return for port poll
When poll the port task and there is task for dequeue just return
positive valid task count value to caller.

Change-Id: I6c078cee69e34ba9b6cc5ffa77c704b8c59683b4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
70ea32f3df [mpp_dec]: Do not release input packet with buffer
NOTE: on advanced mode the input packet should not be released when the
thread is finished.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I66656f6f2e484aabd28f74469c29d4bd44a7dcc2
2021-02-25 17:09:04 +08:00
Herman Chen
22e73ba651 [mpp_dec]: Add decoder hal_info (with 403 kmsg)
NOTE: When MppDev is not output to mpp_dec the codec info update is
disabled.

This patch may cause kernel show the following log on old kernel:
mpp_process_request:1078: unknown mpp ioctl cmd 403

This log has no harm at all and new kernel will disable this log.

Change-Id: I26c8d78e279b5809bb2d1e51baf2c48e7f6e5a33
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-02-25 08:42:46 +08:00
Ding Wei
945168e91b [mpp_hal]: Add MppDev to MppHalCfg
Get MppDev on hal module init.

Change-Id: Ie0c6f7aa04b23f09ee154239ccda3d77c1bb2895
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-02-22 20:28:58 +08:00
Chen Jinsen
f9ef9976e9 [mpp_dec]: Fix stuck issue on decoder control
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: I563a899fdfa428f6204934248e0f9b60cc61a186
2020-12-18 16:29:16 +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
sayon.chen
711459b3c5 [mpp_dec]: Default enable vproc for deinterlace
Change-Id: I724b54de0f4affc7fed8a4841f06aeb6326754d3
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2020-12-15 16:43:56 +08:00
Herman Chen
fdb769274c [vdpu34x]: Support fbc fmt set for dec_out
1.hevc all resolution support fbc out
2.h264 only support frame mb only for fbc out
3.vp9 all resolution support fbc out

Change-Id: I1d68b75aebea30560a1c6c25bd552121f86097f0
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 19:42:53 +08:00
Herman Chen
13b4f27390 [mpp_dec]: Use callback to handle hardware status
Change-Id: Iff972f276f00621dc0289633178e487d897b2e0e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 19:42:53 +08:00
Herman Chen
134de17b36 [mpp_dec]: Sync mpp_dec_control process
Add mpp_dec_proc_cfg in parser thread. The external control will be sync
in decoder thread.

Change-Id: Ic680f055fd1568815fe9f28b62c8ddcc837311bc
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 19:42:53 +08:00
Herman Chen
d9c59b7c0a [mpp_dec]: Add MppDecCfg ctrl process to mpp_dec
Change-Id: I767e7b248922904d61aa19afd657a5543a2b9995
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-12-08 17:48:09 +08:00
Herman Chen
3faae6c3e5 [vdpu34x]: Add vdpu34x H.264 decoder
1. Add vdpu34x common definition.
2. Add hw_id detection on hal_h264d_init.
3. Add vdpu34x H.264 decoder module.

Change-Id: Icd8c8394ad75329c00f910c7903cc8951bb0777b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-11-11 14:48:56 +08:00
Herman Chen
3c55b55e46 [mpp_dec]: Add query interface for debug
1. Add query interface.
2. Add query result in mpi_dec_test.

Change-Id: Ie0026f155331c0b0f8e1b5409aeb7d41b6a3ecc6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-23 14:17:34 +08:00
Herman Chen
d29cb91c22 [mpp_hal]: Remove hal header dependency
1. Remove dependency between mpp_hal.h and mpp_enc_hal.h.
2. Remove unused work_mode.

Change-Id: I1d8e8163e3c2de00636665d7aff38652309820ba
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-10-22 09:27:41 +08:00
Ding Wei
8d38d4b2f0 [mpp_dec]: add immediate_out flag in mpp struct
tips: control cmd for immediate_out, can send both before and after mpp_init.

Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Ibe66878cfab1f592b952d01bee3adade7c9d31bc
2020-05-27 10:22:03 +08:00
Herman Chen
b83158b23b [mpp_time]: Change old timer to clock
The MppClock is used to record and sum the time only.
The MppTimer will have new implement.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I6cace6968d50db611e7493b69b14b46853070d78
2020-04-04 16:06:01 +08:00
Herman Chen
288bf1e5aa [mpp_dec]: Fix error on last empty eos frame
When last stream packet is send with eos flag but without valid task or
not output is set just output an empty eos frame.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I18a4ea004479820d4dcfe30aa75d935b15a188cf
2020-02-27 15:37:42 +08:00
Xingwen Fang
736f6199b5 [mpp]: use mpp_list to store timestamps
MppQueue does not support concurrent access, and there
are defect in the design, which need to be improved in
the future.

Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
Change-Id: I50db4bcf520bbf4115c6f40d7a759652087965ec
2019-12-23 14:28:43 +08:00
Chen Jinsen
fdc8ef19cb [mpp]: Fix output slot index assertion failure while get parse error
Change-Id: I06a9897bad7edbcd96b171faaecdab38a08d46eb
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2019-11-10 10:10:54 +08:00
Herman Chen
585b187b18 [misc]: Use MppDeviceId to replace HalDeviceId
Change-Id: I3fd2f6a673f4f8d05420bfccb78e8b103f2ca26d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-10-14 17:18:13 +08:00
Herman Chen
6cf33e998b [mpp]: Remove extra signal and thread in mpp
1. Only use notify to communicated between mpp and codec.
2. Remove mpp_enc_impl.h

Change-Id: Ia62757240efa7d245b5215ad79539fa9bbbd1550
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-20 15:57:17 +08:00
Herman Chen
5271f581cd [mpp_dec]: Change mjpeg decoder loop flow
Change-Id: Ifa8577f2490df3eb31e410caaada1eb333119819
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 18:07:54 +08:00
Herman Chen
205ba6dc31 [mpp_dec]: Move thread into MppDec
Change-Id: Ifab2773a1aa5405ffeb155ce8fd8e5f21e5a6b45
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 17:46:58 +08:00
Herman Chen
14076644ea [mpp_dec]: Add MppDecImpl layer
Add MppDecImpl layer for separate encoder and decoder.

Change-Id: I02e04acddf617ae5188572af89312ab20fbf21b6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-19 14:54:24 +08:00
Herman Chen
003f8806af [vproc]: Pass HalTask between hal and vproc
Use HalTask to communicate between hal thread and vproc thread.

Change-Id: I4e87b7ca63bdf86e46045e31296ffa69958ae719
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-08-19 15:02:13 +08:00