diff options
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/addrlib/addrinterface.cpp | 66 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrcommon.h | 197 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrelemlib.cpp | 167 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrelemlib.h | 67 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrlib.cpp | 71 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrlib.h | 69 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrlib1.cpp | 284 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrlib1.h | 29 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrobject.cpp | 78 | ||||
-rw-r--r-- | src/amd/addrlib/core/addrobject.h | 38 | ||||
-rw-r--r-- | src/amd/addrlib/r800/ciaddrlib.cpp | 205 | ||||
-rw-r--r-- | src/amd/addrlib/r800/ciaddrlib.h | 28 | ||||
-rw-r--r-- | src/amd/addrlib/r800/egbaddrlib.cpp | 261 | ||||
-rw-r--r-- | src/amd/addrlib/r800/egbaddrlib.h | 16 | ||||
-rw-r--r-- | src/amd/addrlib/r800/siaddrlib.cpp | 245 | ||||
-rw-r--r-- | src/amd/addrlib/r800/siaddrlib.h | 40 |
16 files changed, 969 insertions, 892 deletions
diff --git a/src/amd/addrlib/addrinterface.cpp b/src/amd/addrlib/addrinterface.cpp index c3eb598e34a..efb6ff50841 100644 --- a/src/amd/addrlib/addrinterface.cpp +++ b/src/amd/addrlib/addrinterface.cpp @@ -35,6 +35,8 @@ #include "addrcommon.h" +using namespace Addr; + /////////////////////////////////////////////////////////////////////////////////////////////////// // Create/Destroy/Config functions /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -56,7 +58,7 @@ ADDR_E_RETURNCODE ADDR_API AddrCreate( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - returnCode = AddrLib::Create(pAddrCreateIn, pAddrCreateOut); + returnCode = Lib::Create(pAddrCreateIn, pAddrCreateOut); return returnCode; } @@ -81,7 +83,7 @@ ADDR_E_RETURNCODE ADDR_API AddrDestroy( if (hLib) { - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Lib* pLib = Lib::GetLib(hLib); pLib->Destroy(); } else @@ -114,7 +116,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] surface information ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) ///< [out] surface parameters and alignments { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -148,7 +150,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceAddrFromCoord( const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] surface info and coordinates ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] surface address { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -180,7 +182,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceCoordFromAddr( const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] surface info and address ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) ///< [out] coordinates { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -218,7 +220,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileInfo( const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] Htile information ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) ///< [out] Htile pitch, height and size in bytes { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -250,7 +252,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileAddrFromCoord( const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] Htile info and coordinates ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Htile address { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -283,7 +285,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileCoordFromAddr( const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] Htile info and address ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) ///< [out] Htile coordinates { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -322,7 +324,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskInfo( 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 { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -354,7 +356,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskAddrFromCoord( const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Cmask info and coordinates ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Cmask address { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -387,7 +389,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskCoordFromAddr( const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Cmask info and address ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Cmask coordinates { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -425,7 +427,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] Fmask information ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) ///< [out] Fmask pitch and height { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -457,7 +459,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskAddrFromCoord( const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Fmask info and coordinates ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Fmask address { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -489,7 +491,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskCoordFromAddr( const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Fmask info and address ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Fmask coordinates { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -527,7 +529,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeDccInfo( { ADDR_E_RETURNCODE returnCode; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -560,7 +562,7 @@ UINT_32 ADDR_API AddrGetVersion(ADDR_HANDLE hLib) { UINT_32 version = 0; - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Addr::Lib* pLib = Lib::GetLib(hLib); ADDR_ASSERT(pLib != NULL); @@ -584,7 +586,7 @@ BOOL_32 ADDR_API AddrUseTileIndex(ADDR_HANDLE hLib) { BOOL_32 useTileIndex = FALSE; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_ASSERT(pLib != NULL); @@ -608,7 +610,7 @@ BOOL_32 ADDR_API AddrUseCombinedSwizzle(ADDR_HANDLE hLib) { BOOL_32 useCombinedSwizzle = FALSE; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_ASSERT(pLib != NULL); @@ -637,7 +639,7 @@ ADDR_E_RETURNCODE ADDR_API AddrExtractBankPipeSwizzle( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -668,7 +670,7 @@ ADDR_E_RETURNCODE ADDR_API AddrCombineBankPipeSwizzle( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -699,7 +701,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSliceSwizzle( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -730,7 +732,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeBaseSwizzle( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -763,7 +765,7 @@ ADDR_E_RETURNCODE ADDR_API ElemFlt32ToDepthPixel( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Lib* pLib = Lib::GetLib(hLib); if (pLib != NULL) { @@ -796,7 +798,7 @@ ADDR_E_RETURNCODE ADDR_API ElemFlt32ToColorPixel( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Lib* pLib = Lib::GetLib(hLib); if (pLib != NULL) { @@ -826,7 +828,7 @@ BOOL_32 ADDR_API ElemGetExportNorm( ADDR_HANDLE hLib, ///< addrlib handle const ELEM_GETEXPORTNORM_INPUT* pIn) ///< [in] input structure { - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Addr::Lib* pLib = Lib::GetLib(hLib); BOOL_32 enabled = FALSE; ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -861,7 +863,7 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileInfoToHW( const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] tile info with real value ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) ///< [out] tile info with HW register value { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -893,7 +895,7 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex( const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input - tile index ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -925,7 +927,7 @@ ADDR_E_RETURNCODE ADDR_API AddrGetMacroModeIndex( const ADDR_GET_MACROMODEINDEX_INPUT* pIn, ///< [in] input ADDR_GET_MACROMODEINDEX_OUTPUT* pOut) ///< [out] macro mode index { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode; @@ -957,7 +959,7 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex1( const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input - tile index ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -992,7 +994,7 @@ ADDR_E_RETURNCODE ADDR_API AddrGetTileIndex( const ADDR_GET_TILEINDEX_INPUT* pIn, ADDR_GET_TILEINDEX_OUTPUT* pOut) { - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -1024,7 +1026,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputePrtInfo( { ADDR_E_RETURNCODE returnCode = ADDR_OK; - AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib); + V1::Lib* pLib = V1::Lib::GetLib(hLib); if (pLib != NULL) { @@ -1053,7 +1055,7 @@ ADDR_E_RETURNCODE ADDR_API AddrGetMaxAlignments( ADDR_HANDLE hLib, ///< address lib handle ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) ///< [out] output structure { - AddrLib* pLib = AddrLib::GetAddrLib(hLib); + Addr::Lib* pLib = Lib::GetLib(hLib); ADDR_E_RETURNCODE returnCode = ADDR_OK; diff --git a/src/amd/addrlib/core/addrcommon.h b/src/amd/addrlib/core/addrcommon.h index 5c17f80caf7..9b0cc6dafa9 100644 --- a/src/amd/addrlib/core/addrcommon.h +++ b/src/amd/addrlib/core/addrcommon.h @@ -47,99 +47,6 @@ #endif /////////////////////////////////////////////////////////////////////////////////////////////////// -// Common constants -/////////////////////////////////////////////////////////////////////////////////////////////////// -static const UINT_32 MicroTileWidth = 8; ///< Micro tile width, for 1D and 2D tiling -static const UINT_32 MicroTileHeight = 8; ///< Micro tile height, for 1D and 2D tiling -static const UINT_32 ThickTileThickness = 4; ///< Micro tile thickness, for THICK modes -static const UINT_32 XThickTileThickness = 8; ///< Extra thick tiling thickness -static const UINT_32 PowerSaveTileBytes = 64; ///< Nuber of bytes per tile for power save 64 -static const UINT_32 CmaskCacheBits = 1024; ///< Number of bits for CMASK cache -static const UINT_32 CmaskElemBits = 4; ///< Number of bits for CMASK element -static const UINT_32 HtileCacheBits = 16384; ///< Number of bits for HTILE cache 512*32 - -static const UINT_32 MicroTilePixels = MicroTileWidth * MicroTileHeight; - -static const INT_32 TileIndexInvalid = TILEINDEX_INVALID; -static const INT_32 TileIndexLinearGeneral = TILEINDEX_LINEAR_GENERAL; -static const INT_32 TileIndexNoMacroIndex = -3; - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Common macros -/////////////////////////////////////////////////////////////////////////////////////////////////// -#define BITS_PER_BYTE 8 -#define BITS_TO_BYTES(x) ( ((x) + (BITS_PER_BYTE-1)) / BITS_PER_BYTE ) -#define BYTES_TO_BITS(x) ( (x) * BITS_PER_BYTE ) - -/// Helper macros to select a single bit from an int (undefined later in section) -#define _BIT(v,b) (((v) >> (b) ) & 1) - -/** -**************************************************************************************************** -* @brief Enums to identify AddrLib type -**************************************************************************************************** -*/ -enum AddrLibClass -{ - BASE_ADDRLIB = 0x0, - R600_ADDRLIB = 0x6, - R800_ADDRLIB = 0x8, - SI_ADDRLIB = 0xa, - CI_ADDRLIB = 0xb, -}; - -/** -**************************************************************************************************** -* AddrChipFamily -* -* @brief -* Neutral enums that specifies chip family. -* -**************************************************************************************************** -*/ -enum AddrChipFamily -{ - ADDR_CHIP_FAMILY_IVLD, ///< Invalid family - ADDR_CHIP_FAMILY_R6XX, - ADDR_CHIP_FAMILY_R7XX, - ADDR_CHIP_FAMILY_R8XX, - ADDR_CHIP_FAMILY_NI, - ADDR_CHIP_FAMILY_SI, - ADDR_CHIP_FAMILY_CI, - ADDR_CHIP_FAMILY_VI, -}; - -/** -**************************************************************************************************** -* AddrConfigFlags -* -* @brief -* This structure is used to set configuration flags. -**************************************************************************************************** -*/ -union AddrConfigFlags -{ - struct - { - /// These flags are set up internally thru AddrLib::Create() based on ADDR_CREATE_FLAGS - UINT_32 optimalBankSwap : 1; ///< New bank tiling for RV770 only - UINT_32 noCubeMipSlicesPad : 1; ///< Disables faces padding for cubemap mipmaps - UINT_32 fillSizeFields : 1; ///< If clients fill size fields in all input and - /// output structure - UINT_32 ignoreTileInfo : 1; ///< Don't use tile info structure - UINT_32 useTileIndex : 1; ///< Make tileIndex field in input valid - UINT_32 useCombinedSwizzle : 1; ///< Use combined swizzle - UINT_32 checkLast2DLevel : 1; ///< Check the last 2D mip sub level - UINT_32 useHtileSliceAlign : 1; ///< Do htile single slice alignment - UINT_32 allowLargeThickTile : 1; ///< Allow 64*thickness*bytesPerPixel > rowSize - UINT_32 disableLinearOpt : 1; ///< Disallow tile modes to be optimized to linear - UINT_32 reserved : 22; ///< Reserved bits for future use - }; - - UINT_32 value; -}; - -/////////////////////////////////////////////////////////////////////////////////////////////////// // Platform specific debug break defines /////////////////////////////////////////////////////////////////////////////////////////////////// #if DEBUG @@ -186,7 +93,7 @@ union AddrConfigFlags /////////////////////////////////////////////////////////////////////////////////////////////////// #if DEBUG -#define ADDR_PRNT(a) AddrObject::DebugPrint a +#define ADDR_PRNT(a) Object::DebugPrint a /// @brief Macro for reporting informational messages /// @ingroup util @@ -256,6 +163,106 @@ union AddrConfigFlags #endif // DEBUG /////////////////////////////////////////////////////////////////////////////////////////////////// +namespace Addr +{ + +namespace V1 +{ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Common constants +/////////////////////////////////////////////////////////////////////////////////////////////////// +static const UINT_32 MicroTileWidth = 8; ///< Micro tile width, for 1D and 2D tiling +static const UINT_32 MicroTileHeight = 8; ///< Micro tile height, for 1D and 2D tiling +static const UINT_32 ThickTileThickness = 4; ///< Micro tile thickness, for THICK modes +static const UINT_32 XThickTileThickness = 8; ///< Extra thick tiling thickness +static const UINT_32 PowerSaveTileBytes = 64; ///< Nuber of bytes per tile for power save 64 +static const UINT_32 CmaskCacheBits = 1024; ///< Number of bits for CMASK cache +static const UINT_32 CmaskElemBits = 4; ///< Number of bits for CMASK element +static const UINT_32 HtileCacheBits = 16384; ///< Number of bits for HTILE cache 512*32 + +static const UINT_32 MicroTilePixels = MicroTileWidth * MicroTileHeight; + +static const INT_32 TileIndexInvalid = TILEINDEX_INVALID; +static const INT_32 TileIndexLinearGeneral = TILEINDEX_LINEAR_GENERAL; +static const INT_32 TileIndexNoMacroIndex = -3; + +} // V1 + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Common macros +/////////////////////////////////////////////////////////////////////////////////////////////////// +#define BITS_PER_BYTE 8 +#define BITS_TO_BYTES(x) ( ((x) + (BITS_PER_BYTE-1)) / BITS_PER_BYTE ) +#define BYTES_TO_BITS(x) ( (x) * BITS_PER_BYTE ) + +/// Helper macros to select a single bit from an int (undefined later in section) +#define _BIT(v,b) (((v) >> (b) ) & 1) + +/** +**************************************************************************************************** +* @brief Enums to identify AddrLib type +**************************************************************************************************** +*/ +enum LibClass +{ + BASE_ADDRLIB = 0x0, + R600_ADDRLIB = 0x6, + R800_ADDRLIB = 0x8, + SI_ADDRLIB = 0xa, + CI_ADDRLIB = 0xb, +}; + +/** +**************************************************************************************************** +* ChipFamily +* +* @brief +* Neutral enums that specifies chip family. +* +**************************************************************************************************** +*/ +enum ChipFamily +{ + ADDR_CHIP_FAMILY_IVLD, ///< Invalid family + ADDR_CHIP_FAMILY_R6XX, + ADDR_CHIP_FAMILY_R7XX, + ADDR_CHIP_FAMILY_R8XX, + ADDR_CHIP_FAMILY_NI, + ADDR_CHIP_FAMILY_SI, + ADDR_CHIP_FAMILY_CI, + ADDR_CHIP_FAMILY_VI, +}; + +/** +**************************************************************************************************** +* ConfigFlags +* +* @brief +* This structure is used to set configuration flags. +**************************************************************************************************** +*/ +union ConfigFlags +{ + struct + { + /// These flags are set up internally thru AddrLib::Create() based on ADDR_CREATE_FLAGS + UINT_32 optimalBankSwap : 1; ///< New bank tiling for RV770 only + UINT_32 noCubeMipSlicesPad : 1; ///< Disables faces padding for cubemap mipmaps + UINT_32 fillSizeFields : 1; ///< If clients fill size fields in all input and + /// output structure + UINT_32 ignoreTileInfo : 1; ///< Don't use tile info structure + UINT_32 useTileIndex : 1; ///< Make tileIndex field in input valid + UINT_32 useCombinedSwizzle : 1; ///< Use combined swizzle + UINT_32 checkLast2DLevel : 1; ///< Check the last 2D mip sub level + UINT_32 useHtileSliceAlign : 1; ///< Do htile single slice alignment + UINT_32 allowLargeThickTile : 1; ///< Allow 64*thickness*bytesPerPixel > rowSize + UINT_32 disableLinearOpt : 1; ///< Disallow tile modes to be optimized to linear + UINT_32 reserved : 22; ///< Reserved bits for future use + }; + + UINT_32 value; +}; + /////////////////////////////////////////////////////////////////////////////////////////////////// // Misc helper functions //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -596,5 +603,7 @@ static inline ADDR_CHANNEL_SETTING InitChannel( return t; } +} // Addr + #endif // __ADDR_COMMON_H__ diff --git a/src/amd/addrlib/core/addrelemlib.cpp b/src/amd/addrlib/core/addrelemlib.cpp index 2ec518f6687..b894f49cca6 100644 --- a/src/amd/addrlib/core/addrelemlib.cpp +++ b/src/amd/addrlib/core/addrelemlib.cpp @@ -34,10 +34,12 @@ #include "addrelemlib.h" #include "addrlib.h" +namespace Addr +{ /** **************************************************************************************************** -* AddrElemLib::AddrElemLib +* ElemLib::ElemLib * * @brief * constructor @@ -46,12 +48,13 @@ * N/A **************************************************************************************************** */ -AddrElemLib::AddrElemLib( - AddrLib* const pAddrLib) : ///< [in] Parent addrlib instance pointer - AddrObject(pAddrLib->GetClient()), +ElemLib::ElemLib( + Lib* pAddrLib) ///< [in] Parent addrlib instance pointer + : + Object(pAddrLib->GetClient()), m_pAddrLib(pAddrLib) { - switch (m_pAddrLib->GetAddrChipFamily()) + switch (m_pAddrLib->GetChipFamily()) { case ADDR_CHIP_FAMILY_R6XX: m_depthPlanarType = ADDR_DEPTH_PLANAR_R600; @@ -76,7 +79,7 @@ AddrElemLib::AddrElemLib( /** **************************************************************************************************** -* AddrElemLib::~AddrElemLib +* ElemLib::~ElemLib * * @brief * destructor @@ -85,13 +88,13 @@ AddrElemLib::AddrElemLib( * N/A **************************************************************************************************** */ -AddrElemLib::~AddrElemLib() +ElemLib::~ElemLib() { } /** **************************************************************************************************** -* AddrElemLib::Create +* ElemLib::Create * * @brief * Creates and initializes AddrLib object. @@ -100,21 +103,21 @@ AddrElemLib::~AddrElemLib() * Returns point to ADDR_CREATEINFO if successful. **************************************************************************************************** */ -AddrElemLib* AddrElemLib::Create( - const AddrLib* const pAddrLib) ///< [in] Pointer of parent AddrLib instance +ElemLib* ElemLib::Create( + const Lib* pAddrLib) ///< [in] Pointer of parent AddrLib instance { - AddrElemLib* pElemLib = NULL; + ElemLib* pElemLib = NULL; if (pAddrLib) { - pElemLib = new(pAddrLib->GetClient()) AddrElemLib(const_cast<AddrLib* const>(pAddrLib)); + pElemLib = new(pAddrLib->GetClient()) ElemLib(const_cast<Lib* const>(pAddrLib)); } return pElemLib; } /************************************************************************************************** -* AddrElemLib::Flt32sToInt32s +* ElemLib::Flt32sToInt32s * * @brief * Convert a ADDR_FLT_32 value to Int32 value @@ -123,10 +126,10 @@ AddrElemLib* AddrElemLib::Create( * N/A **************************************************************************************************** */ -VOID AddrElemLib::Flt32sToInt32s( +VOID ElemLib::Flt32sToInt32s( ADDR_FLT_32 value, ///< [in] ADDR_FLT_32 value UINT_32 bits, ///< [in] nubmer of bits in value - AddrNumberType numberType, ///< [in] the type of number + NumberType numberType, ///< [in] the type of number UINT_32* pResult) ///< [out] Int32 value { UINT_8 round = 128; //ADDR_ROUND_BY_HALF @@ -304,7 +307,7 @@ VOID AddrElemLib::Flt32sToInt32s( /** **************************************************************************************************** -* AddrElemLib::Int32sToPixel +* ElemLib::Int32sToPixel * * @brief * Pack 32-bit integer values into an uncompressed pixel, @@ -320,12 +323,12 @@ VOID AddrElemLib::Flt32sToInt32s( * if called on compressed pixel. **************************************************************************************************** */ -VOID AddrElemLib::Int32sToPixel( +VOID ElemLib::Int32sToPixel( UINT_32 numComps, ///< [in] number of components UINT_32* pComps, ///< [in] compnents UINT_32* pCompBits, ///< [in] total bits in each component UINT_32* pCompStart, ///< [in] the first bit position of each component - ADDR_COMPONENT_FLAGS properties, ///< [in] properties about byteAligned, exportNorm + ComponentFlags properties, ///< [in] properties about byteAligned, exportNorm UINT_32 resultBits, ///< [in] result bits: total bpp after decompression UINT_8* pPixel) ///< [out] a depth/stencil pixel value { @@ -386,7 +389,7 @@ VOID AddrElemLib::Int32sToPixel( * N/A **************************************************************************************************** */ -VOID AddrElemLib::Flt32ToDepthPixel( +VOID ElemLib::Flt32ToDepthPixel( AddrDepthFormat format, ///< [in] Depth format const ADDR_FLT_32 comps[2], ///< [in] two components of depth UINT_8* pPixel ///< [out] depth pixel value @@ -394,10 +397,10 @@ VOID AddrElemLib::Flt32ToDepthPixel( { UINT_32 i; UINT_32 values[2]; - ADDR_COMPONENT_FLAGS properties; // byteAligned, exportNorm - UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression + ComponentFlags properties; // byteAligned, exportNorm + UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression - ADDR_PIXEL_FORMATINFO fmt; + PixelFormatInfo fmt; // get type for each component PixGetDepthCompInfo(format, &fmt); @@ -455,7 +458,7 @@ VOID AddrElemLib::Flt32ToDepthPixel( * N/A **************************************************************************************************** */ -VOID AddrElemLib::Flt32ToColorPixel( +VOID ElemLib::Flt32ToColorPixel( AddrColorFormat format, ///< [in] Color format AddrSurfaceNumber surfNum, ///< [in] Surface number AddrSurfaceSwap surfSwap, ///< [in] Surface swap @@ -463,14 +466,14 @@ VOID AddrElemLib::Flt32ToColorPixel( UINT_8* pPixel ///< [out] a red/green/blue/alpha pixel value ) const { - ADDR_PIXEL_FORMATINFO pixelInfo; + PixelFormatInfo pixelInfo; UINT_32 i; UINT_32 values[4]; - ADDR_COMPONENT_FLAGS properties; // byteAligned, exportNorm - UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression + ComponentFlags properties; // byteAligned, exportNorm + UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression - memset(&pixelInfo, 0, sizeof(ADDR_PIXEL_FORMATINFO)); + memset(&pixelInfo, 0, sizeof(PixelFormatInfo)); PixGetColorCompInfo(format, surfNum, surfSwap, &pixelInfo); @@ -532,7 +535,7 @@ VOID AddrElemLib::Flt32ToColorPixel( /** **************************************************************************************************** -* AddrElemLib::GetCompType +* ElemLib::GetCompType * * @brief * Fill per component info @@ -542,10 +545,10 @@ VOID AddrElemLib::Flt32ToColorPixel( * **************************************************************************************************** */ -VOID AddrElemLib::GetCompType( - AddrColorFormat format, ///< [in] surface format - AddrSurfaceNumber numType, ///< [in] number type - ADDR_PIXEL_FORMATINFO* pInfo) ///< [in][out] per component info out +VOID ElemLib::GetCompType( + AddrColorFormat format, ///< [in] surface format + AddrSurfaceNumber numType, ///< [in] number type + PixelFormatInfo* pInfo) ///< [in][out] per component info out { BOOL_32 handled = FALSE; @@ -705,7 +708,7 @@ VOID AddrElemLib::GetCompType( /** **************************************************************************************************** -* AddrElemLib::GetCompSwap +* ElemLib::GetCompSwap * * @brief * Get components swapped for color surface @@ -715,9 +718,9 @@ VOID AddrElemLib::GetCompType( * **************************************************************************************************** */ -VOID AddrElemLib::GetCompSwap( - AddrSurfaceSwap swap, ///< [in] swap mode - ADDR_PIXEL_FORMATINFO* pInfo) ///< [in/out] output per component info +VOID ElemLib::GetCompSwap( + AddrSurfaceSwap swap, ///< [in] swap mode + PixelFormatInfo* pInfo) ///< [in/out] output per component info { switch (pInfo->comps) { @@ -795,7 +798,7 @@ VOID AddrElemLib::GetCompSwap( /** **************************************************************************************************** -* AddrElemLib::GetCompSwap +* ElemLib::GetCompSwap * * @brief * Get components swapped for color surface @@ -805,10 +808,10 @@ VOID AddrElemLib::GetCompSwap( * **************************************************************************************************** */ -VOID AddrElemLib::SwapComps( - UINT_32 c0, ///< [in] component index 0 - UINT_32 c1, ///< [in] component index 1 - ADDR_PIXEL_FORMATINFO* pInfo) ///< [in/out] output per component info +VOID ElemLib::SwapComps( + UINT_32 c0, ///< [in] component index 0 + UINT_32 c1, ///< [in] component index 1 + PixelFormatInfo* pInfo) ///< [in/out] output per component info { UINT_32 start; UINT_32 bits; @@ -824,7 +827,7 @@ VOID AddrElemLib::SwapComps( /** **************************************************************************************************** -* AddrElemLib::PixGetColorCompInfo +* ElemLib::PixGetColorCompInfo * * @brief * Get per component info for color surface @@ -834,11 +837,11 @@ VOID AddrElemLib::SwapComps( * **************************************************************************************************** */ -VOID AddrElemLib::PixGetColorCompInfo( - AddrColorFormat format, ///< [in] surface format, read from register - AddrSurfaceNumber number, ///< [in] pixel number type - AddrSurfaceSwap swap, ///< [in] component swap mode - ADDR_PIXEL_FORMATINFO* pInfo ///< [out] output per component info +VOID ElemLib::PixGetColorCompInfo( + AddrColorFormat format, ///< [in] surface format, read from register + AddrSurfaceNumber number, ///< [in] pixel number type + AddrSurfaceSwap swap, ///< [in] component swap mode + PixelFormatInfo* pInfo ///< [out] output per component info ) const { // 1. Get componet bits @@ -961,7 +964,7 @@ VOID AddrElemLib::PixGetColorCompInfo( /** **************************************************************************************************** -* AddrElemLib::PixGetDepthCompInfo +* ElemLib::PixGetDepthCompInfo * * @brief * Get per component info for depth surface @@ -971,9 +974,9 @@ VOID AddrElemLib::PixGetColorCompInfo( * **************************************************************************************************** */ -VOID AddrElemLib::PixGetDepthCompInfo( - AddrDepthFormat format, ///< [in] surface format, read from register - ADDR_PIXEL_FORMATINFO* pInfo ///< [out] output per component bits and type +VOID ElemLib::PixGetDepthCompInfo( + AddrDepthFormat format, ///< [in] surface format, read from register + PixelFormatInfo* pInfo ///< [out] output per component bits and type ) const { if (m_depthPlanarType == ADDR_DEPTH_PLANAR_R800) @@ -1059,7 +1062,7 @@ VOID AddrElemLib::PixGetDepthCompInfo( /** **************************************************************************************************** -* AddrElemLib::PixGetExportNorm +* ElemLib::PixGetExportNorm * * @brief * Check if fp16 export norm can be enabled. @@ -1069,7 +1072,7 @@ VOID AddrElemLib::PixGetDepthCompInfo( * **************************************************************************************************** */ -BOOL_32 AddrElemLib::PixGetExportNorm( +BOOL_32 ElemLib::PixGetExportNorm( AddrColorFormat colorFmt, ///< [in] surface format, read from register AddrSurfaceNumber numberFmt, ///< [in] pixel number type AddrSurfaceSwap swap ///< [in] components swap type @@ -1077,7 +1080,7 @@ BOOL_32 AddrElemLib::PixGetExportNorm( { BOOL_32 enabled = TRUE; - ADDR_PIXEL_FORMATINFO formatInfo; + PixelFormatInfo formatInfo; PixGetColorCompInfo(colorFmt, numberFmt, swap, &formatInfo); @@ -1111,7 +1114,7 @@ BOOL_32 AddrElemLib::PixGetExportNorm( /** **************************************************************************************************** -* AddrElemLib::AdjustSurfaceInfo +* ElemLib::AdjustSurfaceInfo * * @brief * Adjust bpp/base pitch/width/height according to elemMode and expandX/Y @@ -1120,8 +1123,8 @@ BOOL_32 AddrElemLib::PixGetExportNorm( * N/A **************************************************************************************************** */ -VOID AddrElemLib::AdjustSurfaceInfo( - AddrElemMode elemMode, ///< [in] element mode +VOID ElemLib::AdjustSurfaceInfo( + ElemMode elemMode, ///< [in] element mode UINT_32 expandX, ///< [in] decompression expansion factor in X UINT_32 expandY, ///< [in] decompression expansion factor in Y UINT_32* pBpp, ///< [in/out] bpp @@ -1199,7 +1202,7 @@ VOID AddrElemLib::AdjustSurfaceInfo( else { // Evergreen family workaround - if (bBCnFormat && (m_pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_R8XX)) + if (bBCnFormat && (m_pAddrLib->GetChipFamily() == ADDR_CHIP_FAMILY_R8XX)) { // For BCn we now pad it to POW2 at the beginning so it is safe to // divide by 4 directly @@ -1236,7 +1239,7 @@ VOID AddrElemLib::AdjustSurfaceInfo( /** **************************************************************************************************** -* AddrElemLib::RestoreSurfaceInfo +* ElemLib::RestoreSurfaceInfo * * @brief * Reverse operation of AdjustSurfaceInfo @@ -1245,8 +1248,8 @@ VOID AddrElemLib::AdjustSurfaceInfo( * N/A **************************************************************************************************** */ -VOID AddrElemLib::RestoreSurfaceInfo( - AddrElemMode elemMode, ///< [in] element mode +VOID ElemLib::RestoreSurfaceInfo( + ElemMode elemMode, ///< [in] element mode UINT_32 expandX, ///< [in] decompression expansion factor in X UINT_32 expandY, ///< [out] decompression expansion factor in Y UINT_32* pBpp, ///< [in/out] bpp @@ -1328,7 +1331,7 @@ VOID AddrElemLib::RestoreSurfaceInfo( /** **************************************************************************************************** -* AddrElemLib::GetBitsPerPixel +* ElemLib::GetBitsPerPixel * * @brief * Compute the total bits per element according to a format @@ -1339,9 +1342,9 @@ VOID AddrElemLib::RestoreSurfaceInfo( * Bits per pixel **************************************************************************************************** */ -UINT_32 AddrElemLib::GetBitsPerPixel( +UINT_32 ElemLib::GetBitsPerPixel( AddrFormat format, ///< [in] surface format code - AddrElemMode* pElemMode, ///< [out] element mode + ElemMode* pElemMode, ///< [out] element mode UINT_32* pExpandX, ///< [out] decompression expansion factor in X UINT_32* pExpandY, ///< [out] decompression expansion factor in Y UINT_32* pUnusedBits) ///< [out] bits unused @@ -1350,7 +1353,7 @@ UINT_32 AddrElemLib::GetBitsPerPixel( UINT_32 expandX = 1; UINT_32 expandY = 1; UINT_32 bitUnused = 0; - AddrElemMode elemMode = ADDR_UNCOMPRESSED; // default value + ElemMode elemMode = ADDR_UNCOMPRESSED; // default value switch (format) { @@ -1497,7 +1500,7 @@ UINT_32 AddrElemLib::GetBitsPerPixel( /** **************************************************************************************************** -* AddrElemLib::GetCompBits +* ElemLib::GetCompBits * * @brief * Set each component's bit size and bit start. And set element mode and number type @@ -1506,13 +1509,13 @@ UINT_32 AddrElemLib::GetBitsPerPixel( * N/A **************************************************************************************************** */ -VOID AddrElemLib::GetCompBits( - UINT_32 c0, ///< [in] bits of component 0 - UINT_32 c1, ///< [in] bits of component 1 - UINT_32 c2, ///< [in] bits of component 2 - UINT_32 c3, ///< [in] bits of component 3 - ADDR_PIXEL_FORMATINFO* pInfo, ///< [out] per component info out - AddrElemMode elemMode) ///< [in] element mode +VOID ElemLib::GetCompBits( + UINT_32 c0, ///< [in] bits of component 0 + UINT_32 c1, ///< [in] bits of component 1 + UINT_32 c2, ///< [in] bits of component 2 + UINT_32 c3, ///< [in] bits of component 3 + PixelFormatInfo* pInfo, ///< [out] per component info out + ElemMode elemMode) ///< [in] element mode { pInfo->comps = 0; @@ -1544,7 +1547,7 @@ VOID AddrElemLib::GetCompBits( /** **************************************************************************************************** -* AddrElemLib::GetCompBits +* ElemLib::GetCompBits * * @brief * Set the clear color (or clear depth/stencil) for a surface @@ -1557,7 +1560,7 @@ VOID AddrElemLib::GetCompBits( * N/A **************************************************************************************************** */ -VOID AddrElemLib::SetClearComps( +VOID ElemLib::SetClearComps( ADDR_FLT_32 comps[4], ///< [in/out] components BOOL_32 clearColor, ///< [in] TRUE if clear color is set (CLEAR_COLOR) BOOL_32 float32) ///< [in] TRUE if float32 component (BLEND_FLOAT32) @@ -1600,7 +1603,7 @@ VOID AddrElemLib::SetClearComps( /** **************************************************************************************************** -* AddrElemLib::IsBlockCompressed +* ElemLib::IsBlockCompressed * * @brief * TRUE if this is block compressed format @@ -1611,7 +1614,7 @@ VOID AddrElemLib::SetClearComps( * BOOL_32 **************************************************************************************************** */ -BOOL_32 AddrElemLib::IsBlockCompressed( +BOOL_32 ElemLib::IsBlockCompressed( AddrFormat format) ///< [in] Format { return format >= ADDR_FMT_BC1 && format <= ADDR_FMT_BC7; @@ -1620,7 +1623,7 @@ BOOL_32 AddrElemLib::IsBlockCompressed( /** **************************************************************************************************** -* AddrElemLib::IsCompressed +* ElemLib::IsCompressed * * @brief * TRUE if this is block compressed format or 1 bit format @@ -1631,7 +1634,7 @@ BOOL_32 AddrElemLib::IsBlockCompressed( * BOOL_32 **************************************************************************************************** */ -BOOL_32 AddrElemLib::IsCompressed( +BOOL_32 ElemLib::IsCompressed( AddrFormat format) ///< [in] Format { return IsBlockCompressed(format) || format == ADDR_FMT_BC1 || format == ADDR_FMT_BC7; @@ -1639,7 +1642,7 @@ BOOL_32 AddrElemLib::IsCompressed( /** **************************************************************************************************** -* AddrElemLib::IsExpand3x +* ElemLib::IsExpand3x * * @brief * TRUE if this is 3x expand format @@ -1650,7 +1653,7 @@ BOOL_32 AddrElemLib::IsCompressed( * BOOL_32 **************************************************************************************************** */ -BOOL_32 AddrElemLib::IsExpand3x( +BOOL_32 ElemLib::IsExpand3x( AddrFormat format) ///< [in] Format { BOOL_32 is3x = FALSE; @@ -1671,4 +1674,4 @@ BOOL_32 AddrElemLib::IsExpand3x( return is3x; } - +} diff --git a/src/amd/addrlib/core/addrelemlib.h b/src/amd/addrlib/core/addrelemlib.h index b47a413a9b4..2875026e32e 100644 --- a/src/amd/addrlib/core/addrelemlib.h +++ b/src/amd/addrlib/core/addrelemlib.h @@ -38,10 +38,13 @@ #include "addrobject.h" #include "addrcommon.h" -class AddrLib; +namespace Addr +{ + +class Lib; // The masks for property bits within the Properties INT_32 -union ADDR_COMPONENT_FLAGS +union ComponentFlags { struct { @@ -53,8 +56,8 @@ union ADDR_COMPONENT_FLAGS UINT_32 value; }; -// Copy from legacy lib's AddrNumberType -enum AddrNumberType +// Copy from legacy lib's NumberType +enum NumberType { // The following number types have the range [-1..1] ADDR_NO_NUMBER, // This component doesn't exist and has no default value @@ -109,7 +112,7 @@ enum AddrNumberType }; // Copy from legacy lib's AddrElement -enum AddrElemMode +enum ElemMode { // These formats allow both packing an unpacking ADDR_ROUND_BY_HALF, // add 1/2 and truncate when packing this element @@ -137,7 +140,7 @@ enum AddrElemMode ADDR_END_ELEMENT // Used for range comparisons }; -enum AddrDepthPlanarType +enum DepthPlanarType { ADDR_DEPTH_PLANAR_NONE = 0, // No plane z/stencl ADDR_DEPTH_PLANAR_R600 = 1, // R600 z and stencil planes are store within a tile @@ -146,19 +149,19 @@ enum AddrDepthPlanarType /** **************************************************************************************************** -* ADDR_PIXEL_FORMATINFO +* PixelFormatInfo * * @brief * Per component info * **************************************************************************************************** */ -struct ADDR_PIXEL_FORMATINFO +struct PixelFormatInfo { UINT_32 compBit[4]; - AddrNumberType numType[4]; + NumberType numType[4]; UINT_32 compStart[4]; - AddrElemMode elemMode; + ElemMode elemMode; UINT_32 comps; ///< Number of components }; @@ -167,18 +170,18 @@ struct ADDR_PIXEL_FORMATINFO * @brief This class contains asic indepentent element related attributes and operations **************************************************************************************************** */ -class AddrElemLib : public AddrObject +class ElemLib : public Object { protected: - AddrElemLib(AddrLib* const pAddrLib); + ElemLib(Lib* pAddrLib); public: /// Makes this class virtual - virtual ~AddrElemLib(); + virtual ~ElemLib(); - static AddrElemLib *Create( - const AddrLib* const pAddrLib); + static ElemLib* Create( + const Lib* pAddrLib); /// The implementation is only for R6xx/R7xx, so make it virtual in case we need for R8xx BOOL_32 PixGetExportNorm( @@ -196,32 +199,32 @@ public: const ADDR_FLT_32 comps[4], UINT_8 *pPixel) const; static VOID Flt32sToInt32s( - ADDR_FLT_32 value, UINT_32 bits, AddrNumberType numberType, UINT_32* pResult); + ADDR_FLT_32 value, UINT_32 bits, NumberType numberType, UINT_32* pResult); static VOID Int32sToPixel( UINT_32 numComps, UINT_32* pComps, UINT_32* pCompBits, UINT_32* pCompStart, - ADDR_COMPONENT_FLAGS properties, UINT_32 resultBits, UINT_8* pPixel); + ComponentFlags properties, UINT_32 resultBits, UINT_8* pPixel); VOID PixGetColorCompInfo( AddrColorFormat format, AddrSurfaceNumber number, AddrSurfaceSwap swap, - ADDR_PIXEL_FORMATINFO* pInfo) const; + PixelFormatInfo* pInfo) const; VOID PixGetDepthCompInfo( - AddrDepthFormat format, ADDR_PIXEL_FORMATINFO* pInfo) const; + AddrDepthFormat format, PixelFormatInfo* pInfo) const; UINT_32 GetBitsPerPixel( - AddrFormat format, AddrElemMode* pElemMode, + AddrFormat format, ElemMode* pElemMode, UINT_32* pExpandX = NULL, UINT_32* pExpandY = NULL, UINT_32* pBitsUnused = NULL); static VOID SetClearComps( ADDR_FLT_32 comps[4], BOOL_32 clearColor, BOOL_32 float32); VOID AdjustSurfaceInfo( - AddrElemMode elemMode, UINT_32 expandX, UINT_32 expandY, + ElemMode elemMode, UINT_32 expandX, UINT_32 expandY, UINT_32* pBpp, UINT_32* pBasePitch, UINT_32* pWidth, UINT_32* pHeight); VOID RestoreSurfaceInfo( - AddrElemMode elemMode, UINT_32 expandX, UINT_32 expandY, + ElemMode elemMode, UINT_32 expandX, UINT_32 expandY, UINT_32* pBpp, UINT_32* pWidth, UINT_32* pHeight); /// Checks if depth and stencil are planar inside a tile @@ -231,7 +234,7 @@ public: } /// Sets m_configFlags, copied from AddrLib - VOID SetConfigFlags(AddrConfigFlags flags) + VOID SetConfigFlags(ConfigFlags flags) { m_configFlags = flags; } @@ -244,27 +247,29 @@ protected: static VOID GetCompBits( UINT_32 c0, UINT_32 c1, UINT_32 c2, UINT_32 c3, - ADDR_PIXEL_FORMATINFO* pInfo, - AddrElemMode elemMode = ADDR_ROUND_BY_HALF); + PixelFormatInfo* pInfo, + ElemMode elemMode = ADDR_ROUND_BY_HALF); static VOID GetCompType( AddrColorFormat format, AddrSurfaceNumber numType, - ADDR_PIXEL_FORMATINFO* pInfo); + PixelFormatInfo* pInfo); static VOID GetCompSwap( - AddrSurfaceSwap swap, ADDR_PIXEL_FORMATINFO* pInfo); + AddrSurfaceSwap swap, PixelFormatInfo* pInfo); static VOID SwapComps( - UINT_32 c0, UINT_32 c1, ADDR_PIXEL_FORMATINFO* pInfo); + UINT_32 c0, UINT_32 c1, PixelFormatInfo* pInfo); private: UINT_32 m_fp16ExportNorm; ///< If allow FP16 to be reported as EXPORT_NORM - AddrDepthPlanarType m_depthPlanarType; + DepthPlanarType m_depthPlanarType; - AddrConfigFlags m_configFlags; ///< Copy of AddrLib's configFlags - AddrLib* const m_pAddrLib; ///< Pointer to parent addrlib instance + ConfigFlags m_configFlags; ///< Copy of AddrLib's configFlags + Addr::Lib* const m_pAddrLib; ///< Pointer to parent addrlib instance }; +} //Addr + #endif diff --git a/src/amd/addrlib/core/addrlib.cpp b/src/amd/addrlib/core/addrlib.cpp index f98a459f372..8553ca6569f 100644 --- a/src/amd/addrlib/core/addrlib.cpp +++ b/src/amd/addrlib/core/addrlib.cpp @@ -81,6 +81,8 @@ UINT_32 __umoddi3(UINT_64 n, UINT_32 base) #endif // __APPLE__ +namespace Addr +{ /////////////////////////////////////////////////////////////////////////////////////////////////// // Constructor/Destructor @@ -88,14 +90,14 @@ UINT_32 __umoddi3(UINT_64 n, UINT_32 base) /** **************************************************************************************************** -* AddrLib::AddrLib +* Lib::Lib * * @brief * Constructor for the AddrLib class * **************************************************************************************************** */ -AddrLib::AddrLib() : +Lib::Lib() : m_class(BASE_ADDRLIB), m_chipFamily(ADDR_CHIP_FAMILY_IVLD), m_chipRevision(0), @@ -113,15 +115,15 @@ AddrLib::AddrLib() : /** **************************************************************************************************** -* AddrLib::AddrLib +* Lib::Lib * * @brief * Constructor for the AddrLib class with hClient as parameter * **************************************************************************************************** */ -AddrLib::AddrLib(const AddrClient* pClient) : - AddrObject(pClient), +Lib::Lib(const Client* pClient) : + Object(pClient), m_class(BASE_ADDRLIB), m_chipFamily(ADDR_CHIP_FAMILY_IVLD), m_chipRevision(0), @@ -139,14 +141,14 @@ AddrLib::AddrLib(const AddrClient* pClient) : /** **************************************************************************************************** -* AddrLib::~AddrLib +* Lib::~AddrLib * * @brief * Destructor for the AddrLib class * **************************************************************************************************** */ -AddrLib::~AddrLib() +Lib::~Lib() { if (m_pElemLib) { @@ -162,7 +164,7 @@ AddrLib::~AddrLib() /** **************************************************************************************************** -* AddrLib::Create +* Lib::Create * * @brief * Creates and initializes AddrLib object. @@ -171,11 +173,11 @@ AddrLib::~AddrLib() * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib::Create( +ADDR_E_RETURNCODE Lib::Create( const ADDR_CREATE_INPUT* pCreateIn, ///< [in] pointer to ADDR_CREATE_INPUT ADDR_CREATE_OUTPUT* pCreateOut) ///< [out] pointer to ADDR_CREATE_OUTPUT { - AddrLib* pLib = NULL; + Lib* pLib = NULL; ADDR_E_RETURNCODE returnCode = ADDR_OK; if (pCreateIn->createFlags.fillSizeFields == TRUE) @@ -191,7 +193,7 @@ ADDR_E_RETURNCODE AddrLib::Create( (pCreateIn->callbacks.allocSysMem != NULL) && (pCreateIn->callbacks.freeSysMem != NULL)) { - AddrClient client = { + Client client = { pCreateIn->hClient, pCreateIn->callbacks }; @@ -202,13 +204,13 @@ ADDR_E_RETURNCODE AddrLib::Create( switch (pCreateIn->chipFamily) { case FAMILY_SI: - pLib = AddrSIHwlInit(&client); + pLib = SiHwlInit(&client); break; case FAMILY_VI: case FAMILY_CZ: // VI based fusion(carrizo) case FAMILY_CI: case FAMILY_KV: // CI based fusion - pLib = AddrCIHwlInit(&client); + pLib = CiHwlInit(&client); break; default: ADDR_ASSERT_ALWAYS(); @@ -235,7 +237,7 @@ ADDR_E_RETURNCODE AddrLib::Create( pLib->m_configFlags.allowLargeThickTile = pCreateIn->createFlags.allowLargeThickTile; pLib->m_configFlags.disableLinearOpt = FALSE; - pLib->SetAddrChipFamily(pCreateIn->chipFamily, pCreateIn->chipRevision); + pLib->SetChipFamily(pCreateIn->chipFamily, pCreateIn->chipRevision); pLib->SetMinPitchAlignPixels(pCreateIn->minPitchAlignPixels); @@ -244,7 +246,7 @@ ADDR_E_RETURNCODE AddrLib::Create( if (initValid) { - pLib->m_pElemLib = AddrElemLib::Create(pLib); + pLib->m_pElemLib = ElemLib::Create(pLib); } else { @@ -285,19 +287,19 @@ ADDR_E_RETURNCODE AddrLib::Create( /** **************************************************************************************************** -* AddrLib::SetAddrChipFamily +* Lib::SetChipFamily * * @brief -* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision +* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision * @return * N/A **************************************************************************************************** */ -VOID AddrLib::SetAddrChipFamily( +VOID Lib::SetChipFamily( UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h { - AddrChipFamily family = HwlConvertChipFamily(uChipFamily, uChipRevision); + ChipFamily family = HwlConvertChipFamily(uChipFamily, uChipRevision); ADDR_ASSERT(family != ADDR_CHIP_FAMILY_IVLD); @@ -307,7 +309,7 @@ VOID AddrLib::SetAddrChipFamily( /** **************************************************************************************************** -* AddrLib::SetMinPitchAlignPixels +* Lib::SetMinPitchAlignPixels * * @brief * Set m_minPitchAlignPixels with input param @@ -316,7 +318,7 @@ VOID AddrLib::SetAddrChipFamily( * N/A **************************************************************************************************** */ -VOID AddrLib::SetMinPitchAlignPixels( +VOID Lib::SetMinPitchAlignPixels( UINT_32 minPitchAlignPixels) ///< [in] minmum pitch alignment in pixels { m_minPitchAlignPixels = (minPitchAlignPixels == 0) ? 1 : minPitchAlignPixels; @@ -324,7 +326,7 @@ VOID AddrLib::SetMinPitchAlignPixels( /** **************************************************************************************************** -* AddrLib::GetAddrLib +* Lib::GetLib * * @brief * Get AddrLib pointer @@ -333,15 +335,15 @@ VOID AddrLib::SetMinPitchAlignPixels( * An AddrLib class pointer **************************************************************************************************** */ -AddrLib * AddrLib::GetAddrLib( +Lib* Lib::GetLib( ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE { - return static_cast<AddrLib *>(hLib); + return static_cast<Addr::Lib*>(hLib); } /** **************************************************************************************************** -* AddrLib::GetMaxAlignments +* Lib::GetMaxAlignments * * @brief * Gets maximum alignments @@ -350,7 +352,7 @@ AddrLib * AddrLib::GetAddrLib( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib::GetMaxAlignments( +ADDR_E_RETURNCODE Lib::GetMaxAlignments( ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure ) const { @@ -374,7 +376,7 @@ ADDR_E_RETURNCODE AddrLib::GetMaxAlignments( /** **************************************************************************************************** -* AddrLib::Bits2Number +* Lib::Bits2Number * * @brief * Cat a array of binary bit to a number @@ -383,7 +385,7 @@ ADDR_E_RETURNCODE AddrLib::GetMaxAlignments( * The number combined with the array of bits **************************************************************************************************** */ -UINT_32 AddrLib::Bits2Number( +UINT_32 Lib::Bits2Number( UINT_32 bitNum, ///< [in] how many bits ...) ///< [in] varaible bits value starting from MSB { @@ -414,7 +416,7 @@ UINT_32 AddrLib::Bits2Number( /** **************************************************************************************************** -* AddrLib::Flt32ToColorPixel +* Lib::Flt32ToColorPixel * * @brief * Convert a FLT_32 value to a depth/stencil pixel value @@ -422,7 +424,7 @@ UINT_32 AddrLib::Bits2Number( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib::Flt32ToDepthPixel( +ADDR_E_RETURNCODE Lib::Flt32ToDepthPixel( const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn, ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) const { @@ -492,7 +494,7 @@ ADDR_E_RETURNCODE AddrLib::Flt32ToDepthPixel( /** **************************************************************************************************** -* AddrLib::Flt32ToColorPixel +* Lib::Flt32ToColorPixel * * @brief * Convert a FLT_32 value to a red/green/blue/alpha pixel value @@ -500,7 +502,7 @@ ADDR_E_RETURNCODE AddrLib::Flt32ToDepthPixel( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib::Flt32ToColorPixel( +ADDR_E_RETURNCODE Lib::Flt32ToColorPixel( const ELEM_FLT32TOCOLORPIXEL_INPUT* pIn, ELEM_FLT32TOCOLORPIXEL_OUTPUT* pOut) const { @@ -530,7 +532,7 @@ ADDR_E_RETURNCODE AddrLib::Flt32ToColorPixel( /** **************************************************************************************************** -* AddrLib::GetExportNorm +* Lib::GetExportNorm * * @brief * Check one format can be EXPORT_NUM @@ -538,7 +540,7 @@ ADDR_E_RETURNCODE AddrLib::Flt32ToColorPixel( * TRUE if EXPORT_NORM can be used **************************************************************************************************** */ -BOOL_32 AddrLib::GetExportNorm( +BOOL_32 Lib::GetExportNorm( const ELEM_GETEXPORTNORM_INPUT* pIn) const { ADDR_E_RETURNCODE returnCode = ADDR_OK; @@ -561,3 +563,4 @@ BOOL_32 AddrLib::GetExportNorm( return enabled; } +} // Addr diff --git a/src/amd/addrlib/core/addrlib.h b/src/amd/addrlib/core/addrlib.h index 581ef377f74..10d029f34fe 100644 --- a/src/amd/addrlib/core/addrlib.h +++ b/src/amd/addrlib/core/addrlib.h @@ -34,7 +34,6 @@ #ifndef __ADDR_LIB_H__ #define __ADDR_LIB_H__ - #include "addrinterface.h" #include "addrobject.h" #include "addrelemlib.h" @@ -60,12 +59,16 @@ #ifndef CIASICIDGFXENGINE_SEAISLAND #define CIASICIDGFXENGINE_SEAISLAND 0x0000000B #endif + +namespace Addr +{ + /** **************************************************************************************************** * @brief Neutral enums that define pipeinterleave **************************************************************************************************** */ -enum AddrPipeInterleave +enum PipeInterleave { ADDR_PIPEINTERLEAVE_256B = 256, ADDR_PIPEINTERLEAVE_512B = 512, @@ -76,7 +79,7 @@ enum AddrPipeInterleave * @brief Neutral enums that define DRAM row size **************************************************************************************************** */ -enum AddrRowSize +enum RowSize { ADDR_ROWSIZE_1KB = 1024, ADDR_ROWSIZE_2KB = 2048, @@ -89,7 +92,7 @@ enum AddrRowSize * @brief Neutral enums that define bank interleave **************************************************************************************************** */ -enum AddrBankInterleave +enum BankInterleave { ADDR_BANKINTERLEAVE_1 = 1, ADDR_BANKINTERLEAVE_2 = 2, @@ -99,23 +102,10 @@ enum AddrBankInterleave /** **************************************************************************************************** -* @brief Neutral enums that define MGPU chip tile size -**************************************************************************************************** -*/ -enum AddrChipTileSize -{ - ADDR_CHIPTILESIZE_16 = 16, - ADDR_CHIPTILESIZE_32 = 32, - ADDR_CHIPTILESIZE_64 = 64, - ADDR_CHIPTILESIZE_128 = 128, -}; - -/** -**************************************************************************************************** * @brief Neutral enums that define shader engine tile size **************************************************************************************************** */ -enum AddrEngTileSize +enum ShaderEngineTileSize { ADDR_SE_TILESIZE_16 = 16, ADDR_SE_TILESIZE_32 = 32, @@ -126,7 +116,7 @@ enum AddrEngTileSize * @brief Neutral enums that define bank swap size **************************************************************************************************** */ -enum AddrBankSwapSize +enum BankSwapSize { ADDR_BANKSWAP_128B = 128, ADDR_BANKSWAP_256B = 256, @@ -134,16 +124,15 @@ enum AddrBankSwapSize ADDR_BANKSWAP_1KB = 1024, }; - /** **************************************************************************************************** * @brief This class contains asic independent address lib functionalities **************************************************************************************************** */ -class AddrLib : public AddrObject +class Lib : public Object { public: - virtual ~AddrLib(); + virtual ~Lib(); static ADDR_E_RETURNCODE Create( const ADDR_CREATE_INPUT* pCreateInfo, ADDR_CREATE_OUTPUT* pCreateOut); @@ -154,7 +143,7 @@ public: delete this; } - static AddrLib* GetAddrLib(ADDR_HANDLE hLib); + static Lib* GetLib(ADDR_HANDLE hLib); /// Returns AddrLib version (from compiled binary instead include file) UINT_32 GetVersion() @@ -163,7 +152,7 @@ public: } /// Returns asic chip family name defined by AddrLib - AddrChipFamily GetAddrChipFamily() + ChipFamily GetChipFamily() { return m_chipFamily; } @@ -181,8 +170,8 @@ public: ADDR_E_RETURNCODE GetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const; protected: - AddrLib(); // Constructor is protected - AddrLib(const AddrClient* pClient); + Lib(); // Constructor is protected + Lib(const Client* pClient); /// Pure virtual function to get max alignments virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0; @@ -194,7 +183,7 @@ protected: 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; + virtual ChipFamily HwlConvertChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision) = 0; /// Get equation table pointer and number of equations virtual UINT_32 HwlGetEquationTableInfo(const ADDR_EQUATION** ppEquationTable) const @@ -207,15 +196,15 @@ protected: // // Misc helper // - static UINT_32 Bits2Number(UINT_32 bitNum,...); + 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 + /// Returns pointer of ElemLib + ElemLib* GetElemLib() const { return m_pElemLib; } @@ -228,19 +217,19 @@ protected: private: // Disallow the copy constructor - AddrLib(const AddrLib& a); + Lib(const Lib& a); // Disallow the assignment operator - AddrLib& operator=(const AddrLib& a); + Lib& operator=(const Lib& a); - VOID SetAddrChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision); + VOID SetChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision); VOID SetMinPitchAlignPixels(UINT_32 minPitchAlignPixels); protected: - AddrLibClass m_class; ///< Store class type (HWL type) + LibClass m_class; ///< Store class type (HWL type) - AddrChipFamily m_chipFamily; ///< Chip family translated from the one in atiid.h + ChipFamily m_chipFamily; ///< Chip family translated from the one in atiid.h UINT_32 m_chipRevision; ///< Revision id from xxx_id.h @@ -249,7 +238,7 @@ protected: // // Global parameters // - AddrConfigFlags m_configFlags; ///< Global configuration flags. Note this is setup by + ConfigFlags m_configFlags; ///< Global configuration flags. Note this is setup by /// AddrLib instead of Client except forceLinearAligned UINT_32 m_pipes; ///< Number of pipes @@ -267,11 +256,13 @@ protected: UINT_32 m_minPitchAlignPixels; ///< Minimum pitch alignment in pixels UINT_32 m_maxSamples; ///< Max numSamples private: - AddrElemLib* m_pElemLib; ///< Element Lib pointer + ElemLib* m_pElemLib; ///< Element Lib pointer }; -AddrLib* AddrSIHwlInit (const AddrClient* pClient); -AddrLib* AddrCIHwlInit (const AddrClient* pClient); +Lib* SiHwlInit (const Client* pClient); +Lib* CiHwlInit (const Client* pClient); + +} // Addr #endif diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp index 4a2b4563eb0..e7ac3859a81 100644 --- a/src/amd/addrlib/core/addrlib1.cpp +++ b/src/amd/addrlib/core/addrlib1.cpp @@ -35,12 +35,16 @@ #include "addrlib1.h" #include "addrcommon.h" +namespace Addr +{ +namespace V1 +{ /////////////////////////////////////////////////////////////////////////////////////////////////// // Static Const Member /////////////////////////////////////////////////////////////////////////////////////////////////// -const AddrTileModeFlags AddrLib1::ModeFlags[ADDR_TM_COUNT] = +const TileModeFlags Lib::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 @@ -76,69 +80,71 @@ const AddrTileModeFlags AddrLib1::ModeFlags[ADDR_TM_COUNT] = /** **************************************************************************************************** -* AddrLib1::AddrLib1 +* Lib::AddrLib1 * * @brief * Constructor for the AddrLib1 class * **************************************************************************************************** */ -AddrLib1::AddrLib1() : - AddrLib() +Lib::Lib() + : + Addr::Lib() { } /** **************************************************************************************************** -* AddrLib1::AddrLib1 +* Lib::Lib * * @brief -* Constructor for the AddrLib1 class with hClient as parameter +* Constructor for the Addr::V1::Lib class with hClient as parameter * **************************************************************************************************** */ -AddrLib1::AddrLib1(const AddrClient* pClient) : - AddrLib(pClient) +Lib::Lib(const Client* pClient) + : + Addr::Lib(pClient) { } /** **************************************************************************************************** -* AddrLib1::~AddrLib1 +* Lib::~AddrLib1 * * @brief * Destructor for the AddrLib1 class * **************************************************************************************************** */ -AddrLib1::~AddrLib1() +Lib::~Lib() { } /** **************************************************************************************************** -* AddrLib1::GetAddrLib1 +* Lib::GetLib * * @brief * Get AddrLib1 pointer * * @return -* An AddrLib1 class pointer +* An Addr::V1::Lib class pointer **************************************************************************************************** */ -AddrLib1* AddrLib1::GetAddrLib1( +Lib* Lib::GetLib( ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE { - AddrLib* pAddrLib = AddrLib::GetAddrLib(hLib); + Addr::Lib* pAddrLib = Addr::Lib::GetLib(hLib); if ((pAddrLib != NULL) && - ((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) || - (pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI))) + ((pAddrLib->GetChipFamily() == ADDR_CHIP_FAMILY_IVLD) || + (pAddrLib->GetChipFamily() > ADDR_CHIP_FAMILY_VI))) { // only valid and pre-VI AISC can use AddrLib1 function. ADDR_ASSERT_ALWAYS(); hLib = NULL; } - return static_cast<AddrLib1 *>(hLib); + return static_cast<Lib*>(hLib); } @@ -149,7 +155,7 @@ AddrLib1* AddrLib1::GetAddrLib1( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceInfo +* Lib::ComputeSurfaceInfo * * @brief * Interface function stub of AddrComputeSurfaceInfo. @@ -158,7 +164,7 @@ AddrLib1* AddrLib1::GetAddrLib1( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo( +ADDR_E_RETURNCODE Lib::ComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -222,7 +228,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo( UINT_32 expandX = 1; UINT_32 expandY = 1; - AddrElemMode elemMode; + ElemMode elemMode; // Save outputs that may not go through HWL pOut->pixelBits = localIn.bpp; @@ -435,7 +441,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceInfo +* Lib::ComputeSurfaceInfo * * @brief * Interface function stub of AddrComputeSurfaceInfo. @@ -444,7 +450,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord( +ADDR_E_RETURNCODE Lib::ComputeSurfaceAddrFromCoord( const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -515,7 +521,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceCoordFromAddr +* Lib::ComputeSurfaceCoordFromAddr * * @brief * Interface function stub of ComputeSurfaceCoordFromAddr. @@ -524,7 +530,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr( +ADDR_E_RETURNCODE Lib::ComputeSurfaceCoordFromAddr( const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -590,7 +596,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr( /** **************************************************************************************************** -* AddrLib1::ComputeSliceTileSwizzle +* Lib::ComputeSliceTileSwizzle * * @brief * Interface function stub of ComputeSliceTileSwizzle. @@ -599,7 +605,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle( +ADDR_E_RETURNCODE Lib::ComputeSliceTileSwizzle( const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure ) const @@ -643,7 +649,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle( /** **************************************************************************************************** -* AddrLib1::ExtractBankPipeSwizzle +* Lib::ExtractBankPipeSwizzle * * @brief * Interface function stub of AddrExtractBankPipeSwizzle. @@ -652,7 +658,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle( +ADDR_E_RETURNCODE Lib::ExtractBankPipeSwizzle( const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure ) const @@ -695,7 +701,7 @@ ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle( /** **************************************************************************************************** -* AddrLib1::CombineBankPipeSwizzle +* Lib::CombineBankPipeSwizzle * * @brief * Interface function stub of AddrCombineBankPipeSwizzle. @@ -704,7 +710,7 @@ ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle( +ADDR_E_RETURNCODE Lib::CombineBankPipeSwizzle( const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure ) const @@ -751,7 +757,7 @@ ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle( /** **************************************************************************************************** -* AddrLib1::ComputeBaseSwizzle +* Lib::ComputeBaseSwizzle * * @brief * Interface function stub of AddrCompueBaseSwizzle. @@ -759,7 +765,7 @@ ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle( +ADDR_E_RETURNCODE Lib::ComputeBaseSwizzle( const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn, ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const { @@ -808,7 +814,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle( /** **************************************************************************************************** -* AddrLib1::ComputeFmaskInfo +* Lib::ComputeFmaskInfo * * @brief * Interface function stub of ComputeFmaskInfo. @@ -817,7 +823,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo( +ADDR_E_RETURNCODE Lib::ComputeFmaskInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure ) @@ -902,7 +908,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo( /** **************************************************************************************************** -* AddrLib1::ComputeFmaskAddrFromCoord +* Lib::ComputeFmaskAddrFromCoord * * @brief * Interface function stub of ComputeFmaskAddrFromCoord. @@ -911,7 +917,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord( +ADDR_E_RETURNCODE Lib::ComputeFmaskAddrFromCoord( const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -946,7 +952,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord( /** **************************************************************************************************** -* AddrLib1::ComputeFmaskCoordFromAddr +* Lib::ComputeFmaskCoordFromAddr * * @brief * Interface function stub of ComputeFmaskAddrFromCoord. @@ -955,7 +961,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr( +ADDR_E_RETURNCODE Lib::ComputeFmaskCoordFromAddr( const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -990,7 +996,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr( /** **************************************************************************************************** -* AddrLib1::ConvertTileInfoToHW +* Lib::ConvertTileInfoToHW * * @brief * Convert tile info from real value to HW register value in HW layer @@ -999,7 +1005,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW( +ADDR_E_RETURNCODE Lib::ConvertTileInfoToHW( const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure ) const @@ -1042,7 +1048,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW( /** **************************************************************************************************** -* AddrLib1::ConvertTileIndex +* Lib::ConvertTileIndex * * @brief * Convert tile index to tile mode/type/info @@ -1051,7 +1057,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex( +ADDR_E_RETURNCODE Lib::ConvertTileIndex( const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input structure ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure ) const @@ -1091,7 +1097,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex( /** **************************************************************************************************** -* AddrLib1::GetMacroModeIndex +* Lib::GetMacroModeIndex * * @brief * Get macro mode index based on input info @@ -1100,7 +1106,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::GetMacroModeIndex( +ADDR_E_RETURNCODE Lib::GetMacroModeIndex( const ADDR_GET_MACROMODEINDEX_INPUT* pIn, ///< [in] input structure ADDR_GET_MACROMODEINDEX_OUTPUT* pOut ///< [out] output structure ) const @@ -1128,7 +1134,7 @@ ADDR_E_RETURNCODE AddrLib1::GetMacroModeIndex( /** **************************************************************************************************** -* AddrLib1::ConvertTileIndex1 +* Lib::ConvertTileIndex1 * * @brief * Convert tile index to tile mode/type/info @@ -1137,7 +1143,7 @@ ADDR_E_RETURNCODE AddrLib1::GetMacroModeIndex( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1( +ADDR_E_RETURNCODE Lib::ConvertTileIndex1( const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input structure ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure ) const @@ -1178,7 +1184,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1( /** **************************************************************************************************** -* AddrLib1::GetTileIndex +* Lib::GetTileIndex * * @brief * Get tile index from tile mode/type/info @@ -1187,7 +1193,7 @@ ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::GetTileIndex( +ADDR_E_RETURNCODE Lib::GetTileIndex( const ADDR_GET_TILEINDEX_INPUT* pIn, ///< [in] input structure ADDR_GET_TILEINDEX_OUTPUT* pOut ///< [out] output structure ) const @@ -1213,7 +1219,7 @@ ADDR_E_RETURNCODE AddrLib1::GetTileIndex( /** **************************************************************************************************** -* AddrLib1::Thickness +* Lib::Thickness * * @brief * Get tile mode thickness @@ -1222,7 +1228,7 @@ ADDR_E_RETURNCODE AddrLib1::GetTileIndex( * Tile mode thickness **************************************************************************************************** */ -UINT_32 AddrLib1::Thickness( +UINT_32 Lib::Thickness( AddrTileMode tileMode) ///< [in] tile mode { return ModeFlags[tileMode].thickness; @@ -1236,7 +1242,7 @@ UINT_32 AddrLib1::Thickness( /** **************************************************************************************************** -* AddrLib1::ComputeHtileInfo +* Lib::ComputeHtileInfo * * @brief * Interface function stub of AddrComputeHtilenfo @@ -1245,7 +1251,7 @@ UINT_32 AddrLib1::Thickness( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo( +ADDR_E_RETURNCODE Lib::ComputeHtileInfo( const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -1306,7 +1312,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskInfo +* Lib::ComputeCmaskInfo * * @brief * Interface function stub of AddrComputeCmaskInfo @@ -1315,7 +1321,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( +ADDR_E_RETURNCODE Lib::ComputeCmaskInfo( const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -1372,7 +1378,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( /** **************************************************************************************************** -* AddrLib1::ComputeDccInfo +* Lib::ComputeDccInfo * * @brief * Interface function to compute DCC key info @@ -1381,7 +1387,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( * return code of HwlComputeDccInfo **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo( +ADDR_E_RETURNCODE Lib::ComputeDccInfo( const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_DCCINFO_OUTPUT* pOut ///< [out] output structure ) const @@ -1422,7 +1428,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo( /** **************************************************************************************************** -* AddrLib1::ComputeHtileAddrFromCoord +* Lib::ComputeHtileAddrFromCoord * * @brief * Interface function stub of AddrComputeHtileAddrFromCoord @@ -1431,7 +1437,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord( +ADDR_E_RETURNCODE Lib::ComputeHtileAddrFromCoord( const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -1497,7 +1503,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord( /** **************************************************************************************************** -* AddrLib1::ComputeHtileCoordFromAddr +* Lib::ComputeHtileCoordFromAddr * * @brief * Interface function stub of AddrComputeHtileCoordFromAddr @@ -1506,7 +1512,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr( +ADDR_E_RETURNCODE Lib::ComputeHtileCoordFromAddr( const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -1565,7 +1571,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskAddrFromCoord +* Lib::ComputeCmaskAddrFromCoord * * @brief * Interface function stub of AddrComputeCmaskAddrFromCoord @@ -1574,7 +1580,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord( +ADDR_E_RETURNCODE Lib::ComputeCmaskAddrFromCoord( const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -1637,7 +1643,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskCoordFromAddr +* Lib::ComputeCmaskCoordFromAddr * * @brief * Interface function stub of AddrComputeCmaskCoordFromAddr @@ -1646,7 +1652,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr( +ADDR_E_RETURNCODE Lib::ComputeCmaskCoordFromAddr( const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -1703,7 +1709,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr( /** **************************************************************************************************** -* AddrLib1::ComputeTileDataWidthAndHeight +* Lib::ComputeTileDataWidthAndHeight * * @brief * Compute the squared cache shape for per-tile data (CMASK and HTILE) @@ -1715,7 +1721,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr( * MacroWidth and macroHeight are measured in pixels **************************************************************************************************** */ -VOID AddrLib1::ComputeTileDataWidthAndHeight( +VOID Lib::ComputeTileDataWidthAndHeight( UINT_32 bpp, ///< [in] bits per pixel UINT_32 cacheBits, ///< [in] bits of cache ADDR_TILEINFO* pTileInfo, ///< [in] Tile info @@ -1747,7 +1753,7 @@ VOID AddrLib1::ComputeTileDataWidthAndHeight( /** **************************************************************************************************** -* AddrLib1::HwlComputeTileDataWidthAndHeightLinear +* Lib::HwlComputeTileDataWidthAndHeightLinear * * @brief * Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout @@ -1759,7 +1765,7 @@ VOID AddrLib1::ComputeTileDataWidthAndHeight( * MacroWidth and macroHeight are measured in pixels **************************************************************************************************** */ -VOID AddrLib1::HwlComputeTileDataWidthAndHeightLinear( +VOID Lib::HwlComputeTileDataWidthAndHeightLinear( UINT_32* pMacroWidth, ///< [out] macro tile width UINT_32* pMacroHeight, ///< [out] macro tile height UINT_32 bpp, ///< [in] bits per pixel @@ -1773,7 +1779,7 @@ VOID AddrLib1::HwlComputeTileDataWidthAndHeightLinear( /** **************************************************************************************************** -* AddrLib1::ComputeHtileInfo +* Lib::ComputeHtileInfo * * @brief * Compute htile pitch,width, bytes per 2D slice @@ -1784,7 +1790,7 @@ VOID AddrLib1::HwlComputeTileDataWidthAndHeightLinear( * *Htile pitch, height, total size in bytes, macro-tile dimensions and slice size* **************************************************************************************************** */ -UINT_32 AddrLib1::ComputeHtileInfo( +UINT_32 Lib::ComputeHtileInfo( ADDR_HTILE_FLAGS flags, ///< [in] htile flags UINT_32 pitchIn, ///< [in] pitch input UINT_32 heightIn, ///< [in] height input @@ -1861,7 +1867,7 @@ UINT_32 AddrLib1::ComputeHtileInfo( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskBaseAlign +* Lib::ComputeCmaskBaseAlign * * @brief * Compute cmask base alignment @@ -1870,7 +1876,7 @@ UINT_32 AddrLib1::ComputeHtileInfo( * Cmask base alignment **************************************************************************************************** */ -UINT_32 AddrLib1::ComputeCmaskBaseAlign( +UINT_32 Lib::ComputeCmaskBaseAlign( ADDR_CMASK_FLAGS flags, ///< [in] Cmask flags ADDR_TILEINFO* pTileInfo ///< [in] Tile info ) const @@ -1891,7 +1897,7 @@ UINT_32 AddrLib1::ComputeCmaskBaseAlign( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskBytes +* Lib::ComputeCmaskBytes * * @brief * Compute cmask size in bytes @@ -1900,7 +1906,7 @@ UINT_32 AddrLib1::ComputeCmaskBaseAlign( * Cmask size in bytes **************************************************************************************************** */ -UINT_64 AddrLib1::ComputeCmaskBytes( +UINT_64 Lib::ComputeCmaskBytes( UINT_32 pitch, ///< [in] pitch UINT_32 height, ///< [in] height UINT_32 numSlices ///< [in] number of slices @@ -1912,7 +1918,7 @@ UINT_64 AddrLib1::ComputeCmaskBytes( /** **************************************************************************************************** -* AddrLib1::ComputeCmaskInfo +* Lib::ComputeCmaskInfo * * @brief * Compute cmask pitch,width, bytes per 2D slice @@ -1922,7 +1928,7 @@ UINT_64 AddrLib1::ComputeCmaskBytes( * macro-tile dimensions **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( +ADDR_E_RETURNCODE Lib::ComputeCmaskInfo( ADDR_CMASK_FLAGS flags, ///< [in] cmask flags UINT_32 pitchIn, ///< [in] pitch input UINT_32 heightIn, ///< [in] height input @@ -2027,7 +2033,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( /** **************************************************************************************************** -* AddrLib1::ComputeXmaskCoordYFromPipe +* Lib::ComputeXmaskCoordYFromPipe * * @brief * Compute the Y coord from pipe number for cmask/htile @@ -2037,7 +2043,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo( * **************************************************************************************************** */ -UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe( +UINT_32 Lib::ComputeXmaskCoordYFromPipe( UINT_32 pipe, ///< [in] pipe number UINT_32 x ///< [in] x coordinate ) const @@ -2119,7 +2125,7 @@ UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe( /** **************************************************************************************************** -* AddrLib1::HwlComputeXmaskCoordFromAddr +* Lib::HwlComputeXmaskCoordFromAddr * * @brief * Compute the coord from an address of a cmask/htile @@ -2131,7 +2137,7 @@ UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe( * This method is reused by htile, so rename to Xmask **************************************************************************************************** */ -VOID AddrLib1::HwlComputeXmaskCoordFromAddr( +VOID Lib::HwlComputeXmaskCoordFromAddr( UINT_64 addr, ///< [in] address UINT_32 bitPosition, ///< [in] bitPosition in a byte UINT_32 pitch, ///< [in] pitch @@ -2301,7 +2307,7 @@ VOID AddrLib1::HwlComputeXmaskCoordFromAddr( /** **************************************************************************************************** -* AddrLib1::HwlComputeXmaskAddrFromCoord +* Lib::HwlComputeXmaskAddrFromCoord * * @brief * Compute the address from an address of cmask (prior to si) @@ -2311,7 +2317,7 @@ VOID AddrLib1::HwlComputeXmaskCoordFromAddr( * **************************************************************************************************** */ -UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord( +UINT_64 Lib::HwlComputeXmaskAddrFromCoord( UINT_32 pitch, ///< [in] pitch UINT_32 height, ///< [in] height UINT_32 x, ///< [in] x coord @@ -2513,7 +2519,7 @@ UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceAddrFromCoordLinear +* Lib::ComputeSurfaceAddrFromCoordLinear * * @brief * Compute address from coord for linear surface @@ -2523,7 +2529,7 @@ UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord( * **************************************************************************************************** */ -UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear( +UINT_64 Lib::ComputeSurfaceAddrFromCoordLinear( UINT_32 x, ///< [in] x coord UINT_32 y, ///< [in] y coord UINT_32 slice, ///< [in] slice/depth index @@ -2551,7 +2557,7 @@ UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceCoordFromAddrLinear +* Lib::ComputeSurfaceCoordFromAddrLinear * * @brief * Compute the coord from an address of a linear surface @@ -2560,7 +2566,7 @@ UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear( * N/A **************************************************************************************************** */ -VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear( +VOID Lib::ComputeSurfaceCoordFromAddrLinear( UINT_64 addr, ///< [in] address UINT_32 bitPosition, ///< [in] bitPosition in a byte UINT_32 bpp, ///< [in] bits per pixel @@ -2584,7 +2590,7 @@ VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear( /** **************************************************************************************************** -* AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled +* Lib::ComputeSurfaceCoordFromAddrMicroTiled * * @brief * Compute the coord from an address of a micro tiled surface @@ -2593,7 +2599,7 @@ VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear( * N/A **************************************************************************************************** */ -VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled( +VOID Lib::ComputeSurfaceCoordFromAddrMicroTiled( UINT_64 addr, ///< [in] address UINT_32 bitPosition, ///< [in] bitPosition in a byte UINT_32 bpp, ///< [in] bits per pixel @@ -2706,7 +2712,7 @@ VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled( /** **************************************************************************************************** -* AddrLib1::ComputePipeFromAddr +* Lib::ComputePipeFromAddr * * @brief * Compute the pipe number from an address @@ -2716,7 +2722,7 @@ VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled( * **************************************************************************************************** */ -UINT_32 AddrLib1::ComputePipeFromAddr( +UINT_32 Lib::ComputePipeFromAddr( UINT_64 addr, ///< [in] address UINT_32 numPipes ///< [in] number of banks ) const @@ -2746,7 +2752,7 @@ UINT_32 AddrLib1::ComputePipeFromAddr( /** **************************************************************************************************** -* AddrLib1::ComputeMicroTileEquation +* Lib::ComputeMicroTileEquation * * @brief * Compute micro tile equation @@ -2756,7 +2762,7 @@ UINT_32 AddrLib1::ComputePipeFromAddr( * **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputeMicroTileEquation( +ADDR_E_RETURNCODE Lib::ComputeMicroTileEquation( UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel AddrTileMode tileMode, ///< [in] tile mode AddrTileType microTileType, ///< [in] pixel order in display/non-display mode @@ -2959,7 +2965,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeMicroTileEquation( /** **************************************************************************************************** -* AddrLib1::ComputePixelIndexWithinMicroTile +* Lib::ComputePixelIndexWithinMicroTile * * @brief * Compute the pixel index inside a micro tile of surface @@ -2969,7 +2975,7 @@ ADDR_E_RETURNCODE AddrLib1::ComputeMicroTileEquation( * **************************************************************************************************** */ -UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile( +UINT_32 Lib::ComputePixelIndexWithinMicroTile( UINT_32 x, ///< [in] x coord UINT_32 y, ///< [in] y coord UINT_32 z, ///< [in] slice/depth index @@ -3174,7 +3180,7 @@ UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile( /** **************************************************************************************************** -* AddrLib1::AdjustPitchAlignment +* Lib::AdjustPitchAlignment * * @brief * Adjusts pitch alignment for flipping surface @@ -3184,7 +3190,7 @@ UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile( * **************************************************************************************************** */ -VOID AddrLib1::AdjustPitchAlignment( +VOID Lib::AdjustPitchAlignment( ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags UINT_32* pPitchAlign ///< [out] Pointer to pitch alignment ) const @@ -3204,7 +3210,7 @@ VOID AddrLib1::AdjustPitchAlignment( /** **************************************************************************************************** -* AddrLib1::PadDimensions +* Lib::PadDimensions * * @brief * Helper function to pad dimensions @@ -3214,7 +3220,7 @@ VOID AddrLib1::AdjustPitchAlignment( * **************************************************************************************************** */ -VOID AddrLib1::PadDimensions( +VOID Lib::PadDimensions( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -3310,7 +3316,7 @@ VOID AddrLib1::PadDimensions( /** **************************************************************************************************** -* AddrLib1::HwlPreHandleBaseLvl3xPitch +* Lib::HwlPreHandleBaseLvl3xPitch * * @brief * Pre-handler of 3x pitch (96 bit) adjustment @@ -3319,7 +3325,7 @@ VOID AddrLib1::PadDimensions( * Expected pitch **************************************************************************************************** */ -UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch( +UINT_32 Lib::HwlPreHandleBaseLvl3xPitch( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input UINT_32 expPitch ///< [in] pitch ) const @@ -3328,7 +3334,7 @@ UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch( // // If pitch is pre-multiplied by 3, we retrieve original one here to get correct miplevel size // - if (AddrElemLib::IsExpand3x(pIn->format) && + if (ElemLib::IsExpand3x(pIn->format) && pIn->mipLevel == 0 && pIn->tileMode == ADDR_TM_LINEAR_ALIGNED) { @@ -3341,7 +3347,7 @@ UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch( /** **************************************************************************************************** -* AddrLib1::HwlPostHandleBaseLvl3xPitch +* Lib::HwlPostHandleBaseLvl3xPitch * * @brief * Post-handler of 3x pitch adjustment @@ -3350,7 +3356,7 @@ UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch( * Expected pitch **************************************************************************************************** */ -UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch( +UINT_32 Lib::HwlPostHandleBaseLvl3xPitch( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input UINT_32 expPitch ///< [in] pitch ) const @@ -3359,7 +3365,7 @@ UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch( // 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) && + if (ElemLib::IsExpand3x(pIn->format) && pIn->mipLevel == 0 && pIn->tileMode == ADDR_TM_LINEAR_ALIGNED) { @@ -3372,7 +3378,7 @@ UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch( /** **************************************************************************************************** -* AddrLib1::IsMacroTiled +* Lib::IsMacroTiled * * @brief * Check if the tile mode is macro tiled @@ -3381,7 +3387,7 @@ UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch( * TRUE if it is macro tiled (2D/2B/3D/3B) **************************************************************************************************** */ -BOOL_32 AddrLib1::IsMacroTiled( +BOOL_32 Lib::IsMacroTiled( AddrTileMode tileMode) ///< [in] tile mode { return ModeFlags[tileMode].isMacro; @@ -3389,7 +3395,7 @@ BOOL_32 AddrLib1::IsMacroTiled( /** **************************************************************************************************** -* AddrLib1::IsMacro3dTiled +* Lib::IsMacro3dTiled * * @brief * Check if the tile mode is 3D macro tiled @@ -3398,7 +3404,7 @@ BOOL_32 AddrLib1::IsMacroTiled( * TRUE if it is 3D macro tiled **************************************************************************************************** */ -BOOL_32 AddrLib1::IsMacro3dTiled( +BOOL_32 Lib::IsMacro3dTiled( AddrTileMode tileMode) ///< [in] tile mode { return ModeFlags[tileMode].isMacro3d; @@ -3406,7 +3412,7 @@ BOOL_32 AddrLib1::IsMacro3dTiled( /** **************************************************************************************************** -* AddrLib1::IsMicroTiled +* Lib::IsMicroTiled * * @brief * Check if the tile mode is micro tiled @@ -3415,7 +3421,7 @@ BOOL_32 AddrLib1::IsMacro3dTiled( * TRUE if micro tiled **************************************************************************************************** */ -BOOL_32 AddrLib1::IsMicroTiled( +BOOL_32 Lib::IsMicroTiled( AddrTileMode tileMode) ///< [in] tile mode { return ModeFlags[tileMode].isMicro; @@ -3423,7 +3429,7 @@ BOOL_32 AddrLib1::IsMicroTiled( /** **************************************************************************************************** -* AddrLib1::IsLinear +* Lib::IsLinear * * @brief * Check if the tile mode is linear @@ -3432,7 +3438,7 @@ BOOL_32 AddrLib1::IsMicroTiled( * TRUE if linear **************************************************************************************************** */ -BOOL_32 AddrLib1::IsLinear( +BOOL_32 Lib::IsLinear( AddrTileMode tileMode) ///< [in] tile mode { return ModeFlags[tileMode].isLinear; @@ -3440,7 +3446,7 @@ BOOL_32 AddrLib1::IsLinear( /** **************************************************************************************************** -* AddrLib1::IsPrtNoRotationTileMode +* Lib::IsPrtNoRotationTileMode * * @brief * Return TRUE if it is prt tile without rotation @@ -3448,7 +3454,7 @@ BOOL_32 AddrLib1::IsLinear( * This function just used by CI **************************************************************************************************** */ -BOOL_32 AddrLib1::IsPrtNoRotationTileMode( +BOOL_32 Lib::IsPrtNoRotationTileMode( AddrTileMode tileMode) { return ModeFlags[tileMode].isPrtNoRotation; @@ -3456,7 +3462,7 @@ BOOL_32 AddrLib1::IsPrtNoRotationTileMode( /** **************************************************************************************************** -* AddrLib1::IsPrtTileMode +* Lib::IsPrtTileMode * * @brief * Return TRUE if it is prt tile @@ -3464,7 +3470,7 @@ BOOL_32 AddrLib1::IsPrtNoRotationTileMode( * This function just used by CI **************************************************************************************************** */ -BOOL_32 AddrLib1::IsPrtTileMode( +BOOL_32 Lib::IsPrtTileMode( AddrTileMode tileMode) { return ModeFlags[tileMode].isPrt; @@ -3472,7 +3478,7 @@ BOOL_32 AddrLib1::IsPrtTileMode( /** **************************************************************************************************** -* AddrLib1::ComputeMipLevel +* Lib::ComputeMipLevel * * @brief * Compute mipmap level width/height/slices @@ -3480,11 +3486,11 @@ BOOL_32 AddrLib1::IsPrtTileMode( * N/A **************************************************************************************************** */ -VOID AddrLib1::ComputeMipLevel( +VOID Lib::ComputeMipLevel( ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure ) const { - if (AddrElemLib::IsBlockCompressed(pIn->format)) + if (ElemLib::IsBlockCompressed(pIn->format)) { if (pIn->mipLevel == 0) { @@ -3502,7 +3508,7 @@ VOID AddrLib1::ComputeMipLevel( /** **************************************************************************************************** -* AddrLib1::OptimizeTileMode +* Lib::OptimizeTileMode * * @brief * Check if base level's tile mode can be optimized (degraded) @@ -3510,7 +3516,7 @@ VOID AddrLib1::ComputeMipLevel( * TRUE if degraded, also returns degraded tile mode (unchanged if not degraded) **************************************************************************************************** */ -BOOL_32 AddrLib1::OptimizeTileMode( +BOOL_32 Lib::OptimizeTileMode( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure for surface info AddrTileMode* pTileMode ///< [out] Degraded tile mode ) const @@ -3529,7 +3535,7 @@ BOOL_32 AddrLib1::OptimizeTileMode( // Check if linear mode is optimal if ((pIn->height == 1) && (IsLinear(tileMode) == FALSE) && - (AddrElemLib::IsBlockCompressed(pIn->format) == FALSE) && + (ElemLib::IsBlockCompressed(pIn->format) == FALSE) && (pIn->flags.depth == FALSE) && (pIn->flags.stencil == FALSE) && (m_configFlags.disableLinearOpt == FALSE) && @@ -3572,7 +3578,7 @@ BOOL_32 AddrLib1::OptimizeTileMode( /** **************************************************************************************************** -* AddrLib1::DegradeLargeThickTile +* Lib::DegradeLargeThickTile * * @brief * Check if the thickness needs to be reduced if a tile is too large @@ -3580,7 +3586,7 @@ BOOL_32 AddrLib1::OptimizeTileMode( * The degraded tile mode (unchanged if not degraded) **************************************************************************************************** */ -AddrTileMode AddrLib1::DegradeLargeThickTile( +AddrTileMode Lib::DegradeLargeThickTile( AddrTileMode tileMode, UINT_32 bpp) const { @@ -3642,14 +3648,14 @@ AddrTileMode AddrLib1::DegradeLargeThickTile( /** **************************************************************************************************** -* AddrLib1::PostComputeMipLevel +* Lib::PostComputeMipLevel * @brief * Compute MipLevel info (including level 0) after surface adjustment * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel( +ADDR_E_RETURNCODE Lib::PostComputeMipLevel( ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in/out] Input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] Output structure ) const @@ -3682,7 +3688,7 @@ ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel( /** **************************************************************************************************** -* AddrLib1::HwlSetupTileCfg +* Lib::HwlSetupTileCfg * * @brief * Map tile index to tile setting. @@ -3690,7 +3696,7 @@ ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg( +ADDR_E_RETURNCODE Lib::HwlSetupTileCfg( UINT_32 bpp, ///< Bits per pixel INT_32 index, ///< [in] Tile index INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI) @@ -3704,7 +3710,7 @@ ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg( /** **************************************************************************************************** -* AddrLib1::HwlGetPipes +* Lib::HwlGetPipes * * @brief * Get number pipes @@ -3712,7 +3718,7 @@ ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg( * num pipes **************************************************************************************************** */ -UINT_32 AddrLib1::HwlGetPipes( +UINT_32 Lib::HwlGetPipes( const ADDR_TILEINFO* pTileInfo ///< [in] Tile info ) const { @@ -3722,7 +3728,7 @@ UINT_32 AddrLib1::HwlGetPipes( /** **************************************************************************************************** -* AddrLib1::ComputeQbStereoInfo +* Lib::ComputeQbStereoInfo * * @brief * Get quad buffer stereo information @@ -3730,7 +3736,7 @@ UINT_32 AddrLib1::HwlGetPipes( * TRUE if no error **************************************************************************************************** */ -BOOL_32 AddrLib1::ComputeQbStereoInfo( +BOOL_32 Lib::ComputeQbStereoInfo( ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] updated pOut+pStereoInfo ) const { @@ -3767,7 +3773,7 @@ BOOL_32 AddrLib1::ComputeQbStereoInfo( /** **************************************************************************************************** -* AddrLib1::ComputePrtInfo +* Lib::ComputePrtInfo * * @brief * Compute prt surface related info @@ -3776,7 +3782,7 @@ BOOL_32 AddrLib1::ComputeQbStereoInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo( +ADDR_E_RETURNCODE Lib::ComputePrtInfo( const ADDR_PRT_INFO_INPUT* pIn, ADDR_PRT_INFO_OUTPUT* pOut) const { @@ -3786,12 +3792,12 @@ ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo( UINT_32 expandX = 1; UINT_32 expandY = 1; - AddrElemMode elemMode; + ElemMode elemMode; UINT_32 bpp = GetElemLib()->GetBitsPerPixel(pIn->format, - &elemMode, - &expandX, - &expandY); + &elemMode, + &expandX, + &expandY); if (bpp <8 || bpp == 24 || bpp == 48 || bpp == 96) { @@ -3895,3 +3901,5 @@ ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo( return returnCode; } +} // V1 +} // Addr diff --git a/src/amd/addrlib/core/addrlib1.h b/src/amd/addrlib/core/addrlib1.h index 9751d1d4f17..7c19d102c16 100644 --- a/src/amd/addrlib/core/addrlib1.h +++ b/src/amd/addrlib/core/addrlib1.h @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file addrlib1.h -* @brief Contains the AddrLib1 base class definition. +* @brief Contains the Lib base class definition. **************************************************************************************************** */ @@ -36,13 +36,17 @@ #include "addrlib.h" +namespace Addr +{ +namespace V1 +{ /** **************************************************************************************************** * @brief Neutral enums that define bank swap size **************************************************************************************************** */ -enum AddrSampleSplitSize +enum SampleSplitSize { ADDR_SAMPLESPLIT_1KB = 1024, ADDR_SAMPLESPLIT_2KB = 2048, @@ -55,7 +59,7 @@ enum AddrSampleSplitSize * @brief Flags for AddrTileMode **************************************************************************************************** */ -struct AddrTileModeFlags +struct TileModeFlags { UINT_32 thickness : 4; UINT_32 isLinear : 1; @@ -72,12 +76,12 @@ struct AddrTileModeFlags * @brief This class contains asic independent address lib functionalities **************************************************************************************************** */ -class AddrLib1 : public AddrLib +class Lib : public Addr::Lib { public: - virtual ~AddrLib1(); + virtual ~Lib(); - static AddrLib1* GetAddrLib1( + static Lib* GetLib( ADDR_HANDLE hLib); /// Returns tileIndex support @@ -187,8 +191,8 @@ public: const ADDR_PRT_INFO_INPUT* pIn, ADDR_PRT_INFO_OUTPUT* pOut) const; protected: - AddrLib1(); // Constructor is protected - AddrLib1(const AddrClient* pClient); + Lib(); // Constructor is protected + Lib(const Client* pClient); /// Pure Virtual function for Hwl computing surface info virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo( @@ -434,7 +438,7 @@ protected: // // Misc helper // - static const AddrTileModeFlags ModeFlags[ADDR_TM_COUNT]; + static const TileModeFlags ModeFlags[ADDR_TM_COUNT]; static UINT_32 Thickness( AddrTileMode tileMode); @@ -495,10 +499,10 @@ protected: private: // Disallow the copy constructor - AddrLib1(const AddrLib1& a); + Lib(const Lib& a); // Disallow the assignment operator - AddrLib1& operator=(const AddrLib1& a); + Lib& operator=(const Lib& a); UINT_32 ComputeCmaskBaseAlign( ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const; @@ -517,5 +521,8 @@ private: UINT_32 pipe, UINT_32 x) const; }; +} // V1 +} // Addr + #endif diff --git a/src/amd/addrlib/core/addrobject.cpp b/src/amd/addrlib/core/addrobject.cpp index 2d86e033f13..0c5f81a5185 100644 --- a/src/amd/addrlib/core/addrobject.cpp +++ b/src/amd/addrlib/core/addrobject.cpp @@ -26,23 +26,26 @@ /** **************************************************************************************************** -* @file addrobject.cpp -* @brief Contains the AddrObject base class implementation. +* @file Object.cpp +* @brief Contains the Object base class implementation. **************************************************************************************************** */ #include "addrinterface.h" #include "addrobject.h" +namespace Addr +{ + /** **************************************************************************************************** -* AddrObject::AddrObject +* Object::Object * * @brief -* Constructor for the AddrObject class. +* Constructor for the Object class. **************************************************************************************************** */ -AddrObject::AddrObject() +Object::Object() { m_client.handle = NULL; m_client.callbacks.allocSysMem = NULL; @@ -52,40 +55,40 @@ AddrObject::AddrObject() /** **************************************************************************************************** -* AddrObject::AddrObject +* Object::Object * * @brief -* Constructor for the AddrObject class. +* Constructor for the Object class. **************************************************************************************************** */ -AddrObject::AddrObject(const AddrClient* pClient) +Object::Object(const Client* pClient) { m_client = *pClient; } /** **************************************************************************************************** -* AddrObject::~AddrObject +* Object::~Object * * @brief -* Destructor for the AddrObject class. +* Destructor for the Object class. **************************************************************************************************** */ -AddrObject::~AddrObject() +Object::~Object() { } /** **************************************************************************************************** -* AddrObject::ClientAlloc +* Object::ClientAlloc * * @brief -* Calls instanced allocSysMem inside AddrClient +* Calls instanced allocSysMem inside Client **************************************************************************************************** */ -VOID* AddrObject::ClientAlloc( +VOID* Object::ClientAlloc( size_t objSize, ///< [in] Size to allocate - const AddrClient* pClient) ///< [in] Client pointer + const Client* pClient) ///< [in] Client pointer { VOID* pObjMem = NULL; @@ -106,13 +109,13 @@ VOID* AddrObject::ClientAlloc( /** **************************************************************************************************** -* AddrObject::AddrMalloc +* Object::Alloc * * @brief * A wrapper of ClientAlloc **************************************************************************************************** */ -VOID* AddrObject::AddrMalloc( +VOID* Object::Alloc( size_t objSize) const ///< [in] Size to allocate { return ClientAlloc(objSize, &m_client); @@ -120,15 +123,15 @@ VOID* AddrObject::AddrMalloc( /** **************************************************************************************************** -* AddrObject::ClientFree +* Object::ClientFree * * @brief -* Calls freeSysMem inside AddrClient +* Calls freeSysMem inside Client **************************************************************************************************** */ -VOID AddrObject::ClientFree( +VOID Object::ClientFree( VOID* pObjMem, ///< [in] User virtual address to free. - const AddrClient* pClient) ///< [in] Client pointer + const Client* pClient) ///< [in] Client pointer { if (pClient->callbacks.freeSysMem != NULL) { @@ -147,13 +150,13 @@ VOID AddrObject::ClientFree( /** **************************************************************************************************** -* AddrObject::AddrFree +* Object::Free * * @brief * A wrapper of ClientFree **************************************************************************************************** */ -VOID AddrObject::AddrFree( +VOID Object::Free( VOID* pObjMem) const ///< [in] User virtual address to free. { ClientFree(pObjMem, &m_client); @@ -161,18 +164,18 @@ VOID AddrObject::AddrFree( /** **************************************************************************************************** -* AddrObject::operator new +* Object::operator new * * @brief -* Allocates memory needed for AddrObject object. (with ADDR_CLIENT_HANDLE) +* Allocates memory needed for Object object. (with ADDR_CLIENT_HANDLE) * * @return * Returns NULL if unsuccessful. **************************************************************************************************** */ -VOID* AddrObject::operator new( +VOID* Object::operator new( size_t objSize, ///< [in] Size to allocate - const AddrClient* pClient) ///< [in] Client pointer + const Client* pClient) ///< [in] Client pointer { return ClientAlloc(objSize, pClient); } @@ -180,37 +183,37 @@ VOID* AddrObject::operator new( /** **************************************************************************************************** -* AddrObject::operator delete +* Object::operator delete * * @brief -* Frees AddrObject object memory. +* Frees Object object memory. **************************************************************************************************** */ -VOID AddrObject::operator delete( +VOID Object::operator delete( VOID* pObjMem, ///< [in] User virtual address to free. - const AddrClient* pClient) ///< [in] Client handle + const Client* pClient) ///< [in] Client handle { ClientFree(pObjMem, pClient); } /** **************************************************************************************************** -* AddrObject::operator delete +* Object::operator delete * * @brief -* Frees AddrObject object memory. +* Frees Object object memory. **************************************************************************************************** */ -VOID AddrObject::operator delete( +VOID Object::operator delete( VOID* pObjMem) ///< [in] User virtual address to free. { - AddrObject* pObj = static_cast<AddrObject*>(pObjMem); + Object* pObj = static_cast<Object*>(pObjMem); ClientFree(pObjMem, &pObj->m_client); } /** **************************************************************************************************** -* AddrObject::DebugPrint +* Object::DebugPrint * * @brief * Print debug message @@ -219,7 +222,7 @@ VOID AddrObject::operator delete( * N/A **************************************************************************************************** */ -VOID AddrObject::DebugPrint( +VOID Object::DebugPrint( const CHAR* pDebugString, ///< [in] Debug string ...) const { @@ -244,3 +247,4 @@ VOID AddrObject::DebugPrint( #endif } +} // Addr diff --git a/src/amd/addrlib/core/addrobject.h b/src/amd/addrlib/core/addrobject.h index e3cf0afbc8f..c6483862b56 100644 --- a/src/amd/addrlib/core/addrobject.h +++ b/src/amd/addrlib/core/addrobject.h @@ -26,8 +26,8 @@ /** **************************************************************************************************** -* @file addrobject.h -* @brief Contains the AddrObject base class definition. +* @file Object.h +* @brief Contains the Object base class definition. **************************************************************************************************** */ @@ -37,12 +37,15 @@ #include "addrtypes.h" #include "addrcommon.h" +namespace Addr +{ + /** **************************************************************************************************** * @brief This structure contains client specific data **************************************************************************************************** */ -struct AddrClient +struct Client { ADDR_CLIENT_HANDLE handle; ADDR_CALLBACKS callbacks; @@ -52,38 +55,39 @@ struct AddrClient * @brief This class is the base class for all ADDR class objects. **************************************************************************************************** */ -class AddrObject +class Object { public: - AddrObject(); - AddrObject(const AddrClient* pClient); - virtual ~AddrObject(); + Object(); + Object(const Client* pClient); + virtual ~Object(); - VOID* operator new(size_t size, const AddrClient* pClient); - VOID operator delete(VOID* pObj, const AddrClient* pClient); + VOID* operator new(size_t size, const Client* pClient); + VOID operator delete(VOID* pObj, const Client* pClient); VOID operator delete(VOID* pObj); - VOID* AddrMalloc(size_t size) const; - VOID AddrFree(VOID* pObj) const; + VOID* Alloc(size_t size) const; + VOID Free(VOID* pObj) const; VOID DebugPrint( const CHAR* pDebugString, ...) const; - const AddrClient* GetClient() const {return &m_client;} + const Client* GetClient() const {return &m_client;} protected: - AddrClient m_client; + Client m_client; private: - static VOID* ClientAlloc(size_t size, const AddrClient* pClient); - static VOID ClientFree(VOID* pObj, const AddrClient* pClient); + static VOID* ClientAlloc(size_t size, const Client* pClient); + static VOID ClientFree(VOID* pObj, const Client* pClient); // disallow the copy constructor - AddrObject(const AddrObject& a); + Object(const Object& a); // disallow the assignment operator - AddrObject& operator=(const AddrObject& a); + Object& operator=(const Object& a); }; +} // Addr #endif diff --git a/src/amd/addrlib/r800/ciaddrlib.cpp b/src/amd/addrlib/r800/ciaddrlib.cpp index ebaf3e5623b..839a26833a6 100644 --- a/src/amd/addrlib/r800/ciaddrlib.cpp +++ b/src/amd/addrlib/r800/ciaddrlib.cpp @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file ciaddrlib.cpp -* @brief Contains the implementation for the CiAddrLib class. +* @brief Contains the implementation for the CiLib class. **************************************************************************************************** */ @@ -48,9 +48,31 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// +namespace Addr +{ + +/** +**************************************************************************************************** +* CiHwlInit +* +* @brief +* Creates an CiLib object. +* +* @return +* Returns an CiLib object pointer. +**************************************************************************************************** +*/ +Lib* CiHwlInit(const Client* pClient) +{ + return V1::CiLib::CreateObj(pClient); +} + +namespace V1 +{ + /** **************************************************************************************************** -* AddrMask +* Mask * * @brief * Gets a mask of "width" @@ -58,7 +80,7 @@ * Bit mask **************************************************************************************************** */ -static UINT_64 AddrMask( +static UINT_64 Mask( UINT_32 width) ///< Width of bits { UINT_64 ret; @@ -76,7 +98,7 @@ static UINT_64 AddrMask( /** **************************************************************************************************** -* AddrGetBits +* GetBits * * @brief * Gets bits within a range of [msb, lsb] @@ -84,7 +106,7 @@ static UINT_64 AddrMask( * Bits of this range **************************************************************************************************** */ -static UINT_64 AddrGetBits( +static UINT_64 GetBits( UINT_64 bits, ///< Source bits UINT_32 msb, ///< Most signicant bit UINT_32 lsb) ///< Least signicant bit @@ -93,14 +115,14 @@ static UINT_64 AddrGetBits( if (msb >= lsb) { - ret = (bits >> lsb) & (AddrMask(1 + msb - lsb)); + ret = (bits >> lsb) & (Mask(1 + msb - lsb)); } return ret; } /** **************************************************************************************************** -* AddrRemoveBits +* RemoveBits * * @brief * Removes bits within the range of [msb, lsb] @@ -108,7 +130,7 @@ static UINT_64 AddrGetBits( * Modified bits **************************************************************************************************** */ -static UINT_64 AddrRemoveBits( +static UINT_64 RemoveBits( UINT_64 bits, ///< Source bits UINT_32 msb, ///< Most signicant bit UINT_32 lsb) ///< Least signicant bit @@ -117,15 +139,15 @@ static UINT_64 AddrRemoveBits( if (msb >= lsb) { - ret = AddrGetBits(bits, lsb - 1, 0) // low bits - | (AddrGetBits(bits, 8 * sizeof(bits) - 1, msb + 1) << lsb); //high bits + ret = GetBits(bits, lsb - 1, 0) // low bits + | (GetBits(bits, 8 * sizeof(bits) - 1, msb + 1) << lsb); //high bits } return ret; } /** **************************************************************************************************** -* AddrInsertBits +* InsertBits * * @brief * Inserts new bits into the range of [msb, lsb] @@ -133,7 +155,7 @@ static UINT_64 AddrRemoveBits( * Modified bits **************************************************************************************************** */ -static UINT_64 AddrInsertBits( +static UINT_64 InsertBits( UINT_64 bits, ///< Source bits UINT_64 newBits, ///< New bits to be inserted UINT_32 msb, ///< Most signicant bit @@ -143,41 +165,25 @@ static UINT_64 AddrInsertBits( if (msb >= lsb) { - ret = AddrGetBits(bits, lsb - 1, 0) // old low bitss - | (AddrGetBits(newBits, msb - lsb, 0) << lsb) //new bits - | (AddrGetBits(bits, 8 * sizeof(bits) - 1, lsb) << (msb + 1)); //old high bits + ret = GetBits(bits, lsb - 1, 0) // old low bitss + | (GetBits(newBits, msb - lsb, 0) << lsb) //new bits + | (GetBits(bits, 8 * sizeof(bits) - 1, lsb) << (msb + 1)); //old high bits } return ret; } - -/** -**************************************************************************************************** -* AddrCiHwlInit -* -* @brief -* Creates an CiAddrLib object. -* -* @return -* Returns an CiAddrLib object pointer. -**************************************************************************************************** -*/ -AddrLib* AddrCIHwlInit(const AddrClient* pClient) -{ - return CiAddrLib::CreateObj(pClient); -} - /** **************************************************************************************************** -* CiAddrLib::CiAddrLib +* CiLib::CiLib * * @brief * Constructor * **************************************************************************************************** */ -CiAddrLib::CiAddrLib(const AddrClient* pClient) : - SiAddrLib(pClient), +CiLib::CiLib(const Client* pClient) + : + SiLib(pClient), m_noOfMacroEntries(0), m_allowNonDispThickModes(FALSE) { @@ -187,19 +193,19 @@ CiAddrLib::CiAddrLib(const AddrClient* pClient) : /** **************************************************************************************************** -* CiAddrLib::~CiAddrLib +* CiLib::~CiLib * * @brief * Destructor **************************************************************************************************** */ -CiAddrLib::~CiAddrLib() +CiLib::~CiLib() { } /** **************************************************************************************************** -* CiAddrLib::HwlComputeDccInfo +* CiLib::HwlComputeDccInfo * * @brief * Compute DCC key size, base alignment @@ -207,7 +213,7 @@ CiAddrLib::~CiAddrLib() * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlComputeDccInfo( +ADDR_E_RETURNCODE CiLib::HwlComputeDccInfo( const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const { @@ -281,7 +287,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeDccInfo( /** **************************************************************************************************** -* CiAddrLib::HwlComputeCmaskAddrFromCoord +* CiLib::HwlComputeCmaskAddrFromCoord * * @brief * Compute tc compatible Cmask address from fmask ram address @@ -290,7 +296,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeDccInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlComputeCmaskAddrFromCoord( +ADDR_E_RETURNCODE CiLib::HwlComputeCmaskAddrFromCoord( const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] fmask addr/bpp/tile input ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] cmask address ) const @@ -325,7 +331,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeCmaskAddrFromCoord( /** **************************************************************************************************** -* CiAddrLib::HwlComputeHtileAddrFromCoord +* CiLib::HwlComputeHtileAddrFromCoord * * @brief * Compute tc compatible Htile address from depth/stencil address @@ -334,7 +340,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeCmaskAddrFromCoord( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlComputeHtileAddrFromCoord( +ADDR_E_RETURNCODE CiLib::HwlComputeHtileAddrFromCoord( const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] depth/stencil addr/bpp/tile input ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] htile address ) const @@ -369,19 +375,19 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeHtileAddrFromCoord( /** **************************************************************************************************** -* CiAddrLib::HwlConvertChipFamily +* CiLib::HwlConvertChipFamily * * @brief -* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision +* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision * @return -* AddrChipFamily +* ChipFamily **************************************************************************************************** */ -AddrChipFamily CiAddrLib::HwlConvertChipFamily( +ChipFamily CiLib::HwlConvertChipFamily( UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h { - AddrChipFamily family = ADDR_CHIP_FAMILY_CI; + ChipFamily family = ADDR_CHIP_FAMILY_CI; switch (uChipFamily) { @@ -419,7 +425,7 @@ AddrChipFamily CiAddrLib::HwlConvertChipFamily( /** **************************************************************************************************** -* CiAddrLib::HwlInitGlobalParams +* CiLib::HwlInitGlobalParams * * @brief * Initializes global parameters @@ -429,7 +435,7 @@ AddrChipFamily CiAddrLib::HwlConvertChipFamily( * **************************************************************************************************** */ -BOOL_32 CiAddrLib::HwlInitGlobalParams( +BOOL_32 CiLib::HwlInitGlobalParams( const ADDR_CREATE_INPUT* pCreateIn) ///< [in] create input { BOOL_32 valid = TRUE; @@ -492,7 +498,7 @@ BOOL_32 CiAddrLib::HwlInitGlobalParams( /** **************************************************************************************************** -* CiAddrLib::HwlPostCheckTileIndex +* CiLib::HwlPostCheckTileIndex * * @brief * Map a tile setting to index if curIndex is invalid, otherwise check if curIndex matches @@ -501,7 +507,7 @@ BOOL_32 CiAddrLib::HwlInitGlobalParams( * Tile index. **************************************************************************************************** */ -INT_32 CiAddrLib::HwlPostCheckTileIndex( +INT_32 CiLib::HwlPostCheckTileIndex( const ADDR_TILEINFO* pInfo, ///< [in] Tile Info AddrTileMode mode, ///< [in] Tile mode AddrTileType type, ///< [in] Tile type @@ -583,7 +589,7 @@ INT_32 CiAddrLib::HwlPostCheckTileIndex( /** **************************************************************************************************** -* CiAddrLib::HwlSetupTileCfg +* CiLib::HwlSetupTileCfg * * @brief * Map tile index to tile setting. @@ -591,7 +597,7 @@ INT_32 CiAddrLib::HwlPostCheckTileIndex( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlSetupTileCfg( +ADDR_E_RETURNCODE CiLib::HwlSetupTileCfg( UINT_32 bpp, ///< [in] Bits per pixel INT_32 index, ///< [in] Tile index INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI) @@ -620,7 +626,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlSetupTileCfg( } else { - const AddrTileConfig* pCfgTable = GetTileSetting(index); + const TileConfig* pCfgTable = GetTileSetting(index); if (pInfo != NULL) { @@ -682,15 +688,15 @@ ADDR_E_RETURNCODE CiAddrLib::HwlSetupTileCfg( /** **************************************************************************************************** -* CiAddrLib::HwlComputeSurfaceInfo +* CiLib::HwlComputeSurfaceInfo * * @brief -* Entry of ci's ComputeSurfaceInfo +* Entry of CI's ComputeSurfaceInfo * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlComputeSurfaceInfo( +ADDR_E_RETURNCODE CiLib::HwlComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -704,7 +710,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeSurfaceInfo( // Pass tcCompatible flag from input to output; and turn off it if tile split occurs pOut->tcCompatible = pIn->flags.tcCompatible; - ADDR_E_RETURNCODE retCode = SiAddrLib::HwlComputeSurfaceInfo(pIn,pOut); + ADDR_E_RETURNCODE retCode = SiLib::HwlComputeSurfaceInfo(pIn,pOut); if (pOut->macroModeIndex == TileIndexNoMacroIndex) { @@ -716,14 +722,14 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeSurfaceInfo( /** **************************************************************************************************** -* CiAddrLib::HwlFmaskSurfaceInfo +* CiLib::HwlFmaskSurfaceInfo * @brief * Entry of r800's ComputeFmaskInfo * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlComputeFmaskInfo( +ADDR_E_RETURNCODE CiLib::HwlComputeFmaskInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure ) @@ -803,7 +809,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeFmaskInfo( /** **************************************************************************************************** -* CiAddrLib::HwlFmaskPreThunkSurfInfo +* CiLib::HwlFmaskPreThunkSurfInfo * * @brief * Some preparation before thunking a ComputeSurfaceInfo call for Fmask @@ -811,7 +817,7 @@ ADDR_E_RETURNCODE CiAddrLib::HwlComputeFmaskInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -VOID CiAddrLib::HwlFmaskPreThunkSurfInfo( +VOID CiLib::HwlFmaskPreThunkSurfInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn, ///< [in] Input of fmask info const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut, ///< [in] Output of fmask info ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn, ///< [out] Input of thunked surface info @@ -824,7 +830,7 @@ VOID CiAddrLib::HwlFmaskPreThunkSurfInfo( /** **************************************************************************************************** -* CiAddrLib::HwlFmaskPostThunkSurfInfo +* CiLib::HwlFmaskPostThunkSurfInfo * * @brief * Copy hwl extra field after calling thunked ComputeSurfaceInfo @@ -832,7 +838,7 @@ VOID CiAddrLib::HwlFmaskPreThunkSurfInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -VOID CiAddrLib::HwlFmaskPostThunkSurfInfo( +VOID CiLib::HwlFmaskPostThunkSurfInfo( const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut, ///< [in] Output of surface info ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut ///< [out] Output of fmask info ) const @@ -843,7 +849,7 @@ VOID CiAddrLib::HwlFmaskPostThunkSurfInfo( /** **************************************************************************************************** -* CiAddrLib::HwlDegradeThickTileMode +* CiLib::HwlDegradeThickTileMode * * @brief * Degrades valid tile mode for thick modes if needed @@ -852,7 +858,7 @@ VOID CiAddrLib::HwlFmaskPostThunkSurfInfo( * Suitable tile mode **************************************************************************************************** */ -AddrTileMode CiAddrLib::HwlDegradeThickTileMode( +AddrTileMode CiLib::HwlDegradeThickTileMode( AddrTileMode baseTileMode, ///< [in] base tile mode UINT_32 numSlices, ///< [in] current number of slices UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice @@ -863,7 +869,7 @@ AddrTileMode CiAddrLib::HwlDegradeThickTileMode( /** **************************************************************************************************** -* CiAddrLib::HwlOverrideTileMode +* CiLib::HwlOverrideTileMode * * @brief * Override THICK to THIN, for specific formats on CI @@ -873,7 +879,7 @@ AddrTileMode CiAddrLib::HwlDegradeThickTileMode( * **************************************************************************************************** */ -VOID CiAddrLib::HwlOverrideTileMode( +VOID CiLib::HwlOverrideTileMode( ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure ) const { @@ -1024,7 +1030,7 @@ VOID CiAddrLib::HwlOverrideTileMode( /** **************************************************************************************************** -* CiAddrLib::HwlSelectTileMode +* CiLib::HwlSelectTileMode * * @brief * Select tile modes. @@ -1034,7 +1040,7 @@ VOID CiAddrLib::HwlOverrideTileMode( * **************************************************************************************************** */ -VOID CiAddrLib::HwlSelectTileMode( +VOID CiLib::HwlSelectTileMode( ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure ) const { @@ -1120,13 +1126,13 @@ VOID CiAddrLib::HwlSelectTileMode( /** **************************************************************************************************** -* CiAddrLib::HwlSetupTileInfo +* CiLib::HwlSetupTileInfo * * @brief * Setup default value of tile info for SI **************************************************************************************************** */ -VOID CiAddrLib::HwlSetupTileInfo( +VOID CiLib::HwlSetupTileInfo( AddrTileMode tileMode, ///< [in] Tile mode ADDR_SURFACE_FLAGS flags, ///< [in] Surface type flags UINT_32 bpp, ///< [in] Bits per pixel @@ -1453,7 +1459,7 @@ VOID CiAddrLib::HwlSetupTileInfo( /** **************************************************************************************************** -* CiAddrLib::ReadGbTileMode +* CiLib::ReadGbTileMode * * @brief * Convert GB_TILE_MODE HW value to ADDR_TILE_CONFIG. @@ -1461,9 +1467,9 @@ VOID CiAddrLib::HwlSetupTileInfo( * NA. **************************************************************************************************** */ -VOID CiAddrLib::ReadGbTileMode( - UINT_32 regValue, ///< [in] GB_TILE_MODE register - AddrTileConfig* pCfg ///< [out] output structure +VOID CiLib::ReadGbTileMode( + UINT_32 regValue, ///< [in] GB_TILE_MODE register + TileConfig* pCfg ///< [out] output structure ) const { GB_TILE_MODE gbTileMode; @@ -1529,7 +1535,7 @@ VOID CiAddrLib::ReadGbTileMode( /** **************************************************************************************************** -* CiAddrLib::InitTileSettingTable +* CiLib::InitTileSettingTable * * @brief * Initialize the ADDR_TILE_CONFIG table. @@ -1537,7 +1543,7 @@ VOID CiAddrLib::ReadGbTileMode( * TRUE if tile table is correctly initialized **************************************************************************************************** */ -BOOL_32 CiAddrLib::InitTileSettingTable( +BOOL_32 CiLib::InitTileSettingTable( const UINT_32* pCfg, ///< [in] Pointer to table of tile configs UINT_32 noOfEntries ///< [in] Numbe of entries in the table above ) @@ -1598,7 +1604,7 @@ BOOL_32 CiAddrLib::InitTileSettingTable( /** **************************************************************************************************** -* CiAddrLib::ReadGbMacroTileCfg +* CiLib::ReadGbMacroTileCfg * * @brief * Convert GB_MACRO_TILE_CFG HW value to ADDR_TILE_CONFIG. @@ -1606,7 +1612,7 @@ BOOL_32 CiAddrLib::InitTileSettingTable( * NA. **************************************************************************************************** */ -VOID CiAddrLib::ReadGbMacroTileCfg( +VOID CiLib::ReadGbMacroTileCfg( UINT_32 regValue, ///< [in] GB_MACRO_TILE_MODE register ADDR_TILEINFO* pCfg ///< [out] output structure ) const @@ -1622,7 +1628,7 @@ VOID CiAddrLib::ReadGbMacroTileCfg( /** **************************************************************************************************** -* CiAddrLib::InitMacroTileCfgTable +* CiLib::InitMacroTileCfgTable * * @brief * Initialize the ADDR_MACRO_TILE_CONFIG table. @@ -1630,7 +1636,7 @@ VOID CiAddrLib::ReadGbMacroTileCfg( * TRUE if macro tile table is correctly initialized **************************************************************************************************** */ -BOOL_32 CiAddrLib::InitMacroTileCfgTable( +BOOL_32 CiLib::InitMacroTileCfgTable( const UINT_32* pCfg, ///< [in] Pointer to table of tile configs UINT_32 noOfMacroEntries ///< [in] Numbe of entries in the table above ) @@ -1669,7 +1675,7 @@ BOOL_32 CiAddrLib::InitMacroTileCfgTable( /** **************************************************************************************************** -* CiAddrLib::HwlComputeMacroModeIndex +* CiLib::HwlComputeMacroModeIndex * * @brief * Computes macro tile mode index @@ -1677,7 +1683,7 @@ BOOL_32 CiAddrLib::InitMacroTileCfgTable( * TRUE if macro tile table is correctly initialized **************************************************************************************************** */ -INT_32 CiAddrLib::HwlComputeMacroModeIndex( +INT_32 CiLib::HwlComputeMacroModeIndex( INT_32 tileIndex, ///< [in] Tile mode index ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags UINT_32 bpp, ///< [in] Bit per pixel @@ -1769,7 +1775,7 @@ INT_32 CiAddrLib::HwlComputeMacroModeIndex( /** **************************************************************************************************** -* CiAddrLib::HwlComputeTileDataWidthAndHeightLinear +* CiLib::HwlComputeTileDataWidthAndHeightLinear * * @brief * Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout @@ -1781,7 +1787,7 @@ INT_32 CiAddrLib::HwlComputeMacroModeIndex( * MacroWidth and macroHeight are measured in pixels **************************************************************************************************** */ -VOID CiAddrLib::HwlComputeTileDataWidthAndHeightLinear( +VOID CiLib::HwlComputeTileDataWidthAndHeightLinear( UINT_32* pMacroWidth, ///< [out] macro tile width UINT_32* pMacroHeight, ///< [out] macro tile height UINT_32 bpp, ///< [in] bits per pixel @@ -1814,7 +1820,7 @@ VOID CiAddrLib::HwlComputeTileDataWidthAndHeightLinear( /** **************************************************************************************************** -* CiAddrLib::HwlComputeMetadataNibbleAddress +* CiLib::HwlComputeMetadataNibbleAddress * * @brief * calculate meta data address based on input information @@ -1835,7 +1841,7 @@ VOID CiAddrLib::HwlComputeTileDataWidthAndHeightLinear( * **************************************************************************************************** */ -UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( +UINT_64 CiLib::HwlComputeMetadataNibbleAddress( UINT_64 uncompressedDataByteAddress, UINT_64 dataBaseByteAddress, UINT_64 metadataBaseByteAddress, @@ -1883,7 +1889,7 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( UINT_32 lsb = pipeBits + pipeInterleaveBits; UINT_32 msb = bankBits - 1 + lsb; - UINT_64 bankDataBits = AddrGetBits(offset, msb, lsb); + UINT_64 bankDataBits = GetBits(offset, msb, lsb); ///-------------------------------------------------------------------------------------------- /// Save pipe data bits @@ -1891,7 +1897,7 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( lsb = pipeInterleaveBits; msb = pipeBits - 1 + lsb; - UINT_64 pipeDataBits = AddrGetBits(offset, msb, lsb); + UINT_64 pipeDataBits = GetBits(offset, msb, lsb); ///-------------------------------------------------------------------------------------------- /// Remove pipe and bank bits @@ -1899,7 +1905,7 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( lsb = pipeInterleaveBits; msb = dataMacrotileBits - 1; - UINT_64 offsetWithoutPipeBankBits = AddrRemoveBits(offset, msb, lsb); + UINT_64 offsetWithoutPipeBankBits = RemoveBits(offset, msb, lsb); ADDR_ASSERT((0 != blockByteSize)); UINT_64 blockInBankpipe = offsetWithoutPipeBankBits / blockByteSize; @@ -1917,7 +1923,7 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( } msb = bankBits - 1 + lsb; - UINT_64 blockInBankpipeWithBankBits = AddrInsertBits(blockInBankpipe, bankDataBits, msb, lsb); + UINT_64 blockInBankpipeWithBankBits = InsertBits(blockInBankpipe, bankDataBits, msb, lsb); /// NOTE *2 because we are converting to Nibble address in this step UINT_64 metaAddressInPipe = blockInBankpipeWithBankBits * 2 * metadataBitSize / 8; @@ -1928,14 +1934,14 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( ///-------------------------------------------------------------------------------------------- lsb = pipeInterleaveBits + 1; ///<+1 due to Nibble address now gives interleave bits extra lsb. msb = pipeBits - 1 + lsb; - UINT_64 metadataAddress = AddrInsertBits(metaAddressInPipe, pipeDataBits, msb, lsb); + UINT_64 metadataAddress = InsertBits(metaAddressInPipe, pipeDataBits, msb, lsb); return metadataAddress; } /** **************************************************************************************************** -* CiAddrLib::HwlPadDimensions +* CiLib::HwlPadDimensions * * @brief * Helper function to pad dimensions @@ -1945,7 +1951,7 @@ UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress( * **************************************************************************************************** */ -VOID CiAddrLib::HwlPadDimensions( +VOID CiLib::HwlPadDimensions( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -2021,7 +2027,7 @@ VOID CiAddrLib::HwlPadDimensions( /** **************************************************************************************************** -* CiAddrLib::HwlGetMaxAlignments +* CiLib::HwlGetMaxAlignments * * @brief * Gets maximum alignments @@ -2029,7 +2035,7 @@ VOID CiAddrLib::HwlPadDimensions( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE CiAddrLib::HwlGetMaxAlignments( +ADDR_E_RETURNCODE CiLib::HwlGetMaxAlignments( ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure ) const { @@ -2060,4 +2066,5 @@ ADDR_E_RETURNCODE CiAddrLib::HwlGetMaxAlignments( return ADDR_OK; } - +} // V1 +} // Addr diff --git a/src/amd/addrlib/r800/ciaddrlib.h b/src/amd/addrlib/r800/ciaddrlib.h index 69ede03f51c..438790a5895 100644 --- a/src/amd/addrlib/r800/ciaddrlib.h +++ b/src/amd/addrlib/r800/ciaddrlib.h @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file ciaddrlib.h -* @brief Contains the CiAddrLib class definition. +* @brief Contains the CiLib class definition. **************************************************************************************************** */ @@ -37,6 +37,11 @@ #include "addrlib1.h" #include "siaddrlib.h" +namespace Addr +{ +namespace V1 +{ + /** **************************************************************************************************** * @brief CI specific settings structure. @@ -74,18 +79,18 @@ struct CIChipSettings * function set. **************************************************************************************************** */ -class CiAddrLib : public SiAddrLib +class CiLib : public SiLib { public: - /// Creates CiAddrLib object - static AddrLib* CreateObj(const AddrClient* pClient) + /// Creates CiLib object + static Addr::Lib* CreateObj(const Client* pClient) { - return new(pClient) CiAddrLib(pClient); + return new(pClient) CiLib(pClient); } private: - CiAddrLib(const AddrClient* pClient); - virtual ~CiAddrLib(); + CiLib(const Client* pClient); + virtual ~CiLib(); protected: @@ -98,7 +103,7 @@ protected: const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut); - virtual AddrChipFamily HwlConvertChipFamily( + virtual ChipFamily HwlConvertChipFamily( UINT_32 uChipFamily, UINT_32 uChipRevision); virtual BOOL_32 HwlInitGlobalParams( @@ -117,7 +122,7 @@ protected: ADDR_TILEINFO* pTileInfo, AddrTileMode* pTileMode = NULL, AddrTileType* pTileType = NULL ) const; - // Sub-hwl interface - defined in EgBasedAddrLib + // Sub-hwl interface - defined in EgBasedLib virtual VOID HwlSetupTileInfo( AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples, @@ -167,7 +172,7 @@ protected: private: VOID ReadGbTileMode( - UINT_32 regValue, AddrTileConfig* pCfg) const; + UINT_32 regValue, TileConfig* pCfg) const; VOID ReadGbMacroTileCfg( UINT_32 regValue, ADDR_TILEINFO* pCfg) const; @@ -198,6 +203,9 @@ private: CIChipSettings m_settings; }; +} // V1 +} // Addr + #endif diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp index 393557741bc..5de3f996f08 100644 --- a/src/amd/addrlib/r800/egbaddrlib.cpp +++ b/src/amd/addrlib/r800/egbaddrlib.cpp @@ -27,15 +27,20 @@ /** **************************************************************************************************** * @file egbaddrlib.cpp -* @brief Contains the EgBasedAddrLib class implementation +* @brief Contains the EgBasedLib class implementation **************************************************************************************************** */ #include "egbaddrlib.h" +namespace Addr +{ +namespace V1 +{ + /** **************************************************************************************************** -* EgBasedAddrLib::EgBasedAddrLib +* EgBasedLib::EgBasedLib * * @brief * Constructor @@ -44,8 +49,8 @@ * **************************************************************************************************** */ -EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) : - AddrLib1(pClient), +EgBasedLib::EgBasedLib(const Client* pClient) : + Lib(pClient), m_ranks(0), m_logicalBanks(0), m_bankInterleave(1) @@ -54,19 +59,19 @@ EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) : /** **************************************************************************************************** -* EgBasedAddrLib::~EgBasedAddrLib +* EgBasedLib::~EgBasedLib * * @brief * Destructor **************************************************************************************************** */ -EgBasedAddrLib::~EgBasedAddrLib() +EgBasedLib::~EgBasedLib() { } /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeSurfaceInfo +* EgBasedLib::DispatchComputeSurfaceInfo * * @brief * Compute surface sizes include padded pitch,height,slices,total size in bytes, @@ -77,7 +82,7 @@ EgBasedAddrLib::~EgBasedAddrLib() * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::DispatchComputeSurfaceInfo( +BOOL_32 EgBasedLib::DispatchComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -198,7 +203,7 @@ BOOL_32 EgBasedAddrLib::DispatchComputeSurfaceInfo( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceInfoLinear +* EgBasedLib::ComputeSurfaceInfoLinear * * @brief * Compute linear surface sizes include padded pitch, height, slices, total size in @@ -209,7 +214,7 @@ BOOL_32 EgBasedAddrLib::DispatchComputeSurfaceInfo( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoLinear( +BOOL_32 EgBasedLib::ComputeSurfaceInfoLinear( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure UINT_32 padDims ///< [in] Dimensions to padd @@ -293,7 +298,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoLinear( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceInfoMicroTiled +* EgBasedLib::ComputeSurfaceInfoMicroTiled * * @brief * Compute 1D/Micro Tiled surface sizes include padded pitch, height, slices, total @@ -304,7 +309,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoLinear( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMicroTiled( +BOOL_32 EgBasedLib::ComputeSurfaceInfoMicroTiled( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure UINT_32 padDims, ///< [in] Dimensions to padd @@ -403,7 +408,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceInfoMacroTiled +* EgBasedLib::ComputeSurfaceInfoMacroTiled * * @brief * Compute 2D/macro tiled surface sizes include padded pitch, height, slices, total @@ -414,7 +419,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMicroTiled( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMacroTiled( +BOOL_32 EgBasedLib::ComputeSurfaceInfoMacroTiled( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure UINT_32 padDims, ///< [in] Dimensions to padd @@ -615,7 +620,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceAlignmentsLinear +* EgBasedLib::ComputeSurfaceAlignmentsLinear * * @brief * Compute linear surface alignment, calculation results are returned through @@ -625,7 +630,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMacroTiled( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsLinear( +BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsLinear( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -671,7 +676,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsLinear( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled +* EgBasedLib::ComputeSurfaceAlignmentsMicroTiled * * @brief * Compute 1D tiled surface alignment, calculation results are returned through @@ -681,7 +686,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsLinear( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled( +BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsMicroTiled( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -721,7 +726,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::HwlReduceBankWidthHeight +* EgBasedLib::HwlReduceBankWidthHeight * * @brief * Additional checks, reduce bankHeight/bankWidth if needed and possible @@ -731,7 +736,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::HwlReduceBankWidthHeight( +BOOL_32 EgBasedLib::HwlReduceBankWidthHeight( UINT_32 tileSize, ///< [in] tile size UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -825,7 +830,7 @@ BOOL_32 EgBasedAddrLib::HwlReduceBankWidthHeight( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled +* EgBasedLib::ComputeSurfaceAlignmentsMacroTiled * * @brief * Compute 2D tiled surface alignment, calculation results are returned through @@ -835,7 +840,7 @@ BOOL_32 EgBasedAddrLib::HwlReduceBankWidthHeight( * TRUE if no error occurs **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled( +BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsMacroTiled( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -949,7 +954,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::SanityCheckMacroTiled +* EgBasedLib::SanityCheckMacroTiled * * @brief * Check if macro-tiled parameters are valid @@ -957,7 +962,7 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled( * TRUE if valid **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::SanityCheckMacroTiled( +BOOL_32 EgBasedLib::SanityCheckMacroTiled( ADDR_TILEINFO* pTileInfo ///< [in] macro-tiled parameters ) const { @@ -1054,7 +1059,7 @@ BOOL_32 EgBasedAddrLib::SanityCheckMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceMipLevelTileMode +* EgBasedLib::ComputeSurfaceMipLevelTileMode * * @brief * Compute valid tile mode for surface mipmap sub-levels @@ -1063,7 +1068,7 @@ BOOL_32 EgBasedAddrLib::SanityCheckMacroTiled( * Suitable tile mode **************************************************************************************************** */ -AddrTileMode EgBasedAddrLib::ComputeSurfaceMipLevelTileMode( +AddrTileMode EgBasedLib::ComputeSurfaceMipLevelTileMode( AddrTileMode baseTileMode, ///< [in] base tile mode UINT_32 bpp, ///< [in] bits per pixels UINT_32 pitch, ///< [in] current level pitch @@ -1146,14 +1151,14 @@ AddrTileMode EgBasedAddrLib::ComputeSurfaceMipLevelTileMode( /** **************************************************************************************************** -* EgBasedAddrLib::HwlDegradeBaseLevel +* EgBasedLib::HwlDegradeBaseLevel * @brief * Check if degrade is needed for base level * @return * TRUE if degrade is suggested **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::HwlDegradeBaseLevel( +BOOL_32 EgBasedLib::HwlDegradeBaseLevel( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const { BOOL_32 degrade = FALSE; @@ -1230,7 +1235,7 @@ BOOL_32 EgBasedAddrLib::HwlDegradeBaseLevel( /** **************************************************************************************************** -* EgBasedAddrLib::HwlDegradeThickTileMode +* EgBasedLib::HwlDegradeThickTileMode * * @brief * Degrades valid tile mode for thick modes if needed @@ -1239,7 +1244,7 @@ BOOL_32 EgBasedAddrLib::HwlDegradeBaseLevel( * Suitable tile mode **************************************************************************************************** */ -AddrTileMode EgBasedAddrLib::HwlDegradeThickTileMode( +AddrTileMode EgBasedLib::HwlDegradeThickTileMode( AddrTileMode baseTileMode, ///< [in] base tile mode UINT_32 numSlices, ///< [in] current number of slices UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice @@ -1303,7 +1308,7 @@ AddrTileMode EgBasedAddrLib::HwlDegradeThickTileMode( /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord +* EgBasedLib::DispatchComputeSurfaceAddrFromCoord * * @brief * Compute surface address from given coord (x, y, slice,sample) @@ -1312,7 +1317,7 @@ AddrTileMode EgBasedAddrLib::HwlDegradeThickTileMode( * Address in bytes **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord( +UINT_64 EgBasedLib::DispatchComputeSurfaceAddrFromCoord( const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -1468,7 +1473,7 @@ UINT_64 EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeMacroTileEquation +* EgBasedLib::ComputeMacroTileEquation * * @brief * Computes the address equation in macro tile @@ -1476,7 +1481,7 @@ UINT_64 EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord( * If equation can be computed **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::ComputeMacroTileEquation( +ADDR_E_RETURNCODE EgBasedLib::ComputeMacroTileEquation( UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel AddrTileMode tileMode, ///< [in] tile mode AddrTileType microTileType, ///< [in] micro tiling type @@ -1599,7 +1604,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::ComputeMacroTileEquation( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled +* EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled * * @brief * Computes the surface address and bit position from a @@ -1608,7 +1613,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::ComputeMacroTileEquation( * The byte address **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMacroTiled( +UINT_64 EgBasedLib::ComputeSurfaceAddrFromCoordMacroTiled( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -1874,7 +1879,7 @@ UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled +* EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled * * @brief * Computes the surface address and bit position from a coordinate for 1D tilied @@ -1883,7 +1888,7 @@ UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMacroTiled( * The byte address **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled( +UINT_64 EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -1999,7 +2004,7 @@ UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputePixelCoordFromOffset +* EgBasedLib::HwlComputePixelCoordFromOffset * * @brief * Compute pixel coordinate from offset inside a micro tile @@ -2007,7 +2012,7 @@ UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled( * N/A **************************************************************************************************** */ -VOID EgBasedAddrLib::HwlComputePixelCoordFromOffset( +VOID EgBasedLib::HwlComputePixelCoordFromOffset( UINT_32 offset, ///< [in] offset inside micro tile in bits UINT_32 bpp, ///< [in] bits per pixel UINT_32 numSamples, ///< [in] number of samples @@ -2188,7 +2193,7 @@ VOID EgBasedAddrLib::HwlComputePixelCoordFromOffset( /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddrDispatch +* EgBasedLib::DispatchComputeSurfaceCoordFromAddrDispatch * * @brief * Compute (x,y,slice,sample) coordinates from surface address @@ -2196,7 +2201,7 @@ VOID EgBasedAddrLib::HwlComputePixelCoordFromOffset( * N/A **************************************************************************************************** */ -VOID EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddr( +VOID EgBasedLib::DispatchComputeSurfaceCoordFromAddr( const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -2333,7 +2338,7 @@ VOID EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddr( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled +* EgBasedLib::ComputeSurfaceCoordFromAddrMacroTiled * * @brief * Compute surface coordinates from address for macro tiled surface @@ -2341,7 +2346,7 @@ VOID EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddr( * N/A **************************************************************************************************** */ -VOID EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled( +VOID EgBasedLib::ComputeSurfaceCoordFromAddrMacroTiled( UINT_64 addr, ///< [in] byte address UINT_32 bitPosition, ///< [in] bit position UINT_32 bpp, ///< [in] bits per pixel @@ -2491,7 +2496,7 @@ VOID EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSurfaceCoord2DFromBankPipe +* EgBasedLib::ComputeSurfaceCoord2DFromBankPipe * * @brief * Compute surface x,y coordinates from bank/pipe info @@ -2499,7 +2504,7 @@ VOID EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled( * N/A **************************************************************************************************** */ -VOID EgBasedAddrLib::ComputeSurfaceCoord2DFromBankPipe( +VOID EgBasedLib::ComputeSurfaceCoord2DFromBankPipe( AddrTileMode tileMode, ///< [in] tile mode UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate @@ -2677,14 +2682,14 @@ VOID EgBasedAddrLib::ComputeSurfaceCoord2DFromBankPipe( /** **************************************************************************************************** -* EgBasedAddrLib::HwlExtractBankPipeSwizzle +* EgBasedLib::HwlExtractBankPipeSwizzle * @brief -* Entry of EgBasedAddrLib ExtractBankPipeSwizzle +* Entry of EgBasedLib ExtractBankPipeSwizzle * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlExtractBankPipeSwizzle( +ADDR_E_RETURNCODE EgBasedLib::HwlExtractBankPipeSwizzle( const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure ) const @@ -2700,14 +2705,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlExtractBankPipeSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::HwlCombineBankPipeSwizzle +* EgBasedLib::HwlCombineBankPipeSwizzle * @brief * Combine bank/pipe swizzle * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlCombineBankPipeSwizzle( +ADDR_E_RETURNCODE EgBasedLib::HwlCombineBankPipeSwizzle( UINT_32 bankSwizzle, ///< [in] bank swizzle UINT_32 pipeSwizzle, ///< [in] pipe swizzle ADDR_TILEINFO* pTileInfo, ///< [in] tile info @@ -2731,14 +2736,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlCombineBankPipeSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeBaseSwizzle +* EgBasedLib::HwlComputeBaseSwizzle * @brief * Compute base swizzle * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeBaseSwizzle( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeBaseSwizzle( const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn, ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut ) const @@ -2806,14 +2811,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeBaseSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::ExtractBankPipeSwizzle +* EgBasedLib::ExtractBankPipeSwizzle * @brief * Extract bank/pipe swizzle from base256b * @return * N/A **************************************************************************************************** */ -VOID EgBasedAddrLib::ExtractBankPipeSwizzle( +VOID EgBasedLib::ExtractBankPipeSwizzle( UINT_32 base256b, ///< [in] input base256b register value ADDR_TILEINFO* pTileInfo, ///< [in] 2D tile parameters. Client must provide all data UINT_32* pBankSwizzle, ///< [out] bank swizzle @@ -2844,14 +2849,14 @@ VOID EgBasedAddrLib::ExtractBankPipeSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::GetBankPipeSwizzle +* EgBasedLib::GetBankPipeSwizzle * @brief * Combine bank/pipe swizzle * @return * Base256b bits (only filled bank/pipe bits) **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::GetBankPipeSwizzle( +UINT_32 EgBasedLib::GetBankPipeSwizzle( UINT_32 bankSwizzle, ///< [in] bank swizzle UINT_32 pipeSwizzle, ///< [in] pipe swizzle UINT_64 baseAddr, ///< [in] base address @@ -2870,14 +2875,14 @@ UINT_32 EgBasedAddrLib::GetBankPipeSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeSliceTileSwizzle +* EgBasedLib::ComputeSliceTileSwizzle * @brief * Compute cubemap/3d texture faces/slices tile swizzle * @return * Tile swizzle **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeSliceTileSwizzle( +UINT_32 EgBasedLib::ComputeSliceTileSwizzle( AddrTileMode tileMode, ///< [in] Tile mode UINT_32 baseSwizzle, ///< [in] Base swizzle UINT_32 slice, ///< [in] Slice index, Cubemap face index, 0 means +X @@ -2935,7 +2940,7 @@ UINT_32 EgBasedAddrLib::ComputeSliceTileSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeQbStereoRightSwizzle +* EgBasedLib::HwlComputeQbStereoRightSwizzle * * @brief * Compute right eye swizzle @@ -2943,7 +2948,7 @@ UINT_32 EgBasedAddrLib::ComputeSliceTileSwizzle( * swizzle **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::HwlComputeQbStereoRightSwizzle( +UINT_32 EgBasedLib::HwlComputeQbStereoRightSwizzle( ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pInfo ///< [in] Surface info, must be valid ) const { @@ -2967,7 +2972,7 @@ UINT_32 EgBasedAddrLib::HwlComputeQbStereoRightSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeBankFromCoord +* EgBasedLib::ComputeBankFromCoord * * @brief * Compute bank number from coordinates @@ -2975,7 +2980,7 @@ UINT_32 EgBasedAddrLib::HwlComputeQbStereoRightSwizzle( * Bank number **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeBankFromCoord( +UINT_32 EgBasedLib::ComputeBankFromCoord( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -3099,7 +3104,7 @@ UINT_32 EgBasedAddrLib::ComputeBankFromCoord( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeBankFromAddr +* EgBasedLib::ComputeBankFromAddr * * @brief * Compute the bank number from an address @@ -3107,7 +3112,7 @@ UINT_32 EgBasedAddrLib::ComputeBankFromCoord( * Bank number **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeBankFromAddr( +UINT_32 EgBasedLib::ComputeBankFromAddr( UINT_64 addr, ///< [in] address UINT_32 numBanks, ///< [in] number of banks UINT_32 numPipes ///< [in] number of pipes @@ -3132,7 +3137,7 @@ UINT_32 EgBasedAddrLib::ComputeBankFromAddr( /** **************************************************************************************************** -* EgBasedAddrLib::ComputePipeRotation +* EgBasedLib::ComputePipeRotation * * @brief * Compute pipe rotation value @@ -3140,7 +3145,7 @@ UINT_32 EgBasedAddrLib::ComputeBankFromAddr( * Pipe rotation **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputePipeRotation( +UINT_32 EgBasedLib::ComputePipeRotation( AddrTileMode tileMode, ///< [in] tile mode UINT_32 numPipes ///< [in] number of pipes ) const @@ -3167,7 +3172,7 @@ UINT_32 EgBasedAddrLib::ComputePipeRotation( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeBankRotation +* EgBasedLib::ComputeBankRotation * * @brief * Compute bank rotation value @@ -3175,7 +3180,7 @@ UINT_32 EgBasedAddrLib::ComputePipeRotation( * Bank rotation **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeBankRotation( +UINT_32 EgBasedLib::ComputeBankRotation( AddrTileMode tileMode, ///< [in] tile mode UINT_32 numBanks, ///< [in] number of banks UINT_32 numPipes ///< [in] number of pipes @@ -3210,7 +3215,7 @@ UINT_32 EgBasedAddrLib::ComputeBankRotation( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeHtileBytes +* EgBasedLib::ComputeHtileBytes * * @brief * Compute htile size in bytes @@ -3219,7 +3224,7 @@ UINT_32 EgBasedAddrLib::ComputeBankRotation( * Htile size in bytes **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::ComputeHtileBytes( +UINT_64 EgBasedLib::ComputeHtileBytes( UINT_32 pitch, ///< [in] pitch UINT_32 height, ///< [in] height UINT_32 bpp, ///< [in] bits per pixel @@ -3253,7 +3258,7 @@ UINT_64 EgBasedAddrLib::ComputeHtileBytes( /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeFmaskInfo +* EgBasedLib::DispatchComputeFmaskInfo * * @brief * Compute fmask sizes include padded pitch, height, slices, total size in bytes, @@ -3264,7 +3269,7 @@ UINT_64 EgBasedAddrLib::ComputeHtileBytes( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::DispatchComputeFmaskInfo( +ADDR_E_RETURNCODE EgBasedLib::DispatchComputeFmaskInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) ///< [out] output structure { @@ -3330,14 +3335,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::DispatchComputeFmaskInfo( /** **************************************************************************************************** -* EgBasedAddrLib::HwlFmaskSurfaceInfo +* EgBasedLib::HwlFmaskSurfaceInfo * @brief -* Entry of EgBasedAddrLib ComputeFmaskInfo +* Entry of EgBasedLib ComputeFmaskInfo * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskInfo( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure ) @@ -3372,14 +3377,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskInfo( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeFmaskAddrFromCoord +* EgBasedLib::HwlComputeFmaskAddrFromCoord * @brief -* Entry of EgBasedAddrLib ComputeFmaskAddrFromCoord +* Entry of EgBasedLib ComputeFmaskAddrFromCoord * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskAddrFromCoord( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskAddrFromCoord( const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -3405,14 +3410,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskAddrFromCoord( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeFmaskCoordFromAddr +* EgBasedLib::HwlComputeFmaskCoordFromAddr * @brief -* Entry of EgBasedAddrLib ComputeFmaskCoordFromAddr +* Entry of EgBasedLib ComputeFmaskCoordFromAddr * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskCoordFromAddr( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskCoordFromAddr( const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -3437,7 +3442,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskCoordFromAddr( #if ADDR_AM_BUILD /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord +* EgBasedLib::DispatchComputeFmaskAddrFromCoord * * @brief * Computes the FMASK address and bit position from a coordinate. @@ -3445,7 +3450,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskCoordFromAddr( * The byte address **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord( +UINT_64 EgBasedLib::DispatchComputeFmaskAddrFromCoord( const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -3526,7 +3531,7 @@ UINT_64 EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled +* EgBasedLib::ComputeFmaskAddrFromCoordMicroTiled * * @brief * Computes the FMASK address and bit position from a coordinate for 1D tilied (micro @@ -3535,7 +3540,7 @@ UINT_64 EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord( * The byte address **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled( +UINT_64 EgBasedLib::ComputeFmaskAddrFromCoordMicroTiled( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -3634,7 +3639,7 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled +* EgBasedLib::ComputeFmaskAddrFromCoordMacroTiled * * @brief * Computes the FMASK address and bit position from a coordinate for 2D tilied (macro @@ -3643,7 +3648,7 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled( * The byte address **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled( +UINT_64 EgBasedLib::ComputeFmaskAddrFromCoordMacroTiled( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -3756,7 +3761,7 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled +* EgBasedLib::ComputeFmaskCoordFromAddrMicroTiled * * @brief * Compute (x,y,slice,sample,plane) coordinates from fmask address @@ -3765,7 +3770,7 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled( * **************************************************************************************************** */ -VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled( +VOID EgBasedLib::ComputeFmaskCoordFromAddrMicroTiled( UINT_64 addr, ///< [in] byte address UINT_32 bitPosition,///< [in] bit position UINT_32 pitch, ///< [in] pitch in pixels @@ -3843,7 +3848,7 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled +* EgBasedLib::ComputeFmaskCoordFromAddrMacroTiled * * @brief * Compute (x,y,slice,sample,plane) coordinates from @@ -3853,7 +3858,7 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled( * **************************************************************************************************** */ -VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled( +VOID EgBasedLib::ComputeFmaskCoordFromAddrMacroTiled( UINT_64 addr, ///< [in] byte address UINT_32 bitPosition,///< [in] bit position UINT_32 pitch, ///< [in] pitch in pixels @@ -3943,7 +3948,7 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr +* EgBasedLib::DispatchComputeFmaskCoordFromAddr * * @brief * Compute (x,y,slice,sample,plane) coordinates from @@ -3953,7 +3958,7 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled( * **************************************************************************************************** */ -VOID EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr( +VOID EgBasedLib::DispatchComputeFmaskCoordFromAddr( const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -4033,7 +4038,7 @@ VOID EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples +* EgBasedLib::ComputeFmaskNumPlanesFromNumSamples * * @brief * Compute fmask number of planes from number of samples @@ -4042,7 +4047,7 @@ VOID EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr( * Number of planes **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples( +UINT_32 EgBasedLib::ComputeFmaskNumPlanesFromNumSamples( UINT_32 numSamples) ///< [in] number of samples { UINT_32 numPlanes; @@ -4078,7 +4083,7 @@ UINT_32 EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples( /** **************************************************************************************************** -* EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples +* EgBasedLib::ComputeFmaskResolvedBppFromNumSamples * * @brief * Compute resolved fmask effective bpp based on number of samples @@ -4087,7 +4092,7 @@ UINT_32 EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples( * bpp **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples( +UINT_32 EgBasedLib::ComputeFmaskResolvedBppFromNumSamples( UINT_32 numSamples) ///< number of samples { UINT_32 bpp; @@ -4123,7 +4128,7 @@ UINT_32 EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples( /** **************************************************************************************************** -* EgBasedAddrLib::IsTileInfoAllZero +* EgBasedLib::IsTileInfoAllZero * * @brief * Return TRUE if all field are zero @@ -4131,7 +4136,7 @@ UINT_32 EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples( * Since NULL input is consider to be all zero **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::IsTileInfoAllZero( +BOOL_32 EgBasedLib::IsTileInfoAllZero( ADDR_TILEINFO* pTileInfo) { BOOL_32 allZero = TRUE; @@ -4155,7 +4160,7 @@ BOOL_32 EgBasedAddrLib::IsTileInfoAllZero( /** **************************************************************************************************** -* EgBasedAddrLib::HwlTileInfoEqual +* EgBasedLib::HwlTileInfoEqual * * @brief * Return TRUE if all field are equal @@ -4163,7 +4168,7 @@ BOOL_32 EgBasedAddrLib::IsTileInfoAllZero( * Only takes care of current HWL's data **************************************************************************************************** */ -BOOL_32 EgBasedAddrLib::HwlTileInfoEqual( +BOOL_32 EgBasedLib::HwlTileInfoEqual( const ADDR_TILEINFO* pLeft, ///<[in] Left compare operand const ADDR_TILEINFO* pRight ///<[in] Right compare operand ) const @@ -4184,14 +4189,14 @@ BOOL_32 EgBasedAddrLib::HwlTileInfoEqual( /** **************************************************************************************************** -* EgBasedAddrLib::HwlConvertTileInfoToHW +* EgBasedLib::HwlConvertTileInfoToHW * @brief -* Entry of EgBasedAddrLib ConvertTileInfoToHW +* Entry of EgBasedLib ConvertTileInfoToHW * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlConvertTileInfoToHW( +ADDR_E_RETURNCODE EgBasedLib::HwlConvertTileInfoToHW( const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure ) const @@ -4452,14 +4457,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlConvertTileInfoToHW( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeSurfaceInfo +* EgBasedLib::HwlComputeSurfaceInfo * @brief -* Entry of EgBasedAddrLib ComputeSurfaceInfo +* Entry of EgBasedLib ComputeSurfaceInfo * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceInfo( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure ) const @@ -4539,14 +4544,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceInfo( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeSurfaceAddrFromCoord +* EgBasedLib::HwlComputeSurfaceAddrFromCoord * @brief -* Entry of EgBasedAddrLib ComputeSurfaceAddrFromCoord +* Entry of EgBasedLib ComputeSurfaceAddrFromCoord * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceAddrFromCoord( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceAddrFromCoord( const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure ) const @@ -4572,14 +4577,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceAddrFromCoord( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeSurfaceCoordFromAddr +* EgBasedLib::HwlComputeSurfaceCoordFromAddr * @brief -* Entry of EgBasedAddrLib ComputeSurfaceCoordFromAddr +* Entry of EgBasedLib ComputeSurfaceCoordFromAddr * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceCoordFromAddr( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceCoordFromAddr( const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure ) const @@ -4600,14 +4605,14 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceCoordFromAddr( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeSliceTileSwizzle +* EgBasedLib::HwlComputeSliceTileSwizzle * @brief -* Entry of EgBasedAddrLib ComputeSurfaceCoordFromAddr +* Entry of EgBasedLib ComputeSurfaceCoordFromAddr * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSliceTileSwizzle( +ADDR_E_RETURNCODE EgBasedLib::HwlComputeSliceTileSwizzle( const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure ) const @@ -4633,7 +4638,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSliceTileSwizzle( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeHtileBpp +* EgBasedLib::HwlComputeHtileBpp * * @brief * Compute htile bpp @@ -4642,7 +4647,7 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSliceTileSwizzle( * Htile bpp **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::HwlComputeHtileBpp( +UINT_32 EgBasedLib::HwlComputeHtileBpp( BOOL_32 isWidth8, ///< [in] TRUE if block width is 8 BOOL_32 isHeight8 ///< [in] TRUE if block height is 8 ) const @@ -4654,7 +4659,7 @@ UINT_32 EgBasedAddrLib::HwlComputeHtileBpp( /** **************************************************************************************************** -* EgBasedAddrLib::HwlComputeHtileBaseAlign +* EgBasedLib::HwlComputeHtileBaseAlign * * @brief * Compute htile base alignment @@ -4663,7 +4668,7 @@ UINT_32 EgBasedAddrLib::HwlComputeHtileBpp( * Htile base alignment **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::HwlComputeHtileBaseAlign( +UINT_32 EgBasedLib::HwlComputeHtileBaseAlign( BOOL_32 isTcCompatible, ///< [in] if TC compatible BOOL_32 isLinear, ///< [in] if it is linear mode ADDR_TILEINFO* pTileInfo ///< [in] Tile info @@ -4685,7 +4690,7 @@ UINT_32 EgBasedAddrLib::HwlComputeHtileBaseAlign( /** **************************************************************************************************** -* EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled +* EgBasedLib::HwlGetPitchAlignmentMicroTiled * * @brief * Compute 1D tiled surface pitch alignment, calculation results are returned through @@ -4695,7 +4700,7 @@ UINT_32 EgBasedAddrLib::HwlComputeHtileBaseAlign( * pitch alignment **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled( +UINT_32 EgBasedLib::HwlGetPitchAlignmentMicroTiled( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -4734,7 +4739,7 @@ UINT_32 EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled +* EgBasedLib::HwlGetSizeAdjustmentMicroTiled * * @brief * Adjust 1D tiled surface pitch and slice size @@ -4743,7 +4748,7 @@ UINT_32 EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled( * Logical slice size in bytes **************************************************************************************************** */ -UINT_64 EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled( +UINT_64 EgBasedLib::HwlGetSizeAdjustmentMicroTiled( UINT_32 thickness, ///< [in] thickness UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -4776,7 +4781,7 @@ UINT_64 EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled( /** **************************************************************************************************** -* EgBasedAddrLib::HwlStereoCheckRightOffsetPadding +* EgBasedLib::HwlStereoCheckRightOffsetPadding * * @brief * check if the height needs extra padding for stereo right eye offset, to avoid swizzling @@ -4786,7 +4791,7 @@ UINT_64 EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled( * **************************************************************************************************** */ -UINT_32 EgBasedAddrLib::HwlStereoCheckRightOffsetPadding( +UINT_32 EgBasedLib::HwlStereoCheckRightOffsetPadding( ADDR_TILEINFO* pTileInfo ///< Tiling info ) const { @@ -4809,3 +4814,5 @@ UINT_32 EgBasedAddrLib::HwlStereoCheckRightOffsetPadding( return stereoHeightAlign; } +} // V1 +} // Addr diff --git a/src/amd/addrlib/r800/egbaddrlib.h b/src/amd/addrlib/r800/egbaddrlib.h index 6bc6c53e874..c397cfc4f81 100644 --- a/src/amd/addrlib/r800/egbaddrlib.h +++ b/src/amd/addrlib/r800/egbaddrlib.h @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file egbaddrlib.h -* @brief Contains the EgBasedAddrLib class definition. +* @brief Contains the EgBasedLib class definition. **************************************************************************************************** */ @@ -36,7 +36,10 @@ #include "addrlib1.h" - +namespace Addr +{ +namespace V1 +{ /// Structures for functions struct CoordFromBankPipe { @@ -58,11 +61,11 @@ struct CoordFromBankPipe * @note Abstract class **************************************************************************************************** */ -class EgBasedAddrLib : public AddrLib1 +class EgBasedLib : public Lib { protected: - EgBasedAddrLib(const AddrClient* pClient); - virtual ~EgBasedAddrLib(); + EgBasedLib(const Client* pClient); + virtual ~EgBasedLib(); public: @@ -415,5 +418,8 @@ protected: UINT_32 m_bankInterleave; ///< Bank interleave, as a multiple of pipe interleave size }; +} // V1 +} // Addr + #endif diff --git a/src/amd/addrlib/r800/siaddrlib.cpp b/src/amd/addrlib/r800/siaddrlib.cpp index 964f2fd28cc..9d3f5aa9367 100644 --- a/src/amd/addrlib/r800/siaddrlib.cpp +++ b/src/amd/addrlib/r800/siaddrlib.cpp @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file siaddrlib.cpp -* @brief Contains the implementation for the SiAddrLib class. +* @brief Contains the implementation for the SiLib class. **************************************************************************************************** */ @@ -45,34 +45,40 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// +namespace Addr +{ /** **************************************************************************************************** -* AddrSiHwlInit +* SiHwlInit * * @brief -* Creates an SiAddrLib object. +* Creates an SiLib object. * * @return -* Returns an SiAddrLib object pointer. +* Returns an SiLib object pointer. **************************************************************************************************** */ -AddrLib* AddrSIHwlInit(const AddrClient* pClient) +Lib* SiHwlInit(const Client* pClient) { - return SiAddrLib::CreateObj(pClient); + return V1::SiLib::CreateObj(pClient); } +namespace V1 +{ + /** **************************************************************************************************** -* SiAddrLib::SiAddrLib +* SiLib::SiLib * * @brief * Constructor * **************************************************************************************************** */ -SiAddrLib::SiAddrLib(const AddrClient* pClient) : - EgBasedAddrLib(pClient), +SiLib::SiLib(const Client* pClient) + : + EgBasedLib(pClient), m_noOfEntries(0), m_numEquations(0) { @@ -82,19 +88,19 @@ SiAddrLib::SiAddrLib(const AddrClient* pClient) : /** **************************************************************************************************** -* SiAddrLib::~SiAddrLib +* SiLib::~SiLib * * @brief * Destructor **************************************************************************************************** */ -SiAddrLib::~SiAddrLib() +SiLib::~SiLib() { } /** **************************************************************************************************** -* SiAddrLib::HwlGetPipes +* SiLib::HwlGetPipes * * @brief * Get number pipes @@ -102,7 +108,7 @@ SiAddrLib::~SiAddrLib() * num pipes **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlGetPipes( +UINT_32 SiLib::HwlGetPipes( const ADDR_TILEINFO* pTileInfo ///< [in] Tile info ) const { @@ -123,14 +129,14 @@ UINT_32 SiAddrLib::HwlGetPipes( /** **************************************************************************************************** -* SiAddrLib::GetPipePerSurf +* SiLib::GetPipePerSurf * @brief * get pipe num base on inputing tileinfo->pipeconfig * @return * pipe number **************************************************************************************************** */ -UINT_32 SiAddrLib::GetPipePerSurf( +UINT_32 SiLib::GetPipePerSurf( AddrPipeCfg pipeConfig ///< [in] pipe config ) const { @@ -169,7 +175,7 @@ UINT_32 SiAddrLib::GetPipePerSurf( /** **************************************************************************************************** -* SiAddrLib::ComputeBankEquation +* SiLib::ComputeBankEquation * * @brief * Compute bank equation @@ -178,7 +184,7 @@ UINT_32 SiAddrLib::GetPipePerSurf( * If equation can be computed **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::ComputeBankEquation( +ADDR_E_RETURNCODE SiLib::ComputeBankEquation( UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel UINT_32 threshX, ///< [in] threshold for x channel UINT_32 threshY, ///< [in] threshold for y channel @@ -303,7 +309,7 @@ ADDR_E_RETURNCODE SiAddrLib::ComputeBankEquation( /** **************************************************************************************************** -* SiAddrLib::ComputePipeEquation +* SiLib::ComputePipeEquation * * @brief * Compute pipe equation @@ -312,7 +318,7 @@ ADDR_E_RETURNCODE SiAddrLib::ComputeBankEquation( * If equation can be computed **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::ComputePipeEquation( +ADDR_E_RETURNCODE SiLib::ComputePipeEquation( UINT_32 log2BytesPP, ///< [in] Log2 of bytes per pixel UINT_32 threshX, ///< [in] Threshold for X channel UINT_32 threshY, ///< [in] Threshold for Y channel @@ -501,7 +507,7 @@ ADDR_E_RETURNCODE SiAddrLib::ComputePipeEquation( /** **************************************************************************************************** -* SiAddrLib::ComputePipeFromCoord +* SiLib::ComputePipeFromCoord * * @brief * Compute pipe number from coordinates @@ -509,7 +515,7 @@ ADDR_E_RETURNCODE SiAddrLib::ComputePipeEquation( * Pipe number **************************************************************************************************** */ -UINT_32 SiAddrLib::ComputePipeFromCoord( +UINT_32 SiLib::ComputePipeFromCoord( UINT_32 x, ///< [in] x coordinate UINT_32 y, ///< [in] y coordinate UINT_32 slice, ///< [in] slice index @@ -652,7 +658,7 @@ UINT_32 SiAddrLib::ComputePipeFromCoord( /** **************************************************************************************************** -* SiAddrLib::ComputeTileCoordFromPipeAndElemIdx +* SiLib::ComputeTileCoordFromPipeAndElemIdx * * @brief * Compute (x,y) of a tile within a macro tile from address @@ -660,7 +666,7 @@ UINT_32 SiAddrLib::ComputePipeFromCoord( * Pipe number **************************************************************************************************** */ -VOID SiAddrLib::ComputeTileCoordFromPipeAndElemIdx( +VOID SiLib::ComputeTileCoordFromPipeAndElemIdx( UINT_32 elemIdx, ///< [in] per pipe element index within a macro tile UINT_32 pipe, ///< [in] pipe index AddrPipeCfg pipeCfg, ///< [in] pipe config @@ -909,7 +915,7 @@ VOID SiAddrLib::ComputeTileCoordFromPipeAndElemIdx( /** **************************************************************************************************** -* SiAddrLib::TileCoordToMaskElementIndex +* SiLib::TileCoordToMaskElementIndex * * @brief * Compute element index from coordinates in tiles @@ -917,7 +923,7 @@ VOID SiAddrLib::ComputeTileCoordFromPipeAndElemIdx( * Element index **************************************************************************************************** */ -UINT_32 SiAddrLib::TileCoordToMaskElementIndex( +UINT_32 SiLib::TileCoordToMaskElementIndex( UINT_32 tx, ///< [in] x coord, in Tiles UINT_32 ty, ///< [in] y coord, in Tiles AddrPipeCfg pipeConfig, ///< [in] pipe config @@ -1045,7 +1051,7 @@ UINT_32 SiAddrLib::TileCoordToMaskElementIndex( /** **************************************************************************************************** -* SiAddrLib::HwlComputeTileDataWidthAndHeightLinear +* SiLib::HwlComputeTileDataWidthAndHeightLinear * * @brief * Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout @@ -1057,7 +1063,7 @@ UINT_32 SiAddrLib::TileCoordToMaskElementIndex( * MacroWidth and macroHeight are measured in pixels **************************************************************************************************** */ -VOID SiAddrLib::HwlComputeTileDataWidthAndHeightLinear( +VOID SiLib::HwlComputeTileDataWidthAndHeightLinear( UINT_32* pMacroWidth, ///< [out] macro tile width UINT_32* pMacroHeight, ///< [out] macro tile height UINT_32 bpp, ///< [in] bits per pixel @@ -1091,7 +1097,7 @@ VOID SiAddrLib::HwlComputeTileDataWidthAndHeightLinear( /** **************************************************************************************************** -* SiAddrLib::HwlComputeHtileBytes +* SiLib::HwlComputeHtileBytes * * @brief * Compute htile size in bytes @@ -1100,7 +1106,7 @@ VOID SiAddrLib::HwlComputeTileDataWidthAndHeightLinear( * Htile size in bytes **************************************************************************************************** */ -UINT_64 SiAddrLib::HwlComputeHtileBytes( +UINT_64 SiLib::HwlComputeHtileBytes( UINT_32 pitch, ///< [in] pitch UINT_32 height, ///< [in] height UINT_32 bpp, ///< [in] bits per pixel @@ -1115,7 +1121,7 @@ UINT_64 SiAddrLib::HwlComputeHtileBytes( /** **************************************************************************************************** -* SiAddrLib::HwlComputeXmaskAddrFromCoord +* SiLib::HwlComputeXmaskAddrFromCoord * * @brief * Compute address from coordinates for htile/cmask @@ -1123,7 +1129,7 @@ UINT_64 SiAddrLib::HwlComputeHtileBytes( * Byte address **************************************************************************************************** */ -UINT_64 SiAddrLib::HwlComputeXmaskAddrFromCoord( +UINT_64 SiLib::HwlComputeXmaskAddrFromCoord( UINT_32 pitch, ///< [in] pitch UINT_32 height, ///< [in] height UINT_32 x, ///< [in] x coord @@ -1270,7 +1276,7 @@ UINT_64 SiAddrLib::HwlComputeXmaskAddrFromCoord( /** **************************************************************************************************** -* SiAddrLib::HwlComputeXmaskCoordFromAddr +* SiLib::HwlComputeXmaskCoordFromAddr * * @brief * Compute the coord from an address of a cmask/htile @@ -1282,7 +1288,7 @@ UINT_64 SiAddrLib::HwlComputeXmaskAddrFromCoord( * This method is reused by htile, so rename to Xmask **************************************************************************************************** */ -VOID SiAddrLib::HwlComputeXmaskCoordFromAddr( +VOID SiLib::HwlComputeXmaskCoordFromAddr( UINT_64 addr, ///< [in] address UINT_32 bitPosition, ///< [in] bitPosition in a byte UINT_32 pitch, ///< [in] pitch @@ -1476,14 +1482,14 @@ VOID SiAddrLib::HwlComputeXmaskCoordFromAddr( /** **************************************************************************************************** -* SiAddrLib::HwlGetPitchAlignmentLinear +* SiLib::HwlGetPitchAlignmentLinear * @brief * Get pitch alignment * @return * pitch alignment **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlGetPitchAlignmentLinear( +UINT_32 SiLib::HwlGetPitchAlignmentLinear( UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags ///< [in] surface flags ) const @@ -1506,7 +1512,7 @@ UINT_32 SiAddrLib::HwlGetPitchAlignmentLinear( /** **************************************************************************************************** -* SiAddrLib::HwlGetSizeAdjustmentLinear +* SiLib::HwlGetSizeAdjustmentLinear * * @brief * Adjust linear surface pitch and slice size @@ -1515,7 +1521,7 @@ UINT_32 SiAddrLib::HwlGetPitchAlignmentLinear( * Logical slice size in bytes **************************************************************************************************** */ -UINT_64 SiAddrLib::HwlGetSizeAdjustmentLinear( +UINT_64 SiLib::HwlGetSizeAdjustmentLinear( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel UINT_32 numSamples, ///< [in] number of samples @@ -1567,7 +1573,7 @@ UINT_64 SiAddrLib::HwlGetSizeAdjustmentLinear( /** **************************************************************************************************** -* SiAddrLib::HwlPreHandleBaseLvl3xPitch +* SiLib::HwlPreHandleBaseLvl3xPitch * * @brief * Pre-handler of 3x pitch (96 bit) adjustment @@ -1576,7 +1582,7 @@ UINT_64 SiAddrLib::HwlGetSizeAdjustmentLinear( * Expected pitch **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch( +UINT_32 SiLib::HwlPreHandleBaseLvl3xPitch( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input UINT_32 expPitch ///< [in] pitch ) const @@ -1587,7 +1593,7 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch( // do here if (pIn->flags.pow2Pad == FALSE) { - AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch); + Addr::V1::Lib::HwlPreHandleBaseLvl3xPitch(pIn, expPitch); } else { @@ -1599,7 +1605,7 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch( /** **************************************************************************************************** -* SiAddrLib::HwlPostHandleBaseLvl3xPitch +* SiLib::HwlPostHandleBaseLvl3xPitch * * @brief * Post-handler of 3x pitch adjustment @@ -1608,7 +1614,7 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch( * Expected pitch **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch( +UINT_32 SiLib::HwlPostHandleBaseLvl3xPitch( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input UINT_32 expPitch ///< [in] pitch ) const @@ -1620,7 +1626,7 @@ UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch( // From SI, the pitch is expanded 3x first, then padded to pow2, so no special handler here if (pIn->flags.pow2Pad == FALSE) { - AddrLib1::HwlPostHandleBaseLvl3xPitch(pIn, expPitch); + Addr::V1::Lib::HwlPostHandleBaseLvl3xPitch(pIn, expPitch); } return expPitch; @@ -1628,7 +1634,7 @@ UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch( /** **************************************************************************************************** -* SiAddrLib::HwlGetPitchAlignmentMicroTiled +* SiLib::HwlGetPitchAlignmentMicroTiled * * @brief * Compute 1D tiled surface pitch alignment @@ -1637,7 +1643,7 @@ UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch( * pitch alignment **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlGetPitchAlignmentMicroTiled( +UINT_32 SiLib::HwlGetPitchAlignmentMicroTiled( AddrTileMode tileMode, ///< [in] tile mode UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -1648,7 +1654,7 @@ UINT_32 SiAddrLib::HwlGetPitchAlignmentMicroTiled( if (flags.qbStereo) { - pitchAlign = EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled(tileMode,bpp,flags,numSamples); + pitchAlign = EgBasedLib::HwlGetPitchAlignmentMicroTiled(tileMode,bpp,flags,numSamples); } else { @@ -1660,7 +1666,7 @@ UINT_32 SiAddrLib::HwlGetPitchAlignmentMicroTiled( /** **************************************************************************************************** -* SiAddrLib::HwlGetSizeAdjustmentMicroTiled +* SiLib::HwlGetSizeAdjustmentMicroTiled * * @brief * Adjust 1D tiled surface pitch and slice size @@ -1669,7 +1675,7 @@ UINT_32 SiAddrLib::HwlGetPitchAlignmentMicroTiled( * Logical slice size in bytes **************************************************************************************************** */ -UINT_64 SiAddrLib::HwlGetSizeAdjustmentMicroTiled( +UINT_64 SiLib::HwlGetSizeAdjustmentMicroTiled( UINT_32 thickness, ///< [in] thickness UINT_32 bpp, ///< [in] bits per pixel ADDR_SURFACE_FLAGS flags, ///< [in] surface flags @@ -1740,19 +1746,19 @@ UINT_64 SiAddrLib::HwlGetSizeAdjustmentMicroTiled( /** **************************************************************************************************** -* SiAddrLib::HwlConvertChipFamily +* SiLib::HwlConvertChipFamily * * @brief -* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision +* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision * @return -* AddrChipFamily +* ChipFamily **************************************************************************************************** */ -AddrChipFamily SiAddrLib::HwlConvertChipFamily( +ChipFamily SiLib::HwlConvertChipFamily( UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h { - AddrChipFamily family = ADDR_CHIP_FAMILY_SI; + ChipFamily family = ADDR_CHIP_FAMILY_SI; switch (uChipFamily) { @@ -1774,13 +1780,13 @@ AddrChipFamily SiAddrLib::HwlConvertChipFamily( /** **************************************************************************************************** -* SiAddrLib::HwlSetupTileInfo +* SiLib::HwlSetupTileInfo * * @brief * Setup default value of tile info for SI **************************************************************************************************** */ -VOID SiAddrLib::HwlSetupTileInfo( +VOID SiLib::HwlSetupTileInfo( AddrTileMode tileMode, ///< [in] Tile mode ADDR_SURFACE_FLAGS flags, ///< [in] Surface type flags UINT_32 bpp, ///< [in] Bits per pixel @@ -2097,7 +2103,7 @@ VOID SiAddrLib::HwlSetupTileInfo( /** **************************************************************************************************** -* SiAddrLib::DecodeGbRegs +* SiLib::DecodeGbRegs * * @brief * Decodes GB_ADDR_CONFIG and noOfBanks/noOfRanks @@ -2107,7 +2113,7 @@ VOID SiAddrLib::HwlSetupTileInfo( * **************************************************************************************************** */ -BOOL_32 SiAddrLib::DecodeGbRegs( +BOOL_32 SiLib::DecodeGbRegs( const ADDR_REGISTER_VALUE* pRegValue) ///< [in] create input { GB_ADDR_CONFIG reg; @@ -2186,7 +2192,7 @@ BOOL_32 SiAddrLib::DecodeGbRegs( /** **************************************************************************************************** -* SiAddrLib::HwlInitGlobalParams +* SiLib::HwlInitGlobalParams * * @brief * Initializes global parameters @@ -2196,7 +2202,7 @@ BOOL_32 SiAddrLib::DecodeGbRegs( * **************************************************************************************************** */ -BOOL_32 SiAddrLib::HwlInitGlobalParams( +BOOL_32 SiLib::HwlInitGlobalParams( const ADDR_CREATE_INPUT* pCreateIn) ///< [in] create input { BOOL_32 valid = TRUE; @@ -2235,21 +2241,21 @@ BOOL_32 SiAddrLib::HwlInitGlobalParams( /** **************************************************************************************************** -* SiAddrLib::HwlConvertTileInfoToHW +* SiLib::HwlConvertTileInfoToHW * @brief * Entry of si's ConvertTileInfoToHW * @return * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::HwlConvertTileInfoToHW( +ADDR_E_RETURNCODE SiLib::HwlConvertTileInfoToHW( const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure ) const { ADDR_E_RETURNCODE retCode = ADDR_OK; - retCode = EgBasedAddrLib::HwlConvertTileInfoToHW(pIn, pOut); + retCode = EgBasedLib::HwlConvertTileInfoToHW(pIn, pOut); if (retCode == ADDR_OK) { @@ -2277,7 +2283,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlConvertTileInfoToHW( /** **************************************************************************************************** -* SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe +* SiLib::HwlComputeXmaskCoordYFrom8Pipe * * @brief * Compute the Y coord which will be added to Xmask Y @@ -2286,7 +2292,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlConvertTileInfoToHW( * Y coord **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe( +UINT_32 SiLib::HwlComputeXmaskCoordYFrom8Pipe( UINT_32 pipe, ///< [in] pipe id UINT_32 x ///< [in] tile coord x, which is original x coord / 8 ) const @@ -2300,7 +2306,7 @@ UINT_32 SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe( /** **************************************************************************************************** -* SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe +* SiLib::HwlComputeSurfaceCoord2DFromBankPipe * * @brief * Compute surface x,y coordinates from bank/pipe info @@ -2308,7 +2314,7 @@ UINT_32 SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe( * N/A **************************************************************************************************** */ -VOID SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe( +VOID SiLib::HwlComputeSurfaceCoord2DFromBankPipe( AddrTileMode tileMode, ///< [in] tile mode UINT_32* pX, ///< [in/out] x coordinate UINT_32* pY, ///< [in/out] y coordinate @@ -2465,7 +2471,7 @@ VOID SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe( /** **************************************************************************************************** -* SiAddrLib::HwlPreAdjustBank +* SiLib::HwlPreAdjustBank * * @brief * Adjust bank before calculating address acoording to bank/pipe @@ -2473,7 +2479,7 @@ VOID SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe( * Adjusted bank **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlPreAdjustBank( +UINT_32 SiLib::HwlPreAdjustBank( UINT_32 tileX, ///< [in] x coordinate in unit of tile UINT_32 bank, ///< [in] bank ADDR_TILEINFO* pTileInfo ///< [in] tile info @@ -2497,7 +2503,7 @@ UINT_32 SiAddrLib::HwlPreAdjustBank( /** **************************************************************************************************** -* SiAddrLib::HwlComputeSurfaceInfo +* SiLib::HwlComputeSurfaceInfo * * @brief * Entry of si's ComputeSurfaceInfo @@ -2505,14 +2511,14 @@ UINT_32 SiAddrLib::HwlPreAdjustBank( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::HwlComputeSurfaceInfo( +ADDR_E_RETURNCODE SiLib::HwlComputeSurfaceInfo( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure ) const { pOut->tileIndex = pIn->tileIndex; - ADDR_E_RETURNCODE retCode = EgBasedAddrLib::HwlComputeSurfaceInfo(pIn, pOut); + ADDR_E_RETURNCODE retCode = EgBasedLib::HwlComputeSurfaceInfo(pIn, pOut); UINT_32 tileIndex = static_cast<UINT_32>(pOut->tileIndex); @@ -2541,14 +2547,14 @@ ADDR_E_RETURNCODE SiAddrLib::HwlComputeSurfaceInfo( /** **************************************************************************************************** -* SiAddrLib::HwlComputeMipLevel +* SiLib::HwlComputeMipLevel * @brief * Compute MipLevel info (including level 0) * @return * TRUE if HWL's handled **************************************************************************************************** */ -BOOL_32 SiAddrLib::HwlComputeMipLevel( +BOOL_32 SiLib::HwlComputeMipLevel( ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure ) const { @@ -2558,7 +2564,7 @@ BOOL_32 SiAddrLib::HwlComputeMipLevel( // Note: Don't check expand 3x formats(96 bit) as the basePitch is not pow2 even if // we explicity set pow2Pad flag. The 3x base pitch is padded to pow2 but after being // divided by expandX factor (3) - to program texture pitch, the basePitch is never pow2. - if (AddrElemLib::IsExpand3x(pIn->format) == FALSE) + if (ElemLib::IsExpand3x(pIn->format) == FALSE) { // Sublevel pitches are generated from base level pitch instead of width on SI // If pow2Pad is 0, we don't assert - as this is not really used for a mip chain @@ -2579,7 +2585,7 @@ BOOL_32 SiAddrLib::HwlComputeMipLevel( /** **************************************************************************************************** -* SiAddrLib::HwlCheckLastMacroTiledLvl +* SiLib::HwlCheckLastMacroTiledLvl * * @brief * Sets pOut->last2DLevel to TRUE if it is @@ -2587,7 +2593,7 @@ BOOL_32 SiAddrLib::HwlComputeMipLevel( * **************************************************************************************************** */ -VOID SiAddrLib::HwlCheckLastMacroTiledLvl( +VOID SiLib::HwlCheckLastMacroTiledLvl( const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] Output structure (used as input, too) ) const @@ -2622,7 +2628,7 @@ VOID SiAddrLib::HwlCheckLastMacroTiledLvl( nextHeight = pOut->height >> 1; // Special format such as FMT_1 and FMT_32_32_32 can be linear only so we consider block // compressed foramts - if (AddrElemLib::IsBlockCompressed(pIn->format)) + if (ElemLib::IsBlockCompressed(pIn->format)) { nextHeight = (nextHeight + 3) / 4; } @@ -2654,7 +2660,7 @@ VOID SiAddrLib::HwlCheckLastMacroTiledLvl( /** **************************************************************************************************** -* SiAddrLib::HwlDegradeThickTileMode +* SiLib::HwlDegradeThickTileMode * * @brief * Degrades valid tile mode for thick modes if needed @@ -2663,18 +2669,18 @@ VOID SiAddrLib::HwlCheckLastMacroTiledLvl( * Suitable tile mode **************************************************************************************************** */ -AddrTileMode SiAddrLib::HwlDegradeThickTileMode( +AddrTileMode SiLib::HwlDegradeThickTileMode( AddrTileMode baseTileMode, ///< [in] base tile mode UINT_32 numSlices, ///< [in] current number of slices UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice ) const { - return EgBasedAddrLib::HwlDegradeThickTileMode(baseTileMode, numSlices, pBytesPerTile); + return EgBasedLib::HwlDegradeThickTileMode(baseTileMode, numSlices, pBytesPerTile); } /** **************************************************************************************************** -* SiAddrLib::HwlTileInfoEqual +* SiLib::HwlTileInfoEqual * * @brief * Return TRUE if all field are equal @@ -2682,7 +2688,7 @@ AddrTileMode SiAddrLib::HwlDegradeThickTileMode( * Only takes care of current HWL's data **************************************************************************************************** */ -BOOL_32 SiAddrLib::HwlTileInfoEqual( +BOOL_32 SiLib::HwlTileInfoEqual( const ADDR_TILEINFO* pLeft, ///<[in] Left compare operand const ADDR_TILEINFO* pRight ///<[in] Right compare operand ) const @@ -2691,7 +2697,7 @@ BOOL_32 SiAddrLib::HwlTileInfoEqual( if (pLeft->pipeConfig == pRight->pipeConfig) { - equal = EgBasedAddrLib::HwlTileInfoEqual(pLeft, pRight); + equal = EgBasedLib::HwlTileInfoEqual(pLeft, pRight); } return equal; @@ -2699,7 +2705,7 @@ BOOL_32 SiAddrLib::HwlTileInfoEqual( /** **************************************************************************************************** -* SiAddrLib::GetTileSettings +* SiLib::GetTileSettings * * @brief * Get tile setting infos by index. @@ -2707,7 +2713,7 @@ BOOL_32 SiAddrLib::HwlTileInfoEqual( * Tile setting info. **************************************************************************************************** */ -const AddrTileConfig* SiAddrLib::GetTileSetting( +const TileConfig* SiLib::GetTileSetting( UINT_32 index ///< [in] Tile index ) const { @@ -2717,7 +2723,7 @@ const AddrTileConfig* SiAddrLib::GetTileSetting( /** **************************************************************************************************** -* SiAddrLib::HwlPostCheckTileIndex +* SiLib::HwlPostCheckTileIndex * * @brief * Map a tile setting to index if curIndex is invalid, otherwise check if curIndex matches @@ -2726,7 +2732,7 @@ const AddrTileConfig* SiAddrLib::GetTileSetting( * Tile index. **************************************************************************************************** */ -INT_32 SiAddrLib::HwlPostCheckTileIndex( +INT_32 SiLib::HwlPostCheckTileIndex( const ADDR_TILEINFO* pInfo, ///< [in] Tile Info AddrTileMode mode, ///< [in] Tile mode AddrTileType type, ///< [in] Tile type @@ -2796,7 +2802,7 @@ INT_32 SiAddrLib::HwlPostCheckTileIndex( /** **************************************************************************************************** -* SiAddrLib::HwlSetupTileCfg +* SiLib::HwlSetupTileCfg * * @brief * Map tile index to tile setting. @@ -2804,7 +2810,7 @@ INT_32 SiAddrLib::HwlPostCheckTileIndex( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::HwlSetupTileCfg( +ADDR_E_RETURNCODE SiLib::HwlSetupTileCfg( UINT_32 bpp, ///< [in] Bits per pixel INT_32 index, ///< [in] Tile index INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI) @@ -2846,7 +2852,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlSetupTileCfg( } else { - const AddrTileConfig* pCfgTable = GetTileSetting(index); + const TileConfig* pCfgTable = GetTileSetting(index); if (pInfo) { @@ -2877,17 +2883,17 @@ ADDR_E_RETURNCODE SiAddrLib::HwlSetupTileCfg( /** **************************************************************************************************** -* SiAddrLib::ReadGbTileMode +* SiLib::ReadGbTileMode * * @brief -* Convert GB_TILE_MODE HW value to ADDR_TILE_CONFIG. +* Convert GB_TILE_MODE HW value to TileConfig. * @return * NA. **************************************************************************************************** */ -VOID SiAddrLib::ReadGbTileMode( - UINT_32 regValue, ///< [in] GB_TILE_MODE register - AddrTileConfig* pCfg ///< [out] output structure +VOID SiLib::ReadGbTileMode( + UINT_32 regValue, ///< [in] GB_TILE_MODE register + TileConfig* pCfg ///< [out] output structure ) const { GB_TILE_MODE gbTileMode; @@ -2917,7 +2923,7 @@ VOID SiAddrLib::ReadGbTileMode( /** **************************************************************************************************** -* SiAddrLib::InitTileSettingTable +* SiLib::InitTileSettingTable * * @brief * Initialize the ADDR_TILE_CONFIG table. @@ -2925,7 +2931,7 @@ VOID SiAddrLib::ReadGbTileMode( * TRUE if tile table is correctly initialized **************************************************************************************************** */ -BOOL_32 SiAddrLib::InitTileSettingTable( +BOOL_32 SiLib::InitTileSettingTable( const UINT_32* pCfg, ///< [in] Pointer to table of tile configs UINT_32 noOfEntries ///< [in] Numbe of entries in the table above ) @@ -2968,7 +2974,7 @@ BOOL_32 SiAddrLib::InitTileSettingTable( /** **************************************************************************************************** -* SiAddrLib::HwlGetTileIndex +* SiLib::HwlGetTileIndex * * @brief * Return the virtual/real index for given mode/type/info @@ -2976,7 +2982,7 @@ BOOL_32 SiAddrLib::InitTileSettingTable( * ADDR_OK if successful. **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::HwlGetTileIndex( +ADDR_E_RETURNCODE SiLib::HwlGetTileIndex( const ADDR_GET_TILEINDEX_INPUT* pIn, ADDR_GET_TILEINDEX_OUTPUT* pOut) const { @@ -2989,7 +2995,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlGetTileIndex( /** **************************************************************************************************** -* SiAddrLib::HwlFmaskPreThunkSurfInfo +* SiLib::HwlFmaskPreThunkSurfInfo * * @brief * Some preparation before thunking a ComputeSurfaceInfo call for Fmask @@ -2997,7 +3003,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlGetTileIndex( * ADDR_E_RETURNCODE **************************************************************************************************** */ -VOID SiAddrLib::HwlFmaskPreThunkSurfInfo( +VOID SiLib::HwlFmaskPreThunkSurfInfo( const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn, ///< [in] Input of fmask info const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut, ///< [in] Output of fmask info ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn, ///< [out] Input of thunked surface info @@ -3009,7 +3015,7 @@ VOID SiAddrLib::HwlFmaskPreThunkSurfInfo( /** **************************************************************************************************** -* SiAddrLib::HwlFmaskPostThunkSurfInfo +* SiLib::HwlFmaskPostThunkSurfInfo * * @brief * Copy hwl extra field after calling thunked ComputeSurfaceInfo @@ -3017,7 +3023,7 @@ VOID SiAddrLib::HwlFmaskPreThunkSurfInfo( * ADDR_E_RETURNCODE **************************************************************************************************** */ -VOID SiAddrLib::HwlFmaskPostThunkSurfInfo( +VOID SiLib::HwlFmaskPostThunkSurfInfo( const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut, ///< [in] Output of surface info ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut ///< [out] Output of fmask info ) const @@ -3028,14 +3034,14 @@ VOID SiAddrLib::HwlFmaskPostThunkSurfInfo( /** **************************************************************************************************** -* SiAddrLib::HwlComputeFmaskBits +* SiLib::HwlComputeFmaskBits * @brief * Computes fmask bits * @return * Fmask bits **************************************************************************************************** */ -UINT_32 SiAddrLib::HwlComputeFmaskBits( +UINT_32 SiLib::HwlComputeFmaskBits( const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, UINT_32* pNumSamples ) const @@ -3129,7 +3135,7 @@ UINT_32 SiAddrLib::HwlComputeFmaskBits( /** **************************************************************************************************** -* SiAddrLib::HwlOverrideTileMode +* SiLib::HwlOverrideTileMode * * @brief * Override tile modes (for PRT only, avoid client passes in an invalid PRT mode for SI. @@ -3139,7 +3145,7 @@ UINT_32 SiAddrLib::HwlComputeFmaskBits( * **************************************************************************************************** */ -void SiAddrLib::HwlOverrideTileMode( +VOID SiLib::HwlOverrideTileMode( ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure ) const { @@ -3199,7 +3205,7 @@ void SiAddrLib::HwlOverrideTileMode( /** **************************************************************************************************** -* SiAddrLib::HwlSelectTileMode +* SiLib::HwlSelectTileMode * * @brief * Select tile modes. @@ -3209,7 +3215,7 @@ void SiAddrLib::HwlOverrideTileMode( * **************************************************************************************************** */ -VOID SiAddrLib::HwlSelectTileMode( +VOID SiLib::HwlSelectTileMode( ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure ) const { @@ -3275,7 +3281,7 @@ VOID SiAddrLib::HwlSelectTileMode( /** **************************************************************************************************** -* SiAddrLib::HwlGetMaxAlignments +* SiLib::HwlGetMaxAlignments * * @brief * Gets maximum alignments @@ -3283,7 +3289,7 @@ VOID SiAddrLib::HwlSelectTileMode( * ADDR_E_RETURNCODE **************************************************************************************************** */ -ADDR_E_RETURNCODE SiAddrLib::HwlGetMaxAlignments( +ADDR_E_RETURNCODE SiLib::HwlGetMaxAlignments( ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure ) const { @@ -3321,7 +3327,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlGetMaxAlignments( /** **************************************************************************************************** -* SiAddrLib::InitEquationTable +* SiLib::InitEquationTable * * @brief * Initialize Equation table. @@ -3330,7 +3336,7 @@ ADDR_E_RETURNCODE SiAddrLib::HwlGetMaxAlignments( * N/A **************************************************************************************************** */ -VOID SiAddrLib::InitEquationTable() +VOID SiLib::InitEquationTable() { ADDR_EQUATION_KEY equationKeyTable[EquationTableSize]; memset(equationKeyTable, 0, sizeof(equationKeyTable)); @@ -3354,7 +3360,7 @@ VOID SiAddrLib::InitEquationTable() { UINT_32 equationIndex = ADDR_INVALID_EQUATION_INDEX; - AddrTileConfig tileConfig = m_tileTable[tileIndex]; + TileConfig tileConfig = m_tileTable[tileIndex]; ADDR_SURFACE_FLAGS flags = {{0}}; @@ -3492,7 +3498,7 @@ VOID SiAddrLib::InitEquationTable() /** **************************************************************************************************** -* SiAddrLib::IsEquationSupported +* SiLib::IsEquationSupported * * @brief * Check if it is supported for given bpp and tile config to generate a equation. @@ -3501,9 +3507,9 @@ VOID SiAddrLib::InitEquationTable() * TRUE if supported **************************************************************************************************** */ -BOOL_32 SiAddrLib::IsEquationSupported( +BOOL_32 SiLib::IsEquationSupported( UINT_32 bpp, ///< Bits per pixel - AddrTileConfig tileConfig, ///< Tile config + TileConfig tileConfig, ///< Tile config INT_32 tileIndex ///< Tile index ) const { @@ -3540,7 +3546,7 @@ BOOL_32 SiAddrLib::IsEquationSupported( if ((supported == TRUE) && (m_chipFamily == ADDR_CHIP_FAMILY_SI)) { - // Please refer to SiAddrLib::HwlSetupTileInfo for PRT tile index selecting + // Please refer to SiLib::HwlSetupTileInfo for PRT tile index selecting // Tile index 3, 6, 21-25 are for PRT single sample if (tileIndex == 3) { @@ -3564,4 +3570,5 @@ BOOL_32 SiAddrLib::IsEquationSupported( return supported; } - +} // V1 +} // Addr diff --git a/src/amd/addrlib/r800/siaddrlib.h b/src/amd/addrlib/r800/siaddrlib.h index ef24dfbe560..b63d7e878dc 100644 --- a/src/amd/addrlib/r800/siaddrlib.h +++ b/src/amd/addrlib/r800/siaddrlib.h @@ -27,7 +27,7 @@ /** **************************************************************************************************** * @file siaddrlib.h -* @brief Contains the R800AddrLib class definition. +* @brief Contains the R800Lib class definition. **************************************************************************************************** */ @@ -37,12 +37,17 @@ #include "addrlib1.h" #include "egbaddrlib.h" +namespace Addr +{ +namespace V1 +{ + /** **************************************************************************************************** * @brief Describes the information in tile mode table **************************************************************************************************** */ -struct AddrTileConfig +struct TileConfig { AddrTileMode mode; AddrTileType type; @@ -74,18 +79,18 @@ struct SIChipSettings * function set. **************************************************************************************************** */ -class SiAddrLib : public EgBasedAddrLib +class SiLib : public EgBasedLib { public: - /// Creates SIAddrLib object - static AddrLib* CreateObj(const AddrClient* pClient) + /// Creates SiLib object + static Addr::Lib* CreateObj(const Client* pClient) { - return new(pClient) SiAddrLib(pClient); + return new(pClient) SiLib(pClient); } protected: - SiAddrLib(const AddrClient* pClient); - virtual ~SiAddrLib(); + SiLib(const Client* pClient); + virtual ~SiLib(); // Hwl interface - defined in AddrLib1 virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo( @@ -113,7 +118,7 @@ protected: virtual BOOL_32 HwlComputeMipLevel( ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const; - virtual AddrChipFamily HwlConvertChipFamily( + virtual ChipFamily HwlConvertChipFamily( UINT_32 uChipFamily, UINT_32 uChipRevision); virtual BOOL_32 HwlInitGlobalParams( @@ -157,7 +162,7 @@ protected: virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe( UINT_32 pipe, UINT_32 x) const; - // Sub-hwl interface - defined in EgBasedAddrLib + // Sub-hwl interface - defined in EgBasedLib virtual VOID HwlSetupTileInfo( AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples, @@ -246,7 +251,7 @@ protected: // Check if it is supported for given bpp and tile config to generate an equation BOOL_32 IsEquationSupported( - UINT_32 bpp, AddrTileConfig tileConfig, INT_32 tileIndex) const; + UINT_32 bpp, TileConfig tileConfig, INT_32 tileIndex) const; // Protected non-virtual functions VOID ComputeTileCoordFromPipeAndElemIdx( @@ -260,14 +265,14 @@ protected: BOOL_32 DecodeGbRegs( const ADDR_REGISTER_VALUE* pRegValue); - const AddrTileConfig* GetTileSetting( + const TileConfig* GetTileSetting( UINT_32 index) const; // Initialize equation table VOID InitEquationTable(); static const UINT_32 TileTableSize = 32; - AddrTileConfig m_tileTable[TileTableSize]; + TileConfig m_tileTable[TileTableSize]; UINT_32 m_noOfEntries; // Max number of bpp (8bpp/16bpp/32bpp/64bpp/128bpp) @@ -288,13 +293,14 @@ private: UINT_32 GetPipePerSurf(AddrPipeCfg pipeConfig) const; - VOID ReadGbTileMode( - UINT_32 regValue, AddrTileConfig* pCfg) const; - BOOL_32 InitTileSettingTable( - const UINT_32 *pSetting, UINT_32 noOfEntries); + VOID ReadGbTileMode(UINT_32 regValue, TileConfig* pCfg) const; + BOOL_32 InitTileSettingTable(const UINT_32 *pSetting, UINT_32 noOfEntries); SIChipSettings m_settings; }; +} // V1 +} // Addr + #endif |