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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
Abort decoding when parser found corrupt stream
Change-Id: Ie828ed61b12cf6dc0817a8e96fddc9940e4f4efe
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
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>
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>
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>
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>
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>
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>
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>
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>