Skip to content

[VP]Remove -DLINUX pre-compile definitions #1396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ cmake_minimum_required (VERSION 2.8)
project(IntelGenDmyHexTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)
add_definitions(-D__linux__)

add_executable(GenDmyHex main.cpp)
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ set(HEADERS_
linkfile.h
)

add_definitions(-DLINUX_)
add_definitions(-D__linux__)

add_executable(GenKrnBin ${SOURCE_} ${HEADERS_})
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ cmake_minimum_required (VERSION 2.8)
project(IntelKernelBinToSourceTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)
add_definitions(-D__linux__)

add_executable(KernelBinToSource KernelBinToSource.cpp)
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/KrnToHex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ cmake_minimum_required (VERSION 2.8)
project(KrnToHexTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)
add_definitions(-D__linux__)

add_executable(KrnToHex KrnToHex.cpp)
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ set(SOURCE_
KrnToHex_IGA.cpp
)

add_definitions(-DLINUX_)
add_definitions(-D__linux__)

add_executable(KrnToHex_IGA ${SOURCE_})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Intel Corporation
* Copyright (c) 2021-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -88,7 +88,7 @@ VPHAL_VEBOX_STATE_XE_HPM::VPHAL_VEBOX_STATE_XE_HPM(
}
dwNumofVebox = 0;

#if LINUX
#if __linux__
char* ScalingHQPerfMode = getenv("SET_SCALINGHQ_AS_PERFMODE");
if (ScalingHQPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*===================== begin_copyright_notice ==================================

# Copyright (c) 2020-2021, Intel Corporation
# Copyright (c) 2020-2022, Intel Corporation

# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -52,7 +52,7 @@ VphalSfcStateXe_Xpm::VphalSfcStateXe_Xpm(
true);
VP_PUBLIC_NORMALMESSAGE("m_disableSfcDithering = %d", m_disableSfcDithering);

#if LINUX
#if __linux__
char *Sfc2PassPerfMode = getenv("SET_SFC2PASS_PERFMODE");
if (Sfc2PassPerfMode)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2021, Intel Corporation
* Copyright (c) 2019-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -93,7 +93,7 @@ VPHAL_VEBOX_STATE_XE_XPM::VPHAL_VEBOX_STATE_XE_XPM(
}
dwNumofVebox = 0;

#if LINUX
#if __linux__
char* ScalingHQPerfMode = getenv("SET_SCALINGHQ_AS_PERFMODE");
if (ScalingHQPerfMode)
{
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_hal_dump.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2021, Intel Corporation
* Copyright (c) 2017-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -28,7 +28,7 @@
#include "renderhal_platform_interface.h"

#if (MDF_COMMAND_BUFFER_DUMP || MDF_CURBE_DATA_DUMP || MDF_SURFACE_STATE_DUMP)
#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PlatformSNPrintf snprintf
#define PLATFORM_DIR_SEPERATOR "/"
#else
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_media_state.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Intel Corporation
* Copyright (c) 2018-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -88,7 +88,7 @@ MOS_STATUS CmMediaState::Submit()
return MOS_STATUS_SUCCESS;
}

#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PLATFORM_DIR_SEPERATOR "/"
#else
#define PLATFORM_DIR_SEPERATOR "\\"
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_mem_sse2_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Intel Corporation
* Copyright (c) 2020-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -27,7 +27,7 @@
#include "cm_mem.h"
#include "cm_mem_sse2_impl.h"

#if defined(__SSE2__) || !(defined(LINUX) || defined(ANDROID))
#if defined(__SSE2__) || !(defined(__linux__) || defined(ANDROID))

#include <mmintrin.h>

Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_ssh.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Intel Corporation
* Copyright (c) 2018-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -531,7 +531,7 @@ MOS_STATUS CmSSH::PrepareResourcesForCp()

using namespace std;

#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PLATFORM_DIR_SEPERATOR "/"
#else
#define PLATFORM_DIR_SEPERATOR "\\"
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/vp/hal/vphal.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2021, Intel Corporation
* Copyright (c) 2009-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -892,7 +892,7 @@ MOS_STATUS VphalState::GetStatusReport(
}
else
{ // here we have the first not ready entry.
#if (LINUX || ANDROID)
#if (__linux__ || ANDROID)
uiNewHead = (uiIndex + 1) & (VPHAL_STATUS_TABLE_MAX_SIZE - 1);
#else
uiNewHead = uiIndex;
Expand Down
8 changes: 4 additions & 4 deletions media_driver/agnostic/common/vp/hal/vphal_debug.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021, Intel Corporation
* Copyright (c) 2011-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -2159,7 +2159,7 @@ void VphalSurfaceDumper::GetSurfaceDumpSpec()
UserFeatureData.StringData.pStringData,
UserFeatureData.StringData.uSize);
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down Expand Up @@ -2519,7 +2519,7 @@ void VphalHwStateDumper::GetStateDumpSpec()
pUserFeatureData->StringData.pStringData,
pUserFeatureData->StringData.uSize);
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down Expand Up @@ -3161,7 +3161,7 @@ void VphalParameterDumper::GetParametersDumpSpec()
UserFeatureData.StringData.uSize);
bDumpEnabled = true;
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/vp/hal/vphal_debug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021, Intel Corporation
* Copyright (c) 2011-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -40,7 +40,7 @@
#include "renderhal.h"
#include "mhw_vebox.h"

#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
#include "UmdStateSeparation.h"
#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) Intel Corporation (2018 - 2019).
* Copyright (c) Intel Corporation (2018 - 2022).
*
* INTEL MAKES NO WARRANTY OF ANY KIND REGARDING THE CODE. THIS CODE IS
* LICENSED ON AN "AS IS" BASIS AND INTEL WILL NOT PROVIDE ANY SUPPORT,
Expand Down Expand Up @@ -154,7 +154,7 @@ MOS_STATUS VpHal_16AlignLoadStaticData(
eStatus = MOS_STATUS_INVALID_PARAMETER;
break;
}
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW10.Output_Pitch = p16AlignState->pTarget->OsResource.iPitch;
WalkerStatic.DW10.Output_Height = p16AlignState->pTarget->OsResource.iHeight;
#endif
Expand Down Expand Up @@ -1049,7 +1049,7 @@ MOS_STATUS VpHal_16AlignSetupSurfaceStatesInt(
PRENDERHAL_SURFACE_STATE_ENTRY pSurfaceEntry;
MOS_FORMAT format = pSurface->Format;
uint32_t width = pSurface->dwWidth;
#if defined(LINUX)
#if defined(__linux__)
uint32_t dwSize = pSurface->dwHeight * pSurface->OsResource.iPitch;
#else
uint32_t dwSize = pSurface->dwHeight * pSurface->dwPitch;
Expand Down
10 changes: 5 additions & 5 deletions media_driver/agnostic/common/vp/hal/vphal_render_fast1ton.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2021, Intel Corporation
* Copyright (c) 2018-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -108,7 +108,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW4.Dst_Index0 = FAST1TON_DST_INDEX0;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST0;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW10.Dst_pitch0 = pFast1toNState->pTarget[0]->OsResource.iPitch;
WalkerStatic.DW12.Dst_UVOffset0 = pFast1toNState->pTarget[0]->OsResource.iHeight;
#endif
Expand All @@ -131,7 +131,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW6.Dst_Index1 = FAST1TON_DST_INDEX1;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST1;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW11.Dst_pitch1 = pFast1toNState->pTarget[1]->OsResource.iPitch;
WalkerStatic.DW12.Dst_UVOffset1 = pFast1toNState->pTarget[1]->OsResource.iHeight;
#endif
Expand All @@ -154,7 +154,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW8.Dst_Index2 = FAST1TON_DST_INDEX2;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST2;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW11.Dst_pitch2 = pFast1toNState->pTarget[2]->OsResource.iPitch;
WalkerStatic.DW13.Dst_UVOffset2 = pFast1toNState->pTarget[2]->OsResource.iHeight;
#endif
Expand Down Expand Up @@ -1047,7 +1047,7 @@ MOS_STATUS VpHal_Fast1toNSetupSurfaceStates(
format = pFast1toNState->pTarget[index]->Format;
width = pFast1toNState->pTarget[index]->dwWidth;
pFast1toNState->pTarget[index]->Format = Format_RAW;
#if defined(LINUX)
#if defined(__linux__)
pFast1toNState->pTarget[index]->dwWidth = (pFast1toNState->pTarget[index]->dwHeight * pFast1toNState->pTarget[index]->OsResource.iPitch) * 3/2;
#endif
pFast1toNState->pTarget[index]->dwWidth = MOS_ALIGN_CEIL(pFast1toNState->pTarget[index]->dwWidth, 128);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, Intel Corporation
* Copyright (c) 2019-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -200,7 +200,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryCopy(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL && !_VULKAN
#if !defined(__linux__) && !defined(ANDROID) && !EMUL && !_VULKAN
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down Expand Up @@ -355,7 +355,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryCopy2D(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL && !_VULKAN
#if !defined(__linux__) && !defined(ANDROID) && !EMUL && !_VULKAN
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down Expand Up @@ -470,7 +470,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryTileConvert(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL && !_VULKAN
#if !defined(__linux__) && !defined(ANDROID) && !EMUL && !_VULKAN
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down
6 changes: 3 additions & 3 deletions media_driver/agnostic/common/vp/kdll/hal_kerneldll.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2017, Intel Corporation
* Copyright (c) 2008-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -34,7 +34,7 @@
#if EMUL || VPHAL_LIB
#include <math.h>
#include "support.h"
#elif LINUX
#elif __linux__
#else // !(EMUL | VPHAL_LIB) && !LINUX

#endif // EMUL | VPHAL_LIB
Expand Down Expand Up @@ -4370,7 +4370,7 @@ bool KernelDll_BuildKernel_CmFc(Kdll_State *pState, Kdll_SearchState *pSearchSta
VPHAL_RENDER_FUNCTION_ENTER;

// Disable pop-up box window for STL assertion to avoid VM hang in auto test.
#if (!LINUX)
#if (!__linux__)
::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#if defined(_MSC_VER)
::_set_error_mode(_OUT_TO_STDERR);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020, Intel Corporation
* Copyright (c) 2017-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -1221,7 +1221,7 @@ MOS_STATUS CodechalDecodeVp9G12 :: DecodePrimitiveLevel()
m_osInterface,
&syncParams));

#ifdef LINUX
#ifdef __linux__
#ifdef _DECODE_PROCESSING_SUPPORTED
CODECHAL_DEBUG_TOOL(
if (m_sfcState->m_sfcOutputSurface)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3320,7 +3320,7 @@ MOS_STATUS CodechalVdencVp9StateG12::SetSequenceStructs()

CODECHAL_ENCODE_FUNCTION_ENTER;

#ifdef LINUX
#ifdef __linux__
MOS_SURFACE rawSurface;
PCODEC_VP9_ENCODE_SEQUENCE_PARAMS seqParams = (PCODEC_VP9_ENCODE_SEQUENCE_PARAMS)m_encodeParams.pSeqParams;
rawSurface = *(m_encodeParams.psRawSurface);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021, Intel Corporation
* Copyright (c) 2011-2022, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -3112,7 +3112,7 @@ MOS_STATUS VPHAL_VEBOX_STATE_G12_BASE::Initialize(
// Read user feature key for MMC enable
MOS_ZeroMemory(&UserFeatureData, sizeof(UserFeatureData));
UserFeatureData.i32DataFlag = MOS_USER_FEATURE_VALUE_DATA_FLAG_CUSTOM_DEFAULT_VALUE_TYPE;
#if(LINUX)
#if(__linux__)
UserFeatureData.bData = !MEDIA_IS_WA(pVeboxState->m_pWaTable, WaDisableVPMmc); // enable MMC by default
#else
UserFeatureData.bData = true;
Expand Down
5 changes: 3 additions & 2 deletions media_driver/cmake/linux/media_compile_flags_linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ set(MEDIA_COMPILER_FLAGS_COMMON
-m${ARCH}

# Global defines
-DLINUX=1
-DLINUX
-D__linux__=1

-D__linux__
-DNO_RTTI
-DNO_EXCEPTION_HANDLING
-DINTEL_NOT_PUBLIC
Expand Down
Loading