Skip to content
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
19 changes: 17 additions & 2 deletions Source/GmmLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ if(NOT DEFINED PATCH_VERSION)
set(PATCH_VERSION 0)
endif()

if(NOT DEFINED GMMLIB_API_PATCH_VERSION)
set(GMMLIB_API_PATCH_VERSION ${PATCH_VERSION})
endif()

message(STATUS "API version: ${GMMLIB_API_MAJOR_VERSION}.${GMMLIB_API_MINOR_VERSION}.${GMMLIB_API_PATCH_VERSION}")
message(STATUS "Package version: ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")

if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM)
if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM})
set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}")
Expand Down Expand Up @@ -393,7 +400,7 @@ target_link_libraries( ${GMM_LIB_DLL_NAME}
)
else()
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm")
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${GMMLIB_API_MAJOR_VERSION}.${GMMLIB_API_MINOR_VERSION}.${PATCH_VERSION})
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${GMMLIB_API_MAJOR_VERSION}.${GMMLIB_API_MINOR_VERSION}.${GMMLIB_API_PATCH_VERSION})
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES SOVERSION ${GMMLIB_API_MAJOR_VERSION})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down Expand Up @@ -471,6 +478,11 @@ if(UNIX)
configure_file(${BS_DIR_GMMLIB}/igdgmm.h.in ${CMAKE_BINARY_DIR}/igdgmm.h)
configure_file(${BS_DIR_GMMLIB}/igdgmm.pc.in ${CMAKE_BINARY_DIR}/igdgmm.pc @ONLY)

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst "/sbin/ldconfig\n")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm "/sbin/ldconfig\n")
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

install(TARGETS ${GMM_LIB_DLL_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT gmmlib NAMELINK_SKIP)
install(TARGETS ${GMM_LIB_DLL_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT gmmlib-devel NAMELINK_ONLY)

Expand Down Expand Up @@ -525,10 +537,13 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel")
set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst;${CMAKE_CURRENT_BINARY_DIR}/postrm")

set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
set(CPACK_RPM_PACKAGE_RELEASE 1)
set(CPACK_RPM_COMPRESSION_TYPE "xz")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postrm")

if(CMAKE_VERSION VERSION_GREATER 3.6 OR CMAKE_VERSION VERSION_EQUAL 3.6)
set(CPACK_DEBIAN_GMMLIB_FILE_NAME "intel-gmmlib_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
Expand All @@ -550,7 +565,7 @@ if(UNIX)
endif()

set(CPACK_DEBIAN_GMMLIB-DEVEL_PACKAGE_DEPENDS "intel-gmmlib(=${CPACK_PACKAGE_VERSION})")
set(CPACK_RPM_GMMLIB-DEVEL_PACKAGE_REQUIRES "intel-gmmlib(=${CPACK_PACKAGE_VERSION})")
set(CPACK_RPM_GMMLIB-DEVEL_PACKAGE_REQUIRES "intel-gmmlib = ${CPACK_PACKAGE_VERSION}")

set(CPACK_COMPONENT_INSTALL ON)
set(CPACK_DEB_COMPONENT_INSTALL ON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ DEFINE_RESOURCE_USAGE( CM_RESOURCE_USAGE_L1_Enabled_SurfaceState )
//
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_BEGIN )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_DEFAULT )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_DEFAULT_FF )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_DEFAULT_RCS )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_SurfaceState )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_SurfaceState_FF )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_SurfaceState_RCS )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_AGE3_SurfaceState )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_EDRAM_SurfaceState )
DEFINE_RESOURCE_USAGE( MP_RESOURCE_USAGE_EDRAM_AGE3_SurfaceState )
Expand Down Expand Up @@ -171,6 +175,7 @@ DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_CURR_ENCODE )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_REF_ENCODE )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_MV_DATA_ENCODE )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_HME_DOWNSAMPLED_ENCODE )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_HME_DOWNSAMPLED_ENCODE_FF )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_HME_DOWNSAMPLED_ENCODE_DST )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_ME_DISTORTION_ENCODE )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SURFACE_BRC_ME_DISTORTION_ENCODE )
Expand Down Expand Up @@ -250,6 +255,8 @@ DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_HUC_VIRTUAL_ADDR_REGION_BUFFER_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_SIZE_STREAMOUT_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_COMPRESSED_HEADER_BUFFER_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_PROBABILITY_DELTA_BUFFER_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_TILE_RECORD_BUFFER_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_TILE_SIZE_STAS_BUFFER_CODEC )
DEFINE_RESOURCE_USAGE( GMM_RESOURCE_USAGE_END_CODEC )

// OCL Usages
Expand Down
16 changes: 10 additions & 6 deletions Source/GmmLib/GlobalInfo/GmmInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,17 @@ extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platf
/////////////////////////////////////////////////////////////////////////////////////
extern "C" void GMM_STDCALL GmmDestroySingletonContext(void)
{
__GMM_ASSERTPTR(pGmmGlobalContext, VOIDRETURN);
int32_t ContextRefCount = GmmLib::Context::DecrementRefCount();
if(!ContextRefCount && pGmmGlobalContext)
GMM_STATUS SyncLockStatus = GmmLib::Context::LockSingletonContextSyncMutex();
if(SyncLockStatus == GMM_SUCCESS)
{
pGmmGlobalContext->DestroyContext();
delete pGmmGlobalContext;
pGmmGlobalContext = NULL;
int32_t ContextRefCount = GmmLib::Context::DecrementRefCount();
if(!ContextRefCount && pGmmGlobalContext)
{
pGmmGlobalContext->DestroyContext();
delete pGmmGlobalContext;
pGmmGlobalContext = NULL;
}
GmmLib::Context::UnlockSingletonContextSyncMutex();
}
}

Expand Down
3 changes: 3 additions & 0 deletions Source/GmmLib/Platform/GmmGen10Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,7 @@ GmmLib::PlatformInfoGen10::PlatformInfoGen10(PLATFORM &Platform)
Data.SurfaceMaxSize = GMM_GBYTE(256);
Data.MaxGpuVirtualAddressBitsPerResource = 38;
Data.HiZPixelsPerByte = 2;

Data.ReconMaxHeight = Data.Texture2DSurface.MaxHeight; // Reconstructed surfaces require more height and width for higher resolutions.
Data.ReconMaxWidth = Data.Texture2DSurface.MaxWidth;
}
3 changes: 3 additions & 0 deletions Source/GmmLib/Platform/GmmGen11Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ GmmLib::PlatformInfoGen11::PlatformInfoGen11(PLATFORM &Platform)
Data.SurfaceMaxSize = GMM_GBYTE(16384);
Data.MaxGpuVirtualAddressBitsPerResource = 44;

//Override the Height VP9 VdEnc requirement for Gen11 8k resolution.
Data.ReconMaxHeight = GMM_KBYTE(32);

//Override CCS MaxPitch requirement
if(GFX_GET_CURRENT_PRODUCT(Data.Platform) == IGFX_ICELAKE)
{
Expand Down
5 changes: 4 additions & 1 deletion Source/GmmLib/Platform/GmmGen8Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,7 @@ GmmLib::PlatformInfoGen8::PlatformInfoGen8(PLATFORM &Platform)
Data.MaxSLMSize = GMM_KBYTE(384);

Data.HiZPixelsPerByte = 2;
}

Data.ReconMaxHeight = Data.Texture2DSurface.MaxHeight; // Reconstructed surfaces require more height and width for higher resolutions.
Data.ReconMaxWidth = Data.Texture2DSurface.MaxWidth;
}
3 changes: 3 additions & 0 deletions Source/GmmLib/Platform/GmmGen9Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,7 @@ GmmLib::PlatformInfoGen9::PlatformInfoGen9(PLATFORM &Platform)
}

Data.HiZPixelsPerByte = 2;

Data.ReconMaxHeight = Data.Texture2DSurface.MaxHeight; // Reconstructed surfaces require more height and width for higher resolutions.
Data.ReconMaxWidth = Data.Texture2DSurface.MaxWidth;
}
10 changes: 10 additions & 0 deletions Source/GmmLib/Resource/GmmRestrictions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ void GmmLib::GmmTextureCalc::GetGenericRestrictions(GMM_TEXTURE_INFO *pTexInfo,
{
*pBuff = pPlatformResource->Texture2DLinearSurface;
}
if(GmmIsReconstructableSurface(pTexInfo->Format))
{
pBuff->MaxHeight = pPlatformResource->ReconMaxHeight;
pBuff->MaxWidth = pPlatformResource->ReconMaxWidth;
}
}
}
if(pTexInfo->Flags.Gpu.RenderTarget ||
Expand All @@ -231,6 +236,11 @@ void GmmLib::GmmTextureCalc::GetGenericRestrictions(GMM_TEXTURE_INFO *pTexInfo,
{
*pBuff = pPlatformResource->Texture2DLinearSurface;
}
if(GmmIsReconstructableSurface(pTexInfo->Format))
{
pBuff->MaxHeight = pPlatformResource->ReconMaxHeight;
pBuff->MaxWidth = pPlatformResource->ReconMaxWidth;
}
}
}
if(pTexInfo->Flags.Gpu.Depth)
Expand Down
40 changes: 40 additions & 0 deletions Source/GmmLib/Utility/GmmUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,46 @@ uint8_t GMM_STDCALL GmmIsPlanar(GMM_RESOURCE_FORMAT Format)
return Status;
}

//=============================================================================
// Function:
// GmmIsReconstructableSurface
//
// Description:
// Checks if format is GmmIsReconstructableSurface
//
// Arguments: <Look at Function Header)
//
// Return:
// 1 or 0
//-----------------------------------------------------------------------------
uint8_t GMM_STDCALL GmmIsReconstructableSurface(GMM_RESOURCE_FORMAT Format)
{
uint8_t Status = 0;

switch(Format)
{
case GMM_FORMAT_AYUV:
case GMM_FORMAT_P010:
case GMM_FORMAT_P012:
case GMM_FORMAT_P016:
case GMM_FORMAT_Y210:
case GMM_FORMAT_Y216:
case GMM_FORMAT_Y212:
case GMM_FORMAT_Y410:
case GMM_FORMAT_Y416:
case GMM_FORMAT_P8:
case GMM_FORMAT_NV12:
case GMM_FORMAT_YUY2_2x1:
case GMM_FORMAT_YUY2:
Status = 1;
break;
default:
Status = 0;
break;
}
return Status;
}

//=============================================================================
// Function:
// GmmIsP0xx
Expand Down
1 change: 1 addition & 0 deletions Source/GmmLib/inc/External/Common/GmmFormatTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ GMM_FORMAT( MFX_JPEG_YUV444 , 8, 1, 1, 1, R, x, NA , 0xF ,
GMM_FORMAT( NV11 , 8, 1, 1, 1, R, x, NA , NC , ALWAYS )
GMM_FORMAT( NV12 , 8, 1, 1, 1, R, x, NA , 0xF , ALWAYS )
GMM_FORMAT( NV21 , 8, 1, 1, 1, R, x, NA , 0xF , ALWAYS )
GMM_FORMAT( P8 , 8, 1, 1, 1, R, x, NA, NC , ALWAYS )
GMM_FORMAT( P010 , 16, 1, 1, 1, R, x, NA , 0x7 , ALWAYS )
GMM_FORMAT( P012 , 16, 1, 1, 1, R, x, NA , NC , ALWAYS )
GMM_FORMAT( P016 , 16, 1, 1, 1, R, x, NA , 0x8 , ALWAYS )
Expand Down
2 changes: 2 additions & 0 deletions Source/GmmLib/inc/External/Common/GmmPlatformExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ typedef struct __GMM_PLATFORM_RESOURCE_REC
uint32_t MaxSLMSize;

uint8_t HiZPixelsPerByte; //HiZ-Bpp is < 1, keep inverse
uint64_t ReconMaxHeight;
uint64_t ReconMaxWidth;
}__GMM_PLATFORM_RESOURCE, GMM_PLATFORM_INFO;

//***************************************************************************
Expand Down
1 change: 1 addition & 0 deletions Source/GmmLib/inc/External/Common/GmmResourceInfoExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ uint8_t GMM_STDCALL GmmIsP0xx(GMM_RESOURCE_FORMAT Format);
uint8_t GMM_STDCALL GmmIsUVPacked(GMM_RESOURCE_FORMAT Format);
bool GMM_STDCALL GmmIsYUVFormatLCUAligned(GMM_RESOURCE_FORMAT Format);
#define GmmIsYUVPlanar GmmIsPlanar // TODO(Benign): Support old name until we have a chance to correct in UMD(s) using this. No longer YUV since there are now RGB planar formats.
uint8_t GMM_STDCALL GmmIsReconstructableSurface(GMM_RESOURCE_FORMAT Format);
uint8_t GMM_STDCALL GmmIsCompressed(GMM_RESOURCE_FORMAT Format);
uint8_t GMM_STDCALL GmmIsYUVPacked(GMM_RESOURCE_FORMAT Format);
uint8_t GMM_STDCALL GmmIsRedecribedPlanes(GMM_RESOURCE_INFO *pGmmResource);
Expand Down
10 changes: 10 additions & 0 deletions Source/inc/common/igfxfmid.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ typedef enum {
IGFX_ICELAKE,
IGFX_ICELAKE_LP,
IGFX_LAKEFIELD,
IGFX_ELKHARTLAKE,
IGFX_MAX_PRODUCT,


Expand Down Expand Up @@ -1140,11 +1141,20 @@ typedef enum __NATIVEGTTYPE
#define IICL_LP_1x4x8_ULT_DEVICE_F0_ID 0x8A5B
#define IICL_LP_0x0x0_ULT_DEVICE_A0_ID 0x8A70
#define IICL_LP_1x1x8_ULT_DEVICE_A0_ID 0x8A71
#define IICL_LP_1x4x8_LOW_MEDIA_ULT_DEVICE_F0_ID 0x8A56

//LKF
#define ILKF_1x8x8_DESK_DEVICE_F0_ID 0x9840
#define ILKF_GT0_DESK_DEVICE_A0_ID 0x9850
#define ILKF_1x6x8_DESK_DEVICE_F0_ID 0x9841
#define ILKF_1x4x8_DESK_DEVICE_F0_ID 0x9842

//EHL
#define IEHL_1x4x8_SUPERSKU_DEVICE_A0_ID 0x4500
#define IEHL_1x2x4_DEVICE_A0_ID 0x4541
#define IEHL_1x4x4_DEVICE_A0_ID 0x4551
#define IEHL_1x4x8_DEVICE_A0_ID 0x4571

//ICL PCH LP Device IDs
#define ICP_LP_RESERVED_FUSE_ID 0x3480
#define ICP_LP_U_SUPER_SKU_ID 0x3481
Expand Down