Commit Graph

3026 Commits

Author SHA1 Message Date
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
Johnson Ding
f891449b80 [jpegd]: reset syntax struct before parsing
Incase of some application not reinit Mpp Context for the next JPEG
decoding, some of syntax info will not be overwrite and it will leads to
hardware decoder error. So syntax struct should be cleaned before
parsing.

Change-Id: Iea8d76f0086fe7675d463f497c7a9dc106bdb546
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-23 16:26:51 +08:00
sayon.chen
17a7c77ee3 [hevc_vepu541]: Fix non_ref frame reg cfg issue
Change-Id: I10d79b5c270c90059a274be36bb77d778ece2d73
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-23 14:45:00 +08:00
sayon.chen
e3e2c2d6b0 [h265d]: Fix scaling_list address set issue
Change-Id: I228981e9c0ca55fb57d61f6d8f0fa170cc7966e3
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-23 14:12:23 +08:00
sayon.chen
4753cbc4e0 [h265d]: Fix error on split with redundant data
When split_nal_units found valid nal to decode just return success and
let hardware try to decode the valid nal with redundant data.

Change-Id: I7afb4bd55181d583f46dfc0192c622fc88445d6d
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-23 14:00:55 +08:00
Herman Chen
221d939485 [mpp_enc_refs]: Fix error on mark LTR on IDR frame
When mark IDR frame as longterm reference frame the longterm reference
frame index must be zero. So when user marked IDR frame to be non-zero
lt_idx just reset it to zero lt_idx.

Change-Id: Iec994f6891269ac47137ec68c2c82db5f33f40da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-06-22 14:04:15 +08:00
sayon.chen
b86aa171f3 [h265d]: Support hw resolution capability check
Add hw capability to parser and check resolustion based on
hardware capability.

Change-Id: I6f7ff7a56d0e46d6ca9cb0dcd547e74fd15d7bc1
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2021-06-18 10:23:29 +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
Siyong Chen
0383d8258d [vproc]: Expose hw feedback information to vproc
Return hw detection result from iep2 hal to vproc.

Change-Id: I53acb5260b5806abb6ba9085b81c967f30ea3f13
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-06-11 10:50:20 +08:00
Siyong Chen
250a890f96 [vproc]: Fix confliction of detection and config
Field order detected by hw will be covered by outside config
in previous commit, and cause video jarring when video field
order provided by video header information is incorrection.

Change-Id: I2d76ff5dc544026acd6450965294998bf9ecc06a
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
2021-06-11 10:49:54 +08:00
Yandong Lin
e6d4d6969b [h264d_dpb]: Fix mismatch the num of dpb_mark and fs issue
When fail in store_picture_in_dpb, the dpb_mark and fs binding failed,
the num of dpb_mark and fs does not match, so should flush cur dpb_mark.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I03acc107de655297857fbe56a0f4434576cca49e
2021-06-11 09:54:30 +08:00
Johnson Ding
23c086c88a [jpegd]: Fix marker parsing
When a new start code is not right after the last marker section, parser
will go wrong.

Change-Id: I84a06ed697ccb5900fb76044f36a00f4ea7566f5
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-07 10:21:30 +08:00
Johnson Ding
559b030bcb [jpegd]: Fix timeout problem
When decoding a YUV444 picture with format convertion, it may encounter
timeout error.

Change-Id: I9a9f6eda6c9ee92e029530c0dbbb8ad7f48d9d18
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 18:02:30 +08:00
Johnson Ding
f1c2d025b4 [jpegd]: Suport RGB32 format output
Change-Id: I2eed0a16895196a1270ba3d8e1ec6074be533f4f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 18:00:17 +08:00
Johnson Ding
b582fd8e2c [jpegd]: Fix parser error handling
Abort decoding when parser found corrupt stream

Change-Id: Ie828ed61b12cf6dc0817a8e96fddc9940e4f4efe
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 17:54:50 +08:00
Johnson Ding
0b506c18b9 [jpegd]: Do not parse Comment segment
Change-Id: Ie04056cbe255c772f4486d6ca80162c6618c1fa4
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 17:44:15 +08:00
Johnson Ding
1f76ce416d [jpegd]: handle extra JPEG header case
In case of some JPEG file with multiple stream header, continue to
search all markers even SOS is found.

Change-Id: Ic13c2d43f97a4b52ec5233db2de362d83ccb86a9
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 17:35:38 +08:00
Johnson Ding
7b680e6e6f [jpege]: Support writing EXIF and MPF data
EXIF and MPF data can be write by send user data via KEY_USER_DATAS.

Change-Id: Ib9b5a117433437c202bf354d59dc404c76a4db5f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-06-04 16:54:52 +08:00