Commit Graph

30 Commits

Author SHA1 Message Date
Johnson Ding
643d2116f8 [build]: support NDK-17 and above
Change-Id: I59bb0a1ad06a3e6d2a2b51610c528ade61e9c5d3
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2021-01-13 11:23:55 +08:00
Shunqian Zheng
9464af395b [misc]: Terminate soc_name to fix out of bounds
1. Terminate soc_name string to fix memory out of bounds
2. Fix all snprintf/strnlen warning

Change-Id: I4525c6e289a00d1509bc30ee69545d92f2f4b9cb
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
2020-04-29 16:06:47 +08:00
Herman Chen
11ac01351a [misc]: Fix compile warning on NDK r16b
Change-Id: I1c1f1137fbbb7875d48cee1b6c17aa1d4c6f0863
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-07-03 15:50:35 +08:00
Rimon Xu
a3116b8ce4 [ion]: scandir operation need to be protected by lock.
When multi thread calls scandir, crash may occur, so
the operation needs to be synchronized.

Change-Id: Idbdf539208259313d36c4acd17934af0e4dcf911
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2019-04-23 15:10:24 +08:00
Rimon Xu
fb73f23f53 [alloctor]: add flags for alloctor
Each of the different alloctor has different alloctor modes,
such as allocating physical continuous memory, secure memory,
etc.

Change-Id: Ib032689f0cfd36b494843dcc176a22c6c9587b6a
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
2018-05-07 17:34:34 +08:00
Randy Li
86c5f925cd [alloactor]: fix some minior errors
1. fix the header protection
2. the incorrect offset in ion memory mapping
3. the commentment of the buffer type in a header file

Change-Id: If9d1db90d41131750a341ab6177f947f7b966317
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2018-04-27 17:20:32 +08:00
Chengmc
e648d65af8 [allocator] lock ion heap detection operation
When in multi-codecs cases, the check_sysfs_iommu function reenters
with high probability, so some codec instances may fail to obtain
the correct memory type.

The root cause is scandir call in find_dir_in_path function. For
efficiency consideration it is better to lock ion_heap_id value.

Change-Id: I60a0eb27c3ac35bc022aa00b2cffc4e26e54bf24
Signed-off-by: Chengmc <Martin.Cheng@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-03-22 17:00:49 +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
Herman Chen
ba4b1db7ce [ioctl]: Add compatible patch for different kernel
New kernel use u32 as a fix length ioctl parameter then mpp should keep
compatible to all kernel driver case.

Change-Id: I73afe00971d7b73d6c4695254bc5fdf82422b1f5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-11-01 17:23:13 +08:00
Randy Li
19c0237886 [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.

NOTE: User may use file descriptor outside mpp as buffer index.
If mpp chooses new map fd as its output user may lost the
connection between user external buffer and mpp output buffer.

Change-Id: Ie0f42cd3268dfd08ddcbd5148a68406ff4b66b7a
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-14 11:38:32 +08:00
Randy Li
e709b1b621 [alloactor]: fix the compiler warnings in ion
Change-Id: I73a7d4dae08f18aa2c61d1b3766ea94b7d9eea21
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-24 14:03:21 +08:00
Herman Chen
1bbd1dcce6 [ion]: Ion buffer mmap optimization
1. Do not do map when MppBuffer alloc or import. Only map when user requires a
user pointer. This will save a lot of vma resource especially when buffer is
very large.
2. Fix error in mpp_dec thread which use info.ptr directly.
3. Use external fd on import (have risk of external user close fd on hw work)

Change-Id: I28225f6ba28afa3e9475e605bf971348dcef185a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-04 15:01:09 +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
Alpha Lin
f98c06f233 [osal]: add new dts node for iommu determination
Add new dts node 'vpu_combo' for rk312x,rk3368 video codec devices
compatibility.

Change-Id: I81326d478788ddddfb42e9fe0f4596ab84183934
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2016-12-02 14:28:40 +08:00
hh
824c04836e [ion]: fix ion handle check error
Ion file handle can have a fd_flag equal to 0. So we need to remove the
condition fd_flag == 0 in funciton os_allocator_ion_import.

Change-Id: I0393cf1f69d358308903fc7461efc36158f42358
Signed-off-by: hh <hh@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-11-29 10:34:12 +08:00
Lin Kesheng
89e11ed9c7 [ion]: dup new fd while get fd 0 after importing
1. check input fd is valid
2. dup new fd while imported fd is 0

Change-Id: Ic20d070d1a29e7d37c4f1e75cbef89263c5bc3a9
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-25 14:55:32 +08:00
Herman Chen
80140b3966 [ion]: use mpp_log to print scan info
In order to avoid misunderstanding change mpp_err to mpp_log

Change-Id: Id4a0591a0eeb7975fcdf1979b9d45c9b8d076370
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-10-11 10:06:33 +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
43bfdc6bdf [format]: format coding style
Change-Id: I3d0e081f6636ca8162df4bda68618ec0ba37e7ae
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-08-23 09:16:22 +08:00
ChenHengming
b9ffe80711 [osal]: add function log to allocator_ion
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1189 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-11 06:55:41 +00: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
1cd97ca56a [ion]: use default sysfs path rather than remount path
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1061 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-21 08:03:43 +00:00
ChenHengming
8ccbd01ed0 [allocator_ion]: fix iommu detection failure on 3gr
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1056 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-21 01:58:39 +00:00
ChenHengming
5ebe54881f [ion]: fix compile error on normal linux destop machine
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1031 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-15 03:53:04 +00:00
ChenHengming
668393735f [allocator]: fix failed error detection on ion/drm allocator import function
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1016 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-13 09:40:08 +00:00
GaoZhili
31f69e313e upload allocator dirctory
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@979 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-05 03:35:17 +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
f7cfe5c55e [osal]: fix crash on can not found device information under device-tree
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@823 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-26 03:30:06 +00:00
ChenHengming
70b9429c3b [osal]: fix allocator_ion warning on linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@809 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-24 08:56:44 +00:00
ChenHengming
d4b871ef15 [oasl]: move ion allocator to new directory for linux reuse
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@808 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-24 08:41:18 +00:00