From e4aab4cd32c80eeb98f2af3284b82770c7558c75 Mon Sep 17 00:00:00 2001 From: zhangyichix Date: Thu, 26 Sep 2024 11:41:53 +0000 Subject: [PATCH] Fixed compilation issues in Android Signed-off-by: zhangyichix Signed-off-by: zhepeng.xu --- cmrtlib/linux/hardware/cm_device_os.cpp | 6 ++++-- media_driver/linux/common/ddi/media_libva.h | 1 + .../agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp | 4 ++-- media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c | 6 +++--- .../linux/common/os/osservice/mos_utilities_specific.cpp | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmrtlib/linux/hardware/cm_device_os.cpp b/cmrtlib/linux/hardware/cm_device_os.cpp index 5f84f29942b..8f34dc3c95a 100644 --- a/cmrtlib/linux/hardware/cm_device_os.cpp +++ b/cmrtlib/linux/hardware/cm_device_os.cpp @@ -493,8 +493,10 @@ CmDevice_RT::CmDevice_RT( m_gtpinBufferUP1(nullptr), m_gtpinBufferUP2(nullptr), m_createOption(createOption), - m_driverStoreEnabled(0), - m_driFileDescriptor(0) +#if !defined(ANDROID) + m_driFileDescriptor(0), +#endif + m_driverStoreEnabled(0) { // New Surface Manager diff --git a/media_driver/linux/common/ddi/media_libva.h b/media_driver/linux/common/ddi/media_libva.h index 8842188d678..3066611c637 100755 --- a/media_driver/linux/common/ddi/media_libva.h +++ b/media_driver/linux/common/ddi/media_libva.h @@ -43,6 +43,7 @@ #include #endif #ifdef ANDROID +#include #if VA_MAJOR_VERSION < 1 #include "va_internal_android.h" #endif diff --git a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp index 29075555220..2bad029f77f 100644 --- a/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp +++ b/media_softlet/agnostic/common/vp/hal/bufferMgr/vp_allocator.cpp @@ -740,7 +740,7 @@ MOS_STATUS VpAllocator::AllocParamsInitType( VP_FUNC_CALL(); VP_PUBLIC_CHK_NULL_RETURN(surface); -#if !EMUL && !LINUX +#if !EMUL && !LINUX && !ANDROID // Need to reallocate surface according to expected tiletype instead of tiletype of the surface what we have if ( surface != nullptr && surface->OsResource.pGmmResInfo != nullptr && @@ -1483,4 +1483,4 @@ MOS_HW_RESOURCE_DEF VpAllocator::GetResourceCache(uint32_t feature, bool bOut, E VP_PUBLIC_NORMALMESSAGE("Resource %u was found in cache manager, use mocs usage %u!", feature, element.mocsUsageType); return element.mocsUsageType; -} \ No newline at end of file +} diff --git a/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c b/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c index b255c866f2c..edc0e89a0dd 100644 --- a/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c +++ b/media_softlet/agnostic/common/vp/kdll/hal_kerneldll_next.c @@ -3932,7 +3932,7 @@ bool KernelDll_BuildKernel_CmFc(Kdll_State *pState, Kdll_SearchState *pSearchSta VP_RENDER_FUNCTION_ENTER; // Disable pop-up box window for STL assertion to avoid VM hang in auto test. -#if (!LINUX) +#if (!LINUX && !ANDROID) uint32_t prevErrorMode = ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); #if defined(_MSC_VER) ::_set_error_mode(_OUT_TO_STDERR); @@ -4062,7 +4062,7 @@ bool KernelDll_BuildKernel_CmFc(Kdll_State *pState, Kdll_SearchState *pSearchSta res = true; finish: -#if (!LINUX) +#if (!LINUX && !ANDROID) ::SetErrorMode(prevErrorMode); #endif return res; @@ -4468,4 +4468,4 @@ bool KernelDll_SetupFunctionPointers_Ext( #ifdef __cplusplus } -#endif // __cplusplus \ No newline at end of file +#endif // __cplusplus diff --git a/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp b/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp index 65e8e2082ee..fe57019b1fa 100644 --- a/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp +++ b/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp @@ -40,7 +40,7 @@ #include #include #include -#include "mos_compat.h" // libc variative definitions: backtrace +//#include "mos_compat.h" // libc variative definitions: backtrace #include "mos_user_setting.h" #include "mos_utilities_specific.h" #include "mos_utilities.h"