mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[drm]: use mmap() in native way for GNU Linux target
The "[drm]: fix runtime error for 32bit library" is hack way, it won't work at GNU Linux platform. Also you need to check _FILE_OFFSET_BITS and _LARGEFILE64_SOURCE before use the mmap64(). For the normal mmap() with glibc, we only request to check offset is aligned with page size but not the lenght. But that doesn't apply for the memory from the drm device, also the android use a different rule. I decide not to map all the buffer to cpu at beginning since most of them won't be access by the cpu. Change-Id: I74ac7b5b63d45029cae076985a3d0b4526c62bbc Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
@@ -19,25 +19,3 @@
|
||||
#endif
|
||||
|
||||
#include "mpp_runtime.h"
|
||||
|
||||
static func_mmap64 mpp_rt_mmap64 = NULL;
|
||||
|
||||
func_mmap64 mpp_rt_get_mmap64()
|
||||
{
|
||||
#ifdef RKPLATFORM
|
||||
static RK_U32 once = 1;
|
||||
|
||||
if (once) {
|
||||
void *libc_hdl = dlopen("libc", RTLD_LAZY);
|
||||
if (libc_hdl) {
|
||||
mpp_rt_mmap64 = (func_mmap64)dlsym(libc_hdl, "mmap64");
|
||||
dlclose(libc_hdl);
|
||||
}
|
||||
|
||||
once = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return mpp_rt_mmap64;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user