For kernel 4.4 and before, if VPU only has decoder, register size is
101. Thus extra size append at offset of 164*4 will be ignored by
kernel.
Change-Id: Idf4524099615b8ffd46766f55c9c0ea481f7cb76
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
support hack for err ref check for decoder
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib61336b50dde626d85f9f6bb25950ea70149ea49
Add MPP_FLAGS_REG_OFFSET_ALONE flag to mpp_service_cmd_poll to avoid the
flag be cleared in kernel.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I27ef320ec472e871eace77c9238378abab3f2b34
https://redmine.rock-chips.com/issues/379038
When the reg_offset ioctl is not set the first time decoding will get
error on translate the pps buffer fd in kernel.
So we must set the MPP_FLAGS_REG_OFFSET_ALONE on each message.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I67f8413047adc77ca3addfe8dbed28ab1b0bcea8
NOTE: realloc may change the buffer base. This will invalid the pointer
which point to the old buffer base.
This issue will make 4 tile H.265 encoding with multi osd generate
error stream.
Change-Id: I764ee9b2097687ae9d5f2bcc8d2ff5987a636844
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
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>
1. Add SET_SESSION_FD cmd.
2. Support new delimit interface to send multi request in one ioctl.
Change-Id: I07980cc9c70b5e31585254d1ffde7bc56a3007e2
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
rk3588 encoder needs buffer end address so zero size should be allowed.
Change-Id: Ie350f62c77d99f91b2ca1f02e7b4ff7afe0b0dd8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
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>
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>
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>
Note:
1. In kernel 4.4 and previous version, the array may cross the boundary
and cover an unknown memory address
2. The array is out of bounds caused by the following submission:
commit 5be47f31f0
Author: Yandong Lin <yandong.lin@rock-chips.com>
Date: Wed Feb 24 19:44:32 2021 +0800
[hal_vdpu]: Support fd and offset to be set separately
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie3fc4324dde497732424cf3023ce81997401fd96
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>
Tips: User should close fd before changing the client_type. Otherwise
the kernel will leak one info structure.
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I2f99e4840d1e9a3805306be50e4afa3653f43c0c
tips:
according to rcb_size descending, and sent rcb_info to the kernel.
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I85e951d9cc1c15962e702ab9781df35e6739bb6a
For vepu2, kernel 4.4 and previous version, '/dev/vepu' should be used
rather than '/dev/vpu_service'.
Change-Id: I2efd4a219bbd7dd3cebf226c8ebcede9bcff9823
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. Add soc definition structure to replace old one.
2. Use mpp_soc.h to replace soc detection in mpp_platform.h.
3. Add vcodec_type to each device definition.
4. Add check on soc info init.
Change-Id: Iecc44bd79e6fd09c58afbc1b5c526ecf31acc663
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This helper function is for address register setup its offset.
When offset is less than 4M (20bit) the offset and buffer fd (10bit) can
be filled in 32bit word.
When offset is larger than 4M the full offset should be sent by ioctl
MPP_DEV_REG_OFFSET.
Change-Id: I5f59f3c941e41cf85fa2ab8895d2a177f4412e64
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
New kernel use /proc/mpp_service/supports-cmd
Change-Id: I7c1d258c3652ecf5346c2e19383b90975a30a629
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Move codec_type detection code to vcodec_service.
Only vcodec_service needs to detect vcodec_type. Mpp_service will
report this flag from kernel.
2. Remove kernel device detection code when soc type not detected.
3. Add mpp_soc.h for soc definition.
Change-Id: Ic83897bddbcf0fceb0c5d19a05491f75231092c1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>