summaryrefslogtreecommitdiffstats
path: root/src/amd/addrlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/addrlib')
-rw-r--r--src/amd/addrlib/addrinterface.cpp50
-rw-r--r--src/amd/addrlib/core/addrlib.h416
-rw-r--r--src/amd/addrlib/core/addrlib1.cpp300
-rw-r--r--src/amd/addrlib/core/addrlib1.h451
-rw-r--r--src/amd/addrlib/r800/ciaddrlib.h4
-rw-r--r--src/amd/addrlib/r800/egbaddrlib.cpp2
-rw-r--r--src/amd/addrlib/r800/egbaddrlib.h4
-rw-r--r--src/amd/addrlib/r800/siaddrlib.cpp4
-rw-r--r--src/amd/addrlib/r800/siaddrlib.h4
9 files changed, 675 insertions, 560 deletions
diff --git a/src/amd/addrlib/addrinterface.cpp b/src/amd/addrlib/addrinterface.cpp
index b2120c644bf..fbc5e5f9a37 100644
--- a/src/amd/addrlib/addrinterface.cpp
+++ b/src/amd/addrlib/addrinterface.cpp
@@ -31,7 +31,7 @@
***************************************************************************************************
*/
#include "addrinterface.h"
-#include "addrlib.h"
+#include "addrlib1.h"
#include "addrcommon.h"
@@ -114,7 +114,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -148,7 +148,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -180,7 +180,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -218,7 +218,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -250,7 +250,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -283,7 +283,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -322,7 +322,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -354,7 +354,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -387,7 +387,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -425,7 +425,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -457,7 +457,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -489,7 +489,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -527,7 +527,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeDccInfo(
{
ADDR_E_RETURNCODE returnCode;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
@@ -584,7 +584,7 @@ BOOL_32 ADDR_API AddrUseTileIndex(ADDR_HANDLE hLib)
{
BOOL_32 useTileIndex = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
@@ -608,7 +608,7 @@ BOOL_32 ADDR_API AddrUseCombinedSwizzle(ADDR_HANDLE hLib)
{
BOOL_32 useCombinedSwizzle = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
@@ -637,7 +637,7 @@ ADDR_E_RETURNCODE ADDR_API AddrExtractBankPipeSwizzle(
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
@@ -668,7 +668,7 @@ ADDR_E_RETURNCODE ADDR_API AddrCombineBankPipeSwizzle(
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
@@ -699,7 +699,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSliceSwizzle(
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
@@ -730,7 +730,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeBaseSwizzle(
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
@@ -861,7 +861,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -893,7 +893,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -925,7 +925,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
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -960,7 +960,7 @@ ADDR_E_RETURNCODE ADDR_API AddrGetTileIndex(
const ADDR_GET_TILEINDEX_INPUT* pIn,
ADDR_GET_TILEINDEX_OUTPUT* pOut)
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
@@ -992,7 +992,7 @@ ADDR_E_RETURNCODE ADDR_API AddrComputePrtInfo(
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
diff --git a/src/amd/addrlib/core/addrlib.h b/src/amd/addrlib/core/addrlib.h
index b369db80483..177aece7c18 100644
--- a/src/amd/addrlib/core/addrlib.h
+++ b/src/amd/addrlib/core/addrlib.h
@@ -134,22 +134,6 @@ enum AddrBankSwapSize
ADDR_BANKSWAP_1KB = 1024,
};
-/**
-***************************************************************************************************
-* @brief Flags for AddrTileMode
-***************************************************************************************************
-*/
-struct AddrTileModeFlags
-{
- UINT_32 thickness : 4;
- UINT_32 isLinear : 1;
- UINT_32 isMicro : 1;
- UINT_32 isMacro : 1;
- UINT_32 isMacro3d : 1;
- UINT_32 isPrt : 1;
- UINT_32 isPrtNoRotation : 1;
- UINT_32 isBankSwapped : 1;
-};
/**
***************************************************************************************************
@@ -185,109 +169,6 @@ public:
return m_chipFamily;
}
- /// Returns tileIndex support
- BOOL_32 UseTileIndex(INT_32 index) const
- {
- return m_configFlags.useTileIndex && (index != TileIndexInvalid);
- }
-
- /// Returns combined swizzle support
- BOOL_32 UseCombinedSwizzle() const
- {
- return m_configFlags.useCombinedSwizzle;
- }
-
- //
- // Interface stubs
- //
- ADDR_E_RETURNCODE ComputeSurfaceInfo(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSurfaceAddrFromCoord(
- const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSurfaceCoordFromAddr(
- const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeSliceTileSwizzle(
- const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ExtractBankPipeSwizzle(
- const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE CombineBankPipeSwizzle(
- const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeBaseSwizzle(
- const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeFmaskInfo(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
-
- ADDR_E_RETURNCODE ComputeFmaskAddrFromCoord(
- const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeFmaskCoordFromAddr(
- const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileInfoToHW(
- const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
- ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileIndex(
- const ADDR_CONVERT_TILEINDEX_INPUT* pIn,
- ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ConvertTileIndex1(
- const ADDR_CONVERT_TILEINDEX1_INPUT* pIn,
- ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE GetTileIndex(
- const ADDR_GET_TILEINDEX_INPUT* pIn,
- ADDR_GET_TILEINDEX_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileInfo(
- const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn,
- ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskInfo(
- const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeDccInfo(
- const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
- ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileAddrFromCoord(
- const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskAddrFromCoord(
- const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeHtileCoordFromAddr(
- const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputeCmaskCoordFromAddr(
- const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) const;
-
- ADDR_E_RETURNCODE ComputePrtInfo(
- const ADDR_PRT_INFO_INPUT* pIn,
- ADDR_PRT_INFO_OUTPUT* pOut) const;
-
ADDR_E_RETURNCODE Flt32ToDepthPixel(
const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn,
ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) const;
@@ -305,231 +186,9 @@ protected:
AddrLib(); // Constructor is protected
AddrLib(const AddrClient* pClient);
- /// Pure Virtual function for Hwl computing surface info
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface address from coord
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceAddrFromCoord(
- const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface coord from address
- virtual ADDR_E_RETURNCODE HwlComputeSurfaceCoordFromAddr(
- const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing surface tile swizzle
- virtual ADDR_E_RETURNCODE HwlComputeSliceTileSwizzle(
- const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl extracting bank/pipe swizzle from base256b
- virtual ADDR_E_RETURNCODE HwlExtractBankPipeSwizzle(
- const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
- ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl combining bank/pipe swizzle
- virtual ADDR_E_RETURNCODE HwlCombineBankPipeSwizzle(
- UINT_32 bankSwizzle, UINT_32 pipeSwizzle, ADDR_TILEINFO* pTileInfo,
- UINT_64 baseAddr, UINT_32* pTileSwizzle) const = 0;
-
- /// Pure Virtual function for Hwl computing base swizzle
- virtual ADDR_E_RETURNCODE HwlComputeBaseSwizzle(
- const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
- ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE base align
- virtual UINT_32 HwlComputeHtileBaseAlign(
- BOOL_32 isTcCompatible, BOOL_32 isLinear, ADDR_TILEINFO* pTileInfo) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE bpp
- virtual UINT_32 HwlComputeHtileBpp(
- BOOL_32 isWidth8, BOOL_32 isHeight8) const = 0;
-
- /// Pure Virtual function for Hwl computing HTILE bytes
- virtual UINT_64 HwlComputeHtileBytes(
- UINT_32 pitch, UINT_32 height, UINT_32 bpp,
- BOOL_32 isLinear, UINT_32 numSlices, UINT_64* pSliceBytes, UINT_32 baseAlign) const = 0;
-
- /// Pure Virtual function for Hwl computing FMASK info
- virtual ADDR_E_RETURNCODE HwlComputeFmaskInfo(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) = 0;
-
- /// Pure Virtual function for Hwl FMASK address from coord
- virtual ADDR_E_RETURNCODE HwlComputeFmaskAddrFromCoord(
- const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl FMASK coord from address
- virtual ADDR_E_RETURNCODE HwlComputeFmaskCoordFromAddr(
- const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
- ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl convert tile info from real value to HW value
- virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
- const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
- ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const = 0;
-
- /// Pure Virtual function for Hwl compute mipmap info
- virtual BOOL_32 HwlComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
-
- /// Pure Virtual function for Hwl compute max cmask blockMax value
- virtual BOOL_32 HwlGetMaxCmaskBlockMax() const = 0;
-
- /// Pure Virtual function for Hwl compute fmask bits
- virtual UINT_32 HwlComputeFmaskBits(
- const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
- UINT_32* pNumSamples) const = 0;
-
- /// Virtual function to get index (not pure then no need to implement this in all hwls
- virtual ADDR_E_RETURNCODE HwlGetTileIndex(
- const ADDR_GET_TILEINDEX_INPUT* pIn,
- ADDR_GET_TILEINDEX_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
- /// Virtual function for Hwl to compute Dcc info
- virtual ADDR_E_RETURNCODE HwlComputeDccInfo(
- const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
- ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
- /// Virtual function to get cmask address for tc compatible cmask
- virtual ADDR_E_RETURNCODE HwlComputeCmaskAddrFromCoord(
- const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
- ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const
- {
- return ADDR_NOTSUPPORTED;
- }
-
/// Pure virtual function to get max alignments
virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0;
- // Compute attributes
-
- // HTILE
- UINT_32 ComputeHtileInfo(
- ADDR_HTILE_FLAGS flags,
- UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices,
- BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
- ADDR_TILEINFO* pTileInfo,
- UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pHtileBytes,
- UINT_32* pMacroWidth = NULL, UINT_32* pMacroHeight = NULL,
- UINT_64* pSliceSize = NULL, UINT_32* pBaseAlign = NULL) const;
-
- // CMASK
- ADDR_E_RETURNCODE ComputeCmaskInfo(
- ADDR_CMASK_FLAGS flags,
- UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices, BOOL_32 isLinear,
- ADDR_TILEINFO* pTileInfo, UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pCmaskBytes,
- UINT_32* pMacroWidth, UINT_32* pMacroHeight, UINT_64* pSliceSize = NULL,
- UINT_32* pBaseAlign = NULL, UINT_32* pBlockMax = NULL) const;
-
- virtual VOID HwlComputeTileDataWidthAndHeightLinear(
- UINT_32* pMacroWidth, UINT_32* pMacroHeight,
- UINT_32 bpp, ADDR_TILEINFO* pTileInfo) const;
-
- // CMASK & HTILE addressing
- virtual UINT_64 HwlComputeXmaskAddrFromCoord(
- UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice,
- UINT_32 numSlices, UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8,
- BOOL_32 isHeight8, ADDR_TILEINFO* pTileInfo,
- UINT_32* bitPosition) const;
-
- virtual VOID HwlComputeXmaskCoordFromAddr(
- UINT_64 addr, UINT_32 bitPosition, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
- ADDR_TILEINFO* pTileInfo, UINT_32* pX, UINT_32* pY, UINT_32* pSlice) const;
-
- // Surface mipmap
- VOID ComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
-
- /// Pure Virtual function for Hwl checking degrade for base level
- virtual BOOL_32 HwlDegradeBaseLevel(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
-
- virtual BOOL_32 HwlOverrideTileMode(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- AddrTileMode* pTileMode,
- AddrTileType* pTileType) const
- {
- // not supported in hwl layer, FALSE for not-overrided
- return FALSE;
- }
-
- AddrTileMode DegradeLargeThickTile(AddrTileMode tileMode, UINT_32 bpp) const;
-
- VOID PadDimensions(
- AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
- UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
- UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
- UINT_32* pSlices, UINT_32 sliceAlign) const;
-
- virtual VOID HwlPadDimensions(
- AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
- UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
- UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
- UINT_32* pSlices, UINT_32 sliceAlign) const
- {
- }
-
- //
- // Addressing shared for linear/1D tiling
- //
- UINT_64 ComputeSurfaceAddrFromCoordLinear(
- UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
- UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32* pBitPosition) const;
-
- VOID ComputeSurfaceCoordFromAddrLinear(
- UINT_64 addr, UINT_32 bitPosition, UINT_32 bpp,
- UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample) const;
-
- VOID ComputeSurfaceCoordFromAddrMicroTiled(
- UINT_64 addr, UINT_32 bitPosition,
- UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
- AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
- AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const;
-
- UINT_32 ComputePixelIndexWithinMicroTile(
- UINT_32 x, UINT_32 y, UINT_32 z,
- UINT_32 bpp, AddrTileMode tileMode, AddrTileType microTileType) const;
-
- /// Pure Virtual function for Hwl computing coord from offset inside micro tile
- virtual VOID HwlComputePixelCoordFromOffset(
- UINT_32 offset, UINT_32 bpp, UINT_32 numSamples,
- AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
- UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
- AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const = 0;
-
- //
- // Addressing shared by all
- //
- virtual UINT_32 HwlGetPipes(
- const ADDR_TILEINFO* pTileInfo) const;
-
- UINT_32 ComputePipeFromAddr(
- UINT_64 addr, UINT_32 numPipes) const;
-
- /// Pure Virtual function for Hwl computing pipe from coord
- virtual UINT_32 ComputePipeFromCoord(
- UINT_32 x, UINT_32 y, UINT_32 slice, AddrTileMode tileMode,
- UINT_32 pipeSwizzle, BOOL_32 flags, ADDR_TILEINFO* pTileInfo) const = 0;
-
- /// Pure Virtual function for Hwl computing coord Y for 8 pipe cmask/htile
- virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
- UINT_32 pipe, UINT_32 x) const = 0;
-
//
// Initialization
//
@@ -543,19 +202,6 @@ protected:
//
// Misc helper
//
- static const AddrTileModeFlags m_modeFlags[ADDR_TM_COUNT];
-
- static UINT_32 ComputeSurfaceThickness(
- AddrTileMode tileMode);
-
- // Checking tile mode
- static BOOL_32 IsMacroTiled(AddrTileMode tileMode);
- static BOOL_32 IsMacro3dTiled(AddrTileMode tileMode);
- static BOOL_32 IsLinear(AddrTileMode tileMode);
- static BOOL_32 IsMicroTiled(AddrTileMode tileMode);
- static BOOL_32 IsPrtTileMode(AddrTileMode tileMode);
- static BOOL_32 IsPrtNoRotationTileMode(AddrTileMode tileMode);
-
static UINT_32 Bits2Number(UINT_32 bitNum,...);
static UINT_32 GetNumFragments(UINT_32 numSamples, UINT_32 numFrags)
@@ -569,55 +215,12 @@ protected:
return m_pElemLib;
}
- /// Return TRUE if tile info is needed
- BOOL_32 UseTileInfo() const
- {
- return !m_configFlags.ignoreTileInfo;
- }
-
/// Returns fillSizeFields flag
UINT_32 GetFillSizeFieldsFlags() const
{
return m_configFlags.fillSizeFields;
}
- /// Adjusts pitch alignment for flipping surface
- VOID AdjustPitchAlignment(
- ADDR_SURFACE_FLAGS flags, UINT_32* pPitchAlign) const;
-
- /// Overwrite tile config according to tile index
- virtual ADDR_E_RETURNCODE HwlSetupTileCfg(
- INT_32 index, INT_32 macroModeIndex,
- ADDR_TILEINFO* pInfo, AddrTileMode* mode = NULL, AddrTileType* type = NULL) const;
-
- /// Overwrite macro tile config according to tile index
- virtual INT_32 HwlComputeMacroModeIndex(
- INT_32 index, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 numSamples,
- ADDR_TILEINFO* pTileInfo, AddrTileMode *pTileMode = NULL, AddrTileType *pTileType = NULL
- ) const
- {
- return TileIndexNoMacroIndex;
- }
-
- /// Pre-handler of 3x pitch (96 bit) adjustment
- virtual UINT_32 HwlPreHandleBaseLvl3xPitch(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
- /// Post-handler of 3x pitch adjustment
- virtual UINT_32 HwlPostHandleBaseLvl3xPitch(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
- /// Check miplevel after surface adjustment
- ADDR_E_RETURNCODE PostComputeMipLevel(
- ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- /// Quad buffer stereo support, has its implementation in ind. layer
- virtual BOOL_32 ComputeQbStereoInfo(
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
-
- /// Pure virutual function to compute stereo bank swizzle for right eye
- virtual UINT_32 HwlComputeQbStereoRightSwizzle(
- ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
-
private:
// Disallow the copy constructor
AddrLib(const AddrLib& a);
@@ -627,27 +230,8 @@ private:
VOID SetAddrChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision);
- UINT_32 ComputeCmaskBaseAlign(
- ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const;
-
- UINT_64 ComputeCmaskBytes(
- UINT_32 pitch, UINT_32 height, UINT_32 numSlices) const;
-
- //
- // CMASK/HTILE shared methods
- //
- VOID ComputeTileDataWidthAndHeight(
- UINT_32 bpp, UINT_32 cacheBits, ADDR_TILEINFO* pTileInfo,
- UINT_32* pMacroWidth, UINT_32* pMacroHeight) const;
-
- UINT_32 ComputeXmaskCoordYFromPipe(
- UINT_32 pipe, UINT_32 x) const;
-
VOID SetMinPitchAlignPixels(UINT_32 minPitchAlignPixels);
- BOOL_32 OptimizeTileMode(
- const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, AddrTileMode* pTileMode) const;
-
protected:
AddrLibClass m_class; ///< Store class type (HWL type)
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index e44e673d0a9..1fc8fd718d9 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -24,6 +24,13 @@
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addr1lib.cpp
+* @brief Contains the implementation for the AddrLib1 base class..
+***************************************************************************************************
+*/
+
#include "addrinterface.h"
#include "addrlib1.h"
#include "addrcommon.h"
@@ -33,7 +40,7 @@
// Static Const Member
///////////////////////////////////////////////////////////////////////////////////////////////////
-const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
+const AddrTileModeFlags AddrLib1::m_modeFlags[ADDR_TM_COUNT] =
{// T L 1 2 3 P Pr B
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_GENERAL
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_ALIGNED
@@ -62,6 +69,77 @@ const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
{4, 0, 0, 1, 1, 1, 0, 0}, // ADDR_TM_PRT_3D_TILED_THICK
};
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Constructor/Destructor
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1() :
+ AddrLib()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class with hClient as parameter
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1(const AddrClient* pClient) :
+ AddrLib(pClient)
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::~AddrLib1
+*
+* @brief
+* Destructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::~AddrLib1()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::GetAddrLib1
+*
+* @brief
+* Get AddrLib1 pointer
+*
+* @return
+* An AddrLib1 class pointer
+***************************************************************************************************
+*/
+AddrLib1 * AddrLib1::GetAddrLib1(
+ ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
+{
+ AddrLib *pAddrLib = AddrLib::GetAddrLib(hLib);
+ if ((pAddrLib != NULL) &&
+ ((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
+ (pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI)))
+ {
+ // only valid and pre-VI AISC can use AddrLib1 function.
+ ADDR_ASSERT_ALWAYS();
+ hLib = NULL;
+ }
+ return static_cast<AddrLib1 *>(hLib);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Surface Methods
@@ -70,7 +148,7 @@ const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
@@ -79,7 +157,7 @@ const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
@@ -346,7 +424,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
@@ -355,7 +433,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
@@ -426,7 +504,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceAddrFromCoord(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddr
+* AddrLib1::ComputeSurfaceCoordFromAddr
*
* @brief
* Interface function stub of ComputeSurfaceCoordFromAddr.
@@ -435,7 +513,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceAddrFromCoord(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSurfaceCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
@@ -501,7 +579,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceCoordFromAddr(
/**
***************************************************************************************************
-* AddrLib::ComputeSliceTileSwizzle
+* AddrLib1::ComputeSliceTileSwizzle
*
* @brief
* Interface function stub of ComputeSliceTileSwizzle.
@@ -510,7 +588,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceCoordFromAddr(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeSliceTileSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle(
const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
@@ -554,7 +632,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSliceTileSwizzle(
/**
***************************************************************************************************
-* AddrLib::ExtractBankPipeSwizzle
+* AddrLib1::ExtractBankPipeSwizzle
*
* @brief
* Interface function stub of AddrExtractBankPipeSwizzle.
@@ -563,7 +641,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeSliceTileSwizzle(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ExtractBankPipeSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle(
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
@@ -606,7 +684,7 @@ ADDR_E_RETURNCODE AddrLib::ExtractBankPipeSwizzle(
/**
***************************************************************************************************
-* AddrLib::CombineBankPipeSwizzle
+* AddrLib1::CombineBankPipeSwizzle
*
* @brief
* Interface function stub of AddrCombineBankPipeSwizzle.
@@ -615,7 +693,7 @@ ADDR_E_RETURNCODE AddrLib::ExtractBankPipeSwizzle(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::CombineBankPipeSwizzle(
+ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle(
const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
@@ -662,7 +740,7 @@ ADDR_E_RETURNCODE AddrLib::CombineBankPipeSwizzle(
/**
***************************************************************************************************
-* AddrLib::ComputeBaseSwizzle
+* AddrLib1::ComputeBaseSwizzle
*
* @brief
* Interface function stub of AddrCompueBaseSwizzle.
@@ -670,7 +748,7 @@ ADDR_E_RETURNCODE AddrLib::CombineBankPipeSwizzle(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeBaseSwizzle(
+ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle(
const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const
{
@@ -719,7 +797,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeBaseSwizzle(
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskInfo
+* AddrLib1::ComputeFmaskInfo
*
* @brief
* Interface function stub of ComputeFmaskInfo.
@@ -728,7 +806,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeBaseSwizzle(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure
)
@@ -813,7 +891,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskAddrFromCoord
+* AddrLib1::ComputeFmaskAddrFromCoord
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
@@ -822,7 +900,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskInfo(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
@@ -857,7 +935,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskAddrFromCoord(
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskCoordFromAddr
+* AddrLib1::ComputeFmaskCoordFromAddr
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
@@ -866,7 +944,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskAddrFromCoord(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeFmaskCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
@@ -901,7 +979,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskCoordFromAddr(
/**
***************************************************************************************************
-* AddrLib::ConvertTileInfoToHW
+* AddrLib1::ConvertTileInfoToHW
*
* @brief
* Convert tile info from real value to HW register value in HW layer
@@ -910,7 +988,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeFmaskCoordFromAddr(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileInfoToHW(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure
) const
@@ -952,7 +1030,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileInfoToHW(
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex
+* AddrLib1::ConvertTileIndex
*
* @brief
* Convert tile index to tile mode/type/info
@@ -961,7 +1039,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileInfoToHW(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileIndex(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex(
const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
@@ -1001,7 +1079,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex(
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex1
+* AddrLib1::ConvertTileIndex1
*
* @brief
* Convert tile index to tile mode/type/info
@@ -1010,7 +1088,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ConvertTileIndex1(
+ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1(
const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
@@ -1051,7 +1129,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex1(
/**
***************************************************************************************************
-* AddrLib::GetTileIndex
+* AddrLib1::GetTileIndex
*
* @brief
* Get tile index from tile mode/type/info
@@ -1060,7 +1138,7 @@ ADDR_E_RETURNCODE AddrLib::ConvertTileIndex1(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::GetTileIndex(
+ADDR_E_RETURNCODE AddrLib1::GetTileIndex(
const ADDR_GET_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_GET_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
@@ -1086,7 +1164,7 @@ ADDR_E_RETURNCODE AddrLib::GetTileIndex(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceThickness
+* AddrLib1::ComputeSurfaceThickness
*
* @brief
* Compute surface thickness
@@ -1095,7 +1173,7 @@ ADDR_E_RETURNCODE AddrLib::GetTileIndex(
* Surface thickness
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeSurfaceThickness(
+UINT_32 AddrLib1::ComputeSurfaceThickness(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].thickness;
@@ -1109,7 +1187,7 @@ UINT_32 AddrLib::ComputeSurfaceThickness(
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Interface function stub of AddrComputeHtilenfo
@@ -1118,7 +1196,7 @@ UINT_32 AddrLib::ComputeSurfaceThickness(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo(
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut ///< [out] output structure
) const
@@ -1179,7 +1257,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Interface function stub of AddrComputeCmaskInfo
@@ -1188,7 +1266,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileInfo(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut ///< [out] output structure
) const
@@ -1245,7 +1323,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeDccInfo
+* AddrLib1::ComputeDccInfo
*
* @brief
* Interface function to compute DCC key info
@@ -1254,7 +1332,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
* return code of HwlComputeDccInfo
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeDccInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo(
const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut ///< [out] output structure
) const
@@ -1295,7 +1373,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeDccInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeHtileAddrFromCoord
+* AddrLib1::ComputeHtileAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeHtileAddrFromCoord
@@ -1304,7 +1382,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeDccInfo(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord(
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
@@ -1363,7 +1441,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileAddrFromCoord(
/**
***************************************************************************************************
-* AddrLib::ComputeHtileCoordFromAddr
+* AddrLib1::ComputeHtileCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeHtileCoordFromAddr
@@ -1372,7 +1450,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileAddrFromCoord(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeHtileCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr(
const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
@@ -1431,7 +1509,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileCoordFromAddr(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskAddrFromCoord
+* AddrLib1::ComputeCmaskAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeCmaskAddrFromCoord
@@ -1440,7 +1518,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeHtileCoordFromAddr(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskAddrFromCoord(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord(
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
@@ -1503,7 +1581,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskAddrFromCoord(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskCoordFromAddr
+* AddrLib1::ComputeCmaskCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeCmaskCoordFromAddr
@@ -1512,7 +1590,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskAddrFromCoord(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr(
const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
@@ -1566,9 +1644,10 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
return returnCode;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputeTileDataWidthAndHeight
+* AddrLib1::ComputeTileDataWidthAndHeight
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE)
@@ -1580,7 +1659,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
* MacroWidth and macroHeight are measured in pixels
***************************************************************************************************
*/
-VOID AddrLib::ComputeTileDataWidthAndHeight(
+VOID AddrLib1::ComputeTileDataWidthAndHeight(
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 cacheBits, ///< [in] bits of cache
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
@@ -1612,7 +1691,7 @@ VOID AddrLib::ComputeTileDataWidthAndHeight(
/**
***************************************************************************************************
-* AddrLib::HwlComputeTileDataWidthAndHeightLinear
+* AddrLib1::HwlComputeTileDataWidthAndHeightLinear
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout
@@ -1624,7 +1703,7 @@ VOID AddrLib::ComputeTileDataWidthAndHeight(
* MacroWidth and macroHeight are measured in pixels
***************************************************************************************************
*/
-VOID AddrLib::HwlComputeTileDataWidthAndHeightLinear(
+VOID AddrLib1::HwlComputeTileDataWidthAndHeightLinear(
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight, ///< [out] macro tile height
UINT_32 bpp, ///< [in] bits per pixel
@@ -1638,7 +1717,7 @@ VOID AddrLib::HwlComputeTileDataWidthAndHeightLinear(
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Compute htile pitch,width, bytes per 2D slice
@@ -1649,7 +1728,7 @@ VOID AddrLib::HwlComputeTileDataWidthAndHeightLinear(
* *Htile pitch, height, total size in bytes, macro-tile dimensions and slice size*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeHtileInfo(
+UINT_32 AddrLib1::ComputeHtileInfo(
ADDR_HTILE_FLAGS flags, ///< [in] htile flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
@@ -1726,7 +1805,7 @@ UINT_32 AddrLib::ComputeHtileInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBaseAlign
+* AddrLib1::ComputeCmaskBaseAlign
*
* @brief
* Compute cmask base alignment
@@ -1735,7 +1814,7 @@ UINT_32 AddrLib::ComputeHtileInfo(
* Cmask base alignment
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeCmaskBaseAlign(
+UINT_32 AddrLib1::ComputeCmaskBaseAlign(
ADDR_CMASK_FLAGS flags, ///< [in] Cmask flags
ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
@@ -1756,7 +1835,7 @@ UINT_32 AddrLib::ComputeCmaskBaseAlign(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBytes
+* AddrLib1::ComputeCmaskBytes
*
* @brief
* Compute cmask size in bytes
@@ -1765,7 +1844,7 @@ UINT_32 AddrLib::ComputeCmaskBaseAlign(
* Cmask size in bytes
***************************************************************************************************
*/
-UINT_64 AddrLib::ComputeCmaskBytes(
+UINT_64 AddrLib1::ComputeCmaskBytes(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices ///< [in] number of slices
@@ -1777,7 +1856,7 @@ UINT_64 AddrLib::ComputeCmaskBytes(
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Compute cmask pitch,width, bytes per 2D slice
@@ -1787,7 +1866,7 @@ UINT_64 AddrLib::ComputeCmaskBytes(
* macro-tile dimensions
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
ADDR_CMASK_FLAGS flags, ///< [in] cmask flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
@@ -1892,7 +1971,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
/**
***************************************************************************************************
-* AddrLib::ComputeXmaskCoordYFromPipe
+* AddrLib1::ComputeXmaskCoordYFromPipe
*
* @brief
* Compute the Y coord from pipe number for cmask/htile
@@ -1902,7 +1981,7 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskInfo(
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
+UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe(
UINT_32 pipe, ///< [in] pipe number
UINT_32 x ///< [in] x coordinate
) const
@@ -1984,7 +2063,7 @@ UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskCoordFromAddr
+* AddrLib1::HwlComputeXmaskCoordFromAddr
*
* @brief
* Compute the coord from an address of a cmask/htile
@@ -1996,7 +2075,7 @@ UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
* This method is reused by htile, so rename to Xmask
***************************************************************************************************
*/
-VOID AddrLib::HwlComputeXmaskCoordFromAddr(
+VOID AddrLib1::HwlComputeXmaskCoordFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 pitch, ///< [in] pitch
@@ -2166,7 +2245,7 @@ VOID AddrLib::HwlComputeXmaskCoordFromAddr(
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskAddrFromCoord
+* AddrLib1::HwlComputeXmaskAddrFromCoord
*
* @brief
* Compute the address from an address of cmask (prior to si)
@@ -2176,7 +2255,7 @@ VOID AddrLib::HwlComputeXmaskCoordFromAddr(
*
***************************************************************************************************
*/
-UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
+UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 x, ///< [in] x coord
@@ -2378,7 +2457,7 @@ UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceAddrFromCoordLinear
+* AddrLib1::ComputeSurfaceAddrFromCoordLinear
*
* @brief
* Compute address from coord for linear surface
@@ -2388,7 +2467,7 @@ UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
*
***************************************************************************************************
*/
-UINT_64 AddrLib::ComputeSurfaceAddrFromCoordLinear(
+UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 slice, ///< [in] slice/depth index
@@ -2416,7 +2495,7 @@ UINT_64 AddrLib::ComputeSurfaceAddrFromCoordLinear(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrLinear
+* AddrLib1::ComputeSurfaceCoordFromAddrLinear
*
* @brief
* Compute the coord from an address of a linear surface
@@ -2425,7 +2504,7 @@ UINT_64 AddrLib::ComputeSurfaceAddrFromCoordLinear(
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeSurfaceCoordFromAddrLinear(
+VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
@@ -2449,7 +2528,7 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrLinear(
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrMicroTiled
+* AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled
*
* @brief
* Compute the coord from an address of a micro tiled surface
@@ -2458,7 +2537,7 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrLinear(
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeSurfaceCoordFromAddrMicroTiled(
+VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
@@ -2571,7 +2650,7 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrMicroTiled(
/**
***************************************************************************************************
-* AddrLib::ComputePipeFromAddr
+* AddrLib1::ComputePipeFromAddr
*
* @brief
* Compute the pipe number from an address
@@ -2581,7 +2660,7 @@ VOID AddrLib::ComputeSurfaceCoordFromAddrMicroTiled(
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputePipeFromAddr(
+UINT_32 AddrLib1::ComputePipeFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 numPipes ///< [in] number of banks
) const
@@ -2611,7 +2690,7 @@ UINT_32 AddrLib::ComputePipeFromAddr(
/**
***************************************************************************************************
-* AddrLib::ComputePixelIndexWithinMicroTile
+* AddrLib1::ComputePixelIndexWithinMicroTile
*
* @brief
* Compute the pixel index inside a micro tile of surface
@@ -2621,7 +2700,7 @@ UINT_32 AddrLib::ComputePipeFromAddr(
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputePixelIndexWithinMicroTile(
+UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 z, ///< [in] slice/depth index
@@ -2826,7 +2905,7 @@ UINT_32 AddrLib::ComputePixelIndexWithinMicroTile(
/**
***************************************************************************************************
-* AddrLib::AdjustPitchAlignment
+* AddrLib1::AdjustPitchAlignment
*
* @brief
* Adjusts pitch alignment for flipping surface
@@ -2836,7 +2915,7 @@ UINT_32 AddrLib::ComputePixelIndexWithinMicroTile(
*
***************************************************************************************************
*/
-VOID AddrLib::AdjustPitchAlignment(
+VOID AddrLib1::AdjustPitchAlignment(
ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags
UINT_32* pPitchAlign ///< [out] Pointer to pitch alignment
) const
@@ -2856,7 +2935,7 @@ VOID AddrLib::AdjustPitchAlignment(
/**
***************************************************************************************************
-* AddrLib::PadDimensions
+* AddrLib1::PadDimensions
*
* @brief
* Helper function to pad dimensions
@@ -2866,7 +2945,7 @@ VOID AddrLib::AdjustPitchAlignment(
*
***************************************************************************************************
*/
-VOID AddrLib::PadDimensions(
+VOID AddrLib1::PadDimensions(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
@@ -2962,7 +3041,7 @@ VOID AddrLib::PadDimensions(
/**
***************************************************************************************************
-* AddrLib::HwlPreHandleBaseLvl3xPitch
+* AddrLib1::HwlPreHandleBaseLvl3xPitch
*
* @brief
* Pre-handler of 3x pitch (96 bit) adjustment
@@ -2971,7 +3050,7 @@ VOID AddrLib::PadDimensions(
* Expected pitch
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlPreHandleBaseLvl3xPitch(
+UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
@@ -2993,7 +3072,7 @@ UINT_32 AddrLib::HwlPreHandleBaseLvl3xPitch(
/**
***************************************************************************************************
-* AddrLib::HwlPostHandleBaseLvl3xPitch
+* AddrLib1::HwlPostHandleBaseLvl3xPitch
*
* @brief
* Post-handler of 3x pitch adjustment
@@ -3002,7 +3081,7 @@ UINT_32 AddrLib::HwlPreHandleBaseLvl3xPitch(
* Expected pitch
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlPostHandleBaseLvl3xPitch(
+UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
@@ -3024,7 +3103,7 @@ UINT_32 AddrLib::HwlPostHandleBaseLvl3xPitch(
/**
***************************************************************************************************
-* AddrLib::IsMacroTiled
+* AddrLib1::IsMacroTiled
*
* @brief
* Check if the tile mode is macro tiled
@@ -3033,7 +3112,7 @@ UINT_32 AddrLib::HwlPostHandleBaseLvl3xPitch(
* TRUE if it is macro tiled (2D/2B/3D/3B)
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacroTiled(
+BOOL_32 AddrLib1::IsMacroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro;
@@ -3041,7 +3120,7 @@ BOOL_32 AddrLib::IsMacroTiled(
/**
***************************************************************************************************
-* AddrLib::IsMacro3dTiled
+* AddrLib1::IsMacro3dTiled
*
* @brief
* Check if the tile mode is 3D macro tiled
@@ -3050,7 +3129,7 @@ BOOL_32 AddrLib::IsMacroTiled(
* TRUE if it is 3D macro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacro3dTiled(
+BOOL_32 AddrLib1::IsMacro3dTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro3d;
@@ -3058,7 +3137,7 @@ BOOL_32 AddrLib::IsMacro3dTiled(
/**
***************************************************************************************************
-* AddrLib::IsMicroTiled
+* AddrLib1::IsMicroTiled
*
* @brief
* Check if the tile mode is micro tiled
@@ -3067,7 +3146,7 @@ BOOL_32 AddrLib::IsMacro3dTiled(
* TRUE if micro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMicroTiled(
+BOOL_32 AddrLib1::IsMicroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMicro;
@@ -3075,7 +3154,7 @@ BOOL_32 AddrLib::IsMicroTiled(
/**
***************************************************************************************************
-* AddrLib::IsLinear
+* AddrLib1::IsLinear
*
* @brief
* Check if the tile mode is linear
@@ -3084,7 +3163,7 @@ BOOL_32 AddrLib::IsMicroTiled(
* TRUE if linear
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsLinear(
+BOOL_32 AddrLib1::IsLinear(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isLinear;
@@ -3092,7 +3171,7 @@ BOOL_32 AddrLib::IsLinear(
/**
***************************************************************************************************
-* AddrLib::IsPrtNoRotationTileMode
+* AddrLib1::IsPrtNoRotationTileMode
*
* @brief
* Return TRUE if it is prt tile without rotation
@@ -3100,7 +3179,7 @@ BOOL_32 AddrLib::IsLinear(
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtNoRotationTileMode(
+BOOL_32 AddrLib1::IsPrtNoRotationTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrtNoRotation;
@@ -3108,7 +3187,7 @@ BOOL_32 AddrLib::IsPrtNoRotationTileMode(
/**
***************************************************************************************************
-* AddrLib::IsPrtTileMode
+* AddrLib1::IsPrtTileMode
*
* @brief
* Return TRUE if it is prt tile
@@ -3116,7 +3195,7 @@ BOOL_32 AddrLib::IsPrtNoRotationTileMode(
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtTileMode(
+BOOL_32 AddrLib1::IsPrtTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrt;
@@ -3124,7 +3203,7 @@ BOOL_32 AddrLib::IsPrtTileMode(
/**
***************************************************************************************************
-* AddrLib::ComputeMipLevel
+* AddrLib1::ComputeMipLevel
*
* @brief
* Compute mipmap level width/height/slices
@@ -3132,7 +3211,7 @@ BOOL_32 AddrLib::IsPrtTileMode(
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeMipLevel(
+VOID AddrLib1::ComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
@@ -3154,7 +3233,7 @@ VOID AddrLib::ComputeMipLevel(
/**
***************************************************************************************************
-* AddrLib::OptimizeTileMode
+* AddrLib1::OptimizeTileMode
*
* @brief
* Check if base level's tile mode can be optimized (degraded)
@@ -3162,7 +3241,7 @@ VOID AddrLib::ComputeMipLevel(
* TRUE if degraded, also returns degraded tile mode (unchanged if not degraded)
***************************************************************************************************
*/
-BOOL_32 AddrLib::OptimizeTileMode(
+BOOL_32 AddrLib1::OptimizeTileMode(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure for surface info
AddrTileMode* pTileMode ///< [out] Degraded tile mode
) const
@@ -3224,7 +3303,7 @@ BOOL_32 AddrLib::OptimizeTileMode(
/**
***************************************************************************************************
-* AddrLib::DegradeLargeThickTile
+* AddrLib1::DegradeLargeThickTile
*
* @brief
* Check if the thickness needs to be reduced if a tile is too large
@@ -3232,7 +3311,7 @@ BOOL_32 AddrLib::OptimizeTileMode(
* The degraded tile mode (unchanged if not degraded)
***************************************************************************************************
*/
-AddrTileMode AddrLib::DegradeLargeThickTile(
+AddrTileMode AddrLib1::DegradeLargeThickTile(
AddrTileMode tileMode,
UINT_32 bpp) const
{
@@ -3294,14 +3373,14 @@ AddrTileMode AddrLib::DegradeLargeThickTile(
/**
***************************************************************************************************
-* AddrLib::PostComputeMipLevel
+* AddrLib1::PostComputeMipLevel
* @brief
* Compute MipLevel info (including level 0) after surface adjustment
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::PostComputeMipLevel(
+ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in/out] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] Output structure
) const
@@ -3334,7 +3413,7 @@ ADDR_E_RETURNCODE AddrLib::PostComputeMipLevel(
/**
***************************************************************************************************
-* AddrLib::HwlSetupTileCfg
+* AddrLib1::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
@@ -3342,7 +3421,7 @@ ADDR_E_RETURNCODE AddrLib::PostComputeMipLevel(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::HwlSetupTileCfg(
+ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg(
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
ADDR_TILEINFO* pInfo, ///< [out] Tile Info
@@ -3355,7 +3434,7 @@ ADDR_E_RETURNCODE AddrLib::HwlSetupTileCfg(
/**
***************************************************************************************************
-* AddrLib::HwlGetPipes
+* AddrLib1::HwlGetPipes
*
* @brief
* Get number pipes
@@ -3363,7 +3442,7 @@ ADDR_E_RETURNCODE AddrLib::HwlSetupTileCfg(
* num pipes
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlGetPipes(
+UINT_32 AddrLib1::HwlGetPipes(
const ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
@@ -3373,7 +3452,7 @@ UINT_32 AddrLib::HwlGetPipes(
/**
***************************************************************************************************
-* AddrLib::ComputeQbStereoInfo
+* AddrLib1::ComputeQbStereoInfo
*
* @brief
* Get quad buffer stereo information
@@ -3381,7 +3460,7 @@ UINT_32 AddrLib::HwlGetPipes(
* TRUE if no error
***************************************************************************************************
*/
-BOOL_32 AddrLib::ComputeQbStereoInfo(
+BOOL_32 AddrLib1::ComputeQbStereoInfo(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] updated pOut+pStereoInfo
) const
{
@@ -3406,7 +3485,7 @@ BOOL_32 AddrLib::ComputeQbStereoInfo(
// Double size
pOut->surfSize <<= 1;
- // Right start address meets the base align since it is guaranteed by AddrLib
+ // Right start address meets the base align since it is guaranteed by AddrLib1
// 1D surface on SI may break this rule, but we can force it to meet by checking .qbStereo.
success = TRUE;
@@ -3415,9 +3494,10 @@ BOOL_32 AddrLib::ComputeQbStereoInfo(
return success;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputePrtInfo
+* AddrLib1::ComputePrtInfo
*
* @brief
* Compute prt surface related info
@@ -3426,7 +3506,7 @@ BOOL_32 AddrLib::ComputeQbStereoInfo(
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::ComputePrtInfo(
+ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo(
const ADDR_PRT_INFO_INPUT* pIn,
ADDR_PRT_INFO_OUTPUT* pOut) const
{
diff --git a/src/amd/addrlib/core/addrlib1.h b/src/amd/addrlib/core/addrlib1.h
index f0f8d56842c..9e216840d21 100644
--- a/src/amd/addrlib/core/addrlib1.h
+++ b/src/amd/addrlib/core/addrlib1.h
@@ -24,6 +24,13 @@
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addrlib1.h
+* @brief Contains the AddrLib1 base class definition.
+***************************************************************************************************
+*/
+
#ifndef __ADDR_LIB1_H__
#define __ADDR_LIB1_H__
@@ -43,5 +50,449 @@ enum AddrSampleSplitSize
ADDR_SAMPLESPLIT_8KB = 8192,
};
+/**
+***************************************************************************************************
+* @brief Flags for AddrTileMode
+***************************************************************************************************
+*/
+struct AddrTileModeFlags
+{
+ UINT_32 thickness : 4;
+ UINT_32 isLinear : 1;
+ UINT_32 isMicro : 1;
+ UINT_32 isMacro : 1;
+ UINT_32 isMacro3d : 1;
+ UINT_32 isPrt : 1;
+ UINT_32 isPrtNoRotation : 1;
+ UINT_32 isBankSwapped : 1;
+};
+
+/**
+***************************************************************************************************
+* @brief This class contains asic independent address lib functionalities
+***************************************************************************************************
+*/
+class AddrLib1 : public AddrLib
+{
+public:
+ virtual ~AddrLib1();
+
+ static AddrLib1* GetAddrLib1(
+ ADDR_HANDLE hLib);
+
+ /// Returns tileIndex support
+ BOOL_32 UseTileIndex(INT_32 index) const
+ {
+ return m_configFlags.useTileIndex && (index != TileIndexInvalid);
+ }
+
+ /// Returns combined swizzle support
+ BOOL_32 UseCombinedSwizzle() const
+ {
+ return m_configFlags.useCombinedSwizzle;
+ }
+
+ //
+ // Interface stubs
+ //
+ ADDR_E_RETURNCODE ComputeSurfaceInfo(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSurfaceAddrFromCoord(
+ const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSurfaceCoordFromAddr(
+ const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeSliceTileSwizzle(
+ const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ExtractBankPipeSwizzle(
+ const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE CombineBankPipeSwizzle(
+ const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeBaseSwizzle(
+ const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeFmaskInfo(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
+
+ ADDR_E_RETURNCODE ComputeFmaskAddrFromCoord(
+ const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeFmaskCoordFromAddr(
+ const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileInfoToHW(
+ const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
+ ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileIndex(
+ const ADDR_CONVERT_TILEINDEX_INPUT* pIn,
+ ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ConvertTileIndex1(
+ const ADDR_CONVERT_TILEINDEX1_INPUT* pIn,
+ ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE GetTileIndex(
+ const ADDR_GET_TILEINDEX_INPUT* pIn,
+ ADDR_GET_TILEINDEX_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileInfo(
+ const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskInfo(
+ const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeDccInfo(
+ const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
+ ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileAddrFromCoord(
+ const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskAddrFromCoord(
+ const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeHtileCoordFromAddr(
+ const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputeCmaskCoordFromAddr(
+ const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) const;
+
+ ADDR_E_RETURNCODE ComputePrtInfo(
+ const ADDR_PRT_INFO_INPUT* pIn,
+ ADDR_PRT_INFO_OUTPUT* pOut) const;
+protected:
+ AddrLib1(); // Constructor is protected
+ AddrLib1(const AddrClient* pClient);
+
+ /// Pure Virtual function for Hwl computing surface info
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface address from coord
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceAddrFromCoord(
+ const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface coord from address
+ virtual ADDR_E_RETURNCODE HwlComputeSurfaceCoordFromAddr(
+ const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing surface tile swizzle
+ virtual ADDR_E_RETURNCODE HwlComputeSliceTileSwizzle(
+ const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl extracting bank/pipe swizzle from base256b
+ virtual ADDR_E_RETURNCODE HwlExtractBankPipeSwizzle(
+ const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn,
+ ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl combining bank/pipe swizzle
+ virtual ADDR_E_RETURNCODE HwlCombineBankPipeSwizzle(
+ UINT_32 bankSwizzle, UINT_32 pipeSwizzle, ADDR_TILEINFO* pTileInfo,
+ UINT_64 baseAddr, UINT_32* pTileSwizzle) const = 0;
+
+ /// Pure Virtual function for Hwl computing base swizzle
+ virtual ADDR_E_RETURNCODE HwlComputeBaseSwizzle(
+ const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
+ ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE base align
+ virtual UINT_32 HwlComputeHtileBaseAlign(
+ BOOL_32 isTcCompatible, BOOL_32 isLinear, ADDR_TILEINFO* pTileInfo) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE bpp
+ virtual UINT_32 HwlComputeHtileBpp(
+ BOOL_32 isWidth8, BOOL_32 isHeight8) const = 0;
+
+ /// Pure Virtual function for Hwl computing HTILE bytes
+ virtual UINT_64 HwlComputeHtileBytes(
+ UINT_32 pitch, UINT_32 height, UINT_32 bpp,
+ BOOL_32 isLinear, UINT_32 numSlices, UINT_64* pSliceBytes, UINT_32 baseAlign) const = 0;
+
+ /// Pure Virtual function for Hwl computing FMASK info
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskInfo(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) = 0;
+
+ /// Pure Virtual function for Hwl FMASK address from coord
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskAddrFromCoord(
+ const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl FMASK coord from address
+ virtual ADDR_E_RETURNCODE HwlComputeFmaskCoordFromAddr(
+ const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
+ ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl convert tile info from real value to HW value
+ virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
+ const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
+ ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const = 0;
+
+ /// Pure Virtual function for Hwl compute mipmap info
+ virtual BOOL_32 HwlComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
+
+ /// Pure Virtual function for Hwl compute max cmask blockMax value
+ virtual BOOL_32 HwlGetMaxCmaskBlockMax() const = 0;
+
+ /// Pure Virtual function for Hwl compute fmask bits
+ virtual UINT_32 HwlComputeFmaskBits(
+ const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
+ UINT_32* pNumSamples) const = 0;
+
+ /// Virtual function to get index (not pure then no need to implement this in all hwls
+ virtual ADDR_E_RETURNCODE HwlGetTileIndex(
+ const ADDR_GET_TILEINDEX_INPUT* pIn,
+ ADDR_GET_TILEINDEX_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ /// Virtual function for Hwl to compute Dcc info
+ virtual ADDR_E_RETURNCODE HwlComputeDccInfo(
+ const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
+ ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ /// Virtual function to get cmask address for tc compatible cmask
+ virtual ADDR_E_RETURNCODE HwlComputeCmaskAddrFromCoord(
+ const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn,
+ ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) const
+ {
+ return ADDR_NOTSUPPORTED;
+ }
+
+ // Compute attributes
+
+ // HTILE
+ UINT_32 ComputeHtileInfo(
+ ADDR_HTILE_FLAGS flags,
+ UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices,
+ BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
+ ADDR_TILEINFO* pTileInfo,
+ UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pHtileBytes,
+ UINT_32* pMacroWidth = NULL, UINT_32* pMacroHeight = NULL,
+ UINT_64* pSliceSize = NULL, UINT_32* pBaseAlign = NULL) const;
+
+ // CMASK
+ ADDR_E_RETURNCODE ComputeCmaskInfo(
+ ADDR_CMASK_FLAGS flags,
+ UINT_32 pitchIn, UINT_32 heightIn, UINT_32 numSlices, BOOL_32 isLinear,
+ ADDR_TILEINFO* pTileInfo, UINT_32* pPitchOut, UINT_32* pHeightOut, UINT_64* pCmaskBytes,
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight, UINT_64* pSliceSize = NULL,
+ UINT_32* pBaseAlign = NULL, UINT_32* pBlockMax = NULL) const;
+
+ virtual VOID HwlComputeTileDataWidthAndHeightLinear(
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight,
+ UINT_32 bpp, ADDR_TILEINFO* pTileInfo) const;
+
+ // CMASK & HTILE addressing
+ virtual UINT_64 HwlComputeXmaskAddrFromCoord(
+ UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice,
+ UINT_32 numSlices, UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8,
+ BOOL_32 isHeight8, ADDR_TILEINFO* pTileInfo,
+ UINT_32* bitPosition) const;
+
+ virtual VOID HwlComputeXmaskCoordFromAddr(
+ UINT_64 addr, UINT_32 bitPosition, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
+ ADDR_TILEINFO* pTileInfo, UINT_32* pX, UINT_32* pY, UINT_32* pSlice) const;
+
+ // Surface mipmap
+ VOID ComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
+
+ /// Pure Virtual function for Hwl checking degrade for base level
+ virtual BOOL_32 HwlDegradeBaseLevel(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const = 0;
+
+ virtual BOOL_32 HwlOverrideTileMode(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ AddrTileMode* pTileMode,
+ AddrTileType* pTileType) const
+ {
+ // not supported in hwl layer, FALSE for not-overrided
+ return FALSE;
+ }
+
+ AddrTileMode DegradeLargeThickTile(AddrTileMode tileMode, UINT_32 bpp) const;
+
+ VOID PadDimensions(
+ AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
+ UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
+ UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
+ UINT_32* pSlices, UINT_32 sliceAlign) const;
+
+ virtual VOID HwlPadDimensions(
+ AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
+ UINT_32 numSamples, ADDR_TILEINFO* pTileInfo, UINT_32 padDims, UINT_32 mipLevel,
+ UINT_32* pPitch, UINT_32 pitchAlign, UINT_32* pHeight, UINT_32 heightAlign,
+ UINT_32* pSlices, UINT_32 sliceAlign) const
+ {
+ }
+
+ //
+ // Addressing shared for linear/1D tiling
+ //
+ UINT_64 ComputeSurfaceAddrFromCoordLinear(
+ UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
+ UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32* pBitPosition) const;
+
+ VOID ComputeSurfaceCoordFromAddrLinear(
+ UINT_64 addr, UINT_32 bitPosition, UINT_32 bpp,
+ UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample) const;
+
+ VOID ComputeSurfaceCoordFromAddrMicroTiled(
+ UINT_64 addr, UINT_32 bitPosition,
+ UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
+ AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
+ AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const;
+
+ UINT_32 ComputePixelIndexWithinMicroTile(
+ UINT_32 x, UINT_32 y, UINT_32 z,
+ UINT_32 bpp, AddrTileMode tileMode, AddrTileType microTileType) const;
+
+ /// Pure Virtual function for Hwl computing coord from offset inside micro tile
+ virtual VOID HwlComputePixelCoordFromOffset(
+ UINT_32 offset, UINT_32 bpp, UINT_32 numSamples,
+ AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
+ UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
+ AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const = 0;
+
+ //
+ // Addressing shared by all
+ //
+ virtual UINT_32 HwlGetPipes(
+ const ADDR_TILEINFO* pTileInfo) const;
+
+ UINT_32 ComputePipeFromAddr(
+ UINT_64 addr, UINT_32 numPipes) const;
+
+ /// Pure Virtual function for Hwl computing pipe from coord
+ virtual UINT_32 ComputePipeFromCoord(
+ UINT_32 x, UINT_32 y, UINT_32 slice, AddrTileMode tileMode,
+ UINT_32 pipeSwizzle, BOOL_32 flags, ADDR_TILEINFO* pTileInfo) const = 0;
+
+ /// Pure Virtual function for Hwl computing coord Y for 8 pipe cmask/htile
+ virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
+ UINT_32 pipe, UINT_32 x) const = 0;
+
+ //
+ // Misc helper
+ //
+ static const AddrTileModeFlags m_modeFlags[ADDR_TM_COUNT];
+
+ static UINT_32 ComputeSurfaceThickness(
+ AddrTileMode tileMode);
+
+ // Checking tile mode
+ static BOOL_32 IsMacroTiled(AddrTileMode tileMode);
+ static BOOL_32 IsMacro3dTiled(AddrTileMode tileMode);
+ static BOOL_32 IsLinear(AddrTileMode tileMode);
+ static BOOL_32 IsMicroTiled(AddrTileMode tileMode);
+ static BOOL_32 IsPrtTileMode(AddrTileMode tileMode);
+ static BOOL_32 IsPrtNoRotationTileMode(AddrTileMode tileMode);
+
+ /// Return TRUE if tile info is needed
+ BOOL_32 UseTileInfo() const
+ {
+ return !m_configFlags.ignoreTileInfo;
+ }
+
+ /// Adjusts pitch alignment for flipping surface
+ VOID AdjustPitchAlignment(
+ ADDR_SURFACE_FLAGS flags, UINT_32* pPitchAlign) const;
+
+ /// Overwrite tile config according to tile index
+ virtual ADDR_E_RETURNCODE HwlSetupTileCfg(
+ INT_32 index, INT_32 macroModeIndex,
+ ADDR_TILEINFO* pInfo, AddrTileMode* mode = NULL, AddrTileType* type = NULL) const;
+
+ /// Overwrite macro tile config according to tile index
+ virtual INT_32 HwlComputeMacroModeIndex(
+ INT_32 index, ADDR_SURFACE_FLAGS flags, UINT_32 bpp, UINT_32 numSamples,
+ ADDR_TILEINFO* pTileInfo, AddrTileMode *pTileMode = NULL, AddrTileType *pTileType = NULL
+ ) const
+ {
+ return TileIndexNoMacroIndex;
+ }
+
+ /// Pre-handler of 3x pitch (96 bit) adjustment
+ virtual UINT_32 HwlPreHandleBaseLvl3xPitch(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
+ /// Post-handler of 3x pitch adjustment
+ virtual UINT_32 HwlPostHandleBaseLvl3xPitch(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
+ /// Check miplevel after surface adjustment
+ ADDR_E_RETURNCODE PostComputeMipLevel(
+ ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ /// Quad buffer stereo support, has its implementation in ind. layer
+ virtual BOOL_32 ComputeQbStereoInfo(
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
+ /// Pure virutual function to compute stereo bank swizzle for right eye
+ virtual UINT_32 HwlComputeQbStereoRightSwizzle(
+ ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
+
+private:
+ // Disallow the copy constructor
+ AddrLib1(const AddrLib1& a);
+
+ // Disallow the assignment operator
+ AddrLib1& operator=(const AddrLib1& a);
+
+ UINT_32 ComputeCmaskBaseAlign(
+ ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const;
+
+ UINT_64 ComputeCmaskBytes(
+ UINT_32 pitch, UINT_32 height, UINT_32 numSlices) const;
+
+ //
+ // CMASK/HTILE shared methods
+ //
+ VOID ComputeTileDataWidthAndHeight(
+ UINT_32 bpp, UINT_32 cacheBits, ADDR_TILEINFO* pTileInfo,
+ UINT_32* pMacroWidth, UINT_32* pMacroHeight) const;
+
+ UINT_32 ComputeXmaskCoordYFromPipe(
+ UINT_32 pipe, UINT_32 x) const;
+
+ BOOL_32 OptimizeTileMode(
+ const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, AddrTileMode* pTileMode) const;
+};
#endif
+
diff --git a/src/amd/addrlib/r800/ciaddrlib.h b/src/amd/addrlib/r800/ciaddrlib.h
index 5630959f0ac..90d6c1b2b90 100644
--- a/src/amd/addrlib/r800/ciaddrlib.h
+++ b/src/amd/addrlib/r800/ciaddrlib.h
@@ -34,7 +34,7 @@
#ifndef __CI_ADDR_LIB_H__
#define __CI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "siaddrlib.h"
/**
@@ -89,7 +89,7 @@ private:
protected:
- // Hwl interface - defined in AddrLib
+ // Hwl interface - defined in AddrLib1
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp
index 2085dc57cb0..b7c69956d8a 100644
--- a/src/amd/addrlib/r800/egbaddrlib.cpp
+++ b/src/amd/addrlib/r800/egbaddrlib.cpp
@@ -45,7 +45,7 @@
***************************************************************************************************
*/
EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) :
- AddrLib(pClient),
+ AddrLib1(pClient),
m_ranks(0),
m_logicalBanks(0),
m_bankInterleave(1)
diff --git a/src/amd/addrlib/r800/egbaddrlib.h b/src/amd/addrlib/r800/egbaddrlib.h
index ca1d07d062f..b8eabd816ff 100644
--- a/src/amd/addrlib/r800/egbaddrlib.h
+++ b/src/amd/addrlib/r800/egbaddrlib.h
@@ -34,7 +34,7 @@
#ifndef __EG_BASED_ADDR_LIB_H__
#define __EG_BASED_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
/// Structures for functions
@@ -58,7 +58,7 @@ struct CoordFromBankPipe
* @note Abstract class
***************************************************************************************************
*/
-class EgBasedAddrLib : public AddrLib
+class EgBasedAddrLib : public AddrLib1
{
protected:
EgBasedAddrLib(const AddrClient* pClient);
diff --git a/src/amd/addrlib/r800/siaddrlib.cpp b/src/amd/addrlib/r800/siaddrlib.cpp
index 4d791cef2bf..2b7e9c9bd49 100644
--- a/src/amd/addrlib/r800/siaddrlib.cpp
+++ b/src/amd/addrlib/r800/siaddrlib.cpp
@@ -1254,7 +1254,7 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch(
// do here
if (!pIn->flags.pow2Pad)
{
- AddrLib::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
+ AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
}
else
{
@@ -1287,7 +1287,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)
{
- AddrLib::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
+ AddrLib1::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
}
return expPitch;
diff --git a/src/amd/addrlib/r800/siaddrlib.h b/src/amd/addrlib/r800/siaddrlib.h
index 04f7adcac8f..ba1d4b5466a 100644
--- a/src/amd/addrlib/r800/siaddrlib.h
+++ b/src/amd/addrlib/r800/siaddrlib.h
@@ -34,7 +34,7 @@
#ifndef __SI_ADDR_LIB_H__
#define __SI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "egbaddrlib.h"
/**
@@ -87,7 +87,7 @@ protected:
SiAddrLib(const AddrClient* pClient);
virtual ~SiAddrLib();
- // Hwl interface - defined in AddrLib
+ // Hwl interface - defined in AddrLib1
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;