Skip to content
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

Upgrade to intel-gmmlib-22.3.18 #26

Closed
Closed
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
37 changes: 36 additions & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

cc_library_static {
cc_library_shared {

name: "libgmm_umd",
proprietary: true,
Expand Down Expand Up @@ -90,6 +90,36 @@ cc_library_static {
"-D__STDC_LIMIT_MACROS",
"-D__UMD",
"-Digfx_gmmumd_dll_EXPORTS",
"-Digfx_gmmumd_dll_EXPORTS",
"-O3",
"-DNDEBUG",
"-fPIC",
"-march=core-avx2",
"-mpopcnt",
"-mfpmath=sse",
"-finline-functions",
"-fno-short-enums",
"-Wa,--noexecstack",
"-fno-strict-aliasing",
"-DUSE_MMX",
"-DUSE_SSE",
"-DUSE_SSE2",
"-DUSE_SSE3",
"-DUSE_SSSE3",
"-fstack-protector",
"-fdata-sections",
"-ffunction-sections",
"-fmessage-length=0",
"-fvisibility=hidden",
"-fPIC",
"-g",
"-funswitch-loops",
"-Wl,--no-undefined",
"-Wl,--no-as-needed",
"-Wl,--gc-sections",
"-O2",
"-fno-omit-frame-pointer",
"-pthread",
],

cppflags: [
Expand All @@ -103,6 +133,11 @@ cc_library_static {
"-Wno-pragma-pack",
"-fexceptions",
"-std=c++11",
"-fvisibility-inlines-hidden",
"-fno-use-cxa-atexit",
"-fno-rtti",
"-fcheck-new",
"-pthread",
],

local_include_dirs: [
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Building

4) Run the cmake command to prepare build files

``$ cmake [-DCMAKE_BUILD_TYPE= Release | Debug | ReleaseInternal] [-DARCH= 64 | 32] ..``
``$ cmake [-DCMAKE_BUILD_TYPE= Release | Debug | ReleaseInternal] ..``

5) Build the project

Expand Down
6 changes: 6 additions & 0 deletions Security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Security Policy

Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.

## Reporting a Vulnerability
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
2 changes: 0 additions & 2 deletions Source/GmmLib/CachePolicy/GmmCachePolicyCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ MEMORY_OBJECT_CONTROL_STATE GMM_STDCALL GmmLib::GmmCachePolicyCommon::CachePolic
{
return CachePolicy[Usage].MemoryObjectNoOverride;
}

return CachePolicy[GMM_RESOURCE_USAGE_UNKNOWN].MemoryObjectOverride;
}
/////////////////////////////////////////////////////////////////////////////////////
/// A simple getter function returning the PAT (cache policy) for a given
Expand Down
6 changes: 5 additions & 1 deletion Source/GmmLib/GlobalInfo/GmmInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@ GMM_CLIENT ClientType)
this->GtSysInfo = *pGtSysInfo;

this->pPlatformInfo = CreatePlatformInfo(Platform, false);
if(this->pPlatformInfo == NULL)
{
return GMM_ERROR;
}

OverrideSkuWa();

Expand Down Expand Up @@ -1075,7 +1079,7 @@ GMM_CACHE_POLICY *GMM_STDCALL GmmLib::Context::CreateCachePolicyCommon()
return GetCachePolicyObj();
}

if((GFX_GET_CURRENT_PRODUCT(GetPlatformInfo().Platform) == IGFX_METEORLAKE))
if((GFX_GET_CURRENT_PRODUCT(GetPlatformInfo().Platform) == IGFX_METEORLAKE) || (GFX_GET_CURRENT_PRODUCT(GetPlatformInfo().Platform) == IGFX_ARROWLAKE))
{
pGmmCachePolicy = new GmmLib::GmmXe_LPGCachePolicy(CachePolicy, this);
}
Expand Down
19 changes: 0 additions & 19 deletions Source/GmmLib/GlobalInfo/GmmLibDllMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,6 @@ OTHER DEALINGS IN THE SOFTWARE.
#include "External/Common/GmmClientContext.h"
#include "External/Common/GmmLibDll.h"

/////////////////////////////////////////////////////////////////////////////////////
/// First Call to GMM Lib DLL/so to get the DLL/so exported fucntion pointers
///
/////////////////////////////////////////////////////////////////////////////////////
extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL OpenGmm(GmmExportEntries *pm_GmmFuncs)
{
GMM_STATUS Status = GMM_SUCCESS;
if(pm_GmmFuncs)
{
//TODO
}
else
{
Status = GMM_INVALIDPARAM;
}

return Status;
}

/////////////////////////////////////////////////////////////////////////////////////
// First Call to GMM Lib DLL/so to initialize singleton global context
// and create client context
Expand Down
7 changes: 4 additions & 3 deletions Source/GmmLib/Texture/GmmGen12Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,11 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmGen12TextureCalc::FillTex2D(GMM_TEXTURE_INFO *
((pTexInfo->Flags.Gpu.Depth || pTexInfo->Flags.Gpu.SeparateStencil ||
(GMM_IS_64KB_TILE(pTexInfo->Flags) || pTexInfo->Flags.Info.TiledYf)) ? // MSAA Ys/Yf samples are ALSO stored as array planes, calculate size for single sample and expand it later.
1 :
pTexInfo->MSAA.NumSamples) * // MSAA (non-Depth/Stencil) RT samples stored as array planes.
pTexInfo->MSAA.NumSamples) * // MSAA (non-Depth/Stencil) RT samples stored as array planes.
((pTexInfo->Flags.Gpu.Depth || pTexInfo->Flags.Gpu.SeparateStencil) ? // Depth/Stencil MSAA surface is expanded through Width and Depth
1 :
((GMM_IS_64KB_TILE(pTexInfo->Flags) && !pGmmLibContext->GetSkuTable().FtrTileY && (pTexInfo->MSAA.NumSamples == 16)) ? 4 : // MSAA x8/x16 stored as pseudo array planes each with 4x samples
(GMM_IS_64KB_TILE(pTexInfo->Flags) && !pGmmLibContext->GetSkuTable().FtrTileY && (pTexInfo->MSAA.NumSamples == 8)) ? 2 : 1);
(GMM_IS_64KB_TILE(pTexInfo->Flags) && !pGmmLibContext->GetSkuTable().FtrTileY && (pTexInfo->MSAA.NumSamples == 8)) ? 2 : 1));

if(GMM_IS_64KB_TILE(pTexInfo->Flags) || pTexInfo->Flags.Info.TiledYf)
{
Expand Down Expand Up @@ -497,7 +499,6 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmGen12TextureCalc::FillTex2D(GMM_TEXTURE_INFO *
{
Fill2DTexOffsetAddress(pTexInfo);
}

GMM_DPF_EXIT;

return (Status);
Expand Down
10 changes: 9 additions & 1 deletion Source/GmmLib/Texture/GmmTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,15 @@ GMM_INLINE GMM_STATUS __GmmTexFillHAlignVAlign(GMM_TEXTURE_INFO *pTexInfo,GMM_LI
UnitAlignHeight = pPlatform->TexAlign.YUV422.Height;

// For packed 8/16-bit formats alignment factor of 4 will give us < 16B so expand to 32B
SET_ALIGN_FACTOR(Width, 32);

if (pTexInfo->Flags.Info.Linear)
{
SET_ALIGN_FACTOR(Width, 128);
}
else
{
SET_ALIGN_FACTOR(Width, 32);
}
}
else if(GmmIsCompressed(pGmmLibContext, pTexInfo->Format)) /////////////////////////////
{
Expand Down
11 changes: 11 additions & 0 deletions Source/GmmLib/Texture/GmmTextureAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ bool GmmLib::GmmTextureCalc::ValidateTexInfo(GMM_TEXTURE_INFO * pTexInfo,
return false;
}

if(GmmIsPlanar(pTexInfo->Format))
{
if((!GmmIsReconstructableSurface(pTexInfo->Format)) && (pTexInfo->OffsetInfo.Plane.Y[GMM_PLANE_U] >= GMM_MAX_UV_PLANE_Y_OFFSET))
{
GMM_ASSERTDPF(0,
"GmmLib::GmmTextureCalc::ValidateTexInfo:Y offset of U plane"
"exceeds max HW U plane Y offset restriction.\r\n");
return false;
}
}

GMM_DPF_EXIT;
return true;
}
Expand Down
10 changes: 5 additions & 5 deletions Source/GmmLib/Texture/GmmTextureOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ GMM_STATUS GmmLib::GmmTextureCalc::GetTexStdLayoutOffset(GMM_TEXTURE_INFO * pT
pReqInfo->StdLayout.TileDepthPitch = DepthPitch;
}

PrevMipSize = DepthPitch * MipDepthTiles;
PrevMipSize = (GMM_GFX_SIZE_T)DepthPitch * MipDepthTiles;
SlicePitch += DepthPitch;
}

Expand Down Expand Up @@ -352,12 +352,12 @@ GMM_STATUS GmmLib::GmmTextureCalc::GetTexLockOffset(GMM_TEXTURE_INFO * pTexInf
pReqInfo->Lock.Mip0SlicePitch = GFX_ULONG_CAST(pTexInfo->OffsetInfo.Texture3DOffsetInfo.Mip0SlicePitch);

// Actual address is offset based on requested slice
AddressOffset += SliceRow * MipHeight * Pitch;
AddressOffset += (GMM_GFX_SIZE_T)SliceRow * MipHeight * Pitch;

// Get to particular slice
if(Slice % NumberOfMipsInSingleRow)
{
AddressOffset += (((Slice % NumberOfMipsInSingleRow) *
AddressOffset += (((GMM_GFX_SIZE_T)(Slice % NumberOfMipsInSingleRow) *
MipWidth * pTexInfo->BitsPerPixel) >>
3);
}
Expand Down Expand Up @@ -788,9 +788,9 @@ GMM_GFX_SIZE_T GmmLib::GmmTextureCalc::Get3DMipByteAddress(GMM_TEXTURE_INFO *
MipHeight /= 2;
}

ExtraBytes = PlaneRows * MipHeight * Pitch;
ExtraBytes = (GMM_GFX_SIZE_T)PlaneRows * MipHeight * Pitch;

ExtraBytes += ((Slice % MipsInThisRow) *
ExtraBytes += ((GMM_GFX_SIZE_T)(Slice % MipsInThisRow) *
MipWidth * pTexInfo->BitsPerPixel) >>
3;

Expand Down
4 changes: 2 additions & 2 deletions Source/GmmLib/Texture/GmmXe_LPGTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,12 +1024,12 @@ GMM_STATUS GmmLib::GmmXe_LPGTextureCalc::GetTexLockOffset(GMM_TEXTURE_INFO * p
pReqInfo->Lock.Mip0SlicePitch = GFX_ULONG_CAST(pTexInfo->OffsetInfo.Texture3DOffsetInfo.Mip0SlicePitch);

// Actual address is offset based on requested slice
AddressOffset += SliceRow * MipHeight * Pitch;
AddressOffset += (GMM_GFX_SIZE_T)SliceRow * MipHeight * Pitch;

// Get to particular slice
if(Slice % NumberOfMipsInSingleRow)
{
AddressOffset += (((Slice % NumberOfMipsInSingleRow) *
AddressOffset += (((GMM_GFX_SIZE_T)(Slice % NumberOfMipsInSingleRow) *
MipWidth * pTexInfo->BitsPerPixel) >>
3);
}
Expand Down
23 changes: 18 additions & 5 deletions Source/GmmLib/TranslationTable/GmmAuxTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,11 @@ GMM_STATUS GmmLib::AuxTable::MapValidEntry(GMM_UMD_SYNCCONTEXT *UmdContext, GMM_

GMM_AUXTTL1e GmmLib::AuxTable::CreateAuxL1Data(GMM_RESOURCE_INFO *BaseResInfo)
{
GMM_FORMAT_ENTRY FormatInfo = pClientContext->GetLibContext()->GetPlatformInfo().FormatTable[BaseResInfo->GetResourceFormat()];
GMM_RESOURCE_FORMAT Format;
Format = BaseResInfo->GetResourceFormat();
Format = ((Format > GMM_FORMAT_INVALID) && (Format < GMM_RESOURCE_FORMATS)) ? Format : GMM_FORMAT_INVALID;

GMM_FORMAT_ENTRY FormatInfo = pClientContext->GetLibContext()->GetPlatformInfo().FormatTable[Format];
GMM_AUXTTL1e L1ePartial = {0};
#define GMM_REGISTRY_UMD_PATH "SOFTWARE\\Intel\\IGFX\\GMM\\"
#define GMM_E2EC_OVERRIDEDEPTH16BPPTO12 "ForceYUV16To12BPP"
Expand All @@ -845,7 +849,7 @@ GMM_AUXTTL1e GmmLib::AuxTable::CreateAuxL1Data(GMM_RESOURCE_INFO *BaseResInfo)
L1ePartial.TileMode = BaseResInfo->GetResFlags().Info.TiledYs ? 0 : 1;

L1ePartial.Format = FormatInfo.CompressionFormat.AuxL1eFormat;
L1ePartial.LumaChroma = GmmIsPlanar(BaseResInfo->GetResourceFormat());
L1ePartial.LumaChroma = GmmIsPlanar(Format);

if(pClientContext->GetLibContext()->GetWaTable().WaUntypedBufferCompression && BaseResInfo->GetResourceType() == RESOURCE_BUFFER)
{
Expand Down Expand Up @@ -886,7 +890,7 @@ GMM_AUXTTL1e GmmLib::AuxTable::CreateAuxL1Data(GMM_RESOURCE_INFO *BaseResInfo)
}
else
{
switch(BaseResInfo->GetResourceFormat())
switch(Format)
{
case GMM_FORMAT_P012:
case GMM_FORMAT_Y412:
Expand Down Expand Up @@ -934,8 +938,17 @@ GMM_GFX_ADDRESS GMM_INLINE GmmLib::AuxTable::__GetCCSCacheline(GMM_RESOURCE_INFO
if(BaseIsYF)
{
uint32_t PitchIn4YF = BasePitchInTiles / 4; //Base Pitch is physically padded to 4x1 YF width
i = static_cast<uint32_t>(AdrOffset % PitchIn4YF);
j = static_cast<uint32_t>(AdrOffset / PitchIn4YF);

if (PitchIn4YF != 0)
{
i = static_cast<uint32_t>(AdrOffset % PitchIn4YF);
j = static_cast<uint32_t>(AdrOffset / PitchIn4YF);
}
else
{
__GMM_ASSERT(PitchIn4YF != 0);
return 0;
}
}
else if(BasePitchInTiles != 0) //TileYs
{
Expand Down
Loading
Loading