cleanup stale code - part 2

Change-Id: If1655af31f49fe6f536159bcfc6cdcdf2b60ab86
This commit is contained in:
drprajap 2018-03-14 11:43:12 -07:00 committed by Prajapati, Dimpalben R
parent 31bfdee666
commit 1f6d6fac52
5 changed files with 10 additions and 29 deletions

View File

@ -674,7 +674,7 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
pTexInfo->Flags.Gpu.Texture ||
pTexInfo->Flags.Gpu.Vertex)); // Can explore if needed what combo's make sense--and how req's should combine.
// BSpec.3DSTATE_INDEX_BUFFER...
// 3DSTATE_INDEX_BUFFER...
UPDATE_BASE_ALIGNMENT(4); // 32-bit worst-case, since GMM doesn't receive element-size from clients.
if(pGmmGlobalContext->GetWaTable().WaAlignIndexBuffer)
{
@ -693,7 +693,7 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
pTexInfo->Flags.Gpu.RenderTarget ||
pTexInfo->Flags.Gpu.Texture)); // Can explore if needed what combo's make sense--and how req's should combine.
// BSpec.VERTEX_BUFFER_STATE...
// VERTEX_BUFFER_STATE...
UPDATE_BASE_ALIGNMENT(1); // VB's have member alignment requirements--but it's up to UMD to enforce.
UPDATE_PADDING(1);
}
@ -702,11 +702,11 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
{
uint32_t ElementSize;
// BSpec.SURFACE_STATE...
// SURFACE_STATE...
ElementSize = (pTexInfo->BitsPerPixel >> 3) * (GmmIsYUVPacked(pTexInfo->Format) ? 2 : 1);
__GMM_ASSERT((pTexInfo->Pitch % ElementSize) == 0);
UPDATE_BASE_ALIGNMENT(ElementSize);
UPDATE_PADDING(pTexInfo->Pitch * 2); // BSpec."Surface Padding Requirements --> Render Target and Media Surfaces"
UPDATE_PADDING(pTexInfo->Pitch * 2); // "Surface Padding Requirements --> Render Target and Media Surfaces"
}
if(pTexInfo->Flags.Gpu.Texture) // (i.e. Sampler Surfaces) ///////////////////////////
@ -729,14 +729,14 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
// our interface meaning):
uint32_t ElementSize = 16;
// BSpec."Surface Padding Requirements --> Sampling Engine Surfaces"
// "Surface Padding Requirements --> Sampling Engine Surfaces"
UPDATE_PADDING(ElementSize * ((GFX_GET_CURRENT_RENDERCORE(pPlatform->Platform) == IGFX_GEN8_CORE) ? 512 : 256));
UPDATE_ADDITIONAL_BYTES(16);
}
}
else // RESOURCE_1D/2D...
{
/* BSpec mentions sampler needs Alignment Unit padding--
/* Sampler needs Alignment Unit padding--
but sampler arch confirms that's overly conservative
padding--and for trivial (linear, single-subresource)
2D's, even-row (quad-row on BDW.A0) plus additional
@ -747,7 +747,7 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
if(GmmIsCompressed(pTexInfo->Format))
{
// BSpec: "For compressed textures...padding at the bottom of the surface is to an even compressed row."
// "For compressed textures...padding at the bottom of the surface is to an even compressed row."
UPDATE_PADDING(pTexInfo->Pitch * 2); // (Sampler arch confirmed that even-row is sufficient on BDW despite BDW's 4x4 sampling, since this req is from L2 instead of L1.)
}
else
@ -755,14 +755,14 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
UPDATE_PADDING(pTexInfo->Pitch * ((GFX_GET_CURRENT_RENDERCORE(pPlatform->Platform) == IGFX_GEN8_CORE) ? 4 : 2)); // Sampler Fetch Rows: BDW ? 4 : 2
}
// BSpec "For packed YUV, 96 bpt, 48 bpt, and 24 bpt surface formats, additional padding is required."
// "For packed YUV, 96 bpt, 48 bpt, and 24 bpt surface formats, additional padding is required."
if(GmmIsYUVPacked(pTexInfo->Format) || (pTexInfo->BitsPerPixel == 96) || (pTexInfo->BitsPerPixel == 48) || (pTexInfo->BitsPerPixel == 24))
{
UPDATE_ADDITIONAL_BYTES(16);
UPDATE_ADDITIONAL_ROWS(1);
}
/* BSpec: "For linear surfaces, additional padding of 64
/* "For linear surfaces, additional padding of 64
bytes is required at the bottom of the surface."
(Sampler arch confirmed the 64 bytes can overlap with
the other "additional 16 bytes" mentions in that section.) */
@ -771,7 +771,7 @@ GMM_STATUS GmmLib::GmmResourceInfoCommon::ApplyExistingSysMemRestrictions()
}
else
{
/* BSpec: [DevBDW:B0+]: For SURFTYPE_BUFFER, SURFTYPE_1D, and
/* For SURFTYPE_BUFFER, SURFTYPE_1D, and
SURFTYPE_2D non-array, non-MSAA, non-mip-mapped surfaces in
linear memory, the only padding requirement is to the next
aligned 64-byte boundary beyond the end of the surface. */

View File

@ -617,10 +617,6 @@ void CpuSwizzleBlt( // #########################################################
#define LOW_BIT(x) __builtin_ctz(x)
#define HIGH_BIT(x) ((sizeof(x) * CHAR_BIT - 1) - __builtin_clz(x))
#elif defined(__ghs__)
// FIXME: We are using ffs() for now, but evetually we would like to use the compiler built-in
#define LOW_BIT(x) ffs(x)
#define HIGH_BIT(x) ((sizeof(x) * CHAR_BIT - 1) - __CLZ32(x))
#else
#error "Unexpected compiler!"
#endif
@ -690,11 +686,6 @@ void CpuSwizzleBlt( // #########################################################
unsigned int eax, ebx, ecx, edx;
__cpuid(1, eax, ebx, ecx, edx);
StreamingLoadSupported = ((ecx & (1 << 19)) != 0); // ECX[19] = SSE4.1
#elif defined(__ghs__)
#define MOVNTDQA_R(Reg, Src) ((Reg) = _mm_stream_load_si128((__m128i *)(Src)))
unsigned int CpuInfo[4];
__CPUID(1, CpuInfo);
StreamingLoadSupported = ((CpuInfo[2] & (1 << 19)) != 0); // ECX[19] = SSE4.1
#else
#define MOVNTDQA_R(Reg, Src) ((Reg) = (Reg))
StreamingLoadSupported = 0;

View File

@ -569,8 +569,6 @@ uint32_t __GmmLog2(uint32_t Value)
// Check that Value is pow2
__GMM_ASSERT(__popcnt(Value) <= 1);
_BitScanReverse((DWORD *)&FirstSetBit, (DWORD)Value);
#elif defined(__ghs__)
FirstSetBit = ffs(Value);
#else
// Check that Value is pow2
__GMM_ASSERT(__builtin_popcount(Value) <= 1);

View File

@ -282,10 +282,6 @@ __S_INLINE int64_t GFX_POW2_SIZE (int64_t x)
{
HighBit = MSB - __builtin_clzll(x - 1);
}
#elif defined(__ghs__)
{
HighBit = MSB - __CLZ64(x - 1);
}
#else // Windows
{
#ifdef __CT__

View File

@ -37,10 +37,6 @@ Description:
#ifndef __SKU_WA_H__
#define __SKU_WA_H__
#if (_DEBUG || _RELEASE_INTERNAL)
#define GLOBAL_WAFTR_ENABLED 1
#endif
// Prevent the following...
// warning: ISO C++ prohibits anonymous structs [-pedantic]
// warning: ISO C90 doesn't support unnamed structs/unions [-pedantic]