Add one more abstraction layer into inheritance system.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
***************************************************************************************************
*/
#include "addrinterface.h"
-#include "addrlib.h"
+#include "addrlib1.h"
#include "addrcommon.h"
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
{
ADDR_E_RETURNCODE returnCode;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
{
BOOL_32 useTileIndex = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
{
BOOL_32 useCombinedSwizzle = FALSE;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_ASSERT(pLib != NULL);
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
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;
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;
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;
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;
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
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;
-};
/**
***************************************************************************************************
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;
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
//
//
// Misc helper
//
- static const AddrTileModeFlags m_modeFlags[ADDR_TM_COUNT];
-
- static UINT_32 ComputeSurfaceThickness(
- AddrTileMode tileMode);
-
- // Checking tile mode
- static BOOL_32 IsMacroTiled(AddrTileMode tileMode);
- static BOOL_32 IsMacro3dTiled(AddrTileMode tileMode);
- static BOOL_32 IsLinear(AddrTileMode tileMode);
- static BOOL_32 IsMicroTiled(AddrTileMode tileMode);
- static BOOL_32 IsPrtTileMode(AddrTileMode tileMode);
- static BOOL_32 IsPrtNoRotationTileMode(AddrTileMode tileMode);
-
static UINT_32 Bits2Number(UINT_32 bitNum,...);
static UINT_32 GetNumFragments(UINT_32 numSamples, UINT_32 numFrags)
return 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);
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)
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addr1lib.cpp
+* @brief Contains the implementation for the AddrLib1 base class..
+***************************************************************************************************
+*/
+
#include "addrinterface.h"
#include "addrlib1.h"
#include "addrcommon.h"
// Static Const Member
///////////////////////////////////////////////////////////////////////////////////////////////////
-const AddrTileModeFlags AddrLib::m_modeFlags[ADDR_TM_COUNT] =
+const AddrTileModeFlags AddrLib1::m_modeFlags[ADDR_TM_COUNT] =
{// T L 1 2 3 P Pr B
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_GENERAL
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_ALIGNED
{4, 0, 0, 1, 1, 1, 0, 0}, // ADDR_TM_PRT_3D_TILED_THICK
};
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Constructor/Destructor
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1() :
+ AddrLib()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::AddrLib1
+*
+* @brief
+* Constructor for the AddrLib1 class with hClient as parameter
+*
+***************************************************************************************************
+*/
+AddrLib1::AddrLib1(const AddrClient* pClient) :
+ AddrLib(pClient)
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::~AddrLib1
+*
+* @brief
+* Destructor for the AddrLib1 class
+*
+***************************************************************************************************
+*/
+AddrLib1::~AddrLib1()
+{
+}
+
+/**
+***************************************************************************************************
+* AddrLib1::GetAddrLib1
+*
+* @brief
+* Get AddrLib1 pointer
+*
+* @return
+* An AddrLib1 class pointer
+***************************************************************************************************
+*/
+AddrLib1 * AddrLib1::GetAddrLib1(
+ ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
+{
+ AddrLib *pAddrLib = AddrLib::GetAddrLib(hLib);
+ if ((pAddrLib != NULL) &&
+ ((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
+ (pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI)))
+ {
+ // only valid and pre-VI AISC can use AddrLib1 function.
+ ADDR_ASSERT_ALWAYS();
+ hLib = NULL;
+ }
+ return static_cast<AddrLib1 *>(hLib);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Surface Methods
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceInfo
+* AddrLib1::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddr
+* AddrLib1::ComputeSurfaceCoordFromAddr
*
* @brief
* Interface function stub of ComputeSurfaceCoordFromAddr.
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeSliceTileSwizzle
+* AddrLib1::ComputeSliceTileSwizzle
*
* @brief
* Interface function stub of ComputeSliceTileSwizzle.
* 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
/**
***************************************************************************************************
-* AddrLib::ExtractBankPipeSwizzle
+* AddrLib1::ExtractBankPipeSwizzle
*
* @brief
* Interface function stub of AddrExtractBankPipeSwizzle.
* 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
/**
***************************************************************************************************
-* AddrLib::CombineBankPipeSwizzle
+* AddrLib1::CombineBankPipeSwizzle
*
* @brief
* Interface function stub of AddrCombineBankPipeSwizzle.
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeBaseSwizzle
+* AddrLib1::ComputeBaseSwizzle
*
* @brief
* Interface function stub of AddrCompueBaseSwizzle.
* 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
{
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskInfo
+* AddrLib1::ComputeFmaskInfo
*
* @brief
* Interface function stub of ComputeFmaskInfo.
* 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
)
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskAddrFromCoord
+* AddrLib1::ComputeFmaskAddrFromCoord
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeFmaskCoordFromAddr
+* AddrLib1::ComputeFmaskCoordFromAddr
*
* @brief
* Interface function stub of 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
/**
***************************************************************************************************
-* AddrLib::ConvertTileInfoToHW
+* AddrLib1::ConvertTileInfoToHW
*
* @brief
* Convert tile info from real value to HW register value in HW layer
* 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
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex
+* AddrLib1::ConvertTileIndex
*
* @brief
* Convert tile index to tile mode/type/info
* 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
/**
***************************************************************************************************
-* AddrLib::ConvertTileIndex1
+* AddrLib1::ConvertTileIndex1
*
* @brief
* Convert tile index to tile mode/type/info
* 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
/**
***************************************************************************************************
-* AddrLib::GetTileIndex
+* AddrLib1::GetTileIndex
*
* @brief
* Get tile index from tile mode/type/info
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceThickness
+* AddrLib1::ComputeSurfaceThickness
*
* @brief
* Compute surface thickness
* Surface thickness
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeSurfaceThickness(
+UINT_32 AddrLib1::ComputeSurfaceThickness(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].thickness;
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Interface function stub of AddrComputeHtilenfo
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Interface function stub of AddrComputeCmaskInfo
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeDccInfo
+* AddrLib1::ComputeDccInfo
*
* @brief
* Interface function to compute DCC key info
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeHtileAddrFromCoord
+* AddrLib1::ComputeHtileAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeHtileAddrFromCoord
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeHtileCoordFromAddr
+* AddrLib1::ComputeHtileCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeHtileCoordFromAddr
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskAddrFromCoord
+* AddrLib1::ComputeCmaskAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeCmaskAddrFromCoord
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskCoordFromAddr
+* AddrLib1::ComputeCmaskCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeCmaskCoordFromAddr
* 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
return returnCode;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputeTileDataWidthAndHeight
+* AddrLib1::ComputeTileDataWidthAndHeight
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE)
* 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
/**
***************************************************************************************************
-* AddrLib::HwlComputeTileDataWidthAndHeightLinear
+* AddrLib1::HwlComputeTileDataWidthAndHeightLinear
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE) for linear layout
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeHtileInfo
+* AddrLib1::ComputeHtileInfo
*
* @brief
* Compute htile pitch,width, bytes per 2D slice
* *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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBaseAlign
+* AddrLib1::ComputeCmaskBaseAlign
*
* @brief
* Compute cmask base alignment
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskBytes
+* AddrLib1::ComputeCmaskBytes
*
* @brief
* Compute cmask size in bytes
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeCmaskInfo
+* AddrLib1::ComputeCmaskInfo
*
* @brief
* Compute cmask pitch,width, bytes per 2D slice
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeXmaskCoordYFromPipe
+* AddrLib1::ComputeXmaskCoordYFromPipe
*
* @brief
* Compute the Y coord from pipe number for cmask/htile
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputeXmaskCoordYFromPipe(
+UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe(
UINT_32 pipe, ///< [in] pipe number
UINT_32 x ///< [in] x coordinate
) const
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskCoordFromAddr
+* AddrLib1::HwlComputeXmaskCoordFromAddr
*
* @brief
* Compute the coord from an address of a cmask/htile
* 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
/**
***************************************************************************************************
-* AddrLib::HwlComputeXmaskAddrFromCoord
+* AddrLib1::HwlComputeXmaskAddrFromCoord
*
* @brief
* Compute the address from an address of cmask (prior to si)
*
***************************************************************************************************
*/
-UINT_64 AddrLib::HwlComputeXmaskAddrFromCoord(
+UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 x, ///< [in] x coord
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceAddrFromCoordLinear
+* AddrLib1::ComputeSurfaceAddrFromCoordLinear
*
* @brief
* Compute address from coord for linear surface
*
***************************************************************************************************
*/
-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
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrLinear
+* AddrLib1::ComputeSurfaceCoordFromAddrLinear
*
* @brief
* Compute the coord from an address of a linear surface
* 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
/**
***************************************************************************************************
-* AddrLib::ComputeSurfaceCoordFromAddrMicroTiled
+* AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled
*
* @brief
* Compute the coord from an address of a micro tiled surface
* 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
/**
***************************************************************************************************
-* AddrLib::ComputePipeFromAddr
+* AddrLib1::ComputePipeFromAddr
*
* @brief
* Compute the pipe number from an address
*
***************************************************************************************************
*/
-UINT_32 AddrLib::ComputePipeFromAddr(
+UINT_32 AddrLib1::ComputePipeFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 numPipes ///< [in] number of banks
) const
/**
***************************************************************************************************
-* AddrLib::ComputePixelIndexWithinMicroTile
+* AddrLib1::ComputePixelIndexWithinMicroTile
*
* @brief
* Compute the pixel index inside a micro tile of surface
*
***************************************************************************************************
*/
-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
/**
***************************************************************************************************
-* AddrLib::AdjustPitchAlignment
+* AddrLib1::AdjustPitchAlignment
*
* @brief
* Adjusts pitch alignment for flipping surface
*
***************************************************************************************************
*/
-VOID AddrLib::AdjustPitchAlignment(
+VOID AddrLib1::AdjustPitchAlignment(
ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags
UINT_32* pPitchAlign ///< [out] Pointer to pitch alignment
) const
/**
***************************************************************************************************
-* AddrLib::PadDimensions
+* AddrLib1::PadDimensions
*
* @brief
* Helper function to pad dimensions
*
***************************************************************************************************
*/
-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
/**
***************************************************************************************************
-* AddrLib::HwlPreHandleBaseLvl3xPitch
+* AddrLib1::HwlPreHandleBaseLvl3xPitch
*
* @brief
* Pre-handler of 3x pitch (96 bit) adjustment
* 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
/**
***************************************************************************************************
-* AddrLib::HwlPostHandleBaseLvl3xPitch
+* AddrLib1::HwlPostHandleBaseLvl3xPitch
*
* @brief
* Post-handler of 3x pitch adjustment
* 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
/**
***************************************************************************************************
-* AddrLib::IsMacroTiled
+* AddrLib1::IsMacroTiled
*
* @brief
* Check if the tile mode is macro tiled
* TRUE if it is macro tiled (2D/2B/3D/3B)
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacroTiled(
+BOOL_32 AddrLib1::IsMacroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro;
/**
***************************************************************************************************
-* AddrLib::IsMacro3dTiled
+* AddrLib1::IsMacro3dTiled
*
* @brief
* Check if the tile mode is 3D macro tiled
* TRUE if it is 3D macro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMacro3dTiled(
+BOOL_32 AddrLib1::IsMacro3dTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMacro3d;
/**
***************************************************************************************************
-* AddrLib::IsMicroTiled
+* AddrLib1::IsMicroTiled
*
* @brief
* Check if the tile mode is micro tiled
* TRUE if micro tiled
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsMicroTiled(
+BOOL_32 AddrLib1::IsMicroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isMicro;
/**
***************************************************************************************************
-* AddrLib::IsLinear
+* AddrLib1::IsLinear
*
* @brief
* Check if the tile mode is linear
* TRUE if linear
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsLinear(
+BOOL_32 AddrLib1::IsLinear(
AddrTileMode tileMode) ///< [in] tile mode
{
return m_modeFlags[tileMode].isLinear;
/**
***************************************************************************************************
-* AddrLib::IsPrtNoRotationTileMode
+* AddrLib1::IsPrtNoRotationTileMode
*
* @brief
* Return TRUE if it is prt tile without rotation
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtNoRotationTileMode(
+BOOL_32 AddrLib1::IsPrtNoRotationTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrtNoRotation;
/**
***************************************************************************************************
-* AddrLib::IsPrtTileMode
+* AddrLib1::IsPrtTileMode
*
* @brief
* Return TRUE if it is prt tile
* This function just used by CI
***************************************************************************************************
*/
-BOOL_32 AddrLib::IsPrtTileMode(
+BOOL_32 AddrLib1::IsPrtTileMode(
AddrTileMode tileMode)
{
return m_modeFlags[tileMode].isPrt;
/**
***************************************************************************************************
-* AddrLib::ComputeMipLevel
+* AddrLib1::ComputeMipLevel
*
* @brief
* Compute mipmap level width/height/slices
* N/A
***************************************************************************************************
*/
-VOID AddrLib::ComputeMipLevel(
+VOID AddrLib1::ComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
/**
***************************************************************************************************
-* AddrLib::OptimizeTileMode
+* AddrLib1::OptimizeTileMode
*
* @brief
* Check if base level's tile mode can be optimized (degraded)
* 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
/**
***************************************************************************************************
-* AddrLib::DegradeLargeThickTile
+* AddrLib1::DegradeLargeThickTile
*
* @brief
* Check if the thickness needs to be reduced if a tile is too large
* The degraded tile mode (unchanged if not degraded)
***************************************************************************************************
*/
-AddrTileMode AddrLib::DegradeLargeThickTile(
+AddrTileMode AddrLib1::DegradeLargeThickTile(
AddrTileMode tileMode,
UINT_32 bpp) const
{
/**
***************************************************************************************************
-* 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
/**
***************************************************************************************************
-* AddrLib::HwlSetupTileCfg
+* AddrLib1::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
* 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
/**
***************************************************************************************************
-* AddrLib::HwlGetPipes
+* AddrLib1::HwlGetPipes
*
* @brief
* Get number pipes
* num pipes
***************************************************************************************************
*/
-UINT_32 AddrLib::HwlGetPipes(
+UINT_32 AddrLib1::HwlGetPipes(
const ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
/**
***************************************************************************************************
-* AddrLib::ComputeQbStereoInfo
+* AddrLib1::ComputeQbStereoInfo
*
* @brief
* Get quad buffer stereo information
* TRUE if no error
***************************************************************************************************
*/
-BOOL_32 AddrLib::ComputeQbStereoInfo(
+BOOL_32 AddrLib1::ComputeQbStereoInfo(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] updated pOut+pStereoInfo
) const
{
// Double size
pOut->surfSize <<= 1;
- // Right start address meets the base align since it is guaranteed by AddrLib
+ // Right start address meets the base align since it is guaranteed by AddrLib1
// 1D surface on SI may break this rule, but we can force it to meet by checking .qbStereo.
success = TRUE;
return success;
}
+
/**
***************************************************************************************************
-* AddrLib::ComputePrtInfo
+* AddrLib1::ComputePrtInfo
*
* @brief
* Compute prt surface related info
* 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
{
* of the Software.
*/
+/**
+***************************************************************************************************
+* @file addrlib1.h
+* @brief Contains the AddrLib1 base class definition.
+***************************************************************************************************
+*/
+
#ifndef __ADDR_LIB1_H__
#define __ADDR_LIB1_H__
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
+
#ifndef __CI_ADDR_LIB_H__
#define __CI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "siaddrlib.h"
/**
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;
***************************************************************************************************
*/
EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) :
- AddrLib(pClient),
+ AddrLib1(pClient),
m_ranks(0),
m_logicalBanks(0),
m_bankInterleave(1)
#ifndef __EG_BASED_ADDR_LIB_H__
#define __EG_BASED_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
/// Structures for functions
* @note Abstract class
***************************************************************************************************
*/
-class EgBasedAddrLib : public AddrLib
+class EgBasedAddrLib : public AddrLib1
{
protected:
EgBasedAddrLib(const AddrClient* pClient);
// do here
if (!pIn->flags.pow2Pad)
{
- AddrLib::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
+ AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
}
else
{
// 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;
#ifndef __SI_ADDR_LIB_H__
#define __SI_ADDR_LIB_H__
-#include "addrlib.h"
+#include "addrlib1.h"
#include "egbaddrlib.h"
/**
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;