Commit Graph

27 Commits

Author SHA1 Message Date
xueman.ruan
652e18fcf0 [allocator]: fix dma_heap allocator
segment fault happened in mpp_allocator_put.
 #00 pc 00102e14  /vendor/lib/libmpp.so (mpp_allocator_put+272)
 #01 pc 0004705c  /vendor/lib/libmpp.so (MppBufferService::~MppBufferService()+536)

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: Ia4f9a3b4823bf6a5d8f3fdfd85055630222c0b43
2022-07-04 17:05:59 +08:00
Herman Chen
60f5fc234a [allocator]: Add dma_heap allocator
The dma_heap is introduced in kernel 5.10.

Change-Id: Id3c116d996da461467fe380a79434ba5ea875033
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-06-24 15:52:06 +08:00
Jeffy Chen
0f0d28c2ec Fix compile errors with musl
Tested on RK3588 EVB with musl-1.2.2 and gcc-10.2.

Change-Id: I10574446f46964bad5e67ab45c76060a193b8335
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2022-05-26 11:19:59 +08:00
Randy Li
a78598dab5 [osal]: add new buffer type for DMA import buffer
This buffer type is used for the buffer coming from the
application, the application should make sure those
buffers are the dma buffer.

Change-Id: I2c8491f4dea77e5d7ae8d9157b0a1eda204f4bd6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Herman Chen
321b95ad4d [allocator]: Use auto detect on Android and Linux
There is case that Android 7.1+3.10 kernel without drm and also
Android 7.1+4.4 kernel with both drm and ion.
Use the runtime function to support both of them.

This patch needs more test.

Change-Id: I53f0a30abf057f8e0e6e122e09782896d4789168
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-18 15:15:07 +08:00
Randy Li
c56a9365f6 [ion]: file descriptor for the external buffer
The imported buffer may be released from its origin allocator,
I would suggest to use the new file descriptor from new ion
handle.

The ion only has map_user() to export buffer to userspace,
There is no unmap_user() because the mapping is represented as
a file descriptor in user space. The closing of that file
descriptor will cause the memory to be unmapped from
the calling process.

Change-Id: Ief855aab11793238b40b73da92af853ca3b58349
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: ayaka <ayaka@soulik.info>
2017-11-02 17:55:23 +08:00
Randy Li
0aa2191f26 [allocator]: force using drm allocator in Linux platform
The buffer management system still have a problem with different
memory type, I have to fake the drm buffer as the ion buffer this
time.

Change-Id: I57d972d45419caeaf0f086372d1ecd0c8dd9b9f5
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-07-11 11:49:28 +08:00
Randy Li
5fa4ff0d48 [osal]: match system implementation with compiler marco
It would make the build system more simple, and the cross
toolchains would do the rest to you.

Toolchains like buildroot default not enable the __gnu_linux__
marco in the pre-processor will surfure from the systsm unknown
problem. You should enable the marco in building toolchains
or have a look on those scripts in build directory.

Change-Id: I8f6af3391aa3d94d602ec8d84ba5e43839859169
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-05-04 14:29:29 +08:00
Herman Chen
e2f0da0a89 [allocator]: Transform allocator normal to std
1. Use allocator std to replace default normal allocator on all OS.
2. Use wrapper to simplify mpp_allocator.

Change-Id: I13314a9eec3c5b39bc5ad8ddb3033ac2da79ba8f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-15 17:20:14 +08:00
Jung Zhao
deb649610c [drm]: add macro control in os_allocator.c
1. fix compiling error of previous commit
2. can enable drm on x86 pc linux platform

Change-Id: I06271fe0efcaa7de2531c7fb3e21bf9c75781beb
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-07 17:37:05 +08:00
Lin Kesheng
60373a6973 [all]: format code
use fromdos to change file type, remove ^M in code.

Change-Id: I000202dc51fcff57cc0771455baebea595115b1d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-08 15:21:02 +08:00
Herman Chen
673bc0eef4 [osal]: fix allocator error on x86_64
x86_64 is for simulation debug. It is just for working flow test.

Change-Id: I2d1cb50e52a104e58f6eaf3b27fd9dcf41b9ada6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-09-06 16:22:58 +08:00
ZhaoJun
28745421d5 [sofia-3gr-linux]: add sofia-3gr-linux platform support
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1096 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-25 08:32:27 +00:00
ChenHengming
981d51187b [linux]: fix mpp_buffer_test error on linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@970 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-01 04:01:54 +00:00
ChenHengming
4201f689c0 [format]: format coding style
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@907 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-13 09:47:19 +00:00
ChenHengming
c0866a76f9 [comment]: fix company name hand writing error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@906 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-13 09:42:31 +00:00
ChenHengming
218354e088 [osal]: fix import failed on window and linux
[mpp_buffer]: add mpp_buffer function 

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@884 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-07 09:36:27 +00:00
ChenHengming
788ae5dd63 [osal]: remove extra header in os_allocator.c
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@859 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-01 10:51:07 +00:00
ZhaoJun
3ae8f919c5 [osal]: add drm allocator for linux system
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@857 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-01 10:40:31 +00:00
ChenHengming
e3f49b11aa [allocator]: add import and release function to os/mpp allocator
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@339 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-10-09 21:59:41 +00:00
ChenHengming
aa58d818ce [osal]: add ion on android os_allocator
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@144 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-21 03:45:18 +00:00
ChenHengming
15eb6c5893 [osal/mpp_buffer]: remove MppBufferData and add MppBufferInfo for user interface, tested on window and linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@142 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-21 02:48:01 +00:00
ChenHengming
805db6b02d [osal]: add NORMAL path on android
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@140 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-20 10:31:45 +00:00
ChenHengming
505e4dd8ae [osal]: add allocator type to MppBufferAllocator, passed on window and linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@139 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-20 10:03:38 +00:00
ChenHengming
2e5aafaf44 [osal]: add normal mode mpp_buffer path to test and fix a lot of bug
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@134 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-20 03:23:36 +00:00
ChenHengming
7d0abbd3a8 [osal]: add mpp_allocator to mpp_buffer_impl
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@131 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-19 11:08:48 +00:00
ChenHengming
f22f5635ab [osal]: add mpp_allocator and os_allocator for mpp_buffer
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@130 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-08-19 10:37:38 +00:00