Commit Graph

2993 Commits

Author SHA1 Message Date
Yandong Lin
baf1efa9f8 [mpp_dec_vproc]: fix err frame output issue
when src frame is err, dst should be set errinfo also.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5d9f090abc3a9ffea8f7e921c1b523242ab1fc69
2021-09-14 16:24:37 +08:00
Herman Chen
57ff4c6b46 [cmake]: Enable HAVE_DRM by default
Change-Id: I30db9d3f283913809452d6050e45524fe615221d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-09-13 09:39:18 +08:00
sayon.chen
4166b08375 [h265e]: Fix deblocking_filter_disabled_flag set issue
Change-Id: Ia3f53fcd4d47d3bb3ea7954c1f56b84778314712
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-09-11 17:24:08 +08:00
Yandong Lin
b05b391e3c [hal_vdpu34x]: adjust hal stream info buffers
1. Remove errinfo buffer for h264.
2. Reduce redundant rps buf for h265.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I0f13faaf7a473dc7bfbe169e951313aed10f22e3
2021-09-10 17:06:47 +08:00
Ding Wei
6dadc7e122 [hal_h265d]: Use MPP_OK default, avoid the api->control is NULL
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: Id4966d0caadc82dc4a7a548558e0f2e1b194a1ef
2021-09-02 14:50:51 +08:00
Herman Chen
9036159c76 [jpegd_vdpu2]: Fix error on first jpegd vdpu2 task
The first jpegd vdpu2 will send codec info with normal register access
operation. But some old kernel will not support the codec info cmd 403.
Then kernel will discard the whole ioctl operation and let the first
decoding task failed.

So we separate codec info cmd from the normal register access cmd.

Change-Id: Ic364c90367a0493f132dc78e76fae3d4fd6011ca
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-30 16:39:42 +08:00
Herman Chen
264aca483e [utils]: Remove extra NULL option print
Change-Id: I48871d7af4fae0fdf3e6e405793e53a5e4768801
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-30 10:06:08 +08:00
Herman Chen
1263919d51 [vepu]: Fix error on encoding yuyv format
Fix error on encoding yuyv422 format with offset_x.

Change-Id: I3b1115e300d257cec096981d179da8111e31903d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-08-30 09:04:02 +08:00
Herman Chen
b394dcea6f [jpege]: Set default rc_mode to VBR
When quant or qtable is set change rc mode to fixqp.

Change-Id: Iacb1a1596b98c481b9ee7cbe61696a9c79445188
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-26 17:58:16 +08:00
Yandong Lin
0d11f480e3 [h264d_sei]: fix parse sei crash with invalid sps id
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I990e14fd8ff3b122577f63632d4632ab1723c78a
2021-08-26 09:26:39 +08:00
Yandong Lin
4f06d9dcb3 [mpp]: support dump pkt data for dec
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3a1cf3d8d36c090a1c4fc29f1ad6b4495e8703f7
2021-08-26 09:24:59 +08:00
sayon.chen
196b918d07 [h265e_dpb]: Mark unused ref which no show in dpb
Change-Id: Ie41740c8f85bd61ca590532501d7e89e6fd66fa5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-08-25 10:32:08 +08:00
sayon.chen
fb3e07d963 [rc_v2]: Reorganize ins_ratio calc code
Change-Id: Ice56c636eb53eec7cb0bbfa1269565eede0aa129
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-08-25 10:31:46 +08:00
Yandong Lin
7340076465 [mpp_time]: fix the interval time calculate wrong
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iabfa5c0cd1f85cbb41e85ef49cd0dd96f4f2d7f9
2021-08-25 10:21:52 +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
Chen Jinsen
516fd94a0b [jpegd]: Remove stream copy_flag on rk3568
Change-Id: I60a7d6384210aae5906d21d6286f1dd0f6203e32
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2021-08-23 14:06:02 +08:00
Chen Jinsen
599300a8ce [hal_vdpu]: Support hw resolution capability check
Change-Id: I4737b00550f5d78baacec7656e46e73bcaa28fbf
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2021-08-23 14:05:58 +08:00
Yandong Lin
c7c4183f1a [mpp_service]: Adjust the timing of codec info set
Change-Id: I6d21be4506f4c65bfb8717f07b2d55a65fb50cfe
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2021-08-23 14:05:54 +08:00
Yandong Lin
c1cec3933c [h264d_parser]: optimize the size of some struct
optimize the size of some structures as blow:
1. H264dVideoCtx_t
2. H264dCurCtx_t
3. DXVA_Slice_H264_Long

Change-Id: If3d7ca2f8d92d2a590767a97324537700848ab90
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2021-08-23 14:05:50 +08:00
Herman Chen
549ef870ce [hal_jpegd]: Add have_pp check
Change-Id: Id9b9a5004d0bdc5fd88e084966ada360f575b1a7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-23 14:05:41 +08:00
Herman Chen
6da83e59c3 [mpi_dec_utils]: Fix -f option check issue
Change-Id: I5495e37f7cebd397b1cf86408702a621c661aeba
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-08-23 14:05:21 +08:00
Johnson Ding
6c57191ffb [vepu_common]: Support RGBA little endian format
Change-Id: If896999f442b58078543b46404799ee1f3cb3dd1
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-08-23 14:05:13 +08:00
Johnson Ding
e81e72eca6 [jpegd]: Support RGB 16-bit format output
Change-Id: I0f3152bd068498fccc95569bb2950ab78ade2bf6
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-08-19 15:20:51 +08:00
Herman Chen
be76be4634 [hal_jpegd_vdpu]: Add pp switch for MppDev
Change-Id: I9e38ac2097b4fff6e33fd8c4fd9f16fbe92adf68
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2021-08-12 14:17:56 +08:00
sayon.chen
957b5e0365 [h265e_ps]: Svc case disable tmvp_en
Change-Id: I93068be4cc528c228258c757d6bd05bb18245212
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-08-06 10:40:02 +08:00
Jeffy Chen
49f29006a3 [drm]: Add mmap flag detection
Change-Id: I1099248e40e507d67cf82a5c5dca89ba7c706d52
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-08-04 09:43:19 +08:00
Herman Chen
1c2c12e001 [misc]: chmod some files to 644
Change-Id: I689e5e796b10583a6bacc297e9e60c23bcb117f4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-30 15:03:25 +08:00
Yandong Lin
02058ce67a [h264d_parse]: skip sp/si slice
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I86622ad339594f4d7b613ee5603cd6d11bb9b428
2021-07-29 17:59:05 +08:00
Jeffy Chen
b212aa4d08 [drm]: stop using drm_mmap and drm_munmap
That is no longer needed.

Change-Id: I6ee1efce4be88572200f10bc469904248e799bdc
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-07-29 10:32:53 +08:00
sayon.chen
baf7047942 [mpp_enc]: Fix qp delta_ip & delta_vi check issue
Change-Id: Iebe4c24dfdfbc8fb6b39aefc041b85e83c51528b
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-07-29 10:12:03 +08:00
Grey Li
853782d63b [h264d]: matching macro MAX_NUM_DPB_LAYERS with code
Signed-off-by: Grey Li <grey.li@rock-chips.com>
Change-Id: I915b551701d78dd314ff071473ffd7387e455f0b
2021-07-22 14:57:30 +08:00
Yandong Lin
d125c58815 [h265d]: Reduce malloc/free frequency of sps/pps
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I290b0e7bac7f878bc0285aadbaf742b1f268daa6
2021-07-21 16:56:58 +08:00
Herman Chen
0c43069763 [hal_jpegd]: Fix hal jpeg RGB output byte stride
NOTE: RGB format horizontal stride is byte stride. The pixel_stride in
MppFrame is the stride by pixel.

Change-Id: I09e87c5f7fb871ee2b285451ed2f0abfb1351f19
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-20 08:54:43 +08:00
Herman Chen
82aeaebe34 [drm]: Add DRM_CLOEXEC|DRM_RDWR flag on fd import
1. Add drm fd open flag.
2. Remove unused handle process on mmap.

Change-Id: Id0b29b8914c1e8e8ae6af40877df21f73b46346e
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2021-07-15 17:15:21 +08:00
Yandong Lin
a9410a69d5 [jpegd]: Fix parse err that do not start with soi
Compatible with some jpeg images that do not start with ffd8, but messy
data.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I963e16cb499af13fe95358e60f44e91d0df17bf3
2021-07-14 16:25:55 +08:00
Herman Chen
1bc99bed8c [mpi/mpp]: Add mpp internal start / stop function
Change-Id: I959211f26cd1c37924c7f6894535acedd8a37b88
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-09 16:16:06 +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
40c12b3a33 [hal_h265d]: Fix rps update issue
Change-Id: Ie5a14de91900e66ff8e4eaf0c411dcec9bf1f1db
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-07-06 14:47:51 +08:00
Herman Chen
4dbc29e380 [mpi_dec_test]: Allow loop jpeg decoding test
Change-Id: I2074554b9106213671c976705a195b0e9f740eb7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-01 16:51:08 +08:00
Herman Chen
c37a9ba095 [mpp_buffer]: Fix crash on cleanup leaked buffer
Change-Id: Ie795bb693c904e9c57d9d6af98564fedd0019ead
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-07-01 14:27:12 +08:00
sayon.chen
2ceca7b53e [hal_jpege_vpu]: Fix qtable memory leak
Change-Id: I67b411423d22069edbb79d2a1449e26b61c39495
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-07-01 11:25:32 +08:00
Yandong Lin
aaa65da3c5 [h264d_sps/pps]: Fix h264d err cause by spspps not update issue
When a new sps/pps nal is detected the spspps_update flag must be set.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ida86fae2dbe5e2db5171504859ff6fe65b2c0828
2021-06-29 15:24:13 +08:00
Herman Chen
69211067c9 [mpp_buffer]: Fix miss lock on searching group
1. In mpp_buffer_ref_dec it should be locked on search group by id.
2. Remove extra hash_32 on adding new group.
3. Improve id searching on id overflow.

Change-Id: Ibef4612e48b5a4c9dd6c5eca6c85f8ccba813827
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-29 10:21:23 +08:00
Yandong Lin
926bbb7073 [h264d_parse]: Fix prepare crash issue
When nal buf len is 0, nal buf shouldn't be read.
e.g. the following stream, the nalu_len will be decrese below 0,
it will crash to read nal_buf[] with invalid idx.
0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iafa103fe4f6df7cff41ffbdf6c94b42736456bcb
2021-06-28 16:30:11 +08:00
sayon.chen
902f0c5a98 [rc_v2]: Add bitrate statistic time cfg interface
Change-Id: I78506ed76e6a71d4326e221b0703ebe4126216a4
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-28 16:27:56 +08:00
sayon.chen
37397d6376 [rc_v2]: Rename stat_times to stats_time
Change-Id: I3cfd444b2d26d5bb2ce2a806efc1a74f4cce05b2
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-28 16:17:50 +08:00
Herman Chen
17a872e4b9 [mpp_buffer]: Fix error on releasing leaked buffer
The static lock maybe release before mpp_buffer_service. So we should
not used the lock on finalizing stage.

Change-Id: Ibf207e02e4fcdc2b5280ea58bd68372a7888a60a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-25 11:17:38 +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
aaron.sun
a748e54e88 [drm]: Fix drm handle issue
There is a bug when using single drm allocator device for all buffers:

Sample:
1. external fd a is import to mpp_buffer and get handle B / fd b.
2. external fd a is import to mpp_buffer again and get handle B / fd c.
   NOTE: The handle is the same in mpp for drm allocator is the same
   and the handle ref_count is not increased.
4. release fd b and handle B. (NOTE: The handle B is released in kernel)
5. mmap fd c by handle B. (Crash on getting handle B in kernel)

So we should reacquire handle for fd c when it need mmap or free.

Change-Id: Ide0591f97be5e00ca71f6a16e0ff676c4ed206a5
Signed-off-by: aaron.sun <aaron.sun@rockchips-com>
2021-06-25 08:58:10 +08:00
Yandong Lin
ad3d2bb696 [h264d_vdpu]: Fix ref list err issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I688b90f34dc08521cbaa0f0cdcfe149665882179
2021-06-24 08:36:01 +08:00