Commit graph

522 commits

Author SHA1 Message Date
Yanjun Liao
52f005f2df fix[mpp_singleton]: Fix 64-bit mask overflow
Use 64-bit literals in bit operations to prevent overflow
when singleton module ID >= 32.

Change-Id: Ib08190bbcbb1a0b46559ea3c2ae57d801b5efadf
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-11-05 09:08:10 +08:00
Yanjun Liao
3d047de1d4 fix[mpp]: Fix c89 build error
Change-Id: I648e78e4b271e914225f848309290e749fdd5176
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2025-10-29 10:30:16 +08:00
Herman Chen
33f65bd809 fix[mpp_singleton]: Fix cluster sgln id conflict
1. Add MPP_SGLN_CLUSTER.
2. Add sgln init timing log.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id6d6a103f441cbf6a8acc9b00a0d54c788a939d8
2025-10-24 17:50:07 +08:00
Herman Chen
b40657a3c7 feat[kmpp_vdec]: Add kmpp_vdec module
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I9467fa122fa0c5f3d755714ea63e089a4d86eca9
2025-10-24 17:34:33 +08:00
Herman Chen
a0c6f81f7b feat[kmpp_venc]: Add kmpp_venc module
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I06f071055caa1c4bab2341258c69398d46671ed3
2025-10-24 09:04:26 +00:00
xiaoxu.chen
ef11356680 fix[osal]: Align MppMemPoolNode to 8-byte
Aligning MppMemPoolNode to 8-byte is aimed at avoiding alignment traps caused by compiler optimizations.

Log:
[   41.929204] Alignment trap: not handling instruction f44c6adf at [<a6f0aec4>]
[   41.929236] Unhandled fault: alignment exception (0x801) at 0xa6205cbc

Change-Id: Ia9867225eabfc0e8ab37754a7161814bb596e645
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-10-23 07:13:23 +00:00
Herman Chen
d1855e020d fix[cmake]: Fix libm / libmvec compile error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I431aa784db20494a4df89fae366ccd428dafa7d5
2025-10-22 02:19:06 +00:00
xiaoxu.chen
e45c5c2dbb fix[mpp]: Fix compilation warnings
Change-Id: Id26f40770cf48ff20edde91f33c8a05760eb0740
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-10-11 17:22:40 +08:00
Yandong Lin
d21fa529a7 fix[mpp_soc]: Add mpp_debug env reading when init
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I647ffc2df2c485d7cafb0a5b6f47a08dcbfa4601
2025-10-10 16:47:32 +08:00
Herman Chen
4db2167ff4 feat[kmpp_ioc]: Add kmpp_ioc module
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I766b0ec68f8ae572a44d96dd6ff059240ebfb698
2025-09-30 15:07:12 +08:00
Herman Chen
fb23f69ca7 chore[mpp_singleton]: Update name print
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I24c4ce23032a8b264837040425123e0027f90578
2025-09-03 12:03:49 +08:00
Herman Chen
aa15b9b5bd refactor[sys_cfg]: Refactor C++ sys_cfg to C
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I59f4e3b13ba5e49ae34bb1b4886f37bd3341ce56
2025-09-03 11:48:55 +08:00
Herman Chen
ca061993ef refactor[osal]: Refactor C++ osal file to C
1. Refactor osal cpp files to c.
2. Update osal license to Apache-2.0 OR MIT.
3. Remove windows support.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic5545d861676880f7a6247515404d585cd4fcef5
2025-09-02 17:49:14 +08:00
wangbin
9751e7ac96 fix[mpp_thread]: Fix thread name is not set
https://github.com/rockchip-linux/mpp/pull/887

Change-Id: I96937a2fb42cb40f60d432ead3c826b6d89bee23
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2025-08-12 02:30:40 +00:00
Herman Chen
1893dede1c refactor[rc_api]: Refactor C++ rc_api to C
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0130766b1f5817e4581454e72d478e112e6e836d
2025-07-23 18:01:09 +08:00
Yanjun Liao
69191e72d3 feat[kmpp]: Add KmppBuffer module
1. Add buf_grp, buf_grp_cfg, buffer, buf_cfg objdef.
2. The buf_grp_cfg is binded to buf_grp and the buf_cfg is binded to
buffer. The binding cfg obj is stored in private data.

Change-Id: I9243c03f7b9519536fdc2f24b62761dc04baac85
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2025-07-09 10:39:15 +08:00
Herman Chen
5497c458fe fix[kmpp_obj]: Fix grp_cfg and buf_cfg leak in kmpp_obj_test
1. Use mem pool to alloc KmppObjImpl
2. Add kmpp_obj_put_impl to release KmppObjImpl header only.
3. Add grp_cfg and buf_cfg release operation.
4. Use MPP_SINGLETON to init kmpp_venc_cfg.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I865d4d990d7e89598b2f17d85460b809f7f602df
2025-07-08 17:48:39 +08:00
Herman Chen
870c02cec3 feat[mpp_log]: Add long log (llog) function
The default android log and syslog have a truncated length of 1024.
Use long log function to print check line for a long buffer.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I43212e8c456daf132e7920e24726ac3110f1fd15
2025-06-20 09:50:06 +08:00
Johnson Ding
0a0111b398 fix[osal]: Fix timeout expire too soon issue
Using CLOCK_MONOTONIC instead of CLOCK_REALTIME to avoid date-2038
issue. Also timeout will expire sooner or later than intended if using
CLOCK_REALTIME when clock changed dramatically.

Platform: 32-bit program
Spec: all

Reported-by: #555412 at redmine

Reprodece:
1. setting system date after 2040-01-01
2. running 32-bit program calling mpp video encoder at non-block mode
    with 100ms timeout. eg: screenrecord at Android 11. This program
    will call mpp via vpu_api_legacy routine with a 100ms timeout.
3. timeout will expire sooner than 100ms.

Change-Id: I804146d6e33f5c30cbd3bdfdcf10b6dd56b0610c
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2025-06-17 11:47:02 +00:00
Johnson Ding
9c93a16e11 test[osal]: Add libc and OS compatibility checking
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
Change-Id: Ibce09f46a66fddc484b1331f33eb0d15d72cae7b
2025-06-17 17:34:23 +08:00
Herman Chen
5e67bcdf71 chore[kmpp]: Modify kmpp_objs init / deinit order
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia8fac55bc43f092a6b76bd9f5b7706f4d28bde1d
2025-06-17 11:54:39 +08:00
Herman Chen
e31839cc74 refactor[mpp_mem_pool]: Add exit leak pool print
1. Refactor caller parameter on pool functions.
2. Add name on pool init.
3. Add exit leak pool print.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I39a8a966db895340a9e01ddff3a7894f1ca4b825
2025-06-17 11:09:54 +08:00
Hongjin Li
ed3995dc32 refactor[osal]: Refactor C++ mpp_server to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I80ef1b56d588003d712b94d8db58540de36c9245
2025-06-13 16:21:27 +08:00
Hongjin Li
aa6ae2c5f6 refactor[osal]: Refactor more module from C++ to C
Refactor thread, list, queue and time module.

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I96c07e1549868085867502c8bb974ffd3875ea9d
2025-06-12 18:32:09 +08:00
Hongjin Li
0cd4943d07 refactor[mpp_trace]: Refactor C++ mpp_trace to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0946d23122b2c1061dc4c031c67074a1bb48de11
2025-06-12 11:49:25 +08:00
Hongjin Li
9c4c7f6e49 refactor[mpp_runtime]: Refactor C++ mpp_runtime to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0b68072abb1d4132b22a3817f4ab09dafecc7dee
2025-06-12 11:49:25 +08:00
Hongjin Li
4bfd3f3b0e refactor[mpp_soc]: Refactor C++ mpp_soc to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ib77fd56bf65d307a3b2e505b1c520eb147b06ef2
2025-06-12 11:49:25 +08:00
Hongjin Li
c204fe8c2e refactor[mpp_platform]: Refactor C++ mpp_platform to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I49211ed6c4069971accb37a9f26063de435d3551
2025-06-11 18:33:42 +08:00
Hongjin Li
92d81597bb refactor[mem_pool]: Refactor C++ mem_pool to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I53603de9b0000560d7b0835a216e9addc944554c
2025-06-11 18:33:42 +08:00
Hongjin Li
4692f8bd6b refactor[mpp_mem]: Refactor C++ mpp_mem to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I927346dfdb0edea486b8dda61f379f96059b01ba
2025-06-11 18:33:42 +08:00
xiaoxu.chen
1c867b3cac refactor[kmpp]: Replace venc_packet with KmppPacket
The kmpp.ko should update to after commit:

    commit 5502cf37894311092ca591904753ba429a6ab4ee
    Author: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
    Date:   Wed May 21 10:00:44 2025 +0800

        feat[kmpp_packet]: Add kmpp_packet interface

        Change-Id: I4a5bd37e6e34e084b2b6b4616bac770f58a2d15e
        Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>

Change-Id: Id77297068709422c1465093fa8104949a117a662
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
2025-06-09 12:12:52 +00:00
Hongjin Li
1705827021 refactor[osal/linux/os_log]: Use C constructor.
Change-Id: I178b570db0131965deecbcf536ab8f680a35c46f
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
2025-06-06 16:25:38 +08:00
Hongjin Li
dee9bced95 fix[mpp_singleton]: fix init order issue
Platform: General
Spec: all

Error case:
Constructors may be added after 65535(mpp_singleton_init)
ex: mpp_platform added after 65535 when mpp_soc is
    refactored to c

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: xiaoxu.chen <xiaoxu.chen@rock-chips.com>
Change-Id: If736904beb0cd64a3e4ae3b20fd72e1198646ac7
2025-06-06 16:25:38 +08:00
Herman Chen
8435799824 feat[mpp_log]: Add external callback support
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ice375b1c9522442f403cf6eb1d1d2306e64b9b30
2025-05-28 17:15:41 +08:00
Hongjin Li
095fdce624 feat[osal]: Add mpp_singleton module
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Idfff4d03e1c98e4ad1ddf1553133ba4b0194f7b8
2025-05-06 18:07:33 +08:00
Herman Chen
ecbbb721aa fix[allocator]: Fix misc buffer group flag issue
The default misc buffer group do not have the flag. We need to seperate
the default misc group with different flag.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I14941eedfe9c06ec978a12061ba33e12495aa038
2025-04-18 01:54:32 +00:00
Herman Chen
b01bd3346a fix[cmake]: Fix double object include issue
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I6cf264917d6091154408dfc327c45d4f66ed8c18
2025-04-04 03:54:28 +00:00
Yandong Lin
4ed4105a3c fix[os_log]: Modify default log option for linux
LOG_PERROR: Directs output to stderr stream.
LOG_CONS: Fallback to /dev/console only when syslogd is unavailable.

The syslogd maybe unavailable in linux os.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iae95f7df9e6ed3f7e8ce15accce6fae5a65f2fef
2025-03-05 10:05:43 +00:00
Yandong Lin
c29aedf224 fix[mpp_soc]: Fix cap_fbc for rv1126b
rv1126b only support raster output.

Change-Id: I05fcf331fd872602a26912cf21781512df348353
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-02-21 01:24:47 +00:00
Yanjun Liao
3b118f75cf feat[mpp_soc]: Support rv1126b soc
Change-Id: Ifedb67d4a4f7f2c4107f94dc53e14c2b446aa76a
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-02-18 09:02:16 +00:00
Yandong Lin
2f1eac63f9 feat[kmpp]: Add kmpp module
Change-Id: Ia9c414edf625885fd551ad14f72dd1f7bc34172d
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2025-01-16 15:29:16 +08:00
Hongjin Li
80d7377a0b fix[fbc]: Fix RK3588 av1 FBC usage issue
Platform: RK3588

Error case:
1. After setting FBC, the current platform was not checked for FBC support.
2. The RK3588 AV1 supports FBC.

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: I0696c4469d514291547ed21a80089812c7e6b585
2025-01-10 06:51:18 +00:00
Herman Chen
c7cf58b5c7 fix[mpp_mem_pool]: Record pool buffer allocator caller
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I21650f2af92e73f965a73f1748082556ae0ba516
2024-12-12 14:36:21 +08:00
Ben Hoff
18c0350721 fix[drm]: Call drop master by default
drop master by default to avoid becoming the drm master

Signed-off-by: http://benhoff.net/
Change-Id: Idf850f4ae7c5a0177e058bc2f1d2acc2df70408d
2024-12-10 09:47:45 +08:00
Yandong Lin
05b809393c fix[h265d_vdpu383]: fix dec err when ps_update_flag=0
The ps_update_flag=0 case is not handled properly here,
and follow commit exposes this problem.
233940: fix[h265d]: fix infochange loss when two sps continuous

Change-Id: I54dcea6c31483257b4b771a8bd4994cc75ed41f5
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-09-11 15:40:04 +08:00
Herman Chen
295aa22639 chore[mpp_mem]: Add mpp_realloc_size
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I896b4132e0fded153ee4d932b9c011bf3ba41c16
2024-08-29 17:53:01 +08:00
Herman Chen
8108bf58ea fix[osal]: Fix mpp_mem single instance issue
When another C++ static global object init before the mpp_mem service
the MppService service will be inited twice. Then on object destroy will
deinit service twice and cause mutex double delete issue.

On init

E mpp_mem : MppMemService start 0 0x7c536619e8
I mpp_mem : MppMemService mpp_mem_debug enabled 3 max node 1024
E mpp_mem : MppMemService start 1 0x5e8d724230
I mpp_mem : MppMemService mpp_mem_debug enabled 3 max node 1024

On destory

05-17 09:58:04.743  2576  2576 E mpp_mem : ~MppMemService enter 0 0x5e8d724230
05-17 09:58:04.743  2576  2576 E mpp_mem : ~MppMemService enter 1 0x7c536619e8
05-17 09:58:04.743  2576  2576 E mpp_mem : mpp_osal_free

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'rockchip/rk3576_t/rk3576_t:13/TQ3C.230805.001.B2/eng.kenjc.20240510.161710:userdebug/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-05-17 09:58:04.800905936+0000
Process uptime: 1s
Cmdline: mpp_trie_test
pid: 2576, tid: 2576, name: mpp_trie_test  >>> mpp_trie_test <<<
uid: 0
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x5e8d724230)'
    x0  0000000000000000  x1  0000000000000a10  x2  0000000000000006  x3  0000007fd26f05d0
    x4  0000000000008080  x5  0000000000008080  x6  0000000000008080  x7  8080000000000000
    x8  00000000000000f0  x9  0000007c50d22a00  x10 0000000000000001  x11 0000007c50d60de4
    x12 0101010101010101  x13 000000007fffffff  x14 000000000001ffea  x15 0000000000000078
    x16 0000007c50dc5d58  x17 0000007c50da2c70  x18 0000007c55b38000  x19 0000000000000a10
    x20 0000000000000a10  x21 00000000ffffffff  x22 0000000000001000  x23 0000005e8d724230
    x24 0000007c5489e010  x25 0000005e8d70c060  x26 0000000000000002  x27 0000007c513226e8
    x28 0000000000000000  x29 0000007fd26f0650
    lr  0000007c50d52968  sp  0000007fd26f05b0  pc  0000007c50d52994  pst 0000000000000000
backtrace:
      #00 pc 0000000000051994  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #01 pc 000000000005363c  /apex/com.android.runtime/lib64/bionic/libc.so (__fortify_fatal(char const*, ...)+124) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #02 pc 00000000000b74cc  /apex/com.android.runtime/lib64/bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+60) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #03 pc 00000000000b735c  /apex/com.android.runtime/lib64/bionic/libc.so (pthread_mutex_lock+240) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #04 pc 0000000000048290  /system/bin/mpp_trie_test (mpp_osal_free+108) (BuildId: 55dca41ecc701b3ad16f0ef02270a45ce40533ff)
      #05 pc 0000000000041080  /system/bin/mpp_trie_test (MppMemPoolService::~MppMemPoolService()+32) (BuildId: 55dca41ecc701b3ad16f0ef02270a45ce40533ff)
      #06 pc 00000000000b9ca4  /apex/com.android.runtime/lib64/bionic/libc.so (__cxa_finalize+280) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #07 pc 00000000000ac944  /apex/com.android.runtime/lib64/bionic/libc.so (exit+24) (BuildId: 4e07915368c859b1910c68c84a8de75f)
      #08 pc 000000000004a1f8  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100) (BuildId: 4e07915368c859b1910c68c84a8de75f)

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I81ead0f796ba6e26b520a87ae69cc8f7f6e816f4
2024-08-16 09:53:55 +08:00
Yandong Lin
b739b13594 fix[mpp_common]: fix compile err on F_DUPFD_CLOEXEC not defined
Change-Id: I5e258a13be331af7a4d11d6ab2e4a8afb12418dd
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-07-31 18:18:32 +08:00
Chandler Chen
abf0c5f574 fix[osal]: fix 128 odd plus 64 bytes alignment
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ibd5ebf31b17b63e9604b271b8dd23a48590d0c46
2024-07-06 16:29:49 +08:00
Herman Chen
9c92ab9e20 fix[drm]: Fix permission check issue on GKI kernel
The GKI kernel does not allow non-render thread to open /dev/dri/card0
and alloc drm buffer from it. So we need to use /dev/dri/renderD128
instead.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0fad306c6eeadd8da5507883f4f4915c11946761
2024-06-07 14:48:51 +08:00