Updated address lib to mesa amd-temp-gfx12 branch.
Commit: 6e5244bd3184f0720197270a10e031b5ecd5fe75

Signed-off-by: David Belanger <david.belanger@amd.com>
Change-Id: Icaead4f38c5f3019c375116070b1f97a927f09b0
Signed-off-by: Chris Freehill <cfreehil@amd.com>
Этот коммит содержится в:
David Belanger
2024-02-02 11:06:06 -05:00
коммит произвёл Chris Freehill
родитель 7a3bf30769
Коммит bb02f4e9a7
41 изменённых файлов: 5329 добавлений и 1159 удалений
+16 -26
Просмотреть файл
@@ -2,24 +2,7 @@
************************************************************************************************************************
*
* Copyright (C) 2007-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE
* SPDX-License-Identifier: MIT
*
***********************************************************************************************************************/
@@ -39,8 +22,8 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace rocr {
namespace Addr {
namespace Addr
{
/**
************************************************************************************************************************
@@ -363,6 +346,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeCmaskInfo(
// Generate the CMASK address equation.
pOut->equation.gfx9.num_bits = Min(32u, eq->getsize());
bool checked = false;
for (unsigned b = 0; b < pOut->equation.gfx9.num_bits; b++) {
CoordTerm &bit = (*eq)[b];
@@ -727,6 +711,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeDccInfo(
// Generate the DCC address equation.
pOut->equation.gfx9.num_bits = Min(32u, eq->getsize());
bool checked = false;
for (unsigned b = 0; b < pOut->equation.gfx9.num_bits; b++) {
CoordTerm &bit = (*eq)[b];
@@ -2409,6 +2394,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeBlock256Equation(
ADDR_E_RETURNCODE ret = ADDR_OK;
pEquation->numBits = 8;
pEquation->numBitComponents = 1;
UINT_32 i = 0;
for (; i < elementBytesLog2; i++)
@@ -2735,6 +2721,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeThinEquation(
}
}
FillEqBitComponents(pEquation);
pEquation->numBits = blockSizeLog2;
}
@@ -3012,6 +2999,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeThickEquation(
}
}
FillEqBitComponents(pEquation);
pEquation->numBits = blockSizeLog2;
}
@@ -3722,7 +3710,9 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting(
// Apply optional restrictions
if (pIn->flags.needEquation)
{
FilterInvalidEqSwizzleMode(allowedSwModeSet, pIn->resourceType, Log2(bpp >> 3));
UINT_32 components = pIn->flags.allowExtEquation ? ADDR_MAX_EQUATION_COMP :
ADDR_MAX_LEGACY_EQUATION_COMP;
FilterInvalidEqSwizzleMode(allowedSwModeSet, pIn->resourceType, Log2(bpp >> 3), components);
}
if (allowedSwModeSet.value == Gfx9LinearSwModeMask)
@@ -3763,6 +3753,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting(
const UINT_32 ratioLow = computeMinSize ? 1 : (pIn->flags.opt4space ? 3 : 2);
const UINT_32 ratioHi = computeMinSize ? 1 : (pIn->flags.opt4space ? 2 : 1);
const UINT_64 sizeAlignInElement = Max(NextPow2(pIn->minSizeAlign) / (bpp >> 3), 1u);
UINT_32 minSizeBlk = AddrBlockMicro;
UINT_64 minSize = 0;
@@ -3770,7 +3761,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting(
for (UINT_32 i = AddrBlockLinear; i < AddrBlockMaxTiledType; i++)
{
if (IsBlockTypeAvaiable(allowedBlockSet, static_cast<AddrBlockType>(i)))
if (Addr2IsBlockTypeAvailable(allowedBlockSet, static_cast<::AddrBlockType>(i)))
{
localIn.swizzleMode = swMode[i];
@@ -3788,7 +3779,7 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting(
padSize[i] = localOut.surfSize;
if ((minSize == 0) ||
BlockTypeWithinMemoryBudget(minSize, padSize[i], ratioLow, ratioHi))
Addr2BlockTypeWithinMemoryBudget(minSize, padSize[i], ratioLow, ratioHi))
{
minSize = padSize[i];
minSizeBlk = i;
@@ -3829,9 +3820,9 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting(
for (UINT_32 i = AddrBlockMicro; i < AddrBlockMaxTiledType; i++)
{
if ((i != minSizeBlk) &&
IsBlockTypeAvaiable(allowedBlockSet, static_cast<AddrBlockType>(i)))
Addr2IsBlockTypeAvailable(allowedBlockSet, static_cast<::AddrBlockType>(i)))
{
if (BlockTypeWithinMemoryBudget(minSize, padSize[i], 0, 0, pIn->memoryBudget) == FALSE)
if (Addr2BlockTypeWithinMemoryBudget(minSize, padSize[i], 0, 0, pIn->memoryBudget) == FALSE)
{
// Clear the block type if the memory waste is unacceptable
allowedBlockSet.value &= ~(1u << (i - 1));
@@ -5227,4 +5218,3 @@ VOID Gfx9Lib::ComputeThinBlockDimension(
} // V2
} // Addr
} // rocr
+5 -22
Просмотреть файл
@@ -2,24 +2,7 @@
************************************************************************************************************************
*
* Copyright (C) 2007-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE
* SPDX-License-Identifier: MIT
*
***********************************************************************************************************************/
@@ -36,9 +19,10 @@
#include "addrlib2.h"
#include "coord.h"
namespace rocr {
namespace Addr {
namespace V2 {
namespace Addr
{
namespace V2
{
/**
************************************************************************************************************************
@@ -647,7 +631,6 @@ private:
} // V2
} // Addr
} // rocr
#endif