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>
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>
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>
1. Change mpp_device into a new layer for kernel drvier.
2. Separate mpp_service driver and vcodec_service driver.
3. Add mpp_service.c for /dev/mpp_service driver support.
4. Add global mpp_service info query interface.
5. Remove unused function in mpp_device.c
Change-Id: I3f53bba3aef525ad3b1f450bb55830d1eeaf29a6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move vcodec_service and mpp_service kernel ioctl interface definition
into different headers.
Change-Id: I1aa77d1073e7c51b48d18cf8d16fd76644d23d38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This function is mainly for frame rate statistic.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1ab790bd655dc0945ad958d104ff178f4ffabdbe
The MppClock is used to record and sum the time only.
The MppTimer will have new implement.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I6cace6968d50db611e7493b69b14b46853070d78
Include <stddef.h> and add container_of macro.
Change-Id: Ie439b7683e026be9336e618c605b3b934e4fde38
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move kernel ioctl api version detection to library loading stage.
Change-Id: If8ee750e1eaefb99924fd622d03270ef5032d1be
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add a new ioctl mode for kernel-4.19 or later.
Tips:
1. There will be only one device /dev/mpp_service in kernel.
User should use client type to distinguish different device.
2. Each codec use the same function as before.
3. Ioctl magic changes from VPU_IOC to MPP_IOC.
4. Update structure for ioctl argument.
Original structure:
data_ptr | size
In this mode has many sortcommings:
a) Need many ioctl cmd for different requirements.
b) Data_ptr not to differ library for 32 or 64 system.
c) Contain only one info ioctl once.
New data structure:
cmd_type | flags | size | offset | data_ptr
a) Cmd_type works like previous ioctl cmd.
b) Flags is extend to mark current data for any purpose.
c) Size is the same as before.
d) Data_ptr use 32 bits build in 32 system while 64 bits in 64 system.
kernel-4.19 related commit:
ib94ac0df876dfcc786b25ed3de6a68d861d2ef1e
cda9d27c62017309519bcbf8fe91057dfdc21076
Change-Id: I13d54a2e4823b7378265f100540916a22f62b9d4
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Add fifo access function to mpp_list class.
NOTE: The interface is different and node contain RK_S32 size data
before real data.
Change-Id: I8875312a7a6247b71be7df71044d2b779c228b0a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. rk_mpi_cmd.h will contain cmd value only.
2. rk_venc_cmd.h will contain all the encoder command structure.
3. Move MppCtxType and MppCodingType to rk_type.h for better include
dependency.
4. Add MppEncRefCfg to MppEncCfgSet.
5. Remove rk_mpi.h dependency inside mpp.
Change-Id: I6b972738100fb60c0a6a9b7cfe0a012abf4205b7
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup,
MppTask and MppMeta to rk_type.h.
Later development need to bring in cross reference between these
objects. So we choose to move these declaration together.
Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
commit a base version of vp8 encoder,include vpu1 and vpu2.
encode input raw picture to ivf stream.
Change-Id: I9ac697edf2249a4ca7464fdbfb5fd22a63fd3c34
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
1. User often use multi-instance decoder. The dump file name should has
some way to avoid overlap file operation.
Also an extra stream length config file is added for decoder. For
decoder issue reproducing should stay the same with the real user input
stream seperation.
2. Add mpp operation record file for issue reproduction.
3. ops format is similiar to Android time log.
Change-Id: I4b3702fcb4ae1601579762a6d1d7cadc10861759
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tips: in mpeg4,the divisor named time_pp is likely to be 0.
Change-Id: If9c055cb03139e819fe901009024e3ad4bbe79a5
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Set get environment string parameter to const char to avoid modification.
Change-Id: Ib5308407fcac2fa58b194fb8df33380efc1487f9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
One thread May have multiple lock/wait/signal source:
Input : signal source from input.
Output : signal source from output.
Control: signal source from async control operation.
Then the main working loop may stop on these lock/wait/signal points.
Change-Id: Ia6270b865cfb7087567fc21f07feb9248b929d7a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>