[Mesa-dev] [PATCH 012/140] amdgpu/addrlib: AddrLib inheritance refactor
Marek Olšák
maraeo at gmail.com
Mon Mar 20 22:42:22 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Add one more abstraction layer into inheritance system.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/amd/addrlib/addrinterface.cpp | 50 ++--
src/amd/addrlib/core/addrlib.h | 416 ---------------------------------
src/amd/addrlib/core/addrlib1.cpp | 300 +++++++++++++++---------
src/amd/addrlib/core/addrlib1.h | 451 ++++++++++++++++++++++++++++++++++++
src/amd/addrlib/r800/ciaddrlib.h | 4 +-
src/amd/addrlib/r800/egbaddrlib.cpp | 2 +-
src/amd/addrlib/r800/egbaddrlib.h | 4 +-
src/amd/addrlib/r800/siaddrlib.cpp | 4 +-
src/amd/addrlib/r800/siaddrlib.h | 4 +-
9 files changed, 675 insertions(+), 560 deletions(-)
diff --git a/src/amd/addrlib/addrinterface.cpp b/src/amd/addrlib/addrinterface.cpp
index b2120c6..fbc5e5f 100644
--- a/src/amd/addrlib/addrinterface.cpp
+++ b/src/amd/addrlib/addrinterface.cpp
@@ -24,21 +24,21 @@
* of the Software.
*/
/**
***************************************************************************************************
* @file addrinterface.cpp
* @brief Contains the addrlib interface functions
***************************************************************************************************
*/
#include "addrinterface.h"
-#include "addrlib.h"
+#include "addrlib1.h"
#include "addrcommon.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
// Create/Destroy/Config functions
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
* AddrCreate
@@ -107,21 +107,21 @@ ADDR_E_RETURNCODE ADDR_API AddrDestroy(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceInfo(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] surface information
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) ///< [out] surface parameters and alignments
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -141,21 +141,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceInfo(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceAddrFromCoord(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] surface info and coordinates
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] surface address
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceAddrFromCoord(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -173,21 +173,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceAddrFromCoord(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceCoordFromAddr(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] surface info and address
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) ///< [out] coordinates
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceCoordFromAddr(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -211,21 +211,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceCoordFromAddr(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileInfo(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] Htile information
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) ///< [out] Htile pitch, height and size in bytes
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -243,21 +243,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileInfo(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileAddrFromCoord(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] Htile info and coordinates
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Htile address
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileAddrFromCoord(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -276,21 +276,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileAddrFromCoord(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileCoordFromAddr(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] Htile info and address
ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) ///< [out] Htile coordinates
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileCoordFromAddr(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -315,21 +315,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileCoordFromAddr(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskInfo(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] Cmask pitch and height
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) ///< [out] Cmask pitch, height and size in bytes
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -347,21 +347,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskInfo(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskAddrFromCoord(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Cmask info and coordinates
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Cmask address
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskAddrFromCoord(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -380,21 +380,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskAddrFromCoord(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskCoordFromAddr(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Cmask info and address
ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Cmask coordinates
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskCoordFromAddr(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -418,21 +418,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskCoordFromAddr(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskInfo(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] Fmask information
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) ///< [out] Fmask pitch and height
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -450,21 +450,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskInfo(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskAddrFromCoord(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Fmask info and coordinates
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Fmask address
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskAddrFromCoord(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -482,21 +482,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskAddrFromCoord(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskCoordFromAddr(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Fmask info and address
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Fmask coordinates
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskCoordFromAddr(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -520,21 +520,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskCoordFromAddr(
*
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeDccInfo(
ADDR_HANDLE hLib, ///< [in] handle of addrlib
const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) ///< [out] output
{
ADDR_E_RETURNCODE returnCode;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ComputeDccInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
@@ -577,21 +577,21 @@ UINT_32 ADDR_API AddrGetVersion(ADDR_HANDLE hLib)
* AddrUseTileIndex
*
* @brief
* Return TRUE if tileIndex is enabled in this address library
***************************************************************************************************
*/
BOOL_32 ADDR_API AddrUseTileIndex(ADDR_HANDLE hLib)
{
BOOL_32 useTileIndex = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
if (pLib)
{
useTileIndex = pLib->UseTileIndex(0);
}
return useTileIndex;
}
@@ -601,21 +601,21 @@ BOOL_32 ADDR_API AddrUseTileIndex(ADDR_HANDLE hLib)
* AddrUseCombinedSwizzle
*
* @brief
* Return TRUE if combined swizzle is enabled in this address library
***************************************************************************************************
*/
BOOL_32 ADDR_API AddrUseCombinedSwizzle(ADDR_HANDLE hLib)
{
BOOL_32 useCombinedSwizzle = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
if (pLib)
{
useCombinedSwizzle = pLib->UseCombinedSwizzle();
}
return useCombinedSwizzle;
}
@@ -630,21 +630,21 @@ BOOL_32 ADDR_API AddrUseCombinedSwizzle(ADDR_HANDLE hLib)
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrExtractBankPipeSwizzle(
ADDR_HANDLE hLib, ///< [in] addrlib handle
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) ///< [out] output structure
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ExtractBankPipeSwizzle(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
@@ -661,21 +661,21 @@ ADDR_E_RETURNCODE ADDR_API AddrExtractBankPipeSwizzle(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrCombineBankPipeSwizzle(
ADDR_HANDLE hLib,
const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn,
ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut)
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->CombineBankPipeSwizzle(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
@@ -692,21 +692,21 @@ ADDR_E_RETURNCODE ADDR_API AddrCombineBankPipeSwizzle(
* ADDR_OK if no error
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSliceSwizzle(
ADDR_HANDLE hLib,
const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut)
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ComputeSliceTileSwizzle(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
@@ -723,21 +723,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSliceSwizzle(
* ADDR_OK if no error
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeBaseSwizzle(
ADDR_HANDLE hLib,
const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut)
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ComputeBaseSwizzle(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
@@ -854,21 +854,21 @@ BOOL_32 ADDR_API ElemGetExportNorm(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileInfoToHW(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] tile info with real value
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) ///< [out] tile info with HW register value
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileInfoToHW(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -886,21 +886,21 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileInfoToHW(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input - tile index
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileIndex(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -918,21 +918,21 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex(
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex1(
ADDR_HANDLE hLib, ///< [in] address lib handle
const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input - tile index
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileIndex1(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -953,21 +953,21 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex1(
*
* @note
* Only meaningful for SI (and above)
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrGetTileIndex(
ADDR_HANDLE hLib,
const ADDR_GET_TILEINDEX_INPUT* pIn,
ADDR_GET_TILEINDEX_OUTPUT* pOut)
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->GetTileIndex(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
@@ -985,21 +985,21 @@ ADDR_E_RETURNCODE ADDR_API AddrGetTileIndex(
*
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputePrtInfo(
ADDR_HANDLE hLib,
const ADDR_PRT_INFO_INPUT* pIn,
ADDR_PRT_INFO_OUTPUT* pOut)
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ComputePrtInfo(pIn, pOut);
}
else
{
returnCode = ADDR_ERROR;
}
diff --git a/src/amd/addrlib/core/addrlib.h b/src/amd/addrlib/core/addrlib.h
index b369db8..177aece 100644
--- a/src/amd/addrlib/core/addrlib.h
+++ b/src/amd/addrlib/core/addrlib.h
@@ -127,36 +127,20 @@ enum AddrEngTileSize
***************************************************************************************************
*/
enum AddrBankSwapSize
{
ADDR_BANKSWAP_128B = 128,
ADDR_BANKSWAP_256B = 256,
ADDR_BANKSWAP_512B = 512,
ADDR_BANKSWAP_1KB = 1024,
};
-/**
-***************************************************************************************************
-* @brief Flags for AddrTileMode
-***************************************************************************************************
-*/
-struct AddrTileModeFlags
-{
- UINT_32 thickness : 4;
- UINT_32 isLinear : 1;
- UINT_32 isMicro : 1;
- UINT_32 isMacro : 1;
- UINT_32 isMacro3d : 1;
- UINT_32 isPrt : 1;
- UINT_32 isPrtNoRotation : 1;
- UINT_32 isBankSwapped : 1;
-};
/**
***************************************************************************************************
* @brief This class contains asic independent address lib functionalities
***************************************************************************************************
*/
class AddrLib : public AddrObject
{
public:
virtual ~AddrLib();
@@ -178,483 +162,83 @@ public:
{
return m_version;
}
/// Returns asic chip family name defined by AddrLib
AddrChipFamily GetAddrChipFamily()
{
return m_chipFamily;
}
- /// Returns tileIndex support
- BOOL_32 UseTileIndex(INT_32 index) const
- {
- return m_configFlags.useTileIndex && (index != TileIndexInvalid);
- }
-
- /// Returns combined swizzle support
- BOOL_32 UseCombinedSwizzle() const
- {
- return m_configFlags.useCombinedSwizzle;
- }
-
- //
- // Interface stubs
- //
- ADDR_E_RETURNCODE ComputeSurfaceInfo(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSurfaceAddrFromCoord(
- const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSurfaceCoordFromAddr(
- const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSliceTileSwizzle(
- const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ExtractBankPipeSwizzle(
- const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE CombineBankPipeSwizzle(
- const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeBaseSwizzle(
- const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeFmaskInfo(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
-
- ADDR_E_RETURNCODE ComputeFmaskAddrFromCoord(
- const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeFmaskCoordFromAddr(
- const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileInfoToHW(
- const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
- ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileIndex(
- const ADDR_CONVERT_TILEINDEX_INPUT* pIn,
- ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileIndex1(
- const ADDR_CONVERT_TILEINDEX1_INPUT* pIn,
- ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE GetTileIndex(
- const ADDR_GET_TILEINDEX_INPUT* pIn,
- ADDR_GET_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileInfo(
- const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn,
- ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskInfo(
- const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeDccInfo(
- const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
- ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileAddrFromCoord(
- const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskAddrFromCoord(
- const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileCoordFromAddr(
- const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskCoordFromAddr(
- const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputePrtInfo(
- const ADDR_PRT_INFO_INPUT* pIn,
- ADDR_PRT_INFO_OUTPUT* pOut) const;
-
ADDR_E_RETURNCODE Flt32ToDepthPixel(
const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn,
ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) const;
ADDR_E_RETURNCODE Flt32ToColorPixel(
const ELEM_FLT32TOCOLORPIXEL_INPUT* pIn,
ELEM_FLT32TOCOLORPIXEL_OUTPUT* pOut) const;
BOOL_32 GetExportNorm(
const ELEM_GETEXPORTNORM_INPUT* pIn) const;
ADDR_E_RETURNCODE GetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const;
protected:
AddrLib(); // Constructor is protected
AddrLib(const AddrClient* pClient);
- /// Pure Virtual function for Hwl computing surface info
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface address from coord
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceAddrFromCoord(
- const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface coord from address
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceCoordFromAddr(
- const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface tile swizzle
- virtual ADDR_E_RETURNCODE HwlComputeSliceTileSwizzle(
- const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl extracting bank/pipe swizzle from base256b
- virtual ADDR_E_RETURNCODE HwlExtractBankPipeSwizzle(
- const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl combining bank/pipe swizzle
- virtual ADDR_E_RETURNCODE HwlCombineBankPipeSwizzle(
- UINT_32 bankSwizzle, UINT_32 pipeSwizzle, ADDR_TILEINFO* pTileInfo,
- UINT_64 baseAddr, UINT_32* pTileSwizzle) const = 0;
-
- /// Pure Virtual function for Hwl computing base swizzle
- virtual ADDR_E_RETURNCODE HwlComputeBaseSwizzle(
- const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE base align
- virtual UINT_32 HwlComputeHtileBaseAlign(
- BOOL_32 isTcCompatible, BOOL_32 isLinear, ADDR_TILEINFO* pTileInfo) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE bpp
- virtual UINT_32 HwlComputeHtileBpp(
- BOOL_32 isWidth8, BOOL_32 isHeight8) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE bytes
- virtual UINT_64 HwlComputeHtileBytes(
- UINT_32 pitch, UINT_32 height, UINT_32 bpp,
- BOOL_32 isLinear, UINT_32 numSlices, UINT_64* pSliceBytes, UINT_32 baseAlign) const = 0;
-
- /// Pure Virtual function for Hwl computing FMASK info
- virtual ADDR_E_RETURNCODE HwlComputeFmaskInfo(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) = 0;
-
- /// Pure Virtual function for Hwl FMASK address from coord
- virtual ADDR_E_RETURNCODE HwlComputeFmaskAddrFromCoord(
- const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl FMASK coord from address
- virtual ADDR_E_RETURNCODE HwlComputeFmaskCoordFromAddr(
- const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl convert tile info from real value to HW value
- virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
- const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
- ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl compute mipmap info
- virtual BOOL_32 HwlComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
-
- /// Pure Virtual function for Hwl compute max cmask blockMax value
- virtual BOOL_32 HwlGetMaxCmaskBlockMax() const = 0;
-
- /// Pure Virtual function for Hwl compute fmask bits
- virtual UINT_32 HwlComputeFmaskBits(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- UINT_32* pNumSamples) const = 0;
-
- /// Virtual function to get index (not pure then no need to implement this in all hwls
- virtual ADDR_E_RETURNCODE HwlGetTileIndex(
- const ADDR_GET_TILEINDEX_INPUT* pIn,
- ADDR_GET_TILEINDEX_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
- /// Virtual function for Hwl to compute Dcc info
- virtual ADDR_E_RETURNCODE HwlComputeDccInfo(
- const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
- ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
- /// Virtual function to get cmask address for tc compatible cmask
- virtual ADDR_E_RETURNCODE HwlComputeCmaskAddrFromCoord(
- const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
/// Pure virtual function to get max alignments
virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0;
- // Compute attributes
-
- // HTILE
- UINT_32 ComputeHtileInfo(
- ADDR_HTILE_FLAGS flags,
- UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices,
- BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
- ADDR_TILEINFO* pTileInfo,
- UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pHtileBytes,
- UINT_32* pMacroWidth = NULL, UINT_32* pMacroHeight = NULL,
- UINT_64* pSliceSize = NULL, UINT_32* pBaseAlign = NULL) const;
-
- // CMASK
- ADDR_E_RETURNCODE ComputeCmaskInfo(
- ADDR_CMASK_FLAGS flags,
- UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices, BOOL_32 isLinear,
- ADDR_TILEINFO* pTileInfo, UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pCmaskBytes,
- UINT_32* pMacroWidth, UINT_32* pMacroHeight, UINT_64* pSliceSize = NULL,
- UINT_32* pBaseAlign = NULL, UINT_32* pBlockMax = NULL) const;
-
- virtual VOID HwlComputeTileDataWidthAndHeightLinear(
- UINT_32* pMacroWidth, UINT_32* pMacroHeight,
- UINT_32 bpp, ADDR_TILEINFO* pTileInfo) const;
-
- // CMASK & HTILE addressing
- virtual UINT_64 HwlComputeXmaskAddrFromCoord(
- UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice,
- UINT_32 numSlices, UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8,
- BOOL_32 isHeight8, ADDR_TILEINFO* pTileInfo,
- UINT_32* bitPosition) const;
-
- virtual VOID HwlComputeXmaskCoordFromAddr(
- UINT_64 addr, UINT_32 bitPosition, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
- ADDR_TILEINFO* pTileInfo, UINT_32* pX, UINT_32* pY, UINT_32* pSlice) const;
-
- // Surface mipmap
- VOID ComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
-
- /// Pure Virtual function for Hwl checking degrade for base level
- virtual BOOL_32 HwlDegradeBaseLevel(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
-
- virtual BOOL_32 HwlOverrideTileMode(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- AddrTileMode* pTileMode,
- AddrTileType* pTileType) const
- {
- // not supported in hwl layer, FALSE for not-overrided
- return FALSE;
- }
-
- AddrTileMode DegradeLargeThickTile(AddrTileMode tileMode, UINT_32 bpp) const;
-
- VOID PadDimensions(
- AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
- UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
- UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
- UINT_32* pSlices, UINT_32 sliceAlign) const;
-
- virtual VOID HwlPadDimensions(
- AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
- UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
- UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
- UINT_32* pSlices, UINT_32 sliceAlign) const
- {
- }
-
- //
- // Addressing shared for linear/1D tiling
- //
- UINT_64 ComputeSurfaceAddrFromCoordLinear(
- UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
- UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32* pBitPosition) const;
-
- VOID ComputeSurfaceCoordFromAddrLinear(
- UINT_64 addr, UINT_32 bitPosition, UINT_32 bpp,
- UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample) const;
-
- VOID ComputeSurfaceCoordFromAddrMicroTiled(
- UINT_64 addr, UINT_32 bitPosition,
- UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
- AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
- AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const;
-
- UINT_32 ComputePixelIndexWithinMicroTile(
- UINT_32 x, UINT_32 y, UINT_32 z,
- UINT_32 bpp, AddrTileMode tileMode, AddrTileType microTileType) const;
-
- /// Pure Virtual function for Hwl computing coord from offset inside micro tile
- virtual VOID HwlComputePixelCoordFromOffset(
- UINT_32 offset, UINT_32 bpp, UINT_32 numSamples,
- AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
- AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const = 0;
-
- //
- // Addressing shared by all
- //
- virtual UINT_32 HwlGetPipes(
- const ADDR_TILEINFO* pTileInfo) const;
-
- UINT_32 ComputePipeFromAddr(
- UINT_64 addr, UINT_32 numPipes) const;
-
- /// Pure Virtual function for Hwl computing pipe from coord
- virtual UINT_32 ComputePipeFromCoord(
- UINT_32 x, UINT_32 y, UINT_32 slice, AddrTileMode tileMode,
- UINT_32 pipeSwizzle, BOOL_32 flags, ADDR_TILEINFO* pTileInfo) const = 0;
-
- /// Pure Virtual function for Hwl computing coord Y for 8 pipe cmask/htile
- virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
- UINT_32 pipe, UINT_32 x) const = 0;
-
//
// Initialization
//
/// Pure Virtual function for Hwl computing internal global parameters from h/w registers
virtual BOOL_32 HwlInitGlobalParams(
const ADDR_CREATE_INPUT* pCreateIn) = 0;
/// Pure Virtual function for Hwl converting chip family
virtual AddrChipFamily HwlConvertChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision) = 0;
//
// Misc helper
//
- static const AddrTileModeFlags m_modeFlags[ADDR_TM_COUNT];
-
- static UINT_32 ComputeSurfaceThickness(
- AddrTileMode tileMode);
-
- // Checking tile mode
- static BOOL_32 IsMacroTiled(AddrTileMode tileMode);
- static BOOL_32 IsMacro3dTiled(AddrTileMode tileMode);
- static BOOL_32 IsLinear(AddrTileMode tileMode);
- static BOOL_32 IsMicroTiled(AddrTileMode tileMode);
- static BOOL_32 IsPrtTileMode(AddrTileMode tileMode);
- static BOOL_32 IsPrtNoRotationTileMode(AddrTileMode tileMode);
-
static UINT_32 Bits2Number(UINT_32 bitNum,...);
static UINT_32 GetNumFragments(UINT_32 numSamples, UINT_32 numFrags)
{
return numFrags != 0 ? numFrags : Max(1u, numSamples);
}
/// Returns pointer of AddrElemLib
AddrElemLib* GetElemLib() const
{
return m_pElemLib;
}
- /// Return TRUE if tile info is needed
- BOOL_32 UseTileInfo() const
- {
- return !m_configFlags.ignoreTileInfo;
- }
-
/// Returns fillSizeFields flag
UINT_32 GetFillSizeFieldsFlags() const
{
return m_configFlags.fillSizeFields;
}
- /// Adjusts pitch alignment for flipping surface
- VOID AdjustPitchAlignment(
- ADDR_SURFACE_FLAGS flags, UINT_32* pPitchAlign) const;
-
- /// Overwrite tile config according to tile index
- virtual ADDR_E_RETURNCODE HwlSetupTileCfg(
- INT_32 index, INT_32 macroModeIndex,
- ADDR_TILEINFO* pInfo, AddrTileMode* mode = NULL, AddrTileType* type = NULL) const;
-
- /// Overwrite macro tile config according to tile index
- virtual INT_32 HwlComputeMacroModeIndex(
- INT_32 index, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 numSamples,
- ADDR_TILEINFO* pTileInfo, AddrTileMode *pTileMode = NULL, AddrTileType *pTileType = NULL
- ) const
- {
- return TileIndexNoMacroIndex;
- }
-
- /// Pre-handler of 3x pitch (96 bit) adjustment
- virtual UINT_32 HwlPreHandleBaseLvl3xPitch(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
- /// Post-handler of 3x pitch adjustment
- virtual UINT_32 HwlPostHandleBaseLvl3xPitch(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
- /// Check miplevel after surface adjustment
- ADDR_E_RETURNCODE PostComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- /// Quad buffer stereo support, has its implementation in ind. layer
- virtual BOOL_32 ComputeQbStereoInfo(
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- /// Pure virutual function to compute stereo bank swizzle for right eye
- virtual UINT_32 HwlComputeQbStereoRightSwizzle(
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
-
private:
// Disallow the copy constructor
AddrLib(const AddrLib& a);
// Disallow the assignment operator
AddrLib& operator=(const AddrLib& a);
VOID SetAddrChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision);
- UINT_32 ComputeCmaskBaseAlign(
- ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const;
-
- UINT_64 ComputeCmaskBytes(
- UINT_32 pitch, UINT_32 height, UINT_32 numSlices) const;
-
- //
- // CMASK/HTILE shared methods
- //
- VOID ComputeTileDataWidthAndHeight(
- UINT_32 bpp, UINT_32 cacheBits, ADDR_TILEINFO* pTileInfo,
- UINT_32* pMacroWidth, UINT_32* pMacroHeight) const;
-
- UINT_32 ComputeXmaskCoordYFromPipe(
- UINT_32 pipe, UINT_32 x) const;
-
VOID SetMinPitchAlignPixels(UINT_32 minPitchAlignPixels);
- BOOL_32 OptimizeTileMode(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, AddrTileMode* pTileMode) const;
-
protected:
AddrLibClass m_class; ///< Store class type (HWL type)
AddrChipFamily m_chipFamily; ///< Chip family translated from the one in atiid.h
UINT_32 m_chipRevision; ///< Revision id from xxx_id.h
UINT_32 m_version; ///< Current version
//
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index e44e673..1fc8fd7 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -17,30 +17,37 @@
* AND/OR ITS SUPPLIERS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addr1lib.cpp
+* @brief Contains the implementation for the AddrLib1 base class..
+***************************************************************************************************
+*/
+
#include "addrinterface.h"
#include "addrlib1.h"
#include "addrcommon.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
// Static Const Member
///////////////////////////////////////////////////////////////////////////////////////////////////
-const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
+const AddrTileModeFlags AddrLib1::m_modeFlags[ADDR_TM_COUNT] =
{// T L 1 2 3 P Pr B
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_GENERAL
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_ALIGNED
{1, 0, 1, 0, 0, 0, 0, 0}, // ADDR_TM_1D_TILED_THIN1
{4, 0, 1, 0, 0, 0, 0, 0}, // ADDR_TM_1D_TILED_THICK
{1, 0, 0, 1, 0, 0, 0, 0}, // ADDR_TM_2D_TILED_THIN1
{1, 0, 0, 1, 0, 0, 0, 0}, // ADDR_TM_2D_TILED_THIN2
{1, 0, 0, 1, 0, 0, 0, 0}, // ADDR_TM_2D_TILED_THIN4
{4, 0, 0, 1, 0, 0, 0, 0}, // ADDR_TM_2D_TILED_THICK
{1, 0, 0, 1, 0, 0, 0, 1}, // ADDR_TM_2B_TILED_THIN1
@@ -55,38 +62,109 @@ const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
{8, 0, 0, 1, 1, 0, 0, 0}, // ADDR_TM_3D_TILED_XTHICK
{1, 0, 0, 0, 0, 0, 0, 0}, // ADDR_TM_POWER_SAVE
{1, 0, 0, 1, 0, 1, 1, 0}, // ADDR_TM_PRT_TILED_THIN1
{1, 0, 0, 1, 0, 1, 0, 0}, // ADDR_TM_PRT_2D_TILED_THIN1
{1, 0, 0, 1, 1, 1, 0, 0}, // ADDR_TM_PRT_3D_TILED_THIN1
{4, 0, 0, 1, 0, 1, 1, 0}, // ADDR_TM_PRT_TILED_THICK
{4, 0, 0, 1, 0, 1, 0, 0}, // ADDR_TM_PRT_2D_TILED_THICK
{4, 0, 0, 1, 1, 1, 0, 0}, // ADDR_TM_PRT_3D_TILED_THICK
};
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Constructor/Destructor
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1() :
+ AddrLib()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class with hClient as parameter
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1(const AddrClient* pClient) :
+ AddrLib(pClient)
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::~AddrLib1
+*
+* @brief
+* Destructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::~AddrLib1()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::GetAddrLib1
+*
+* @brief
+* Get AddrLib1 pointer
+*
+* @return
+* An AddrLib1 class pointer
+***************************************************************************************************
+*/
+AddrLib1 * AddrLib1::GetAddrLib1(
+ ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
+{
+ AddrLib *pAddrLib = AddrLib::GetAddrLib(hLib);
+ if ((pAddrLib != NULL) &&
+ ((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
+ (pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI)))
+ {
+ // only valid and pre-VI AISC can use AddrLib1 function.
+ ADDR_ASSERT_ALWAYS();
+ hLib = NULL;
+ }
+ return static_cast<AddrLib1 *>(hLib);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Surface Methods
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_SURFACE_INFO_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_SURFACE_INFO_OUTPUT)))
@@ -339,30 +417,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
pOut->heightTileMax = pOut->height / 8 - 1;
pOut->sliceTileMax = pOut->pitch * pOut->height / 64 - 1;
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT)))
@@ -419,30 +497,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceAddrFromCoord(
pOut->prtBlockIndex = static_cast<UINT_32>(pOut->addr / (64 * 1024));
}
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddr
+* AddrLib1::ComputeSurfaceCoordFromAddr
*
* @brief
* Interface function stub of ComputeSurfaceCoordFromAddr.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT)))
@@ -494,30 +572,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceCoordFromAddr(
{
returnCode = HwlComputeSurfaceCoordFromAddr(pIn, pOut);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeSliceTileSwizzle
+* AddrLib1::ComputeSliceTileSwizzle
*
* @brief
* Interface function stub of ComputeSliceTileSwizzle.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSliceTileSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle(
const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_SLICESWIZZLE_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_SLICESWIZZLE_OUTPUT)))
@@ -547,30 +625,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeSliceTileSwizzle(
{
returnCode = HwlComputeSliceTileSwizzle(pIn, pOut);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ExtractBankPipeSwizzle
+* AddrLib1::ExtractBankPipeSwizzle
*
* @brief
* Interface function stub of AddrExtractBankPipeSwizzle.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ExtractBankPipeSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle(
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT)) ||
(pOut->size != sizeof(ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT)))
@@ -599,30 +677,30 @@ ADDR_E_RETURNCODE AddrLib::ExtractBankPipeSwizzle(
{
returnCode = HwlExtractBankPipeSwizzle(pIn, pOut);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::CombineBankPipeSwizzle
+* AddrLib1::CombineBankPipeSwizzle
*
* @brief
* Interface function stub of AddrCombineBankPipeSwizzle.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::CombineBankPipeSwizzle(
+ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle(
const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_FMASK_INFO_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_FMASK_INFO_OUTPUT)))
@@ -655,29 +733,29 @@ ADDR_E_RETURNCODE AddrLib::CombineBankPipeSwizzle(
pIn->baseAddr,
&pOut->tileSwizzle);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeBaseSwizzle
+* AddrLib1::ComputeBaseSwizzle
*
* @brief
* Interface function stub of AddrCompueBaseSwizzle.
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeBaseSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle(
const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_BASE_SWIZZLE_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT)))
{
@@ -712,30 +790,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeBaseSwizzle(
pOut->tileSwizzle = 0;
}
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskInfo
+* AddrLib1::ComputeFmaskInfo
*
* @brief
* Interface function stub of ComputeFmaskInfo.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure
)
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_FMASK_INFO_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_FMASK_INFO_OUTPUT)))
@@ -806,30 +884,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskInfo(
returnCode = ADDR_INVALIDPARAMS;
}
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskAddrFromCoord
+* AddrLib1::ComputeFmaskAddrFromCoord
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT)))
@@ -850,30 +928,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskAddrFromCoord(
{
returnCode = ADDR_INVALIDPARAMS;
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskCoordFromAddr
+* AddrLib1::ComputeFmaskCoordFromAddr
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT)))
@@ -894,30 +972,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskCoordFromAddr(
{
returnCode = ADDR_INVALIDPARAMS;
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ConvertTileInfoToHW
+* AddrLib1::ConvertTileInfoToHW
*
* @brief
* Convert tile info from real value to HW register value in HW layer
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileInfoToHW(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_CONVERT_TILEINFOTOHW_INPUT)) ||
(pOut->size != sizeof(ADDR_CONVERT_TILEINFOTOHW_OUTPUT)))
@@ -945,30 +1023,30 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileInfoToHW(
{
returnCode = HwlConvertTileInfoToHW(pIn, pOut);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex
+* AddrLib1::ConvertTileIndex
*
* @brief
* Convert tile index to tile mode/type/info
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileIndex(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex(
const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_CONVERT_TILEINDEX_INPUT)) ||
(pOut->size != sizeof(ADDR_CONVERT_TILEINDEX_OUTPUT)))
@@ -994,30 +1072,30 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex(
returnCode = HwlConvertTileInfoToHW(&hwInput, &hwOutput);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex1
+* AddrLib1::ConvertTileIndex1
*
* @brief
* Convert tile index to tile mode/type/info
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileIndex1(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1(
const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_CONVERT_TILEINDEX1_INPUT)) ||
(pOut->size != sizeof(ADDR_CONVERT_TILEINDEX_OUTPUT)))
@@ -1044,30 +1122,30 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex1(
returnCode = HwlConvertTileInfoToHW(&hwInput, &hwOutput);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::GetTileIndex
+* AddrLib1::GetTileIndex
*
* @brief
* Get tile index from tile mode/type/info
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::GetTileIndex(
+ADDR_E_RETURNCODE AddrLib1::GetTileIndex(
const ADDR_GET_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_GET_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_GET_TILEINDEX_INPUT)) ||
(pOut->size != sizeof(ADDR_GET_TILEINDEX_OUTPUT)))
@@ -1079,53 +1157,53 @@ ADDR_E_RETURNCODE AddrLib::GetTileIndex(
if (returnCode == ADDR_OK)
{
returnCode = HwlGetTileIndex(pIn, pOut);
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceThickness
+* AddrLib1::ComputeSurfaceThickness
*
* @brief
* Compute surface thickness
*
* @return
* Surface thickness
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeSurfaceThickness(
+UINT_32 AddrLib1::ComputeSurfaceThickness(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].thickness;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// CMASK/HTILE
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Interface function stub of AddrComputeHtilenfo
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo(
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
BOOL_32 isWidth8 = (pIn->blockWidth == 8) ? TRUE : FALSE;
BOOL_32 isHeight8 = (pIn->blockHeight == 8) ? TRUE : FALSE;
if (GetFillSizeFieldsFlags() == TRUE)
@@ -1172,30 +1250,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileInfo(
&pOut->sliceSize,
&pOut->baseAlign);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Interface function stub of AddrComputeCmaskInfo
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_CMASK_INFO_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_CMASK_INFO_OUTPUT)))
@@ -1238,30 +1316,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
&pOut->baseAlign,
&pOut->blockMax);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeDccInfo
+* AddrLib1::ComputeDccInfo
*
* @brief
* Interface function to compute DCC key info
*
* @return
* return code of HwlComputeDccInfo
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeDccInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo(
const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE ret = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_DCCINFO_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_DCCINFO_OUTPUT)))
@@ -1288,30 +1366,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeDccInfo(
{
ret = HwlComputeDccInfo(pIn, pOut);
}
}
return ret;
}
/**
***************************************************************************************************
-* AddrLib::ComputeHtileAddrFromCoord
+* AddrLib1::ComputeHtileAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeHtileAddrFromCoord
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord(
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
BOOL_32 isWidth8 = (pIn->blockWidth == 8) ? TRUE : FALSE;
BOOL_32 isHeight8 = (pIn->blockHeight == 8) ? TRUE : FALSE;
if (GetFillSizeFieldsFlags() == TRUE)
@@ -1356,30 +1434,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileAddrFromCoord(
&pOut->bitPosition);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeHtileCoordFromAddr
+* AddrLib1::ComputeHtileCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeHtileCoordFromAddr
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr(
const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
BOOL_32 isWidth8 = (pIn->blockWidth == 8) ? TRUE : FALSE;
BOOL_32 isHeight8 = (pIn->blockHeight == 8) ? TRUE : FALSE;
if (GetFillSizeFieldsFlags() == TRUE)
@@ -1424,30 +1502,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileCoordFromAddr(
&pOut->y,
&pOut->slice);
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskAddrFromCoord
+* AddrLib1::ComputeCmaskAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeCmaskAddrFromCoord
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord(
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT)))
@@ -1496,30 +1574,30 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskAddrFromCoord(
}
}
}
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskCoordFromAddr
+* AddrLib1::ComputeCmaskCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeCmaskCoordFromAddr
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr(
const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (GetFillSizeFieldsFlags() == TRUE)
{
if ((pIn->size != sizeof(ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT)) ||
(pOut->size != sizeof(ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT)))
@@ -1559,35 +1637,36 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
pIn->pTileInfo,
&pOut->x,
&pOut->y,
&pOut->slice);
}
}
return returnCode;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputeTileDataWidthAndHeight
+* AddrLib1::ComputeTileDataWidthAndHeight
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE)
*
* @return
* N/A
*
* @note
* MacroWidth and macroHeight are measured in pixels
***************************************************************************************************
*/
-VOID AddrLib::ComputeTileDataWidthAndHeight(
+VOID AddrLib1::ComputeTileDataWidthAndHeight(
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 cacheBits, ///< [in] bits of cache
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight ///< [out] macro tile height
) const
{
UINT_32 height = 1;
UINT_32 width = cacheBits / bpp;
UINT_32 pipes = HwlGetPipes(pTileInfo);
@@ -1605,58 +1684,58 @@ VOID AddrLib::ComputeTileDataWidthAndHeight(
*pMacroHeight = 8 * height * pipes;
// Note: The above iterative comptuation is equivalent to the following
//
//int log2_height = ((log2(cacheBits)-log2(bpp)-log2(pipes))/2);
//int macroHeight = pow2( 3+log2(pipes)+log2_height );
}
/**
***************************************************************************************************
-* AddrLib::HwlComputeTileDataWidthAndHeightLinear
+* AddrLib1::HwlComputeTileDataWidthAndHeightLinear
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout
*
* @return
* N/A
*
* @note
* MacroWidth and macroHeight are measured in pixels
***************************************************************************************************
*/
-VOID AddrLib::HwlComputeTileDataWidthAndHeightLinear(
+VOID AddrLib1::HwlComputeTileDataWidthAndHeightLinear(
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight, ///< [out] macro tile height
UINT_32 bpp, ///< [in] bits per pixel
ADDR_TILEINFO* pTileInfo ///< [in] tile info
) const
{
ADDR_ASSERT(bpp != 4); // Cmask does not support linear layout prior to SI
*pMacroWidth = 8 * 512 / bpp; // Align width to 512-bit memory accesses
*pMacroHeight = 8 * m_pipes; // Align height to number of pipes
}
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Compute htile pitch,width, bytes per 2D slice
*
* @return
* Htile bpp i.e. How many bits for an 8x8 tile
* Also returns by output parameters:
* *Htile pitch, height, total size in bytes, macro-tile dimensions and slice size*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeHtileInfo(
+UINT_32 AddrLib1::ComputeHtileInfo(
ADDR_HTILE_FLAGS flags, ///< [in] htile flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
UINT_32 numSlices, ///< [in] number of slices
BOOL_32 isLinear, ///< [in] if it is linear mode
BOOL_32 isWidth8, ///< [in] if htile block width is 8
BOOL_32 isHeight8, ///< [in] if htile block height is 8
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
UINT_32* pPitchOut, ///< [out] pitch output
UINT_32* pHeightOut, ///< [out] height output
@@ -1719,82 +1798,82 @@ UINT_32 AddrLib::ComputeHtileInfo(
SafeAssign(pSliceSize, sliceBytes);
SafeAssign(pBaseAlign, baseAlign);
return bpp;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBaseAlign
+* AddrLib1::ComputeCmaskBaseAlign
*
* @brief
* Compute cmask base alignment
*
* @return
* Cmask base alignment
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeCmaskBaseAlign(
+UINT_32 AddrLib1::ComputeCmaskBaseAlign(
ADDR_CMASK_FLAGS flags, ///< [in] Cmask flags
ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
UINT_32 baseAlign = m_pipeInterleaveBytes * HwlGetPipes(pTileInfo);
if (flags.tcCompatible)
{
ADDR_ASSERT(pTileInfo != NULL);
if (pTileInfo)
{
baseAlign *= pTileInfo->banks;
}
}
return baseAlign;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBytes
+* AddrLib1::ComputeCmaskBytes
*
* @brief
* Compute cmask size in bytes
*
* @return
* Cmask size in bytes
***************************************************************************************************
*/
-UINT_64 AddrLib::ComputeCmaskBytes(
+UINT_64 AddrLib1::ComputeCmaskBytes(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices ///< [in] number of slices
) const
{
return BITS_TO_BYTES(static_cast<UINT_64>(pitch) * height * numSlices * CmaskElemBits) /
MicroTilePixels;
}
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Compute cmask pitch,width, bytes per 2D slice
*
* @return
* BlockMax. Also by output parameters: Cmask pitch,height, total size in bytes,
* macro-tile dimensions
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
ADDR_CMASK_FLAGS flags, ///< [in] cmask flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
UINT_32 numSlices, ///< [in] number of slices
BOOL_32 isLinear, ///< [in] is linear mode
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
UINT_32* pPitchOut, ///< [out] pitch output
UINT_32* pHeightOut, ///< [out] height output
UINT_64* pCmaskBytes, ///< [out] bytes per 2D slice
UINT_32* pMacroWidth, ///< [out] macro-tile width in pixels
@@ -1885,31 +1964,31 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
returnCode = ADDR_INVALIDPARAMS;
}
SafeAssign(pBlockMax, blockMax);
return returnCode;
}
/**
***************************************************************************************************
-* AddrLib::ComputeXmaskCoordYFromPipe
+* AddrLib1::ComputeXmaskCoordYFromPipe
*
* @brief
* Compute the Y coord from pipe number for cmask/htile
*
* @return
* Y coordinate
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
+UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe(
UINT_32 pipe, ///< [in] pipe number
UINT_32 x ///< [in] x coordinate
) const
{
UINT_32 pipeBit0;
UINT_32 pipeBit1;
UINT_32 xBit0;
UINT_32 xBit1;
UINT_32 yBit0;
UINT_32 yBit1;
@@ -1977,33 +2056,33 @@ UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
y = HwlComputeXmaskCoordYFrom8Pipe(pipe, x);
break;
default:
break;
}
return y;
}
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskCoordFromAddr
+* AddrLib1::HwlComputeXmaskCoordFromAddr
*
* @brief
* Compute the coord from an address of a cmask/htile
*
* @return
* N/A
*
* @note
* This method is reused by htile, so rename to Xmask
***************************************************************************************************
*/
-VOID AddrLib::HwlComputeXmaskCoordFromAddr(
+VOID AddrLib1::HwlComputeXmaskCoordFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices, ///< [in] number of slices
UINT_32 factor, ///< [in] factor that indicates cmask or htile
BOOL_32 isLinear, ///< [in] linear or tiled HTILE layout
BOOL_32 isWidth8, ///< [in] TRUE if width is 8, FALSE means 4. It's register value
BOOL_32 isHeight8, ///< [in] TRUE if width is 8, FALSE means 4. It's register value
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
@@ -2159,31 +2238,31 @@ VOID AddrLib::HwlComputeXmaskCoordFromAddr(
//
// Assemble final coordinates.
//
*pY += microTileCoordY * MicroTileHeight;
}
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskAddrFromCoord
+* AddrLib1::HwlComputeXmaskAddrFromCoord
*
* @brief
* Compute the address from an address of cmask (prior to si)
*
* @return
* Address in bytes
*
***************************************************************************************************
*/
-UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
+UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 slice, ///< [in] slice/depth index
UINT_32 numSlices, ///< [in] number of slices
UINT_32 factor, ///< [in] factor that indicates cmask(2) or htile(1)
BOOL_32 isLinear, ///< [in] linear or tiled HTILE layout
BOOL_32 isWidth8, ///< [in] TRUE if width is 8, FALSE means 4. It's register value
BOOL_32 isHeight8, ///< [in] TRUE if width is 8, FALSE means 4. It's register value
@@ -2371,31 +2450,31 @@ UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
return addr;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Surface Addressing Shared
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceAddrFromCoordLinear
+* AddrLib1::ComputeSurfaceAddrFromCoordLinear
*
* @brief
* Compute address from coord for linear surface
*
* @return
* Address in bytes
*
***************************************************************************************************
*/
-UINT_64 AddrLib::ComputeSurfaceAddrFromCoordLinear(
+UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 slice, ///< [in] slice/depth index
UINT_32 sample, ///< [in] sample index
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices, ///< [in] number of slices
UINT_32* pBitPosition ///< [out] bit position inside a byte
) const
@@ -2409,30 +2488,30 @@ UINT_64 AddrLib::ComputeSurfaceAddrFromCoordLinear(
UINT_64 addr = (sliceOffset + rowOffset + pixOffset) * bpp;
*pBitPosition = static_cast<UINT_32>(addr % 8);
addr /= 8;
return addr;
}
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrLinear
+* AddrLib1::ComputeSurfaceCoordFromAddrLinear
*
* @brief
* Compute the coord from an address of a linear surface
*
* @return
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeSurfaceCoordFromAddrLinear(
+VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices, ///< [in] number of slices
UINT_32* pX, ///< [out] x coord
UINT_32* pY, ///< [out] y coord
UINT_32* pSlice, ///< [out] slice/depth index
UINT_32* pSample ///< [out] sample index
@@ -2442,30 +2521,30 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrLinear(
const UINT_64 linearOffset = (BYTES_TO_BITS(addr) + bitPosition) / bpp;
*pX = static_cast<UINT_32>((linearOffset % sliceSize) % pitch);
*pY = static_cast<UINT_32>((linearOffset % sliceSize) / pitch % height);
*pSlice = static_cast<UINT_32>((linearOffset / sliceSize) % numSlices);
*pSample = static_cast<UINT_32>((linearOffset / sliceSize) / numSlices);
}
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrMicroTiled
+* AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled
*
* @brief
* Compute the coord from an address of a micro tiled surface
*
* @return
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeSurfaceCoordFromAddrMicroTiled(
+VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSamples, ///< [in] number of samples
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 tileBase, ///< [in] base offset within a tile
UINT_32 compBits, ///< [in] component bits actually needed(for planar surface)
UINT_32* pX, ///< [out] x coord
@@ -2564,31 +2643,31 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrMicroTiled(
*pSample = pixelCoordS;
if (microTileThickness > 1)
{
*pSample = 0;
}
}
/**
***************************************************************************************************
-* AddrLib::ComputePipeFromAddr
+* AddrLib1::ComputePipeFromAddr
*
* @brief
* Compute the pipe number from an address
*
* @return
* Pipe number
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputePipeFromAddr(
+UINT_32 AddrLib1::ComputePipeFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 numPipes ///< [in] number of banks
) const
{
UINT_32 pipe;
UINT_32 groupBytes = m_pipeInterleaveBytes; //just different terms
// R600
// The LSBs of the address are arranged as follows:
@@ -2604,31 +2683,31 @@ UINT_32 AddrLib::ComputePipeFromAddr(
// To get the pipe number, shift off the pipe interleave bits and mask the pipe bits.
//
pipe = static_cast<UINT_32>(addr >> Log2(groupBytes)) & (numPipes - 1);
return pipe;
}
/**
***************************************************************************************************
-* AddrLib::ComputePixelIndexWithinMicroTile
+* AddrLib1::ComputePixelIndexWithinMicroTile
*
* @brief
* Compute the pixel index inside a micro tile of surface
*
* @return
* Pixel index
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputePixelIndexWithinMicroTile(
+UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 z, ///< [in] slice/depth index
UINT_32 bpp, ///< [in] bits per pixel
AddrTileMode tileMode, ///< [in] tile mode
AddrTileType microTileType ///< [in] pixel order in display/non-display mode
) const
{
UINT_32 pixelBit0 = 0;
UINT_32 pixelBit1 = 0;
@@ -2819,61 +2898,61 @@ UINT_32 AddrLib::ComputePixelIndexWithinMicroTile(
(pixelBit5 << 5) |
(pixelBit6 << 6) |
(pixelBit7 << 7) |
(pixelBit8 << 8));
return pixelNumber;
}
/**
***************************************************************************************************
-* AddrLib::AdjustPitchAlignment
+* AddrLib1::AdjustPitchAlignment
*
* @brief
* Adjusts pitch alignment for flipping surface
*
* @return
* N/A
*
***************************************************************************************************
*/
-VOID AddrLib::AdjustPitchAlignment(
+VOID AddrLib1::AdjustPitchAlignment(
ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags
UINT_32* pPitchAlign ///< [out] Pointer to pitch alignment
) const
{
// Display engine hardwires lower 5 bit of GRPH_PITCH to ZERO which means 32 pixel alignment
// Maybe it will be fixed in future but let's make it general for now.
if (flags.display || flags.overlay)
{
*pPitchAlign = PowTwoAlign(*pPitchAlign, 32);
if(flags.display)
{
*pPitchAlign = Max(m_minPitchAlignPixels, *pPitchAlign);
}
}
}
/**
***************************************************************************************************
-* AddrLib::PadDimensions
+* AddrLib1::PadDimensions
*
* @brief
* Helper function to pad dimensions
*
* @return
* N/A
*
***************************************************************************************************
*/
-VOID AddrLib::PadDimensions(
+VOID AddrLib1::PadDimensions(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
UINT_32 numSamples, ///< [in] number of samples
ADDR_TILEINFO* pTileInfo, ///< [in/out] bank structure.
UINT_32 padDims, ///< [in] Dimensions to pad valid value 1,2,3
UINT_32 mipLevel, ///< [in] MipLevel
UINT_32* pPitch, ///< [in/out] pitch in pixels
UINT_32 pitchAlign, ///< [in] pitch alignment
UINT_32* pHeight, ///< [in/out] height in pixels
@@ -2955,30 +3034,30 @@ VOID AddrLib::PadDimensions(
pitchAlign,
pHeight,
heightAlign,
pSlices,
sliceAlign);
}
/**
***************************************************************************************************
-* AddrLib::HwlPreHandleBaseLvl3xPitch
+* AddrLib1::HwlPreHandleBaseLvl3xPitch
*
* @brief
* Pre-handler of 3x pitch (96 bit) adjustment
*
* @return
* Expected pitch
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlPreHandleBaseLvl3xPitch(
+UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
{
ADDR_ASSERT(pIn->width == expPitch);
//
// If pitch is pre-multiplied by 3, we retrieve original one here to get correct miplevel size
//
if (AddrElemLib::IsExpand3x(pIn->format) &&
pIn->mipLevel == 0 &&
@@ -2986,30 +3065,30 @@ UINT_32 AddrLib::HwlPreHandleBaseLvl3xPitch(
{
expPitch /= 3;
expPitch = NextPow2(expPitch);
}
return expPitch;
}
/**
***************************************************************************************************
-* AddrLib::HwlPostHandleBaseLvl3xPitch
+* AddrLib1::HwlPostHandleBaseLvl3xPitch
*
* @brief
* Post-handler of 3x pitch adjustment
*
* @return
* Expected pitch
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlPostHandleBaseLvl3xPitch(
+UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
{
//
// 96 bits surface of sub levels require element pitch of 32 bits instead
// So we just return pitch in 32 bit pixels without timing 3
//
if (AddrElemLib::IsExpand3x(pIn->format) &&
pIn->mipLevel == 0 &&
@@ -3017,129 +3096,129 @@ UINT_32 AddrLib::HwlPostHandleBaseLvl3xPitch(
{
expPitch *= 3;
}
return expPitch;
}
/**
***************************************************************************************************
-* AddrLib::IsMacroTiled
+* AddrLib1::IsMacroTiled
*
* @brief
* Check if the tile mode is macro tiled
*
* @return
* TRUE if it is macro tiled (2D/2B/3D/3B)
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacroTiled(
+BOOL_32 AddrLib1::IsMacroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro;
}
/**
***************************************************************************************************
-* AddrLib::IsMacro3dTiled
+* AddrLib1::IsMacro3dTiled
*
* @brief
* Check if the tile mode is 3D macro tiled
*
* @return
* TRUE if it is 3D macro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacro3dTiled(
+BOOL_32 AddrLib1::IsMacro3dTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro3d;
}
/**
***************************************************************************************************
-* AddrLib::IsMicroTiled
+* AddrLib1::IsMicroTiled
*
* @brief
* Check if the tile mode is micro tiled
*
* @return
* TRUE if micro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMicroTiled(
+BOOL_32 AddrLib1::IsMicroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMicro;
}
/**
***************************************************************************************************
-* AddrLib::IsLinear
+* AddrLib1::IsLinear
*
* @brief
* Check if the tile mode is linear
*
* @return
* TRUE if linear
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsLinear(
+BOOL_32 AddrLib1::IsLinear(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isLinear;
}
/**
***************************************************************************************************
-* AddrLib::IsPrtNoRotationTileMode
+* AddrLib1::IsPrtNoRotationTileMode
*
* @brief
* Return TRUE if it is prt tile without rotation
* @note
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtNoRotationTileMode(
+BOOL_32 AddrLib1::IsPrtNoRotationTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrtNoRotation;
}
/**
***************************************************************************************************
-* AddrLib::IsPrtTileMode
+* AddrLib1::IsPrtTileMode
*
* @brief
* Return TRUE if it is prt tile
* @note
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtTileMode(
+BOOL_32 AddrLib1::IsPrtTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrt;
}
/**
***************************************************************************************************
-* AddrLib::ComputeMipLevel
+* AddrLib1::ComputeMipLevel
*
* @brief
* Compute mipmap level width/height/slices
* @return
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeMipLevel(
+VOID AddrLib1::ComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
if (AddrElemLib::IsBlockCompressed(pIn->format))
{
if (pIn->mipLevel == 0)
{
// DXTn's level 0 must be multiple of 4
// But there are exceptions:
// 1. Internal surface creation in hostblt/vsblt/etc...
@@ -3147,29 +3226,29 @@ VOID AddrLib::ComputeMipLevel(
pIn->width = PowTwoAlign(pIn->width, 4);
pIn->height = PowTwoAlign(pIn->height, 4);
}
}
HwlComputeMipLevel(pIn);
}
/**
***************************************************************************************************
-* AddrLib::OptimizeTileMode
+* AddrLib1::OptimizeTileMode
*
* @brief
* Check if base level's tile mode can be optimized (degraded)
* @return
* TRUE if degraded, also returns degraded tile mode (unchanged if not degraded)
***************************************************************************************************
*/
-BOOL_32 AddrLib::OptimizeTileMode(
+BOOL_32 AddrLib1::OptimizeTileMode(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure for surface info
AddrTileMode* pTileMode ///< [out] Degraded tile mode
) const
{
AddrTileMode tileMode = pIn->tileMode;
UINT_32 thickness = ComputeSurfaceThickness(tileMode);
// Optimization can only be done on level 0 and samples <= 1
if ((pIn->flags.opt4Space == TRUE) &&
(pIn->mipLevel == 0) &&
@@ -3217,29 +3296,29 @@ BOOL_32 AddrLib::OptimizeTileMode(
BOOL_32 optimized = (tileMode != pIn->tileMode);
if (optimized)
{
*pTileMode = tileMode;
}
return optimized;
}
/**
***************************************************************************************************
-* AddrLib::DegradeLargeThickTile
+* AddrLib1::DegradeLargeThickTile
*
* @brief
* Check if the thickness needs to be reduced if a tile is too large
* @return
* The degraded tile mode (unchanged if not degraded)
***************************************************************************************************
*/
-AddrTileMode AddrLib::DegradeLargeThickTile(
+AddrTileMode AddrLib1::DegradeLargeThickTile(
AddrTileMode tileMode,
UINT_32 bpp) const
{
// Override tilemode
// When tile_width (8) * tile_height (8) * thickness * element_bytes is > row_size,
// it is better to just use THIN mode in this case
UINT_32 thickness = ComputeSurfaceThickness(tileMode);
if (thickness > 1 && m_configFlags.allowLargeThickTile == 0)
{
@@ -3287,28 +3366,28 @@ AddrTileMode AddrLib::DegradeLargeThickTile(
break;
}
}
}
return tileMode;
}
/**
***************************************************************************************************
-* AddrLib::PostComputeMipLevel
+* AddrLib1::PostComputeMipLevel
* @brief
* Compute MipLevel info (including level 0) after surface adjustment
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::PostComputeMipLevel(
+ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in/out] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] Output structure
) const
{
// Mipmap including level 0 must be pow2 padded since either SI hw expects so or it is
// required by CFX for Hw Compatibility between NI and SI. Otherwise it is only needed for
// mipLevel > 0. Any h/w has different requirement should implement its own virtual function
if (pIn->flags.pow2Pad)
{
@@ -3327,68 +3406,68 @@ ADDR_E_RETURNCODE AddrLib::PostComputeMipLevel(
}
// for cubemap, we keep its value at first
}
return ADDR_OK;
}
/**
***************************************************************************************************
-* AddrLib::HwlSetupTileCfg
+* AddrLib1::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::HwlSetupTileCfg(
+ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg(
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
ADDR_TILEINFO* pInfo, ///< [out] Tile Info
AddrTileMode* pMode, ///< [out] Tile mode
AddrTileType* pType ///< [out] Tile type
) const
{
return ADDR_NOTSUPPORTED;
}
/**
***************************************************************************************************
-* AddrLib::HwlGetPipes
+* AddrLib1::HwlGetPipes
*
* @brief
* Get number pipes
* @return
* num pipes
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlGetPipes(
+UINT_32 AddrLib1::HwlGetPipes(
const ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
//pTileInfo can be NULL when asic is 6xx and 8xx.
return m_pipes;
}
/**
***************************************************************************************************
-* AddrLib::ComputeQbStereoInfo
+* AddrLib1::ComputeQbStereoInfo
*
* @brief
* Get quad buffer stereo information
* @return
* TRUE if no error
***************************************************************************************************
*/
-BOOL_32 AddrLib::ComputeQbStereoInfo(
+BOOL_32 AddrLib1::ComputeQbStereoInfo(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] updated pOut+pStereoInfo
) const
{
BOOL_32 success = FALSE;
if (pOut->pStereoInfo)
{
ADDR_ASSERT(pOut->bpp >= 8);
ADDR_ASSERT((pOut->surfSize % pOut->baseAlign) == 0);
@@ -3399,41 +3478,42 @@ BOOL_32 AddrLib::ComputeQbStereoInfo(
pOut->pStereoInfo->rightOffset = static_cast<UINT_32>(pOut->surfSize);
pOut->pStereoInfo->rightSwizzle = HwlComputeQbStereoRightSwizzle(pOut);
// Double height
pOut->height <<= 1;
pOut->pixelHeight <<= 1;
// Double size
pOut->surfSize <<= 1;
- // Right start address meets the base align since it is guaranteed by AddrLib
+ // Right start address meets the base align since it is guaranteed by AddrLib1
// 1D surface on SI may break this rule, but we can force it to meet by checking .qbStereo.
success = TRUE;
}
return success;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputePrtInfo
+* AddrLib1::ComputePrtInfo
*
* @brief
* Compute prt surface related info
*
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputePrtInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo(
const ADDR_PRT_INFO_INPUT* pIn,
ADDR_PRT_INFO_OUTPUT* pOut) const
{
ADDR_ASSERT(pOut != NULL);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
UINT_32 expandX = 1;
UINT_32 expandY = 1;
AddrElemMode elemMode;
diff --git a/src/amd/addrlib/core/addrlib1.h b/src/amd/addrlib/core/addrlib1.h
index f0f8d56..9e21684 100644
--- a/src/amd/addrlib/core/addrlib1.h
+++ b/src/amd/addrlib/core/addrlib1.h
@@ -17,31 +17,482 @@
* AND/OR ITS SUPPLIERS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addrlib1.h
+* @brief Contains the AddrLib1 base class definition.
+***************************************************************************************************
+*/
+
#ifndef __ADDR_LIB1_H__
#define __ADDR_LIB1_H__
#include "addrlib.h"
/**
***************************************************************************************************
* @brief Neutral enums that define bank swap size
***************************************************************************************************
*/
enum AddrSampleSplitSize
{
ADDR_SAMPLESPLIT_1KB = 1024,
ADDR_SAMPLESPLIT_2KB = 2048,
ADDR_SAMPLESPLIT_4KB = 4096,
ADDR_SAMPLESPLIT_8KB = 8192,
};
+/**
+***************************************************************************************************
+* @brief Flags for AddrTileMode
+***************************************************************************************************
+*/
+struct AddrTileModeFlags
+{
+ UINT_32 thickness : 4;
+ UINT_32 isLinear : 1;
+ UINT_32 isMicro : 1;
+ UINT_32 isMacro : 1;
+ UINT_32 isMacro3d : 1;
+ UINT_32 isPrt : 1;
+ UINT_32 isPrtNoRotation : 1;
+ UINT_32 isBankSwapped : 1;
+};
+
+/**
+***************************************************************************************************
+* @brief This class contains asic independent address lib functionalities
+***************************************************************************************************
+*/
+class AddrLib1 : public AddrLib
+{
+public:
+ virtual ~AddrLib1();
+
+ static AddrLib1* GetAddrLib1(
+ ADDR_HANDLE hLib);
+
+ /// Returns tileIndex support
+ BOOL_32 UseTileIndex(INT_32 index) const
+ {
+ return m_configFlags.useTileIndex && (index != TileIndexInvalid);
+ }
+
+ /// Returns combined swizzle support
+ BOOL_32 UseCombinedSwizzle() const
+ {
+ return m_configFlags.useCombinedSwizzle;
+ }
+
+ //
+ // Interface stubs
+ //
+ ADDR_E_RETURNCODE ComputeSurfaceInfo(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSurfaceAddrFromCoord(
+ const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSurfaceCoordFromAddr(
+ const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSliceTileSwizzle(
+ const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ExtractBankPipeSwizzle(
+ const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE CombineBankPipeSwizzle(
+ const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeBaseSwizzle(
+ const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeFmaskInfo(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
+
+ ADDR_E_RETURNCODE ComputeFmaskAddrFromCoord(
+ const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeFmaskCoordFromAddr(
+ const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileInfoToHW(
+ const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
+ ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileIndex(
+ const ADDR_CONVERT_TILEINDEX_INPUT* pIn,
+ ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileIndex1(
+ const ADDR_CONVERT_TILEINDEX1_INPUT* pIn,
+ ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE GetTileIndex(
+ const ADDR_GET_TILEINDEX_INPUT* pIn,
+ ADDR_GET_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileInfo(
+ const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskInfo(
+ const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeDccInfo(
+ const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
+ ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileAddrFromCoord(
+ const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskAddrFromCoord(
+ const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileCoordFromAddr(
+ const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskCoordFromAddr(
+ const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputePrtInfo(
+ const ADDR_PRT_INFO_INPUT* pIn,
+ ADDR_PRT_INFO_OUTPUT* pOut) const;
+protected:
+ AddrLib1(); // Constructor is protected
+ AddrLib1(const AddrClient* pClient);
+
+ /// Pure Virtual function for Hwl computing surface info
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface address from coord
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceAddrFromCoord(
+ const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface coord from address
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceCoordFromAddr(
+ const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface tile swizzle
+ virtual ADDR_E_RETURNCODE HwlComputeSliceTileSwizzle(
+ const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl extracting bank/pipe swizzle from base256b
+ virtual ADDR_E_RETURNCODE HwlExtractBankPipeSwizzle(
+ const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl combining bank/pipe swizzle
+ virtual ADDR_E_RETURNCODE HwlCombineBankPipeSwizzle(
+ UINT_32 bankSwizzle, UINT_32 pipeSwizzle, ADDR_TILEINFO* pTileInfo,
+ UINT_64 baseAddr, UINT_32* pTileSwizzle) const = 0;
+
+ /// Pure Virtual function for Hwl computing base swizzle
+ virtual ADDR_E_RETURNCODE HwlComputeBaseSwizzle(
+ const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE base align
+ virtual UINT_32 HwlComputeHtileBaseAlign(
+ BOOL_32 isTcCompatible, BOOL_32 isLinear, ADDR_TILEINFO* pTileInfo) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE bpp
+ virtual UINT_32 HwlComputeHtileBpp(
+ BOOL_32 isWidth8, BOOL_32 isHeight8) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE bytes
+ virtual UINT_64 HwlComputeHtileBytes(
+ UINT_32 pitch, UINT_32 height, UINT_32 bpp,
+ BOOL_32 isLinear, UINT_32 numSlices, UINT_64* pSliceBytes, UINT_32 baseAlign) const = 0;
+
+ /// Pure Virtual function for Hwl computing FMASK info
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskInfo(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) = 0;
+
+ /// Pure Virtual function for Hwl FMASK address from coord
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskAddrFromCoord(
+ const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl FMASK coord from address
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskCoordFromAddr(
+ const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl convert tile info from real value to HW value
+ virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
+ const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
+ ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl compute mipmap info
+ virtual BOOL_32 HwlComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
+
+ /// Pure Virtual function for Hwl compute max cmask blockMax value
+ virtual BOOL_32 HwlGetMaxCmaskBlockMax() const = 0;
+
+ /// Pure Virtual function for Hwl compute fmask bits
+ virtual UINT_32 HwlComputeFmaskBits(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ UINT_32* pNumSamples) const = 0;
+
+ /// Virtual function to get index (not pure then no need to implement this in all hwls
+ virtual ADDR_E_RETURNCODE HwlGetTileIndex(
+ const ADDR_GET_TILEINDEX_INPUT* pIn,
+ ADDR_GET_TILEINDEX_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ /// Virtual function for Hwl to compute Dcc info
+ virtual ADDR_E_RETURNCODE HwlComputeDccInfo(
+ const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
+ ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ /// Virtual function to get cmask address for tc compatible cmask
+ virtual ADDR_E_RETURNCODE HwlComputeCmaskAddrFromCoord(
+ const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ // Compute attributes
+
+ // HTILE
+ UINT_32 ComputeHtileInfo(
+ ADDR_HTILE_FLAGS flags,
+ UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices,
+ BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
+ ADDR_TILEINFO* pTileInfo,
+ UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pHtileBytes,
+ UINT_32* pMacroWidth = NULL, UINT_32* pMacroHeight = NULL,
+ UINT_64* pSliceSize = NULL, UINT_32* pBaseAlign = NULL) const;
+
+ // CMASK
+ ADDR_E_RETURNCODE ComputeCmaskInfo(
+ ADDR_CMASK_FLAGS flags,
+ UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices, BOOL_32 isLinear,
+ ADDR_TILEINFO* pTileInfo, UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pCmaskBytes,
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight, UINT_64* pSliceSize = NULL,
+ UINT_32* pBaseAlign = NULL, UINT_32* pBlockMax = NULL) const;
+
+ virtual VOID HwlComputeTileDataWidthAndHeightLinear(
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight,
+ UINT_32 bpp, ADDR_TILEINFO* pTileInfo) const;
+
+ // CMASK & HTILE addressing
+ virtual UINT_64 HwlComputeXmaskAddrFromCoord(
+ UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice,
+ UINT_32 numSlices, UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8,
+ BOOL_32 isHeight8, ADDR_TILEINFO* pTileInfo,
+ UINT_32* bitPosition) const;
+
+ virtual VOID HwlComputeXmaskCoordFromAddr(
+ UINT_64 addr, UINT_32 bitPosition, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
+ ADDR_TILEINFO* pTileInfo, UINT_32* pX, UINT_32* pY, UINT_32* pSlice) const;
+
+ // Surface mipmap
+ VOID ComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
+
+ /// Pure Virtual function for Hwl checking degrade for base level
+ virtual BOOL_32 HwlDegradeBaseLevel(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
+
+ virtual BOOL_32 HwlOverrideTileMode(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ AddrTileMode* pTileMode,
+ AddrTileType* pTileType) const
+ {
+ // not supported in hwl layer, FALSE for not-overrided
+ return FALSE;
+ }
+
+ AddrTileMode DegradeLargeThickTile(AddrTileMode tileMode, UINT_32 bpp) const;
+
+ VOID PadDimensions(
+ AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
+ UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
+ UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
+ UINT_32* pSlices, UINT_32 sliceAlign) const;
+
+ virtual VOID HwlPadDimensions(
+ AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
+ UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
+ UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
+ UINT_32* pSlices, UINT_32 sliceAlign) const
+ {
+ }
+
+ //
+ // Addressing shared for linear/1D tiling
+ //
+ UINT_64 ComputeSurfaceAddrFromCoordLinear(
+ UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
+ UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32* pBitPosition) const;
+
+ VOID ComputeSurfaceCoordFromAddrLinear(
+ UINT_64 addr, UINT_32 bitPosition, UINT_32 bpp,
+ UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample) const;
+
+ VOID ComputeSurfaceCoordFromAddrMicroTiled(
+ UINT_64 addr, UINT_32 bitPosition,
+ UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
+ AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
+ AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const;
+
+ UINT_32 ComputePixelIndexWithinMicroTile(
+ UINT_32 x, UINT_32 y, UINT_32 z,
+ UINT_32 bpp, AddrTileMode tileMode, AddrTileType microTileType) const;
+
+ /// Pure Virtual function for Hwl computing coord from offset inside micro tile
+ virtual VOID HwlComputePixelCoordFromOffset(
+ UINT_32 offset, UINT_32 bpp, UINT_32 numSamples,
+ AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
+ AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const = 0;
+
+ //
+ // Addressing shared by all
+ //
+ virtual UINT_32 HwlGetPipes(
+ const ADDR_TILEINFO* pTileInfo) const;
+
+ UINT_32 ComputePipeFromAddr(
+ UINT_64 addr, UINT_32 numPipes) const;
+
+ /// Pure Virtual function for Hwl computing pipe from coord
+ virtual UINT_32 ComputePipeFromCoord(
+ UINT_32 x, UINT_32 y, UINT_32 slice, AddrTileMode tileMode,
+ UINT_32 pipeSwizzle, BOOL_32 flags, ADDR_TILEINFO* pTileInfo) const = 0;
+
+ /// Pure Virtual function for Hwl computing coord Y for 8 pipe cmask/htile
+ virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
+ UINT_32 pipe, UINT_32 x) const = 0;
+
+ //
+ // Misc helper
+ //
+ static const AddrTileModeFlags m_modeFlags[ADDR_TM_COUNT];
+
+ static UINT_32 ComputeSurfaceThickness(
+ AddrTileMode tileMode);
+
+ // Checking tile mode
+ static BOOL_32 IsMacroTiled(AddrTileMode tileMode);
+ static BOOL_32 IsMacro3dTiled(AddrTileMode tileMode);
+ static BOOL_32 IsLinear(AddrTileMode tileMode);
+ static BOOL_32 IsMicroTiled(AddrTileMode tileMode);
+ static BOOL_32 IsPrtTileMode(AddrTileMode tileMode);
+ static BOOL_32 IsPrtNoRotationTileMode(AddrTileMode tileMode);
+
+ /// Return TRUE if tile info is needed
+ BOOL_32 UseTileInfo() const
+ {
+ return !m_configFlags.ignoreTileInfo;
+ }
+
+ /// Adjusts pitch alignment for flipping surface
+ VOID AdjustPitchAlignment(
+ ADDR_SURFACE_FLAGS flags, UINT_32* pPitchAlign) const;
+
+ /// Overwrite tile config according to tile index
+ virtual ADDR_E_RETURNCODE HwlSetupTileCfg(
+ INT_32 index, INT_32 macroModeIndex,
+ ADDR_TILEINFO* pInfo, AddrTileMode* mode = NULL, AddrTileType* type = NULL) const;
+
+ /// Overwrite macro tile config according to tile index
+ virtual INT_32 HwlComputeMacroModeIndex(
+ INT_32 index, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 numSamples,
+ ADDR_TILEINFO* pTileInfo, AddrTileMode *pTileMode = NULL, AddrTileType *pTileType = NULL
+ ) const
+ {
+ return TileIndexNoMacroIndex;
+ }
+
+ /// Pre-handler of 3x pitch (96 bit) adjustment
+ virtual UINT_32 HwlPreHandleBaseLvl3xPitch(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
+ /// Post-handler of 3x pitch adjustment
+ virtual UINT_32 HwlPostHandleBaseLvl3xPitch(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
+ /// Check miplevel after surface adjustment
+ ADDR_E_RETURNCODE PostComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ /// Quad buffer stereo support, has its implementation in ind. layer
+ virtual BOOL_32 ComputeQbStereoInfo(
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ /// Pure virutual function to compute stereo bank swizzle for right eye
+ virtual UINT_32 HwlComputeQbStereoRightSwizzle(
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
+
+private:
+ // Disallow the copy constructor
+ AddrLib1(const AddrLib1& a);
+
+ // Disallow the assignment operator
+ AddrLib1& operator=(const AddrLib1& a);
+
+ UINT_32 ComputeCmaskBaseAlign(
+ ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const;
+
+ UINT_64 ComputeCmaskBytes(
+ UINT_32 pitch, UINT_32 height, UINT_32 numSlices) const;
+
+ //
+ // CMASK/HTILE shared methods
+ //
+ VOID ComputeTileDataWidthAndHeight(
+ UINT_32 bpp, UINT_32 cacheBits, ADDR_TILEINFO* pTileInfo,
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight) const;
+
+ UINT_32 ComputeXmaskCoordYFromPipe(
+ UINT_32 pipe, UINT_32 x) const;
+
+ BOOL_32 OptimizeTileMode(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, AddrTileMode* pTileMode) const;
+};
#endif
+
diff --git a/src/amd/addrlib/r800/ciaddrlib.h b/src/amd/addrlib/r800/ciaddrlib.h
index 5630959..90d6c1b 100644
--- a/src/amd/addrlib/r800/ciaddrlib.h
+++ b/src/amd/addrlib/r800/ciaddrlib.h
@@ -27,21 +27,21 @@
/**
***************************************************************************************************
* @file ciaddrlib.h
* @brief Contains the CiAddrLib class definition.
***************************************************************************************************
*/
#ifndef __CI_ADDR_LIB_H__
#define __CI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "siaddrlib.h"
/**
***************************************************************************************************
* @brief CI specific settings structure.
***************************************************************************************************
*/
struct CIChipSettings
{
struct
@@ -82,21 +82,21 @@ public:
{
return new(pClient) CiAddrLib(pClient);
}
private:
CiAddrLib(const AddrClient* pClient);
virtual ~CiAddrLib();
protected:
- // Hwl interface - defined in AddrLib
+ // Hwl interface - defined in AddrLib1
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
virtual ADDR_E_RETURNCODE HwlComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
virtual AddrChipFamily HwlConvertChipFamily(
UINT_32 uChipFamily, UINT_32 uChipRevision);
diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp
index 2085dc5..b7c6995 100644
--- a/src/amd/addrlib/r800/egbaddrlib.cpp
+++ b/src/amd/addrlib/r800/egbaddrlib.cpp
@@ -38,21 +38,21 @@
* EgBasedAddrLib::EgBasedAddrLib
*
* @brief
* Constructor
*
* @note
*
***************************************************************************************************
*/
EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) :
- AddrLib(pClient),
+ AddrLib1(pClient),
m_ranks(0),
m_logicalBanks(0),
m_bankInterleave(1)
{
}
/**
***************************************************************************************************
* EgBasedAddrLib::~EgBasedAddrLib
*
diff --git a/src/amd/addrlib/r800/egbaddrlib.h b/src/amd/addrlib/r800/egbaddrlib.h
index ca1d07d..b8eabd8 100644
--- a/src/amd/addrlib/r800/egbaddrlib.h
+++ b/src/amd/addrlib/r800/egbaddrlib.h
@@ -27,21 +27,21 @@
/**
***************************************************************************************************
* @file egbaddrlib.h
* @brief Contains the EgBasedAddrLib class definition.
***************************************************************************************************
*/
#ifndef __EG_BASED_ADDR_LIB_H__
#define __EG_BASED_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
/// Structures for functions
struct CoordFromBankPipe
{
UINT_32 xBits : 3;
UINT_32 yBits : 4;
UINT_32 xBit3 : 1;
UINT_32 xBit4 : 1;
@@ -51,21 +51,21 @@ struct CoordFromBankPipe
UINT_32 yBit5 : 1;
UINT_32 yBit6 : 1;
};
/**
***************************************************************************************************
* @brief This class is the Evergreen based address library
* @note Abstract class
***************************************************************************************************
*/
-class EgBasedAddrLib : public AddrLib
+class EgBasedAddrLib : public AddrLib1
{
protected:
EgBasedAddrLib(const AddrClient* pClient);
virtual ~EgBasedAddrLib();
public:
/// Surface info functions
// NOTE: DispatchComputeSurfaceInfo using TileInfo takes both an input and an output.
diff --git a/src/amd/addrlib/r800/siaddrlib.cpp b/src/amd/addrlib/r800/siaddrlib.cpp
index 4d791ce..2b7e9c9 100644
--- a/src/amd/addrlib/r800/siaddrlib.cpp
+++ b/src/amd/addrlib/r800/siaddrlib.cpp
@@ -1247,21 +1247,21 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
{
ADDR_ASSERT(pIn->width == expPitch);
// From SI, if pow2Pad is 1 the pitch is expanded 3x first, then padded to pow2, so nothing to
// do here
if (!pIn->flags.pow2Pad)
{
- AddrLib::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
+ AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
}
else
{
ADDR_ASSERT(IsPow2(expPitch));
}
return expPitch;
}
/**
@@ -1280,21 +1280,21 @@ UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch(
UINT_32 expPitch ///< [in] pitch
) const
{
/**
* @note The pitch will be divided by 3 in the end so the value will look odd but h/w should
* be able to compute a correct pitch from it as h/w address library is doing the job.
*/
// From SI, the pitch is expanded 3x first, then padded to pow2, so no special handler here
if (!pIn->flags.pow2Pad)
{
- AddrLib::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
+ AddrLib1::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
}
return expPitch;
}
/**
***************************************************************************************************
* SiAddrLib::HwlGetPitchAlignmentMicroTiled
*
* @brief
diff --git a/src/amd/addrlib/r800/siaddrlib.h b/src/amd/addrlib/r800/siaddrlib.h
index 04f7adc..ba1d4b5 100644
--- a/src/amd/addrlib/r800/siaddrlib.h
+++ b/src/amd/addrlib/r800/siaddrlib.h
@@ -27,21 +27,21 @@
/**
***************************************************************************************************
* @file siaddrlib.h
* @brief Contains the R800AddrLib class definition.
***************************************************************************************************
*/
#ifndef __SI_ADDR_LIB_H__
#define __SI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "egbaddrlib.h"
/**
***************************************************************************************************
* @brief Describes the information in tile mode table
***************************************************************************************************
*/
struct ADDR_TILECONFIG
{
AddrTileMode mode;
@@ -80,21 +80,21 @@ public:
/// Creates SIAddrLib object
static AddrLib* CreateObj(const AddrClient* pClient)
{
return new(pClient) SiAddrLib(pClient);
}
protected:
SiAddrLib(const AddrClient* pClient);
virtual ~SiAddrLib();
- // Hwl interface - defined in AddrLib
+ // Hwl interface - defined in AddrLib1
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
virtual UINT_64 HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 numSlices,
--
2.7.4
More information about the mesa-dev
mailing list