[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:
Randy Li
2017-02-24 16:03:55 +08:00
committed by Herman Chen
parent 8083d5ca60
commit e0a1d6579d
3 changed files with 83 additions and 116 deletions

View File

@@ -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;
}