Commit Graph

473 Commits

Author SHA1 Message Date
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
Johnson Ding
53abf03bf2 fix[hal_jpeg_vdpu1]: fix dec failed on RK3036 problem
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>
2024-06-06 18:13:00 +08:00
Johnson Ding
45f2fcbcf0 fix[osal]: rv1109/rv1126 vcodec_type mismatch problem
RV1126/RV1109 JPEG decoder has no PP. This will be conflict with
vcodec_type queried from kernel. Also VPU_CLIENT_VEPU2_JPEG is defined
and used only for multi-core JPEG encoder at kernel. So the following
changes is made to fix this problem:

1. This reverts commit 9b860cd250.
2. Define a new MppDecHwCap to distinguish normal VPU with only JPEG
   supported from multi-core JPEG encoder.
3. Correct vcodec_type queried from kernel when there is no PP for
   VDPU2.

Change-Id: I58a1abe708721f725a9cf487e8f870dd5820844f
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-06-06 18:07:06 +08:00
Yandong Lin
678db389ee chore[mpp_service]: fix typo err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ifa31c12ce535fd7a74f7a04bee3f9401370182ac
2024-06-04 09:12:45 +08:00
Johnson Ding
ccf8f46e78 refactor[dec]: get deocder capability via common routine
Change-Id: I9700a2418653a6d5a9a00b4c4c13f33022d2159b
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-05-10 15:57:47 +08:00
leo
4cc3fb25f7 fix[allocator]: fix on invalid DMA heap allocator
fallback to DRM/ION buffer when DMA heap allocator is invalid

Signed-off-by: leo <8252892+leokvw@users.noreply.github.com>
Change-Id: Ib2cd5669e6c9b41ceed7f4dd87f8fc33de88aa1c
2024-04-26 15:05:38 +08:00
Chandler Chen
2c2c3c4d53 fix[mpp_common]: fix 128 odd plus 64 alignment
former commit:https://10.10.10.29/c/rk/mpp/+/213571

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: If09095891c1dfaa0663c01776ca4cb046ed4b24a
2024-04-24 09:59:50 +08:00
Chandler Chen
8759039d5f feat[vdpu383]: align hor stride to 128 odds + 64 byte
for better performance

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I312c6b22f0c189b0674b0a667c20f68ac83315d6
2024-04-01 16:08:32 +08:00
Herman Chen
8d27cb798e feat[mpp_dev]: Add fd attach/detach operation
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I4ef09ee8d866eccbbaf3f5668ceefe81e3dc26c0
2024-03-29 10:02:00 +08:00
Yanjun Liao
423ebb1da1 fix[ext_dma]: fix mmap permission error
Change-Id: Ic7ae7c8de978752f8437f2d0b700014ea6817c56
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
2024-03-18 18:05:13 +08:00
Yandong Lin
467d6088eb fix[mpp_service]: fix rcb info env config
Change-Id: I9cd8749f50d4ffb26c87229f079c0228fce770f8
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
2024-02-28 16:52:29 +08:00
xueman.ruan
677b2a877e feat[vdpp]: Add vdpp module and vdpp_test
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I8bd74ad9b4404864ea3d88c7f2e57eecc4c0e35d
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2024-02-27 18:00:54 +08:00
Yanjun Liao
3cbb906673 feat[mpp_soc]: support rk3576 soc
Change-Id: I49bd3ccbc643b3c95db5ba3ca692f365c9425440
Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2024-02-20 09:45:25 +08:00
Yandong Lin
0e03d3bc70 fix[mpp_dmabuf]: fix align cache line size calculate err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide7daa58b12b22dc115acbbb7a9b8e305a167d57
2024-01-12 10:37:24 +08:00
Herman Chen
c06d3b4a71 fix[dmabuf]: Disable dmabuf partial sync function
For kernel dmabuf driver has bug on partial sync function we deside to
disable partial sync to reduce user's error.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2c69c407eb5b0056ad0377699fef6ef31e1d79cd
2024-01-11 16:17:44 +08:00
Herman Chen
8db63d761a fix[common]: Add mpp_dup function
mpp_dup function use fnctl F_DUPFD_CLOEXEC for fd dup with CLOEXEC flag.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Idd82eb935b06d2885685aeb696b95e910981539d
2024-01-10 18:15:45 +08:00
Yandong Lin
35a99b5d50 fix[dmabuf]: align offset/len to cache line for partial sync
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib6b0f6714bc4d98daa83f02d17c7659c00df570a
2023-12-27 14:56:46 +08:00
Herman Chen
d9fb399576 fix[dma-buf]: Add dma-buf.h for old ndk compiling
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id1188a945aa56af165c5957b88aa1a7453f5799b
2023-12-06 14:44:23 +08:00
Herman Chen
318bfc1b78 fix[cmake]: Remove HAVE_DRM option
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I6ce230a7e85472acca5feafc9ad84effb222f57a
2023-11-30 09:22:44 +08:00
Herman Chen
6ce3007994 refactor[allocator]: Refactor allocator flow
1. Allocator api is determined by buffer type.
2. Allocator ctx is determined by both buffer type and buffer flags.
3. All allocator dma_heap / drm / ion / ext_dma should support different
buffer flags.
4. The buffer flag supports cacheable / 32-bit / contig options.
5. Add flags update flow on allocator create process.
6. Add mpp_dmabuf_has_partial_ops to disable dmabuf partial ops when the
kernel driver has bug.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If36a05c6704112cad3ab46861023597ff02bf14c
2023-11-29 09:54:36 +08:00
Yandong Lin
e155a7eac7 fix[dma_heap]: add dma heap uncached node checking
Currently only support uncached dma heap node access,
because of the cache processing is not yet complete.

So if there are no uncached node in /dev/dma_heap/ path,
mpp will not use dma_heap allocator.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ic33fca9c445c7668a86454f01f9d7577668de32b
2023-11-29 09:54:36 +08:00
Herman Chen
dbdccc6818 fix[mpp_mem]: Fix MEM_ALIGNED macro error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I08d403f7e1d67b7d80655278255f31d4c0c6784e
2023-11-27 14:59:04 +08:00
Herman Chen
d4913c1b88 chore[mpp_dmabuf]: Add dmabuf ioctl unit test
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ice181f6d8cf312d68c79d6e6a33cddcbf65ef5f6
2023-11-16 16:33:40 +08:00
xueman.ruan
e15972e9af feat[mpp_dmabuf]: Add dmabuf sync operation
sync_begin - cache invalidate, should be called before cpu read
sync_end   - cache flush, should be called after cpu write

MppBuffer sync flow:
1. hw access
2. sync_begin
3. cpu access (read / write)
4. sync_end
5. hw access

NOTE: readonly option is faster for read only buffer.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I253a6139e9bb30808c07075d64f17b5cfad8519a
2023-11-16 14:27:02 +08:00
Herman Chen
12aefae5b1 feat[mpp_lock]: Add spinlock timing statistic
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id63e28605853f07c3e557f01d8edffd67d7d1541
2023-10-13 11:06:53 +08:00
Herman Chen
fa9998fd37 feat[mpp_thread]: Add simple thread
The simple thread has the thread group feature.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ife367ecc3b5a46d2b50037e8d21cc8ce665a4c02
2023-10-13 10:49:50 +08:00
Chen Jinsen
4b45330c50 [mpp_soc]: Add rk3567 soc support
Change-Id: I6d02f021544a9ba4d7ff96e5aad47f5fe1f87fb3
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
2023-10-13 09:30:04 +08:00
Hery Xu
f377c2ae70 fix[vp9d]: Fix AFBC to non-FBC mode switch issue
When vp9 decoder switches from FBC mode to non-FBC mode it requires
resetting the alignment function in buf_slot.

Change-Id: I0c3e35e2c573d003192a2a82d9bdd9c30f42088c
Signed-off-by: Hery Xu <hery.xu@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2023-10-10 09:41:23 +08:00
Xinhuang Li
c14ef0f774 fix[allocator]: dma_heap allocator has the highest priority
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Change-Id: Ic81a84a8335f0ed08dc9cac79d3e46a869095823
2023-10-07 17:18:21 +08:00
xueman.ruan
7017dbd1b6 fix[utils]: fix hor_stride 24 aligned error
Change-Id: Ife950bd3ae5fac5faffffa4275222fcc7fb9bbe0
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-09-28 16:24:22 +08:00
Yandong Lin
6ac268dfea fix[mpp_soc]: fix rk356x vepu2 capability
Not support vp8 enc

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I6080b5377a0c3615d922bb6ddcc677a736cb2b10
2023-08-03 10:29:14 +08:00
Chandler Chen
4fe51a6c29 feat: Add rk3528a support
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Iff9f9f11bcda78476f8753c5f7c922953c243b25
2023-07-28 17:31:09 +08:00
Herman Chen
44996a76ce [cmake]: Fix ndk r10d compile error
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I64fcf77e7adf13702f98d5d7735338846faff843
2023-07-25 14:59:11 +08:00
Herman Chen
78a6ca648e [cmake]: Adapt to Android 14 requirement
1. Android 14 required to use libc++ instead of libstdc++
2. Add ndk search path and options for ndk switch.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I07595fc0290daaaf6518eca18d7b318be89fc6ae
2023-06-25 10:08:43 +08:00
Yandong Lin
f1734a1737 [mpp_service]: remove get disable_rcb_info env runtime
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I3886482cd10ac8cc02d35d7b89c8cc8f88c1a600
2023-06-08 18:27:13 +08:00
Herman Chen
feab136f1a [allocator_dma_heap]: Add error log
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I06af727713e1c096eada8a40795f42668fdaff6d
2023-06-06 15:48:43 +08:00
Yandong Lin
193309a852 [driver]: add MPP_CMD_SET_ERR_REF_HACK api
support hack for err ref check for decoder

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib61336b50dde626d85f9f6bb25950ea70149ea49
2023-05-10 18:24:13 +08:00
Yandong Lin
d86f0fc707 [mpp_service]: fix query_cfg name issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib594f7e892fdd8831fd49fa8fa4aeb8ac0dd533e
2023-05-09 18:12:49 +08:00
xueman.ruan
c794d353c5 [allocator_dma_heap]: add file permission check.
Change-Id: Icfffaf3594f029b87e3a87f17de408a681c49dfb
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
2023-05-04 08:57:02 +08:00
Yandong Lin
13794992d9 [mpp_mem_pool]: fix MppMemPoolNode double put issue
When a object is double put by mpp_mem_pool_put,
it will destroy the info of MppMemPoolImpl.

So set node->check = NULL when mpp_mem_pool_put, and it will check
failed adn return when double mpp_mem_pool_put.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I54be2eae3a1d7e81579f89d3e80304abface3049
2023-04-27 17:45:28 +08:00
xueman.ruan
f387c6dac2 [mpp_allocator]: disable std allocator.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I27441d49c2072176b848b5d80d408ebcb50926df
2023-04-07 09:06:37 +08:00
Yandong Lin
8bbb9045c3 [mpp_soc]: fix enc cap for rk3562
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I9166ae8288c1c7d4fb4c691779b5a37bcd87318e
2023-03-24 14:54:28 +08:00
xueman.ruan
062c175265 [hal_jpege]: Add dma heap options for JPEG encode.
use cachable dma buffer to reduce copy time.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I7fcc0fa5942ea5aa4e247b5f10677843d006ff28
2023-02-21 20:57:26 +08:00
Chandler Chen
4c14bb1556 [mpp_soc] dec hw_cap add cap_colmv_compress
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: I13b98c5227f03a235c48cfdb639286e7ee595b3f
2023-01-13 14:20:00 +08:00
Chandler Chen
726840336e [mpp_soc] add hw cap for rk3528
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Iadd4e3b99789a52f24a8da1dc96896ffc59a0266
2023-01-13 14:20:00 +08:00
Chandler Chen
1756c9a4de [mpp_soc][hal]: Add rk3562 support
add hw_id define for rk3562 & rk3528

Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Change-Id: Ie32ecec242da6bdcb59a1df3e3f2a3a1a54fd695
2023-01-13 14:20:00 +08:00
Herman Chen
5469f9d08b [misc]: Add compatible for fbc header alignment
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I0ae4ec4b8603648a7186d0cccf63aa3ea3fb29b3
2022-12-23 17:36:34 +08:00
Grey Li
1e1b58d5bd [jpegd]: Fix stream copy_flag by hw cap
Change-Id: Iadcdb46f4828f8e5d9bc8fd77d76bd090a1e602e
Signed-off-by: Grey Li <grey.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-12-22 14:28:26 +08:00
xueman.ruan
05bf99bec9 [hal_jpege]: Fix hardware mismatch error.
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I5f2051cf21711331e9e58ed0a92a2be2c24197a7
2022-11-22 14:49:39 +08:00
Herman Chen
6a643f6e18 [hal_avsd_plus]: Add avs+ dec support for rk3528
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8cc2cd61cfa65e5824c1a0696d6de7bb1728221d
2022-11-18 17:12:00 +08:00