Commit Graph

1465 Commits

Author SHA1 Message Date
Herman Chen
68e49f835c [legacy]: Get vpu_api_debug in early stage
When open vpu_api context we need to get it earlier.

Change-Id: I10ee57df5d746dfe5b655fd2299a782e54e6dd3f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-08 14:38:21 +08:00
Herman Chen
195ac89557 [legacy]: Add vendor lib path for Android 8.0
On Android 8.0 librk_vpuapi.so is under /vendor/lib. We need to add it.
And for debugging case there may be multiple library in system so we had
better to print librk_vpuapi.so path.

Change-Id: Ic85c594d41da723cf8528d06e93c4643de048a99
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-03 17:57:43 +08:00
Herman Chen
77f33cbcb4 [test]: Add delay calculation on performance test
Change-Id: Idc058e900c46ebce406ff0739d6e73e4e78b3cd8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-03 15:25:18 +08:00
Herman Chen
3b4c3eaf2f [mpp]: Add temporally patch for blocking issue
There is a bug of stucking on decoder parser thread:
When decoder parser thread is block by info change and enter waiting.
There is no way to wake up parser thread to continue decoding.
The put_packet only signal sem on packets. May be it better to use
sem on info change too.

Change-Id: I3a3c45629a55d438ae9fee1968db27a94bafb20d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-04-02 10:11:49 +08:00
Ding Wei
19e2b0f748 [h265d]: fixed bug: set register using align function
tips: 16 align input buffer commit case.
when calculate stride for register, used picture height.
when height is 1080 while ver_stride align 16, then is not matching.

Change-Id: I47dae884ed0eaf7328314daa6a6cb5940359ee91
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-04-02 10:11:27 +08:00
Herman Chen
ca57f9d31e [legacy]: Use rkvdec default on RK3399
RK3399 has powerfull rkvdec. There is no need to save power on
multi-instance decoding case.

Change-Id: I454594c68a1d620451e36ee4cf46f81404857de3
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-31 20:28:09 +08:00
Herman Chen
0ec78dec05 [hal]: Enable mpp_device_debug
Read mpp_device_debug on opening device.

Change-Id: I8aa17eb93eb251c2dda81a051d809d872ba1948f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-30 15:30:49 +08:00
Herman Chen
de39570d75 [hal]: Add uyvy422 support to jpeg encoder
Add vepu1 and vepu2 jpeg encoder support uyvy422 format.
Remove format limit on hal control operation.

Change-Id: I1bceb45fd3d285941878197256b284875094b44e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-30 10:36:09 +08:00
Herman Chen
87da5bef82 [test]: Add yuyv422 and uyvy422 test case
Add yuyv422 and uyvy422 support to encoder test case: mpi_enc_test.
Note: on these two case the hor_stride should be twice of width.
With this modification test case can output correct stream now.

Change-Id: I463d3c158369d831e4558199c917023773300ac1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-29 12:01:55 +08:00
Herman Chen
5d6b20385e [legacy]: Fix vpu_api_test memory leak issue
Data in DecoderOut_t is malloc from vpu_api_legacy. And Android OMX
component is following this rule for historical reason. We have to
change test case to support it.

Change-Id: I202525eecc461bd9507cfa2c376de11e2fc6fc9b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-27 16:17:59 +08:00
sliver.chen
02e340d445 [doc]: add link to mpp application base on linux and android.
Include linux display demo and android mediacodec interface demo.

Change-Id: Ib1f6eee521b911c84fa8628e907da903fc0a9e2b
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-26 15:59:31 +08:00
sliver.chen
a1d9c05e7f [legacy]: fix memory access segmentfault
expand legacy buffer and align stride when copy buffer.

Change-Id: I68ab7935ab69c37161b586efc0f35f804b29b4f4
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-26 15:58:27 +08:00
sliver.chen
0a73f9f75a [test]: bench mark unit test
Add multi-instance test case with multi-thread decoding.
This test case is mainly for platform performance evaluation.

Change-Id: I79d86a01778c2e7af00e13d1d3c3d2937bcbbcce
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 15:49:40 +08:00
Herman Chen
e4d6d81287 [mpp_mem]: Add error log for mpp mem debug
When mpp_mem debug is enabled there is limit for recording mpp_mem
usage. But there is NO obvious log when this limit is reached.

This case will easily happen on multi-instance decoding in one process.
We add obvious log when this case happen.

Change-Id: Ic9160766d4499d442c25fdefae00231d15d71359
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 15:41:29 +08:00
Herman Chen
a00b980a71 [mpp_mem]: Fix print error on mpp_mem leak check
Change-Id: I97d7c34034084aed4dfda064b113386d6dede8a8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-26 10:22:06 +08:00
Xingwen Fang
aa277519d3 [osal]: Fix mpp queue deadlock on exit
On mp4 case, we back-up extra data into mPackets at the
end of reset, then MppQueue#mFlushFlag will be reset,
and may be blocked on MppQueue#pull.

Change-Id: I99864ac4b3fbc053107bb35dd47d2f21fb3b6a73
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2018-03-26 08:43:54 +08:00
Herman Chen
25271e9ad0 [test]: Add mpi multi-thread decoder
Add new test case for multi-thread input / output.
This demo is for performance test and multi-thread decoding.

Change-Id: Iec979ba214dc189d26d2733e90e00ebd7d204f4a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 18:42:48 +08:00
Herman Chen
af816d320c [base]: Fill buf_size to mpp_frame when setup slot
There is difficulty for external user to get proper buffer size for
decoding. So we could fill the buf_size field at output info change
mpp_frame. Then user can get buf_size and create buffer group correctly.

Change-Id: Ibf33a81fed085615205035d2b5129029a5096d9a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 17:35:39 +08:00
Xingwen Fang
702ccb4a9d [osal]: Reject multiple call mpp queue flush
Change-Id: I31622b38c93e86113ed9a4189d82acadc140e834
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2018-03-23 17:34:53 +08:00
Herman Chen
ed4151e245 [osal]: Change time function
Change time function from gettimeofday to clock_gettime.
Output of mpp_time() is still in us.

Change-Id: I7f961bb7bb4007e8e42ae5358bd7f568edf6c3d0
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-23 09:20:56 +08:00
Chengmc
e648d65af8 [allocator] lock ion heap detection operation
When in multi-codecs cases, the check_sysfs_iommu function reenters
with high probability, so some codec instances may fail to obtain
the correct memory type.

The root cause is scandir call in find_dir_in_path function. For
efficiency consideration it is better to lock ion_heap_id value.

Change-Id: I60a0eb27c3ac35bc022aa00b2cffc4e26e54bf24
Signed-off-by: Chengmc <Martin.Cheng@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 17:00:49 +08:00
Herman Chen
3bca32d1e0 [inc]: Add eos flag clear function to mpp_packet
For it is inconvenient to clear the eos bit in mpp_packet flag we add a
new function to clear the eos flag only.

Change-Id: I67fad6e416bca68b6b7cee8e816fca386759f35a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 11:52:01 +08:00
sliver.chen
7b46386d38 [h264d]: fix a scenes of null nalu
in some case may meet scenes of null nalu pkt,
just like 00 00 00 01 00 00 01,parser should jump over it.
if we don't jump it,p->nalu_len will be zero and p->nalu_len - 1
get 0xffffffff,access the memory addr will leads to segmentfault.

Change-Id: Ie0fae2f38bd76287c9ef924506f0801d571fb1f5
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-20 14:18:43 +08:00
sliver.chen
eb28892adc [jpegd]: add information if input img format may be png
in some case,user may think of png bitstream as jpeg.
and file suffixes can also easily lead to misunderstandings,
so add warning to prevention is necessary.

Change-Id: I2ed319033706b2ef48c8b34c6cdc77098137827c
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-19 17:20:38 +08:00
sliver.chen
e11e7e7e76 [cmake]: fix cmake error about need twice make
modify cmake script to allow multiple define about ndk variables.
It is a bug caused by low version ndk.

Change-Id: I92584f050b0cfd5397b7cf85a8963dbe492baa69
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-03-07 19:24:09 +08:00
sliver.chen
bf702db051 [test]: add argb fmt support for unit test
modify read yuv image method and buffer size.

Change-Id: I5a5dd63fd98831a744801d5504f4ac6d2e0fcebc
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-02-23 11:38:49 +08:00
sliver.chen
552e2db07f [cmake]: linux aarch should define HAVE_DRM ON by default.
Just like in the android arm/aarch directory.

Change-Id: I27fd97835c92e23e0422cfdcd381c540b9af8fd9
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-02-08 09:20:09 +08:00
Herman Chen
bae30008a7 [cmake]: Simplify cmake script
Change-Id: If5280bdb8d58d995d59f86c4cc5d51d4d5f74fe6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-02-02 11:22:11 +08:00
Herman Chen
c8a41a69a9 [h265d]: Avoid uninitialised value in Qmatrix
In hal_h265d_output_scalinglist_packet first call the uninitialised
value in array may cause unexpected memcmp return value.

Change-Id: I32535fad765f548db7649dd4fefdc71d907efcd4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-29 11:50:03 +08:00
Herman Chen
82bc016bbb [oasl]: Add debug function to mpp_mem
1. Add memory node record.
2. Add runtime log with memory count and total size.
3. Add extra room for overflow detection.
4. Add memory poison after free to detect write after free.

Change-Id: I4f0fe7295f18a746c3b4c135681127a18337585e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-29 11:47:31 +08:00
sayon.chen
c8baa3490a [h265d]: remove unused malloc code
remove rpl buf malloc due to no used in h265parser

Change-Id: I8a9a4348b0ae386afe60614e17ab3a108bfb55b5
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
2018-01-25 16:25:57 +08:00
Ding Wei
0a87e905a2 [mpp_platform]: add px30 && rk3326 support
Change-Id: If4f69842c9468faee3d6f598e2e2453cb9d8511c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-24 14:14:18 +08:00
Ding Wei
4b2c91ed78 [utils]: fix bug: has error when calc last 4 byte
Change-Id: I240518ff7fcf429f42e50f87b56bf78738f2bb6d
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-24 09:31:18 +08:00
sliver.chen
1c7586932c [test]: remove roi control cfg except avc type
ROI cmd just avaiable in rkvenc,but also we need to 
ignore it in vpu. or will leads to warning about
unknow vpu cmd.

Change-Id: I9a630171df5698ae5d39bb2e5c38f06b2f988893
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-23 08:36:25 +08:00
sliver.chen
381a9d3e3b [jpege]: add vpu1 and vpu2 jpeg encode rgb fmt support
Modify some register params to support 32-bit rgb fmt,including
vepu1 and vepu2.

Change-Id: I265ad77eb02f95cc51de3bc51a340b56cdebb702
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-23 08:31:35 +08:00
Ding Wei
53a02bf26f [checksum]: use sum and xor for data/frame check
Change-Id: Ie3bd2f2819d8387a5b2486cf0a096d271220d819
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-19 15:01:38 +08:00
Herman Chen
1a795b05aa [mpp_dec]: Fix mpp_frame memory leak on reset
When push display mpp_frame will generate a new copy. If it found a
reset flag the whole mpp_frame should be free rather than only
mpp_buffer in the mpp_frame.

Change-Id: I4b784e668167ef9be06a9dd1a02e860a7654a021
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-18 09:20:40 +08:00
Xingwen Fang
11876f0465 [vpu]: compatible for vpu-service node
Change-Id: Ia32c6c075e928dd932726885d76146e7f0a3b768
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
2018-01-17 15:54:08 +08:00
Herman Chen
c7cdadb5a9 [build]: Add libc.so for Android arm64 compiling
Change-Id: I2ba9eec174d87e9d02dff4731287397ab593115e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-17 15:47:29 +08:00
sliver.chen
9dd4ef5061 [h264]: ignore roi set cmd to avoid warning
ROI cmd just avaiable in rkvenc,but also we need to ignore it in vpu or
will leads to warning about unknow vpu cmd.

Change-Id: I938aeb75adbc68f7ef04f0c78f2c7df84665111c
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-16 11:21:45 +08:00
timkingh.huang
1acefd6207 [h264e]: add configuration of ROI
Change-Id: Ieba60baedc8fabd248112636f5ea59a107775403
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-15 18:34:28 +08:00
sliver.chen
bb5552b7d9 [h264]: add ignore MPP_FMT
It is obvious.

Change-Id: I5a551d8d500f7e4a877c8f68c381df04c807e1a2
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-15 18:29:04 +08:00
timkingh.huang
24c80231fa [h264e]: fix OSD bug
related to https://10.10.10.29/#/c/39038/

Change-Id: I711f26df5647b2ea309599a19036aeaa615e2187
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-15 18:27:58 +08:00
sliver.chen
73b7fc36fd [cmake]: fix cmake syntax error about macro HAVE_DRM
It is obvious,just a clerical error.

Change-Id: Iee22c422ff1786d513afd4f8b3d7fee502a9c89b
Signed-off-by: sliver.chen <sliver.chen@rock-chips.com>
2018-01-15 18:19:15 +08:00
timkingh.huang
88a884fc1b [vpu_api]: reset variant before usage
Change-Id: I4c3048a6bb74fc8611355249ed5cce440829ca6d
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2018-01-05 16:43:01 +08:00
Randy Li
a670ee57d2 [mpp]: prevent assigning the listener for a nil group
The external buffer group has been assigned to
nil, so doesn't assign a listener for it.

Change-Id: I6d4a19ffba88f271114c18f10523b5cc6a60df66
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-01-05 14:09:22 +08:00
Ding Wei
9dec5cd14e [mpp_dec]: add flag about display queue whether full
tips: when decode too fast then display queue is full,
that should wait until frame displayed.

Change-Id: Ic8ec18368fdb956cad92b0760a3d4637e46f55bf
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-05 08:50:59 +08:00
Ding Wei
ecd1acb2b6 [h265d]: split mode: deal with eos_packet has data
tips: when last packet is not empty and has data should decode
it and then flush dpb.

Change-Id: Ia677a3bc8163405feb50ce426d954a1477dc3146
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2018-01-05 08:50:08 +08:00
Herman Chen
7b7b509847 [runtime]: Add more runtime detection
As we found that simple ion / drm device detectioin can not cover all the
case. For example on some 3368 platform kernel provide both ion and drm
device. We have better to use allocator chosen in dts.

But later kernel patch from Randy will bring unified dma-fd translation in
kernel then this detection will be removed.

Change-Id: I2746142d1c3d0f36791bacaadb231dc2001a5aa7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-03 16:48:56 +08:00
Herman Chen
4231398479 [mpp_buffer]: Add more log operation
Add log record for mpp_buffer_group_reset and mpp_buffer discard.
Add log when normal group became orphan group.

Change-Id: I08127efae9f9587693c012816aa4e48de50a61c4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-03 09:04:23 +08:00