#include "addrcommon.h"
+using namespace Addr;
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Create/Destroy/Config functions
///////////////////////////////////////////////////////////////////////////////////////////////////
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- returnCode = AddrLib::Create(pAddrCreateIn, pAddrCreateOut);
+ returnCode = Lib::Create(pAddrCreateIn, pAddrCreateOut);
return returnCode;
}
if (hLib)
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Lib* pLib = Lib::GetLib(hLib);
pLib->Destroy();
}
else
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] surface information
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) ///< [out] surface parameters and alignments
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] surface info and coordinates
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] surface address
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] surface info and address
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) ///< [out] coordinates
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] Htile information
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) ///< [out] Htile pitch, height and size in bytes
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] Htile info and coordinates
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Htile address
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] Htile info and address
ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut) ///< [out] Htile coordinates
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] Cmask pitch and height
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) ///< [out] Cmask pitch, height and size in bytes
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Cmask info and coordinates
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Cmask address
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Cmask info and address
ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Cmask coordinates
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] Fmask information
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) ///< [out] Fmask pitch and height
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] Fmask info and coordinates
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) ///< [out] Fmask address
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] Fmask info and address
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) ///< [out] Fmask coordinates
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
{
ADDR_E_RETURNCODE returnCode;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
{
UINT_32 version = 0;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Addr::Lib* pLib = Lib::GetLib(hLib);
ADDR_ASSERT(pLib != NULL);
{
BOOL_32 useTileIndex = FALSE;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_ASSERT(pLib != NULL);
{
BOOL_32 useCombinedSwizzle = FALSE;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_ASSERT(pLib != NULL);
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Lib* pLib = Lib::GetLib(hLib);
if (pLib != NULL)
{
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Lib* pLib = Lib::GetLib(hLib);
if (pLib != NULL)
{
ADDR_HANDLE hLib, ///< addrlib handle
const ELEM_GETEXPORTNORM_INPUT* pIn) ///< [in] input structure
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Addr::Lib* pLib = Lib::GetLib(hLib);
BOOL_32 enabled = FALSE;
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] tile info with real value
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) ///< [out] tile info with HW register value
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input - tile index
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_GET_MACROMODEINDEX_INPUT* pIn, ///< [in] input
ADDR_GET_MACROMODEINDEX_OUTPUT* pOut) ///< [out] macro mode index
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode;
const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input - tile index
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut) ///< [out] tile mode/type/info
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
const ADDR_GET_TILEINDEX_INPUT* pIn,
ADDR_GET_TILEINDEX_OUTPUT* pOut)
{
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
- AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
+ V1::Lib* pLib = V1::Lib::GetLib(hLib);
if (pLib != NULL)
{
ADDR_HANDLE hLib, ///< address lib handle
ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) ///< [out] output structure
{
- AddrLib* pLib = AddrLib::GetAddrLib(hLib);
+ Addr::Lib* pLib = Lib::GetLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
#include <string.h>
#endif
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Common constants
-///////////////////////////////////////////////////////////////////////////////////////////////////
-static const UINT_32 MicroTileWidth = 8; ///< Micro tile width, for 1D and 2D tiling
-static const UINT_32 MicroTileHeight = 8; ///< Micro tile height, for 1D and 2D tiling
-static const UINT_32 ThickTileThickness = 4; ///< Micro tile thickness, for THICK modes
-static const UINT_32 XThickTileThickness = 8; ///< Extra thick tiling thickness
-static const UINT_32 PowerSaveTileBytes = 64; ///< Nuber of bytes per tile for power save 64
-static const UINT_32 CmaskCacheBits = 1024; ///< Number of bits for CMASK cache
-static const UINT_32 CmaskElemBits = 4; ///< Number of bits for CMASK element
-static const UINT_32 HtileCacheBits = 16384; ///< Number of bits for HTILE cache 512*32
-
-static const UINT_32 MicroTilePixels = MicroTileWidth * MicroTileHeight;
-
-static const INT_32 TileIndexInvalid = TILEINDEX_INVALID;
-static const INT_32 TileIndexLinearGeneral = TILEINDEX_LINEAR_GENERAL;
-static const INT_32 TileIndexNoMacroIndex = -3;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Common macros
-///////////////////////////////////////////////////////////////////////////////////////////////////
-#define BITS_PER_BYTE 8
-#define BITS_TO_BYTES(x) ( ((x) + (BITS_PER_BYTE-1)) / BITS_PER_BYTE )
-#define BYTES_TO_BITS(x) ( (x) * BITS_PER_BYTE )
-
-/// Helper macros to select a single bit from an int (undefined later in section)
-#define _BIT(v,b) (((v) >> (b) ) & 1)
-
-/**
-****************************************************************************************************
-* @brief Enums to identify AddrLib type
-****************************************************************************************************
-*/
-enum AddrLibClass
-{
- BASE_ADDRLIB = 0x0,
- R600_ADDRLIB = 0x6,
- R800_ADDRLIB = 0x8,
- SI_ADDRLIB = 0xa,
- CI_ADDRLIB = 0xb,
-};
-
-/**
-****************************************************************************************************
-* AddrChipFamily
-*
-* @brief
-* Neutral enums that specifies chip family.
-*
-****************************************************************************************************
-*/
-enum AddrChipFamily
-{
- ADDR_CHIP_FAMILY_IVLD, ///< Invalid family
- ADDR_CHIP_FAMILY_R6XX,
- ADDR_CHIP_FAMILY_R7XX,
- ADDR_CHIP_FAMILY_R8XX,
- ADDR_CHIP_FAMILY_NI,
- ADDR_CHIP_FAMILY_SI,
- ADDR_CHIP_FAMILY_CI,
- ADDR_CHIP_FAMILY_VI,
-};
-
-/**
-****************************************************************************************************
-* AddrConfigFlags
-*
-* @brief
-* This structure is used to set configuration flags.
-****************************************************************************************************
-*/
-union AddrConfigFlags
-{
- struct
- {
- /// These flags are set up internally thru AddrLib::Create() based on ADDR_CREATE_FLAGS
- UINT_32 optimalBankSwap : 1; ///< New bank tiling for RV770 only
- UINT_32 noCubeMipSlicesPad : 1; ///< Disables faces padding for cubemap mipmaps
- UINT_32 fillSizeFields : 1; ///< If clients fill size fields in all input and
- /// output structure
- UINT_32 ignoreTileInfo : 1; ///< Don't use tile info structure
- UINT_32 useTileIndex : 1; ///< Make tileIndex field in input valid
- UINT_32 useCombinedSwizzle : 1; ///< Use combined swizzle
- UINT_32 checkLast2DLevel : 1; ///< Check the last 2D mip sub level
- UINT_32 useHtileSliceAlign : 1; ///< Do htile single slice alignment
- UINT_32 allowLargeThickTile : 1; ///< Allow 64*thickness*bytesPerPixel > rowSize
- UINT_32 disableLinearOpt : 1; ///< Disallow tile modes to be optimized to linear
- UINT_32 reserved : 22; ///< Reserved bits for future use
- };
-
- UINT_32 value;
-};
-
///////////////////////////////////////////////////////////////////////////////////////////////////
// Platform specific debug break defines
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#if DEBUG
-#define ADDR_PRNT(a) AddrObject::DebugPrint a
+#define ADDR_PRNT(a) Object::DebugPrint a
/// @brief Macro for reporting informational messages
/// @ingroup util
#endif // DEBUG
///////////////////////////////////////////////////////////////////////////////////////////////////
+namespace Addr
+{
+
+namespace V1
+{
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Common constants
+///////////////////////////////////////////////////////////////////////////////////////////////////
+static const UINT_32 MicroTileWidth = 8; ///< Micro tile width, for 1D and 2D tiling
+static const UINT_32 MicroTileHeight = 8; ///< Micro tile height, for 1D and 2D tiling
+static const UINT_32 ThickTileThickness = 4; ///< Micro tile thickness, for THICK modes
+static const UINT_32 XThickTileThickness = 8; ///< Extra thick tiling thickness
+static const UINT_32 PowerSaveTileBytes = 64; ///< Nuber of bytes per tile for power save 64
+static const UINT_32 CmaskCacheBits = 1024; ///< Number of bits for CMASK cache
+static const UINT_32 CmaskElemBits = 4; ///< Number of bits for CMASK element
+static const UINT_32 HtileCacheBits = 16384; ///< Number of bits for HTILE cache 512*32
+
+static const UINT_32 MicroTilePixels = MicroTileWidth * MicroTileHeight;
+
+static const INT_32 TileIndexInvalid = TILEINDEX_INVALID;
+static const INT_32 TileIndexLinearGeneral = TILEINDEX_LINEAR_GENERAL;
+static const INT_32 TileIndexNoMacroIndex = -3;
+
+} // V1
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Common macros
+///////////////////////////////////////////////////////////////////////////////////////////////////
+#define BITS_PER_BYTE 8
+#define BITS_TO_BYTES(x) ( ((x) + (BITS_PER_BYTE-1)) / BITS_PER_BYTE )
+#define BYTES_TO_BITS(x) ( (x) * BITS_PER_BYTE )
+
+/// Helper macros to select a single bit from an int (undefined later in section)
+#define _BIT(v,b) (((v) >> (b) ) & 1)
+
+/**
+****************************************************************************************************
+* @brief Enums to identify AddrLib type
+****************************************************************************************************
+*/
+enum LibClass
+{
+ BASE_ADDRLIB = 0x0,
+ R600_ADDRLIB = 0x6,
+ R800_ADDRLIB = 0x8,
+ SI_ADDRLIB = 0xa,
+ CI_ADDRLIB = 0xb,
+};
+
+/**
+****************************************************************************************************
+* ChipFamily
+*
+* @brief
+* Neutral enums that specifies chip family.
+*
+****************************************************************************************************
+*/
+enum ChipFamily
+{
+ ADDR_CHIP_FAMILY_IVLD, ///< Invalid family
+ ADDR_CHIP_FAMILY_R6XX,
+ ADDR_CHIP_FAMILY_R7XX,
+ ADDR_CHIP_FAMILY_R8XX,
+ ADDR_CHIP_FAMILY_NI,
+ ADDR_CHIP_FAMILY_SI,
+ ADDR_CHIP_FAMILY_CI,
+ ADDR_CHIP_FAMILY_VI,
+};
+
+/**
+****************************************************************************************************
+* ConfigFlags
+*
+* @brief
+* This structure is used to set configuration flags.
+****************************************************************************************************
+*/
+union ConfigFlags
+{
+ struct
+ {
+ /// These flags are set up internally thru AddrLib::Create() based on ADDR_CREATE_FLAGS
+ UINT_32 optimalBankSwap : 1; ///< New bank tiling for RV770 only
+ UINT_32 noCubeMipSlicesPad : 1; ///< Disables faces padding for cubemap mipmaps
+ UINT_32 fillSizeFields : 1; ///< If clients fill size fields in all input and
+ /// output structure
+ UINT_32 ignoreTileInfo : 1; ///< Don't use tile info structure
+ UINT_32 useTileIndex : 1; ///< Make tileIndex field in input valid
+ UINT_32 useCombinedSwizzle : 1; ///< Use combined swizzle
+ UINT_32 checkLast2DLevel : 1; ///< Check the last 2D mip sub level
+ UINT_32 useHtileSliceAlign : 1; ///< Do htile single slice alignment
+ UINT_32 allowLargeThickTile : 1; ///< Allow 64*thickness*bytesPerPixel > rowSize
+ UINT_32 disableLinearOpt : 1; ///< Disallow tile modes to be optimized to linear
+ UINT_32 reserved : 22; ///< Reserved bits for future use
+ };
+
+ UINT_32 value;
+};
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Misc helper functions
////////////////////////////////////////////////////////////////////////////////////////////////////
return t;
}
+} // Addr
+
#endif // __ADDR_COMMON_H__
#include "addrelemlib.h"
#include "addrlib.h"
+namespace Addr
+{
/**
****************************************************************************************************
-* AddrElemLib::AddrElemLib
+* ElemLib::ElemLib
*
* @brief
* constructor
* N/A
****************************************************************************************************
*/
-AddrElemLib::AddrElemLib(
- AddrLib* const pAddrLib) : ///< [in] Parent addrlib instance pointer
- AddrObject(pAddrLib->GetClient()),
+ElemLib::ElemLib(
+ Lib* pAddrLib) ///< [in] Parent addrlib instance pointer
+ :
+ Object(pAddrLib->GetClient()),
m_pAddrLib(pAddrLib)
{
- switch (m_pAddrLib->GetAddrChipFamily())
+ switch (m_pAddrLib->GetChipFamily())
{
case ADDR_CHIP_FAMILY_R6XX:
m_depthPlanarType = ADDR_DEPTH_PLANAR_R600;
/**
****************************************************************************************************
-* AddrElemLib::~AddrElemLib
+* ElemLib::~ElemLib
*
* @brief
* destructor
* N/A
****************************************************************************************************
*/
-AddrElemLib::~AddrElemLib()
+ElemLib::~ElemLib()
{
}
/**
****************************************************************************************************
-* AddrElemLib::Create
+* ElemLib::Create
*
* @brief
* Creates and initializes AddrLib object.
* Returns point to ADDR_CREATEINFO if successful.
****************************************************************************************************
*/
-AddrElemLib* AddrElemLib::Create(
- const AddrLib* const pAddrLib) ///< [in] Pointer of parent AddrLib instance
+ElemLib* ElemLib::Create(
+ const Lib* pAddrLib) ///< [in] Pointer of parent AddrLib instance
{
- AddrElemLib* pElemLib = NULL;
+ ElemLib* pElemLib = NULL;
if (pAddrLib)
{
- pElemLib = new(pAddrLib->GetClient()) AddrElemLib(const_cast<AddrLib* const>(pAddrLib));
+ pElemLib = new(pAddrLib->GetClient()) ElemLib(const_cast<Lib* const>(pAddrLib));
}
return pElemLib;
}
/**************************************************************************************************
-* AddrElemLib::Flt32sToInt32s
+* ElemLib::Flt32sToInt32s
*
* @brief
* Convert a ADDR_FLT_32 value to Int32 value
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::Flt32sToInt32s(
+VOID ElemLib::Flt32sToInt32s(
ADDR_FLT_32 value, ///< [in] ADDR_FLT_32 value
UINT_32 bits, ///< [in] nubmer of bits in value
- AddrNumberType numberType, ///< [in] the type of number
+ NumberType numberType, ///< [in] the type of number
UINT_32* pResult) ///< [out] Int32 value
{
UINT_8 round = 128; //ADDR_ROUND_BY_HALF
/**
****************************************************************************************************
-* AddrElemLib::Int32sToPixel
+* ElemLib::Int32sToPixel
*
* @brief
* Pack 32-bit integer values into an uncompressed pixel,
* if called on compressed pixel.
****************************************************************************************************
*/
-VOID AddrElemLib::Int32sToPixel(
+VOID ElemLib::Int32sToPixel(
UINT_32 numComps, ///< [in] number of components
UINT_32* pComps, ///< [in] compnents
UINT_32* pCompBits, ///< [in] total bits in each component
UINT_32* pCompStart, ///< [in] the first bit position of each component
- ADDR_COMPONENT_FLAGS properties, ///< [in] properties about byteAligned, exportNorm
+ ComponentFlags properties, ///< [in] properties about byteAligned, exportNorm
UINT_32 resultBits, ///< [in] result bits: total bpp after decompression
UINT_8* pPixel) ///< [out] a depth/stencil pixel value
{
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::Flt32ToDepthPixel(
+VOID ElemLib::Flt32ToDepthPixel(
AddrDepthFormat format, ///< [in] Depth format
const ADDR_FLT_32 comps[2], ///< [in] two components of depth
UINT_8* pPixel ///< [out] depth pixel value
{
UINT_32 i;
UINT_32 values[2];
- ADDR_COMPONENT_FLAGS properties; // byteAligned, exportNorm
- UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression
+ ComponentFlags properties; // byteAligned, exportNorm
+ UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression
- ADDR_PIXEL_FORMATINFO fmt;
+ PixelFormatInfo fmt;
// get type for each component
PixGetDepthCompInfo(format, &fmt);
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::Flt32ToColorPixel(
+VOID ElemLib::Flt32ToColorPixel(
AddrColorFormat format, ///< [in] Color format
AddrSurfaceNumber surfNum, ///< [in] Surface number
AddrSurfaceSwap surfSwap, ///< [in] Surface swap
UINT_8* pPixel ///< [out] a red/green/blue/alpha pixel value
) const
{
- ADDR_PIXEL_FORMATINFO pixelInfo;
+ PixelFormatInfo pixelInfo;
UINT_32 i;
UINT_32 values[4];
- ADDR_COMPONENT_FLAGS properties; // byteAligned, exportNorm
- UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression
+ ComponentFlags properties; // byteAligned, exportNorm
+ UINT_32 resultBits = 0; // result bits: total bits per pixel after decompression
- memset(&pixelInfo, 0, sizeof(ADDR_PIXEL_FORMATINFO));
+ memset(&pixelInfo, 0, sizeof(PixelFormatInfo));
PixGetColorCompInfo(format, surfNum, surfSwap, &pixelInfo);
/**
****************************************************************************************************
-* AddrElemLib::GetCompType
+* ElemLib::GetCompType
*
* @brief
* Fill per component info
*
****************************************************************************************************
*/
-VOID AddrElemLib::GetCompType(
- AddrColorFormat format, ///< [in] surface format
- AddrSurfaceNumber numType, ///< [in] number type
- ADDR_PIXEL_FORMATINFO* pInfo) ///< [in][out] per component info out
+VOID ElemLib::GetCompType(
+ AddrColorFormat format, ///< [in] surface format
+ AddrSurfaceNumber numType, ///< [in] number type
+ PixelFormatInfo* pInfo) ///< [in][out] per component info out
{
BOOL_32 handled = FALSE;
/**
****************************************************************************************************
-* AddrElemLib::GetCompSwap
+* ElemLib::GetCompSwap
*
* @brief
* Get components swapped for color surface
*
****************************************************************************************************
*/
-VOID AddrElemLib::GetCompSwap(
- AddrSurfaceSwap swap, ///< [in] swap mode
- ADDR_PIXEL_FORMATINFO* pInfo) ///< [in/out] output per component info
+VOID ElemLib::GetCompSwap(
+ AddrSurfaceSwap swap, ///< [in] swap mode
+ PixelFormatInfo* pInfo) ///< [in/out] output per component info
{
switch (pInfo->comps)
{
/**
****************************************************************************************************
-* AddrElemLib::GetCompSwap
+* ElemLib::GetCompSwap
*
* @brief
* Get components swapped for color surface
*
****************************************************************************************************
*/
-VOID AddrElemLib::SwapComps(
- UINT_32 c0, ///< [in] component index 0
- UINT_32 c1, ///< [in] component index 1
- ADDR_PIXEL_FORMATINFO* pInfo) ///< [in/out] output per component info
+VOID ElemLib::SwapComps(
+ UINT_32 c0, ///< [in] component index 0
+ UINT_32 c1, ///< [in] component index 1
+ PixelFormatInfo* pInfo) ///< [in/out] output per component info
{
UINT_32 start;
UINT_32 bits;
/**
****************************************************************************************************
-* AddrElemLib::PixGetColorCompInfo
+* ElemLib::PixGetColorCompInfo
*
* @brief
* Get per component info for color surface
*
****************************************************************************************************
*/
-VOID AddrElemLib::PixGetColorCompInfo(
- AddrColorFormat format, ///< [in] surface format, read from register
- AddrSurfaceNumber number, ///< [in] pixel number type
- AddrSurfaceSwap swap, ///< [in] component swap mode
- ADDR_PIXEL_FORMATINFO* pInfo ///< [out] output per component info
+VOID ElemLib::PixGetColorCompInfo(
+ AddrColorFormat format, ///< [in] surface format, read from register
+ AddrSurfaceNumber number, ///< [in] pixel number type
+ AddrSurfaceSwap swap, ///< [in] component swap mode
+ PixelFormatInfo* pInfo ///< [out] output per component info
) const
{
// 1. Get componet bits
/**
****************************************************************************************************
-* AddrElemLib::PixGetDepthCompInfo
+* ElemLib::PixGetDepthCompInfo
*
* @brief
* Get per component info for depth surface
*
****************************************************************************************************
*/
-VOID AddrElemLib::PixGetDepthCompInfo(
- AddrDepthFormat format, ///< [in] surface format, read from register
- ADDR_PIXEL_FORMATINFO* pInfo ///< [out] output per component bits and type
+VOID ElemLib::PixGetDepthCompInfo(
+ AddrDepthFormat format, ///< [in] surface format, read from register
+ PixelFormatInfo* pInfo ///< [out] output per component bits and type
) const
{
if (m_depthPlanarType == ADDR_DEPTH_PLANAR_R800)
/**
****************************************************************************************************
-* AddrElemLib::PixGetExportNorm
+* ElemLib::PixGetExportNorm
*
* @brief
* Check if fp16 export norm can be enabled.
*
****************************************************************************************************
*/
-BOOL_32 AddrElemLib::PixGetExportNorm(
+BOOL_32 ElemLib::PixGetExportNorm(
AddrColorFormat colorFmt, ///< [in] surface format, read from register
AddrSurfaceNumber numberFmt, ///< [in] pixel number type
AddrSurfaceSwap swap ///< [in] components swap type
{
BOOL_32 enabled = TRUE;
- ADDR_PIXEL_FORMATINFO formatInfo;
+ PixelFormatInfo formatInfo;
PixGetColorCompInfo(colorFmt, numberFmt, swap, &formatInfo);
/**
****************************************************************************************************
-* AddrElemLib::AdjustSurfaceInfo
+* ElemLib::AdjustSurfaceInfo
*
* @brief
* Adjust bpp/base pitch/width/height according to elemMode and expandX/Y
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::AdjustSurfaceInfo(
- AddrElemMode elemMode, ///< [in] element mode
+VOID ElemLib::AdjustSurfaceInfo(
+ ElemMode elemMode, ///< [in] element mode
UINT_32 expandX, ///< [in] decompression expansion factor in X
UINT_32 expandY, ///< [in] decompression expansion factor in Y
UINT_32* pBpp, ///< [in/out] bpp
else
{
// Evergreen family workaround
- if (bBCnFormat && (m_pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_R8XX))
+ if (bBCnFormat && (m_pAddrLib->GetChipFamily() == ADDR_CHIP_FAMILY_R8XX))
{
// For BCn we now pad it to POW2 at the beginning so it is safe to
// divide by 4 directly
/**
****************************************************************************************************
-* AddrElemLib::RestoreSurfaceInfo
+* ElemLib::RestoreSurfaceInfo
*
* @brief
* Reverse operation of AdjustSurfaceInfo
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::RestoreSurfaceInfo(
- AddrElemMode elemMode, ///< [in] element mode
+VOID ElemLib::RestoreSurfaceInfo(
+ ElemMode elemMode, ///< [in] element mode
UINT_32 expandX, ///< [in] decompression expansion factor in X
UINT_32 expandY, ///< [out] decompression expansion factor in Y
UINT_32* pBpp, ///< [in/out] bpp
/**
****************************************************************************************************
-* AddrElemLib::GetBitsPerPixel
+* ElemLib::GetBitsPerPixel
*
* @brief
* Compute the total bits per element according to a format
* Bits per pixel
****************************************************************************************************
*/
-UINT_32 AddrElemLib::GetBitsPerPixel(
+UINT_32 ElemLib::GetBitsPerPixel(
AddrFormat format, ///< [in] surface format code
- AddrElemMode* pElemMode, ///< [out] element mode
+ ElemMode* pElemMode, ///< [out] element mode
UINT_32* pExpandX, ///< [out] decompression expansion factor in X
UINT_32* pExpandY, ///< [out] decompression expansion factor in Y
UINT_32* pUnusedBits) ///< [out] bits unused
UINT_32 expandX = 1;
UINT_32 expandY = 1;
UINT_32 bitUnused = 0;
- AddrElemMode elemMode = ADDR_UNCOMPRESSED; // default value
+ ElemMode elemMode = ADDR_UNCOMPRESSED; // default value
switch (format)
{
/**
****************************************************************************************************
-* AddrElemLib::GetCompBits
+* ElemLib::GetCompBits
*
* @brief
* Set each component's bit size and bit start. And set element mode and number type
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::GetCompBits(
- UINT_32 c0, ///< [in] bits of component 0
- UINT_32 c1, ///< [in] bits of component 1
- UINT_32 c2, ///< [in] bits of component 2
- UINT_32 c3, ///< [in] bits of component 3
- ADDR_PIXEL_FORMATINFO* pInfo, ///< [out] per component info out
- AddrElemMode elemMode) ///< [in] element mode
+VOID ElemLib::GetCompBits(
+ UINT_32 c0, ///< [in] bits of component 0
+ UINT_32 c1, ///< [in] bits of component 1
+ UINT_32 c2, ///< [in] bits of component 2
+ UINT_32 c3, ///< [in] bits of component 3
+ PixelFormatInfo* pInfo, ///< [out] per component info out
+ ElemMode elemMode) ///< [in] element mode
{
pInfo->comps = 0;
/**
****************************************************************************************************
-* AddrElemLib::GetCompBits
+* ElemLib::GetCompBits
*
* @brief
* Set the clear color (or clear depth/stencil) for a surface
* N/A
****************************************************************************************************
*/
-VOID AddrElemLib::SetClearComps(
+VOID ElemLib::SetClearComps(
ADDR_FLT_32 comps[4], ///< [in/out] components
BOOL_32 clearColor, ///< [in] TRUE if clear color is set (CLEAR_COLOR)
BOOL_32 float32) ///< [in] TRUE if float32 component (BLEND_FLOAT32)
/**
****************************************************************************************************
-* AddrElemLib::IsBlockCompressed
+* ElemLib::IsBlockCompressed
*
* @brief
* TRUE if this is block compressed format
* BOOL_32
****************************************************************************************************
*/
-BOOL_32 AddrElemLib::IsBlockCompressed(
+BOOL_32 ElemLib::IsBlockCompressed(
AddrFormat format) ///< [in] Format
{
return format >= ADDR_FMT_BC1 && format <= ADDR_FMT_BC7;
/**
****************************************************************************************************
-* AddrElemLib::IsCompressed
+* ElemLib::IsCompressed
*
* @brief
* TRUE if this is block compressed format or 1 bit format
* BOOL_32
****************************************************************************************************
*/
-BOOL_32 AddrElemLib::IsCompressed(
+BOOL_32 ElemLib::IsCompressed(
AddrFormat format) ///< [in] Format
{
return IsBlockCompressed(format) || format == ADDR_FMT_BC1 || format == ADDR_FMT_BC7;
/**
****************************************************************************************************
-* AddrElemLib::IsExpand3x
+* ElemLib::IsExpand3x
*
* @brief
* TRUE if this is 3x expand format
* BOOL_32
****************************************************************************************************
*/
-BOOL_32 AddrElemLib::IsExpand3x(
+BOOL_32 ElemLib::IsExpand3x(
AddrFormat format) ///< [in] Format
{
BOOL_32 is3x = FALSE;
return is3x;
}
-
+}
#include "addrobject.h"
#include "addrcommon.h"
-class AddrLib;
+namespace Addr
+{
+
+class Lib;
// The masks for property bits within the Properties INT_32
-union ADDR_COMPONENT_FLAGS
+union ComponentFlags
{
struct
{
UINT_32 value;
};
-// Copy from legacy lib's AddrNumberType
-enum AddrNumberType
+// Copy from legacy lib's NumberType
+enum NumberType
{
// The following number types have the range [-1..1]
ADDR_NO_NUMBER, // This component doesn't exist and has no default value
};
// Copy from legacy lib's AddrElement
-enum AddrElemMode
+enum ElemMode
{
// These formats allow both packing an unpacking
ADDR_ROUND_BY_HALF, // add 1/2 and truncate when packing this element
ADDR_END_ELEMENT // Used for range comparisons
};
-enum AddrDepthPlanarType
+enum DepthPlanarType
{
ADDR_DEPTH_PLANAR_NONE = 0, // No plane z/stencl
ADDR_DEPTH_PLANAR_R600 = 1, // R600 z and stencil planes are store within a tile
/**
****************************************************************************************************
-* ADDR_PIXEL_FORMATINFO
+* PixelFormatInfo
*
* @brief
* Per component info
*
****************************************************************************************************
*/
-struct ADDR_PIXEL_FORMATINFO
+struct PixelFormatInfo
{
UINT_32 compBit[4];
- AddrNumberType numType[4];
+ NumberType numType[4];
UINT_32 compStart[4];
- AddrElemMode elemMode;
+ ElemMode elemMode;
UINT_32 comps; ///< Number of components
};
* @brief This class contains asic indepentent element related attributes and operations
****************************************************************************************************
*/
-class AddrElemLib : public AddrObject
+class ElemLib : public Object
{
protected:
- AddrElemLib(AddrLib* const pAddrLib);
+ ElemLib(Lib* pAddrLib);
public:
/// Makes this class virtual
- virtual ~AddrElemLib();
+ virtual ~ElemLib();
- static AddrElemLib *Create(
- const AddrLib* const pAddrLib);
+ static ElemLib* Create(
+ const Lib* pAddrLib);
/// The implementation is only for R6xx/R7xx, so make it virtual in case we need for R8xx
BOOL_32 PixGetExportNorm(
const ADDR_FLT_32 comps[4], UINT_8 *pPixel) const;
static VOID Flt32sToInt32s(
- ADDR_FLT_32 value, UINT_32 bits, AddrNumberType numberType, UINT_32* pResult);
+ ADDR_FLT_32 value, UINT_32 bits, NumberType numberType, UINT_32* pResult);
static VOID Int32sToPixel(
UINT_32 numComps, UINT_32* pComps, UINT_32* pCompBits, UINT_32* pCompStart,
- ADDR_COMPONENT_FLAGS properties, UINT_32 resultBits, UINT_8* pPixel);
+ ComponentFlags properties, UINT_32 resultBits, UINT_8* pPixel);
VOID PixGetColorCompInfo(
AddrColorFormat format, AddrSurfaceNumber number, AddrSurfaceSwap swap,
- ADDR_PIXEL_FORMATINFO* pInfo) const;
+ PixelFormatInfo* pInfo) const;
VOID PixGetDepthCompInfo(
- AddrDepthFormat format, ADDR_PIXEL_FORMATINFO* pInfo) const;
+ AddrDepthFormat format, PixelFormatInfo* pInfo) const;
UINT_32 GetBitsPerPixel(
- AddrFormat format, AddrElemMode* pElemMode,
+ AddrFormat format, ElemMode* pElemMode,
UINT_32* pExpandX = NULL, UINT_32* pExpandY = NULL, UINT_32* pBitsUnused = NULL);
static VOID SetClearComps(
ADDR_FLT_32 comps[4], BOOL_32 clearColor, BOOL_32 float32);
VOID AdjustSurfaceInfo(
- AddrElemMode elemMode, UINT_32 expandX, UINT_32 expandY,
+ ElemMode elemMode, UINT_32 expandX, UINT_32 expandY,
UINT_32* pBpp, UINT_32* pBasePitch, UINT_32* pWidth, UINT_32* pHeight);
VOID RestoreSurfaceInfo(
- AddrElemMode elemMode, UINT_32 expandX, UINT_32 expandY,
+ ElemMode elemMode, UINT_32 expandX, UINT_32 expandY,
UINT_32* pBpp, UINT_32* pWidth, UINT_32* pHeight);
/// Checks if depth and stencil are planar inside a tile
}
/// Sets m_configFlags, copied from AddrLib
- VOID SetConfigFlags(AddrConfigFlags flags)
+ VOID SetConfigFlags(ConfigFlags flags)
{
m_configFlags = flags;
}
static VOID GetCompBits(
UINT_32 c0, UINT_32 c1, UINT_32 c2, UINT_32 c3,
- ADDR_PIXEL_FORMATINFO* pInfo,
- AddrElemMode elemMode = ADDR_ROUND_BY_HALF);
+ PixelFormatInfo* pInfo,
+ ElemMode elemMode = ADDR_ROUND_BY_HALF);
static VOID GetCompType(
AddrColorFormat format, AddrSurfaceNumber numType,
- ADDR_PIXEL_FORMATINFO* pInfo);
+ PixelFormatInfo* pInfo);
static VOID GetCompSwap(
- AddrSurfaceSwap swap, ADDR_PIXEL_FORMATINFO* pInfo);
+ AddrSurfaceSwap swap, PixelFormatInfo* pInfo);
static VOID SwapComps(
- UINT_32 c0, UINT_32 c1, ADDR_PIXEL_FORMATINFO* pInfo);
+ UINT_32 c0, UINT_32 c1, PixelFormatInfo* pInfo);
private:
UINT_32 m_fp16ExportNorm; ///< If allow FP16 to be reported as EXPORT_NORM
- AddrDepthPlanarType m_depthPlanarType;
+ DepthPlanarType m_depthPlanarType;
- AddrConfigFlags m_configFlags; ///< Copy of AddrLib's configFlags
- AddrLib* const m_pAddrLib; ///< Pointer to parent addrlib instance
+ ConfigFlags m_configFlags; ///< Copy of AddrLib's configFlags
+ Addr::Lib* const m_pAddrLib; ///< Pointer to parent addrlib instance
};
+} //Addr
+
#endif
#endif // __APPLE__
+namespace Addr
+{
///////////////////////////////////////////////////////////////////////////////////////////////////
// Constructor/Destructor
/**
****************************************************************************************************
-* AddrLib::AddrLib
+* Lib::Lib
*
* @brief
* Constructor for the AddrLib class
*
****************************************************************************************************
*/
-AddrLib::AddrLib() :
+Lib::Lib() :
m_class(BASE_ADDRLIB),
m_chipFamily(ADDR_CHIP_FAMILY_IVLD),
m_chipRevision(0),
/**
****************************************************************************************************
-* AddrLib::AddrLib
+* Lib::Lib
*
* @brief
* Constructor for the AddrLib class with hClient as parameter
*
****************************************************************************************************
*/
-AddrLib::AddrLib(const AddrClient* pClient) :
- AddrObject(pClient),
+Lib::Lib(const Client* pClient) :
+ Object(pClient),
m_class(BASE_ADDRLIB),
m_chipFamily(ADDR_CHIP_FAMILY_IVLD),
m_chipRevision(0),
/**
****************************************************************************************************
-* AddrLib::~AddrLib
+* Lib::~AddrLib
*
* @brief
* Destructor for the AddrLib class
*
****************************************************************************************************
*/
-AddrLib::~AddrLib()
+Lib::~Lib()
{
if (m_pElemLib)
{
/**
****************************************************************************************************
-* AddrLib::Create
+* Lib::Create
*
* @brief
* Creates and initializes AddrLib object.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::Create(
+ADDR_E_RETURNCODE Lib::Create(
const ADDR_CREATE_INPUT* pCreateIn, ///< [in] pointer to ADDR_CREATE_INPUT
ADDR_CREATE_OUTPUT* pCreateOut) ///< [out] pointer to ADDR_CREATE_OUTPUT
{
- AddrLib* pLib = NULL;
+ Lib* pLib = NULL;
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pCreateIn->createFlags.fillSizeFields == TRUE)
(pCreateIn->callbacks.allocSysMem != NULL) &&
(pCreateIn->callbacks.freeSysMem != NULL))
{
- AddrClient client = {
+ Client client = {
pCreateIn->hClient,
pCreateIn->callbacks
};
switch (pCreateIn->chipFamily)
{
case FAMILY_SI:
- pLib = AddrSIHwlInit(&client);
+ pLib = SiHwlInit(&client);
break;
case FAMILY_VI:
case FAMILY_CZ: // VI based fusion(carrizo)
case FAMILY_CI:
case FAMILY_KV: // CI based fusion
- pLib = AddrCIHwlInit(&client);
+ pLib = CiHwlInit(&client);
break;
default:
ADDR_ASSERT_ALWAYS();
pLib->m_configFlags.allowLargeThickTile = pCreateIn->createFlags.allowLargeThickTile;
pLib->m_configFlags.disableLinearOpt = FALSE;
- pLib->SetAddrChipFamily(pCreateIn->chipFamily, pCreateIn->chipRevision);
+ pLib->SetChipFamily(pCreateIn->chipFamily, pCreateIn->chipRevision);
pLib->SetMinPitchAlignPixels(pCreateIn->minPitchAlignPixels);
if (initValid)
{
- pLib->m_pElemLib = AddrElemLib::Create(pLib);
+ pLib->m_pElemLib = ElemLib::Create(pLib);
}
else
{
/**
****************************************************************************************************
-* AddrLib::SetAddrChipFamily
+* Lib::SetChipFamily
*
* @brief
-* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision
+* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision
* @return
* N/A
****************************************************************************************************
*/
-VOID AddrLib::SetAddrChipFamily(
+VOID Lib::SetChipFamily(
UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h
UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h
{
- AddrChipFamily family = HwlConvertChipFamily(uChipFamily, uChipRevision);
+ ChipFamily family = HwlConvertChipFamily(uChipFamily, uChipRevision);
ADDR_ASSERT(family != ADDR_CHIP_FAMILY_IVLD);
/**
****************************************************************************************************
-* AddrLib::SetMinPitchAlignPixels
+* Lib::SetMinPitchAlignPixels
*
* @brief
* Set m_minPitchAlignPixels with input param
* N/A
****************************************************************************************************
*/
-VOID AddrLib::SetMinPitchAlignPixels(
+VOID Lib::SetMinPitchAlignPixels(
UINT_32 minPitchAlignPixels) ///< [in] minmum pitch alignment in pixels
{
m_minPitchAlignPixels = (minPitchAlignPixels == 0) ? 1 : minPitchAlignPixels;
/**
****************************************************************************************************
-* AddrLib::GetAddrLib
+* Lib::GetLib
*
* @brief
* Get AddrLib pointer
* An AddrLib class pointer
****************************************************************************************************
*/
-AddrLib * AddrLib::GetAddrLib(
+Lib* Lib::GetLib(
ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
{
- return static_cast<AddrLib *>(hLib);
+ return static_cast<Addr::Lib*>(hLib);
}
/**
****************************************************************************************************
-* AddrLib::GetMaxAlignments
+* Lib::GetMaxAlignments
*
* @brief
* Gets maximum alignments
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::GetMaxAlignments(
+ADDR_E_RETURNCODE Lib::GetMaxAlignments(
ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure
) const
{
/**
****************************************************************************************************
-* AddrLib::Bits2Number
+* Lib::Bits2Number
*
* @brief
* Cat a array of binary bit to a number
* The number combined with the array of bits
****************************************************************************************************
*/
-UINT_32 AddrLib::Bits2Number(
+UINT_32 Lib::Bits2Number(
UINT_32 bitNum, ///< [in] how many bits
...) ///< [in] varaible bits value starting from MSB
{
/**
****************************************************************************************************
-* AddrLib::Flt32ToColorPixel
+* Lib::Flt32ToColorPixel
*
* @brief
* Convert a FLT_32 value to a depth/stencil pixel value
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::Flt32ToDepthPixel(
+ADDR_E_RETURNCODE Lib::Flt32ToDepthPixel(
const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn,
ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) const
{
/**
****************************************************************************************************
-* AddrLib::Flt32ToColorPixel
+* Lib::Flt32ToColorPixel
*
* @brief
* Convert a FLT_32 value to a red/green/blue/alpha pixel value
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib::Flt32ToColorPixel(
+ADDR_E_RETURNCODE Lib::Flt32ToColorPixel(
const ELEM_FLT32TOCOLORPIXEL_INPUT* pIn,
ELEM_FLT32TOCOLORPIXEL_OUTPUT* pOut) const
{
/**
****************************************************************************************************
-* AddrLib::GetExportNorm
+* Lib::GetExportNorm
*
* @brief
* Check one format can be EXPORT_NUM
* TRUE if EXPORT_NORM can be used
****************************************************************************************************
*/
-BOOL_32 AddrLib::GetExportNorm(
+BOOL_32 Lib::GetExportNorm(
const ELEM_GETEXPORTNORM_INPUT* pIn) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
return enabled;
}
+} // Addr
#ifndef __ADDR_LIB_H__
#define __ADDR_LIB_H__
-
#include "addrinterface.h"
#include "addrobject.h"
#include "addrelemlib.h"
#ifndef CIASICIDGFXENGINE_SEAISLAND
#define CIASICIDGFXENGINE_SEAISLAND 0x0000000B
#endif
+
+namespace Addr
+{
+
/**
****************************************************************************************************
* @brief Neutral enums that define pipeinterleave
****************************************************************************************************
*/
-enum AddrPipeInterleave
+enum PipeInterleave
{
ADDR_PIPEINTERLEAVE_256B = 256,
ADDR_PIPEINTERLEAVE_512B = 512,
* @brief Neutral enums that define DRAM row size
****************************************************************************************************
*/
-enum AddrRowSize
+enum RowSize
{
ADDR_ROWSIZE_1KB = 1024,
ADDR_ROWSIZE_2KB = 2048,
* @brief Neutral enums that define bank interleave
****************************************************************************************************
*/
-enum AddrBankInterleave
+enum BankInterleave
{
ADDR_BANKINTERLEAVE_1 = 1,
ADDR_BANKINTERLEAVE_2 = 2,
ADDR_BANKINTERLEAVE_8 = 8,
};
-/**
-****************************************************************************************************
-* @brief Neutral enums that define MGPU chip tile size
-****************************************************************************************************
-*/
-enum AddrChipTileSize
-{
- ADDR_CHIPTILESIZE_16 = 16,
- ADDR_CHIPTILESIZE_32 = 32,
- ADDR_CHIPTILESIZE_64 = 64,
- ADDR_CHIPTILESIZE_128 = 128,
-};
-
/**
****************************************************************************************************
* @brief Neutral enums that define shader engine tile size
****************************************************************************************************
*/
-enum AddrEngTileSize
+enum ShaderEngineTileSize
{
ADDR_SE_TILESIZE_16 = 16,
ADDR_SE_TILESIZE_32 = 32,
* @brief Neutral enums that define bank swap size
****************************************************************************************************
*/
-enum AddrBankSwapSize
+enum BankSwapSize
{
ADDR_BANKSWAP_128B = 128,
ADDR_BANKSWAP_256B = 256,
ADDR_BANKSWAP_1KB = 1024,
};
-
/**
****************************************************************************************************
* @brief This class contains asic independent address lib functionalities
****************************************************************************************************
*/
-class AddrLib : public AddrObject
+class Lib : public Object
{
public:
- virtual ~AddrLib();
+ virtual ~Lib();
static ADDR_E_RETURNCODE Create(
const ADDR_CREATE_INPUT* pCreateInfo, ADDR_CREATE_OUTPUT* pCreateOut);
delete this;
}
- static AddrLib* GetAddrLib(ADDR_HANDLE hLib);
+ static Lib* GetLib(ADDR_HANDLE hLib);
/// Returns AddrLib version (from compiled binary instead include file)
UINT_32 GetVersion()
}
/// Returns asic chip family name defined by AddrLib
- AddrChipFamily GetAddrChipFamily()
+ ChipFamily GetChipFamily()
{
return m_chipFamily;
}
ADDR_E_RETURNCODE GetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const;
protected:
- AddrLib(); // Constructor is protected
- AddrLib(const AddrClient* pClient);
+ Lib(); // Constructor is protected
+ Lib(const Client* pClient);
/// Pure virtual function to get max alignments
virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0;
virtual BOOL_32 HwlInitGlobalParams(const ADDR_CREATE_INPUT* pCreateIn) = 0;
/// Pure Virtual function for Hwl converting chip family
- virtual AddrChipFamily HwlConvertChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision) = 0;
+ virtual ChipFamily HwlConvertChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision) = 0;
/// Get equation table pointer and number of equations
virtual UINT_32 HwlGetEquationTableInfo(const ADDR_EQUATION** ppEquationTable) const
//
// Misc helper
//
- static UINT_32 Bits2Number(UINT_32 bitNum,...);
+ static UINT_32 Bits2Number(UINT_32 bitNum, ...);
static UINT_32 GetNumFragments(UINT_32 numSamples, UINT_32 numFrags)
{
return (numFrags != 0) ? numFrags : Max(1u, numSamples);
}
- /// Returns pointer of AddrElemLib
- AddrElemLib* GetElemLib() const
+ /// Returns pointer of ElemLib
+ ElemLib* GetElemLib() const
{
return m_pElemLib;
}
private:
// Disallow the copy constructor
- AddrLib(const AddrLib& a);
+ Lib(const Lib& a);
// Disallow the assignment operator
- AddrLib& operator=(const AddrLib& a);
+ Lib& operator=(const Lib& a);
- VOID SetAddrChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision);
+ VOID SetChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision);
VOID SetMinPitchAlignPixels(UINT_32 minPitchAlignPixels);
protected:
- AddrLibClass m_class; ///< Store class type (HWL type)
+ LibClass m_class; ///< Store class type (HWL type)
- AddrChipFamily m_chipFamily; ///< Chip family translated from the one in atiid.h
+ ChipFamily m_chipFamily; ///< Chip family translated from the one in atiid.h
UINT_32 m_chipRevision; ///< Revision id from xxx_id.h
//
// Global parameters
//
- AddrConfigFlags m_configFlags; ///< Global configuration flags. Note this is setup by
+ ConfigFlags m_configFlags; ///< Global configuration flags. Note this is setup by
/// AddrLib instead of Client except forceLinearAligned
UINT_32 m_pipes; ///< Number of pipes
UINT_32 m_minPitchAlignPixels; ///< Minimum pitch alignment in pixels
UINT_32 m_maxSamples; ///< Max numSamples
private:
- AddrElemLib* m_pElemLib; ///< Element Lib pointer
+ ElemLib* m_pElemLib; ///< Element Lib pointer
};
-AddrLib* AddrSIHwlInit (const AddrClient* pClient);
-AddrLib* AddrCIHwlInit (const AddrClient* pClient);
+Lib* SiHwlInit (const Client* pClient);
+Lib* CiHwlInit (const Client* pClient);
+
+} // Addr
#endif
#include "addrlib1.h"
#include "addrcommon.h"
+namespace Addr
+{
+namespace V1
+{
///////////////////////////////////////////////////////////////////////////////////////////////////
// Static Const Member
///////////////////////////////////////////////////////////////////////////////////////////////////
-const AddrTileModeFlags AddrLib1::ModeFlags[ADDR_TM_COUNT] =
+const TileModeFlags Lib::ModeFlags[ADDR_TM_COUNT] =
{// T L 1 2 3 P Pr B
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_GENERAL
{1, 1, 0, 0, 0, 0, 0, 0}, // ADDR_TM_LINEAR_ALIGNED
/**
****************************************************************************************************
-* AddrLib1::AddrLib1
+* Lib::AddrLib1
*
* @brief
* Constructor for the AddrLib1 class
*
****************************************************************************************************
*/
-AddrLib1::AddrLib1() :
- AddrLib()
+Lib::Lib()
+ :
+ Addr::Lib()
{
}
/**
****************************************************************************************************
-* AddrLib1::AddrLib1
+* Lib::Lib
*
* @brief
-* Constructor for the AddrLib1 class with hClient as parameter
+* Constructor for the Addr::V1::Lib class with hClient as parameter
*
****************************************************************************************************
*/
-AddrLib1::AddrLib1(const AddrClient* pClient) :
- AddrLib(pClient)
+Lib::Lib(const Client* pClient)
+ :
+ Addr::Lib(pClient)
{
}
/**
****************************************************************************************************
-* AddrLib1::~AddrLib1
+* Lib::~AddrLib1
*
* @brief
* Destructor for the AddrLib1 class
*
****************************************************************************************************
*/
-AddrLib1::~AddrLib1()
+Lib::~Lib()
{
}
/**
****************************************************************************************************
-* AddrLib1::GetAddrLib1
+* Lib::GetLib
*
* @brief
* Get AddrLib1 pointer
*
* @return
-* An AddrLib1 class pointer
+* An Addr::V1::Lib class pointer
****************************************************************************************************
*/
-AddrLib1* AddrLib1::GetAddrLib1(
+Lib* Lib::GetLib(
ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
{
- AddrLib* pAddrLib = AddrLib::GetAddrLib(hLib);
+ Addr::Lib* pAddrLib = Addr::Lib::GetLib(hLib);
if ((pAddrLib != NULL) &&
- ((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
- (pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI)))
+ ((pAddrLib->GetChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
+ (pAddrLib->GetChipFamily() > ADDR_CHIP_FAMILY_VI)))
{
// only valid and pre-VI AISC can use AddrLib1 function.
ADDR_ASSERT_ALWAYS();
hLib = NULL;
}
- return static_cast<AddrLib1 *>(hLib);
+ return static_cast<Lib*>(hLib);
}
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceInfo
+* Lib::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceInfo(
+ADDR_E_RETURNCODE Lib::ComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
UINT_32 expandX = 1;
UINT_32 expandY = 1;
- AddrElemMode elemMode;
+ ElemMode elemMode;
// Save outputs that may not go through HWL
pOut->pixelBits = localIn.bpp;
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceInfo
+* Lib::ComputeSurfaceInfo
*
* @brief
* Interface function stub of AddrComputeSurfaceInfo.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceAddrFromCoord(
+ADDR_E_RETURNCODE Lib::ComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceCoordFromAddr
+* Lib::ComputeSurfaceCoordFromAddr
*
* @brief
* Interface function stub of ComputeSurfaceCoordFromAddr.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeSurfaceCoordFromAddr(
+ADDR_E_RETURNCODE Lib::ComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeSliceTileSwizzle
+* Lib::ComputeSliceTileSwizzle
*
* @brief
* Interface function stub of ComputeSliceTileSwizzle.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeSliceTileSwizzle(
+ADDR_E_RETURNCODE Lib::ComputeSliceTileSwizzle(
const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ExtractBankPipeSwizzle
+* Lib::ExtractBankPipeSwizzle
*
* @brief
* Interface function stub of AddrExtractBankPipeSwizzle.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ExtractBankPipeSwizzle(
+ADDR_E_RETURNCODE Lib::ExtractBankPipeSwizzle(
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::CombineBankPipeSwizzle
+* Lib::CombineBankPipeSwizzle
*
* @brief
* Interface function stub of AddrCombineBankPipeSwizzle.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::CombineBankPipeSwizzle(
+ADDR_E_RETURNCODE Lib::CombineBankPipeSwizzle(
const ADDR_COMBINE_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMBINE_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeBaseSwizzle
+* Lib::ComputeBaseSwizzle
*
* @brief
* Interface function stub of AddrCompueBaseSwizzle.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeBaseSwizzle(
+ADDR_E_RETURNCODE Lib::ComputeBaseSwizzle(
const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut) const
{
/**
****************************************************************************************************
-* AddrLib1::ComputeFmaskInfo
+* Lib::ComputeFmaskInfo
*
* @brief
* Interface function stub of ComputeFmaskInfo.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeFmaskInfo(
+ADDR_E_RETURNCODE Lib::ComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure
)
/**
****************************************************************************************************
-* AddrLib1::ComputeFmaskAddrFromCoord
+* Lib::ComputeFmaskAddrFromCoord
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeFmaskAddrFromCoord(
+ADDR_E_RETURNCODE Lib::ComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeFmaskCoordFromAddr
+* Lib::ComputeFmaskCoordFromAddr
*
* @brief
* Interface function stub of ComputeFmaskAddrFromCoord.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeFmaskCoordFromAddr(
+ADDR_E_RETURNCODE Lib::ComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ConvertTileInfoToHW
+* Lib::ConvertTileInfoToHW
*
* @brief
* Convert tile info from real value to HW register value in HW layer
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ConvertTileInfoToHW(
+ADDR_E_RETURNCODE Lib::ConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ConvertTileIndex
+* Lib::ConvertTileIndex
*
* @brief
* Convert tile index to tile mode/type/info
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex(
+ADDR_E_RETURNCODE Lib::ConvertTileIndex(
const ADDR_CONVERT_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::GetMacroModeIndex
+* Lib::GetMacroModeIndex
*
* @brief
* Get macro mode index based on input info
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::GetMacroModeIndex(
+ADDR_E_RETURNCODE Lib::GetMacroModeIndex(
const ADDR_GET_MACROMODEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_GET_MACROMODEINDEX_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ConvertTileIndex1
+* Lib::ConvertTileIndex1
*
* @brief
* Convert tile index to tile mode/type/info
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ConvertTileIndex1(
+ADDR_E_RETURNCODE Lib::ConvertTileIndex1(
const ADDR_CONVERT_TILEINDEX1_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::GetTileIndex
+* Lib::GetTileIndex
*
* @brief
* Get tile index from tile mode/type/info
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::GetTileIndex(
+ADDR_E_RETURNCODE Lib::GetTileIndex(
const ADDR_GET_TILEINDEX_INPUT* pIn, ///< [in] input structure
ADDR_GET_TILEINDEX_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::Thickness
+* Lib::Thickness
*
* @brief
* Get tile mode thickness
* Tile mode thickness
****************************************************************************************************
*/
-UINT_32 AddrLib1::Thickness(
+UINT_32 Lib::Thickness(
AddrTileMode tileMode) ///< [in] tile mode
{
return ModeFlags[tileMode].thickness;
/**
****************************************************************************************************
-* AddrLib1::ComputeHtileInfo
+* Lib::ComputeHtileInfo
*
* @brief
* Interface function stub of AddrComputeHtilenfo
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeHtileInfo(
+ADDR_E_RETURNCODE Lib::ComputeHtileInfo(
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskInfo
+* Lib::ComputeCmaskInfo
*
* @brief
* Interface function stub of AddrComputeCmaskInfo
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
+ADDR_E_RETURNCODE Lib::ComputeCmaskInfo(
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeDccInfo
+* Lib::ComputeDccInfo
*
* @brief
* Interface function to compute DCC key info
* return code of HwlComputeDccInfo
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeDccInfo(
+ADDR_E_RETURNCODE Lib::ComputeDccInfo(
const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeHtileAddrFromCoord
+* Lib::ComputeHtileAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeHtileAddrFromCoord
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeHtileAddrFromCoord(
+ADDR_E_RETURNCODE Lib::ComputeHtileAddrFromCoord(
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeHtileCoordFromAddr
+* Lib::ComputeHtileCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeHtileCoordFromAddr
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeHtileCoordFromAddr(
+ADDR_E_RETURNCODE Lib::ComputeHtileCoordFromAddr(
const ADDR_COMPUTE_HTILE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_HTILE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskAddrFromCoord
+* Lib::ComputeCmaskAddrFromCoord
*
* @brief
* Interface function stub of AddrComputeCmaskAddrFromCoord
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeCmaskAddrFromCoord(
+ADDR_E_RETURNCODE Lib::ComputeCmaskAddrFromCoord(
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskCoordFromAddr
+* Lib::ComputeCmaskCoordFromAddr
*
* @brief
* Interface function stub of AddrComputeCmaskCoordFromAddr
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeCmaskCoordFromAddr(
+ADDR_E_RETURNCODE Lib::ComputeCmaskCoordFromAddr(
const ADDR_COMPUTE_CMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_CMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeTileDataWidthAndHeight
+* Lib::ComputeTileDataWidthAndHeight
*
* @brief
* Compute the squared cache shape for per-tile data (CMASK and HTILE)
* MacroWidth and macroHeight are measured in pixels
****************************************************************************************************
*/
-VOID AddrLib1::ComputeTileDataWidthAndHeight(
+VOID Lib::ComputeTileDataWidthAndHeight(
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 cacheBits, ///< [in] bits of cache
ADDR_TILEINFO* pTileInfo, ///< [in] Tile info
/**
****************************************************************************************************
-* AddrLib1::HwlComputeTileDataWidthAndHeightLinear
+* Lib::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 AddrLib1::HwlComputeTileDataWidthAndHeightLinear(
+VOID Lib::HwlComputeTileDataWidthAndHeightLinear(
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight, ///< [out] macro tile height
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* AddrLib1::ComputeHtileInfo
+* Lib::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 AddrLib1::ComputeHtileInfo(
+UINT_32 Lib::ComputeHtileInfo(
ADDR_HTILE_FLAGS flags, ///< [in] htile flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskBaseAlign
+* Lib::ComputeCmaskBaseAlign
*
* @brief
* Compute cmask base alignment
* Cmask base alignment
****************************************************************************************************
*/
-UINT_32 AddrLib1::ComputeCmaskBaseAlign(
+UINT_32 Lib::ComputeCmaskBaseAlign(
ADDR_CMASK_FLAGS flags, ///< [in] Cmask flags
ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskBytes
+* Lib::ComputeCmaskBytes
*
* @brief
* Compute cmask size in bytes
* Cmask size in bytes
****************************************************************************************************
*/
-UINT_64 AddrLib1::ComputeCmaskBytes(
+UINT_64 Lib::ComputeCmaskBytes(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 numSlices ///< [in] number of slices
/**
****************************************************************************************************
-* AddrLib1::ComputeCmaskInfo
+* Lib::ComputeCmaskInfo
*
* @brief
* Compute cmask pitch,width, bytes per 2D slice
* macro-tile dimensions
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeCmaskInfo(
+ADDR_E_RETURNCODE Lib::ComputeCmaskInfo(
ADDR_CMASK_FLAGS flags, ///< [in] cmask flags
UINT_32 pitchIn, ///< [in] pitch input
UINT_32 heightIn, ///< [in] height input
/**
****************************************************************************************************
-* AddrLib1::ComputeXmaskCoordYFromPipe
+* Lib::ComputeXmaskCoordYFromPipe
*
* @brief
* Compute the Y coord from pipe number for cmask/htile
*
****************************************************************************************************
*/
-UINT_32 AddrLib1::ComputeXmaskCoordYFromPipe(
+UINT_32 Lib::ComputeXmaskCoordYFromPipe(
UINT_32 pipe, ///< [in] pipe number
UINT_32 x ///< [in] x coordinate
) const
/**
****************************************************************************************************
-* AddrLib1::HwlComputeXmaskCoordFromAddr
+* Lib::HwlComputeXmaskCoordFromAddr
*
* @brief
* Compute the coord from an address of a cmask/htile
* This method is reused by htile, so rename to Xmask
****************************************************************************************************
*/
-VOID AddrLib1::HwlComputeXmaskCoordFromAddr(
+VOID Lib::HwlComputeXmaskCoordFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 pitch, ///< [in] pitch
/**
****************************************************************************************************
-* AddrLib1::HwlComputeXmaskAddrFromCoord
+* Lib::HwlComputeXmaskAddrFromCoord
*
* @brief
* Compute the address from an address of cmask (prior to si)
*
****************************************************************************************************
*/
-UINT_64 AddrLib1::HwlComputeXmaskAddrFromCoord(
+UINT_64 Lib::HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 x, ///< [in] x coord
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceAddrFromCoordLinear
+* Lib::ComputeSurfaceAddrFromCoordLinear
*
* @brief
* Compute address from coord for linear surface
*
****************************************************************************************************
*/
-UINT_64 AddrLib1::ComputeSurfaceAddrFromCoordLinear(
+UINT_64 Lib::ComputeSurfaceAddrFromCoordLinear(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 slice, ///< [in] slice/depth index
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceCoordFromAddrLinear
+* Lib::ComputeSurfaceCoordFromAddrLinear
*
* @brief
* Compute the coord from an address of a linear surface
* N/A
****************************************************************************************************
*/
-VOID AddrLib1::ComputeSurfaceCoordFromAddrLinear(
+VOID Lib::ComputeSurfaceCoordFromAddrLinear(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled
+* Lib::ComputeSurfaceCoordFromAddrMicroTiled
*
* @brief
* Compute the coord from an address of a micro tiled surface
* N/A
****************************************************************************************************
*/
-VOID AddrLib1::ComputeSurfaceCoordFromAddrMicroTiled(
+VOID Lib::ComputeSurfaceCoordFromAddrMicroTiled(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* AddrLib1::ComputePipeFromAddr
+* Lib::ComputePipeFromAddr
*
* @brief
* Compute the pipe number from an address
*
****************************************************************************************************
*/
-UINT_32 AddrLib1::ComputePipeFromAddr(
+UINT_32 Lib::ComputePipeFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 numPipes ///< [in] number of banks
) const
/**
****************************************************************************************************
-* AddrLib1::ComputeMicroTileEquation
+* Lib::ComputeMicroTileEquation
*
* @brief
* Compute micro tile equation
*
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputeMicroTileEquation(
+ADDR_E_RETURNCODE Lib::ComputeMicroTileEquation(
UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel
AddrTileMode tileMode, ///< [in] tile mode
AddrTileType microTileType, ///< [in] pixel order in display/non-display mode
/**
****************************************************************************************************
-* AddrLib1::ComputePixelIndexWithinMicroTile
+* Lib::ComputePixelIndexWithinMicroTile
*
* @brief
* Compute the pixel index inside a micro tile of surface
*
****************************************************************************************************
*/
-UINT_32 AddrLib1::ComputePixelIndexWithinMicroTile(
+UINT_32 Lib::ComputePixelIndexWithinMicroTile(
UINT_32 x, ///< [in] x coord
UINT_32 y, ///< [in] y coord
UINT_32 z, ///< [in] slice/depth index
/**
****************************************************************************************************
-* AddrLib1::AdjustPitchAlignment
+* Lib::AdjustPitchAlignment
*
* @brief
* Adjusts pitch alignment for flipping surface
*
****************************************************************************************************
*/
-VOID AddrLib1::AdjustPitchAlignment(
+VOID Lib::AdjustPitchAlignment(
ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags
UINT_32* pPitchAlign ///< [out] Pointer to pitch alignment
) const
/**
****************************************************************************************************
-* AddrLib1::PadDimensions
+* Lib::PadDimensions
*
* @brief
* Helper function to pad dimensions
*
****************************************************************************************************
*/
-VOID AddrLib1::PadDimensions(
+VOID Lib::PadDimensions(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* AddrLib1::HwlPreHandleBaseLvl3xPitch
+* Lib::HwlPreHandleBaseLvl3xPitch
*
* @brief
* Pre-handler of 3x pitch (96 bit) adjustment
* Expected pitch
****************************************************************************************************
*/
-UINT_32 AddrLib1::HwlPreHandleBaseLvl3xPitch(
+UINT_32 Lib::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
//
// If pitch is pre-multiplied by 3, we retrieve original one here to get correct miplevel size
//
- if (AddrElemLib::IsExpand3x(pIn->format) &&
+ if (ElemLib::IsExpand3x(pIn->format) &&
pIn->mipLevel == 0 &&
pIn->tileMode == ADDR_TM_LINEAR_ALIGNED)
{
/**
****************************************************************************************************
-* AddrLib1::HwlPostHandleBaseLvl3xPitch
+* Lib::HwlPostHandleBaseLvl3xPitch
*
* @brief
* Post-handler of 3x pitch adjustment
* Expected pitch
****************************************************************************************************
*/
-UINT_32 AddrLib1::HwlPostHandleBaseLvl3xPitch(
+UINT_32 Lib::HwlPostHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
// 96 bits surface of sub levels require element pitch of 32 bits instead
// So we just return pitch in 32 bit pixels without timing 3
//
- if (AddrElemLib::IsExpand3x(pIn->format) &&
+ if (ElemLib::IsExpand3x(pIn->format) &&
pIn->mipLevel == 0 &&
pIn->tileMode == ADDR_TM_LINEAR_ALIGNED)
{
/**
****************************************************************************************************
-* AddrLib1::IsMacroTiled
+* Lib::IsMacroTiled
*
* @brief
* Check if the tile mode is macro tiled
* TRUE if it is macro tiled (2D/2B/3D/3B)
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsMacroTiled(
+BOOL_32 Lib::IsMacroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return ModeFlags[tileMode].isMacro;
/**
****************************************************************************************************
-* AddrLib1::IsMacro3dTiled
+* Lib::IsMacro3dTiled
*
* @brief
* Check if the tile mode is 3D macro tiled
* TRUE if it is 3D macro tiled
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsMacro3dTiled(
+BOOL_32 Lib::IsMacro3dTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return ModeFlags[tileMode].isMacro3d;
/**
****************************************************************************************************
-* AddrLib1::IsMicroTiled
+* Lib::IsMicroTiled
*
* @brief
* Check if the tile mode is micro tiled
* TRUE if micro tiled
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsMicroTiled(
+BOOL_32 Lib::IsMicroTiled(
AddrTileMode tileMode) ///< [in] tile mode
{
return ModeFlags[tileMode].isMicro;
/**
****************************************************************************************************
-* AddrLib1::IsLinear
+* Lib::IsLinear
*
* @brief
* Check if the tile mode is linear
* TRUE if linear
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsLinear(
+BOOL_32 Lib::IsLinear(
AddrTileMode tileMode) ///< [in] tile mode
{
return ModeFlags[tileMode].isLinear;
/**
****************************************************************************************************
-* AddrLib1::IsPrtNoRotationTileMode
+* Lib::IsPrtNoRotationTileMode
*
* @brief
* Return TRUE if it is prt tile without rotation
* This function just used by CI
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsPrtNoRotationTileMode(
+BOOL_32 Lib::IsPrtNoRotationTileMode(
AddrTileMode tileMode)
{
return ModeFlags[tileMode].isPrtNoRotation;
/**
****************************************************************************************************
-* AddrLib1::IsPrtTileMode
+* Lib::IsPrtTileMode
*
* @brief
* Return TRUE if it is prt tile
* This function just used by CI
****************************************************************************************************
*/
-BOOL_32 AddrLib1::IsPrtTileMode(
+BOOL_32 Lib::IsPrtTileMode(
AddrTileMode tileMode)
{
return ModeFlags[tileMode].isPrt;
/**
****************************************************************************************************
-* AddrLib1::ComputeMipLevel
+* Lib::ComputeMipLevel
*
* @brief
* Compute mipmap level width/height/slices
* N/A
****************************************************************************************************
*/
-VOID AddrLib1::ComputeMipLevel(
+VOID Lib::ComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
- if (AddrElemLib::IsBlockCompressed(pIn->format))
+ if (ElemLib::IsBlockCompressed(pIn->format))
{
if (pIn->mipLevel == 0)
{
/**
****************************************************************************************************
-* AddrLib1::OptimizeTileMode
+* Lib::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 AddrLib1::OptimizeTileMode(
+BOOL_32 Lib::OptimizeTileMode(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure for surface info
AddrTileMode* pTileMode ///< [out] Degraded tile mode
) const
// Check if linear mode is optimal
if ((pIn->height == 1) &&
(IsLinear(tileMode) == FALSE) &&
- (AddrElemLib::IsBlockCompressed(pIn->format) == FALSE) &&
+ (ElemLib::IsBlockCompressed(pIn->format) == FALSE) &&
(pIn->flags.depth == FALSE) &&
(pIn->flags.stencil == FALSE) &&
(m_configFlags.disableLinearOpt == FALSE) &&
/**
****************************************************************************************************
-* AddrLib1::DegradeLargeThickTile
+* Lib::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 AddrLib1::DegradeLargeThickTile(
+AddrTileMode Lib::DegradeLargeThickTile(
AddrTileMode tileMode,
UINT_32 bpp) const
{
/**
****************************************************************************************************
-* AddrLib1::PostComputeMipLevel
+* Lib::PostComputeMipLevel
* @brief
* Compute MipLevel info (including level 0) after surface adjustment
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::PostComputeMipLevel(
+ADDR_E_RETURNCODE Lib::PostComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in/out] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] Output structure
) const
/**
****************************************************************************************************
-* AddrLib1::HwlSetupTileCfg
+* Lib::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::HwlSetupTileCfg(
+ADDR_E_RETURNCODE Lib::HwlSetupTileCfg(
UINT_32 bpp, ///< Bits per pixel
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
/**
****************************************************************************************************
-* AddrLib1::HwlGetPipes
+* Lib::HwlGetPipes
*
* @brief
* Get number pipes
* num pipes
****************************************************************************************************
*/
-UINT_32 AddrLib1::HwlGetPipes(
+UINT_32 Lib::HwlGetPipes(
const ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
/**
****************************************************************************************************
-* AddrLib1::ComputeQbStereoInfo
+* Lib::ComputeQbStereoInfo
*
* @brief
* Get quad buffer stereo information
* TRUE if no error
****************************************************************************************************
*/
-BOOL_32 AddrLib1::ComputeQbStereoInfo(
+BOOL_32 Lib::ComputeQbStereoInfo(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] updated pOut+pStereoInfo
) const
{
/**
****************************************************************************************************
-* AddrLib1::ComputePrtInfo
+* Lib::ComputePrtInfo
*
* @brief
* Compute prt surface related info
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo(
+ADDR_E_RETURNCODE Lib::ComputePrtInfo(
const ADDR_PRT_INFO_INPUT* pIn,
ADDR_PRT_INFO_OUTPUT* pOut) const
{
UINT_32 expandX = 1;
UINT_32 expandY = 1;
- AddrElemMode elemMode;
+ ElemMode elemMode;
UINT_32 bpp = GetElemLib()->GetBitsPerPixel(pIn->format,
- &elemMode,
- &expandX,
- &expandY);
+ &elemMode,
+ &expandX,
+ &expandY);
if (bpp <8 || bpp == 24 || bpp == 48 || bpp == 96)
{
return returnCode;
}
+} // V1
+} // Addr
/**
****************************************************************************************************
* @file addrlib1.h
-* @brief Contains the AddrLib1 base class definition.
+* @brief Contains the Lib base class definition.
****************************************************************************************************
*/
#include "addrlib.h"
+namespace Addr
+{
+namespace V1
+{
/**
****************************************************************************************************
* @brief Neutral enums that define bank swap size
****************************************************************************************************
*/
-enum AddrSampleSplitSize
+enum SampleSplitSize
{
ADDR_SAMPLESPLIT_1KB = 1024,
ADDR_SAMPLESPLIT_2KB = 2048,
* @brief Flags for AddrTileMode
****************************************************************************************************
*/
-struct AddrTileModeFlags
+struct TileModeFlags
{
UINT_32 thickness : 4;
UINT_32 isLinear : 1;
* @brief This class contains asic independent address lib functionalities
****************************************************************************************************
*/
-class AddrLib1 : public AddrLib
+class Lib : public Addr::Lib
{
public:
- virtual ~AddrLib1();
+ virtual ~Lib();
- static AddrLib1* GetAddrLib1(
+ static Lib* GetLib(
ADDR_HANDLE hLib);
/// Returns tileIndex support
const ADDR_PRT_INFO_INPUT* pIn,
ADDR_PRT_INFO_OUTPUT* pOut) const;
protected:
- AddrLib1(); // Constructor is protected
- AddrLib1(const AddrClient* pClient);
+ Lib(); // Constructor is protected
+ Lib(const Client* pClient);
/// Pure Virtual function for Hwl computing surface info
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
//
// Misc helper
//
- static const AddrTileModeFlags ModeFlags[ADDR_TM_COUNT];
+ static const TileModeFlags ModeFlags[ADDR_TM_COUNT];
static UINT_32 Thickness(
AddrTileMode tileMode);
private:
// Disallow the copy constructor
- AddrLib1(const AddrLib1& a);
+ Lib(const Lib& a);
// Disallow the assignment operator
- AddrLib1& operator=(const AddrLib1& a);
+ Lib& operator=(const Lib& a);
UINT_32 ComputeCmaskBaseAlign(
ADDR_CMASK_FLAGS flags, ADDR_TILEINFO* pTileInfo) const;
UINT_32 pipe, UINT_32 x) const;
};
+} // V1
+} // Addr
+
#endif
/**
****************************************************************************************************
-* @file addrobject.cpp
-* @brief Contains the AddrObject base class implementation.
+* @file Object.cpp
+* @brief Contains the Object base class implementation.
****************************************************************************************************
*/
#include "addrinterface.h"
#include "addrobject.h"
+namespace Addr
+{
+
/**
****************************************************************************************************
-* AddrObject::AddrObject
+* Object::Object
*
* @brief
-* Constructor for the AddrObject class.
+* Constructor for the Object class.
****************************************************************************************************
*/
-AddrObject::AddrObject()
+Object::Object()
{
m_client.handle = NULL;
m_client.callbacks.allocSysMem = NULL;
/**
****************************************************************************************************
-* AddrObject::AddrObject
+* Object::Object
*
* @brief
-* Constructor for the AddrObject class.
+* Constructor for the Object class.
****************************************************************************************************
*/
-AddrObject::AddrObject(const AddrClient* pClient)
+Object::Object(const Client* pClient)
{
m_client = *pClient;
}
/**
****************************************************************************************************
-* AddrObject::~AddrObject
+* Object::~Object
*
* @brief
-* Destructor for the AddrObject class.
+* Destructor for the Object class.
****************************************************************************************************
*/
-AddrObject::~AddrObject()
+Object::~Object()
{
}
/**
****************************************************************************************************
-* AddrObject::ClientAlloc
+* Object::ClientAlloc
*
* @brief
-* Calls instanced allocSysMem inside AddrClient
+* Calls instanced allocSysMem inside Client
****************************************************************************************************
*/
-VOID* AddrObject::ClientAlloc(
+VOID* Object::ClientAlloc(
size_t objSize, ///< [in] Size to allocate
- const AddrClient* pClient) ///< [in] Client pointer
+ const Client* pClient) ///< [in] Client pointer
{
VOID* pObjMem = NULL;
/**
****************************************************************************************************
-* AddrObject::AddrMalloc
+* Object::Alloc
*
* @brief
* A wrapper of ClientAlloc
****************************************************************************************************
*/
-VOID* AddrObject::AddrMalloc(
+VOID* Object::Alloc(
size_t objSize) const ///< [in] Size to allocate
{
return ClientAlloc(objSize, &m_client);
/**
****************************************************************************************************
-* AddrObject::ClientFree
+* Object::ClientFree
*
* @brief
-* Calls freeSysMem inside AddrClient
+* Calls freeSysMem inside Client
****************************************************************************************************
*/
-VOID AddrObject::ClientFree(
+VOID Object::ClientFree(
VOID* pObjMem, ///< [in] User virtual address to free.
- const AddrClient* pClient) ///< [in] Client pointer
+ const Client* pClient) ///< [in] Client pointer
{
if (pClient->callbacks.freeSysMem != NULL)
{
/**
****************************************************************************************************
-* AddrObject::AddrFree
+* Object::Free
*
* @brief
* A wrapper of ClientFree
****************************************************************************************************
*/
-VOID AddrObject::AddrFree(
+VOID Object::Free(
VOID* pObjMem) const ///< [in] User virtual address to free.
{
ClientFree(pObjMem, &m_client);
/**
****************************************************************************************************
-* AddrObject::operator new
+* Object::operator new
*
* @brief
-* Allocates memory needed for AddrObject object. (with ADDR_CLIENT_HANDLE)
+* Allocates memory needed for Object object. (with ADDR_CLIENT_HANDLE)
*
* @return
* Returns NULL if unsuccessful.
****************************************************************************************************
*/
-VOID* AddrObject::operator new(
+VOID* Object::operator new(
size_t objSize, ///< [in] Size to allocate
- const AddrClient* pClient) ///< [in] Client pointer
+ const Client* pClient) ///< [in] Client pointer
{
return ClientAlloc(objSize, pClient);
}
/**
****************************************************************************************************
-* AddrObject::operator delete
+* Object::operator delete
*
* @brief
-* Frees AddrObject object memory.
+* Frees Object object memory.
****************************************************************************************************
*/
-VOID AddrObject::operator delete(
+VOID Object::operator delete(
VOID* pObjMem, ///< [in] User virtual address to free.
- const AddrClient* pClient) ///< [in] Client handle
+ const Client* pClient) ///< [in] Client handle
{
ClientFree(pObjMem, pClient);
}
/**
****************************************************************************************************
-* AddrObject::operator delete
+* Object::operator delete
*
* @brief
-* Frees AddrObject object memory.
+* Frees Object object memory.
****************************************************************************************************
*/
-VOID AddrObject::operator delete(
+VOID Object::operator delete(
VOID* pObjMem) ///< [in] User virtual address to free.
{
- AddrObject* pObj = static_cast<AddrObject*>(pObjMem);
+ Object* pObj = static_cast<Object*>(pObjMem);
ClientFree(pObjMem, &pObj->m_client);
}
/**
****************************************************************************************************
-* AddrObject::DebugPrint
+* Object::DebugPrint
*
* @brief
* Print debug message
* N/A
****************************************************************************************************
*/
-VOID AddrObject::DebugPrint(
+VOID Object::DebugPrint(
const CHAR* pDebugString, ///< [in] Debug string
...) const
{
#endif
}
+} // Addr
/**
****************************************************************************************************
-* @file addrobject.h
-* @brief Contains the AddrObject base class definition.
+* @file Object.h
+* @brief Contains the Object base class definition.
****************************************************************************************************
*/
#include "addrtypes.h"
#include "addrcommon.h"
+namespace Addr
+{
+
/**
****************************************************************************************************
* @brief This structure contains client specific data
****************************************************************************************************
*/
-struct AddrClient
+struct Client
{
ADDR_CLIENT_HANDLE handle;
ADDR_CALLBACKS callbacks;
* @brief This class is the base class for all ADDR class objects.
****************************************************************************************************
*/
-class AddrObject
+class Object
{
public:
- AddrObject();
- AddrObject(const AddrClient* pClient);
- virtual ~AddrObject();
+ Object();
+ Object(const Client* pClient);
+ virtual ~Object();
- VOID* operator new(size_t size, const AddrClient* pClient);
- VOID operator delete(VOID* pObj, const AddrClient* pClient);
+ VOID* operator new(size_t size, const Client* pClient);
+ VOID operator delete(VOID* pObj, const Client* pClient);
VOID operator delete(VOID* pObj);
- VOID* AddrMalloc(size_t size) const;
- VOID AddrFree(VOID* pObj) const;
+ VOID* Alloc(size_t size) const;
+ VOID Free(VOID* pObj) const;
VOID DebugPrint(
const CHAR* pDebugString,
...) const;
- const AddrClient* GetClient() const {return &m_client;}
+ const Client* GetClient() const {return &m_client;}
protected:
- AddrClient m_client;
+ Client m_client;
private:
- static VOID* ClientAlloc(size_t size, const AddrClient* pClient);
- static VOID ClientFree(VOID* pObj, const AddrClient* pClient);
+ static VOID* ClientAlloc(size_t size, const Client* pClient);
+ static VOID ClientFree(VOID* pObj, const Client* pClient);
// disallow the copy constructor
- AddrObject(const AddrObject& a);
+ Object(const Object& a);
// disallow the assignment operator
- AddrObject& operator=(const AddrObject& a);
+ Object& operator=(const Object& a);
};
+} // Addr
#endif
/**
****************************************************************************************************
* @file ciaddrlib.cpp
-* @brief Contains the implementation for the CiAddrLib class.
+* @brief Contains the implementation for the CiLib class.
****************************************************************************************************
*/
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
+namespace Addr
+{
+
+/**
+****************************************************************************************************
+* CiHwlInit
+*
+* @brief
+* Creates an CiLib object.
+*
+* @return
+* Returns an CiLib object pointer.
+****************************************************************************************************
+*/
+Lib* CiHwlInit(const Client* pClient)
+{
+ return V1::CiLib::CreateObj(pClient);
+}
+
+namespace V1
+{
+
/**
****************************************************************************************************
-* AddrMask
+* Mask
*
* @brief
* Gets a mask of "width"
* Bit mask
****************************************************************************************************
*/
-static UINT_64 AddrMask(
+static UINT_64 Mask(
UINT_32 width) ///< Width of bits
{
UINT_64 ret;
/**
****************************************************************************************************
-* AddrGetBits
+* GetBits
*
* @brief
* Gets bits within a range of [msb, lsb]
* Bits of this range
****************************************************************************************************
*/
-static UINT_64 AddrGetBits(
+static UINT_64 GetBits(
UINT_64 bits, ///< Source bits
UINT_32 msb, ///< Most signicant bit
UINT_32 lsb) ///< Least signicant bit
if (msb >= lsb)
{
- ret = (bits >> lsb) & (AddrMask(1 + msb - lsb));
+ ret = (bits >> lsb) & (Mask(1 + msb - lsb));
}
return ret;
}
/**
****************************************************************************************************
-* AddrRemoveBits
+* RemoveBits
*
* @brief
* Removes bits within the range of [msb, lsb]
* Modified bits
****************************************************************************************************
*/
-static UINT_64 AddrRemoveBits(
+static UINT_64 RemoveBits(
UINT_64 bits, ///< Source bits
UINT_32 msb, ///< Most signicant bit
UINT_32 lsb) ///< Least signicant bit
if (msb >= lsb)
{
- ret = AddrGetBits(bits, lsb - 1, 0) // low bits
- | (AddrGetBits(bits, 8 * sizeof(bits) - 1, msb + 1) << lsb); //high bits
+ ret = GetBits(bits, lsb - 1, 0) // low bits
+ | (GetBits(bits, 8 * sizeof(bits) - 1, msb + 1) << lsb); //high bits
}
return ret;
}
/**
****************************************************************************************************
-* AddrInsertBits
+* InsertBits
*
* @brief
* Inserts new bits into the range of [msb, lsb]
* Modified bits
****************************************************************************************************
*/
-static UINT_64 AddrInsertBits(
+static UINT_64 InsertBits(
UINT_64 bits, ///< Source bits
UINT_64 newBits, ///< New bits to be inserted
UINT_32 msb, ///< Most signicant bit
if (msb >= lsb)
{
- ret = AddrGetBits(bits, lsb - 1, 0) // old low bitss
- | (AddrGetBits(newBits, msb - lsb, 0) << lsb) //new bits
- | (AddrGetBits(bits, 8 * sizeof(bits) - 1, lsb) << (msb + 1)); //old high bits
+ ret = GetBits(bits, lsb - 1, 0) // old low bitss
+ | (GetBits(newBits, msb - lsb, 0) << lsb) //new bits
+ | (GetBits(bits, 8 * sizeof(bits) - 1, lsb) << (msb + 1)); //old high bits
}
return ret;
}
-
-/**
-****************************************************************************************************
-* AddrCiHwlInit
-*
-* @brief
-* Creates an CiAddrLib object.
-*
-* @return
-* Returns an CiAddrLib object pointer.
-****************************************************************************************************
-*/
-AddrLib* AddrCIHwlInit(const AddrClient* pClient)
-{
- return CiAddrLib::CreateObj(pClient);
-}
-
/**
****************************************************************************************************
-* CiAddrLib::CiAddrLib
+* CiLib::CiLib
*
* @brief
* Constructor
*
****************************************************************************************************
*/
-CiAddrLib::CiAddrLib(const AddrClient* pClient) :
- SiAddrLib(pClient),
+CiLib::CiLib(const Client* pClient)
+ :
+ SiLib(pClient),
m_noOfMacroEntries(0),
m_allowNonDispThickModes(FALSE)
{
/**
****************************************************************************************************
-* CiAddrLib::~CiAddrLib
+* CiLib::~CiLib
*
* @brief
* Destructor
****************************************************************************************************
*/
-CiAddrLib::~CiAddrLib()
+CiLib::~CiLib()
{
}
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeDccInfo
+* CiLib::HwlComputeDccInfo
*
* @brief
* Compute DCC key size, base alignment
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlComputeDccInfo(
+ADDR_E_RETURNCODE CiLib::HwlComputeDccInfo(
const ADDR_COMPUTE_DCCINFO_INPUT* pIn,
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) const
{
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeCmaskAddrFromCoord
+* CiLib::HwlComputeCmaskAddrFromCoord
*
* @brief
* Compute tc compatible Cmask address from fmask ram address
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlComputeCmaskAddrFromCoord(
+ADDR_E_RETURNCODE CiLib::HwlComputeCmaskAddrFromCoord(
const ADDR_COMPUTE_CMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] fmask addr/bpp/tile input
ADDR_COMPUTE_CMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] cmask address
) const
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeHtileAddrFromCoord
+* CiLib::HwlComputeHtileAddrFromCoord
*
* @brief
* Compute tc compatible Htile address from depth/stencil address
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlComputeHtileAddrFromCoord(
+ADDR_E_RETURNCODE CiLib::HwlComputeHtileAddrFromCoord(
const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT* pIn, ///< [in] depth/stencil addr/bpp/tile input
ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] htile address
) const
/**
****************************************************************************************************
-* CiAddrLib::HwlConvertChipFamily
+* CiLib::HwlConvertChipFamily
*
* @brief
-* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision
+* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision
* @return
-* AddrChipFamily
+* ChipFamily
****************************************************************************************************
*/
-AddrChipFamily CiAddrLib::HwlConvertChipFamily(
+ChipFamily CiLib::HwlConvertChipFamily(
UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h
UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h
{
- AddrChipFamily family = ADDR_CHIP_FAMILY_CI;
+ ChipFamily family = ADDR_CHIP_FAMILY_CI;
switch (uChipFamily)
{
/**
****************************************************************************************************
-* CiAddrLib::HwlInitGlobalParams
+* CiLib::HwlInitGlobalParams
*
* @brief
* Initializes global parameters
*
****************************************************************************************************
*/
-BOOL_32 CiAddrLib::HwlInitGlobalParams(
+BOOL_32 CiLib::HwlInitGlobalParams(
const ADDR_CREATE_INPUT* pCreateIn) ///< [in] create input
{
BOOL_32 valid = TRUE;
/**
****************************************************************************************************
-* CiAddrLib::HwlPostCheckTileIndex
+* CiLib::HwlPostCheckTileIndex
*
* @brief
* Map a tile setting to index if curIndex is invalid, otherwise check if curIndex matches
* Tile index.
****************************************************************************************************
*/
-INT_32 CiAddrLib::HwlPostCheckTileIndex(
+INT_32 CiLib::HwlPostCheckTileIndex(
const ADDR_TILEINFO* pInfo, ///< [in] Tile Info
AddrTileMode mode, ///< [in] Tile mode
AddrTileType type, ///< [in] Tile type
/**
****************************************************************************************************
-* CiAddrLib::HwlSetupTileCfg
+* CiLib::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlSetupTileCfg(
+ADDR_E_RETURNCODE CiLib::HwlSetupTileCfg(
UINT_32 bpp, ///< [in] Bits per pixel
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
}
else
{
- const AddrTileConfig* pCfgTable = GetTileSetting(index);
+ const TileConfig* pCfgTable = GetTileSetting(index);
if (pInfo != NULL)
{
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeSurfaceInfo
+* CiLib::HwlComputeSurfaceInfo
*
* @brief
-* Entry of ci's ComputeSurfaceInfo
+* Entry of CI's ComputeSurfaceInfo
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlComputeSurfaceInfo(
+ADDR_E_RETURNCODE CiLib::HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
// Pass tcCompatible flag from input to output; and turn off it if tile split occurs
pOut->tcCompatible = pIn->flags.tcCompatible;
- ADDR_E_RETURNCODE retCode = SiAddrLib::HwlComputeSurfaceInfo(pIn,pOut);
+ ADDR_E_RETURNCODE retCode = SiLib::HwlComputeSurfaceInfo(pIn,pOut);
if (pOut->macroModeIndex == TileIndexNoMacroIndex)
{
/**
****************************************************************************************************
-* CiAddrLib::HwlFmaskSurfaceInfo
+* CiLib::HwlFmaskSurfaceInfo
* @brief
* Entry of r800's ComputeFmaskInfo
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlComputeFmaskInfo(
+ADDR_E_RETURNCODE CiLib::HwlComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure
)
/**
****************************************************************************************************
-* CiAddrLib::HwlFmaskPreThunkSurfInfo
+* CiLib::HwlFmaskPreThunkSurfInfo
*
* @brief
* Some preparation before thunking a ComputeSurfaceInfo call for Fmask
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-VOID CiAddrLib::HwlFmaskPreThunkSurfInfo(
+VOID CiLib::HwlFmaskPreThunkSurfInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn, ///< [in] Input of fmask info
const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut, ///< [in] Output of fmask info
ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn, ///< [out] Input of thunked surface info
/**
****************************************************************************************************
-* CiAddrLib::HwlFmaskPostThunkSurfInfo
+* CiLib::HwlFmaskPostThunkSurfInfo
*
* @brief
* Copy hwl extra field after calling thunked ComputeSurfaceInfo
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-VOID CiAddrLib::HwlFmaskPostThunkSurfInfo(
+VOID CiLib::HwlFmaskPostThunkSurfInfo(
const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut, ///< [in] Output of surface info
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut ///< [out] Output of fmask info
) const
/**
****************************************************************************************************
-* CiAddrLib::HwlDegradeThickTileMode
+* CiLib::HwlDegradeThickTileMode
*
* @brief
* Degrades valid tile mode for thick modes if needed
* Suitable tile mode
****************************************************************************************************
*/
-AddrTileMode CiAddrLib::HwlDegradeThickTileMode(
+AddrTileMode CiLib::HwlDegradeThickTileMode(
AddrTileMode baseTileMode, ///< [in] base tile mode
UINT_32 numSlices, ///< [in] current number of slices
UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice
/**
****************************************************************************************************
-* CiAddrLib::HwlOverrideTileMode
+* CiLib::HwlOverrideTileMode
*
* @brief
* Override THICK to THIN, for specific formats on CI
*
****************************************************************************************************
*/
-VOID CiAddrLib::HwlOverrideTileMode(
+VOID CiLib::HwlOverrideTileMode(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure
) const
{
/**
****************************************************************************************************
-* CiAddrLib::HwlSelectTileMode
+* CiLib::HwlSelectTileMode
*
* @brief
* Select tile modes.
*
****************************************************************************************************
*/
-VOID CiAddrLib::HwlSelectTileMode(
+VOID CiLib::HwlSelectTileMode(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure
) const
{
/**
****************************************************************************************************
-* CiAddrLib::HwlSetupTileInfo
+* CiLib::HwlSetupTileInfo
*
* @brief
* Setup default value of tile info for SI
****************************************************************************************************
*/
-VOID CiAddrLib::HwlSetupTileInfo(
+VOID CiLib::HwlSetupTileInfo(
AddrTileMode tileMode, ///< [in] Tile mode
ADDR_SURFACE_FLAGS flags, ///< [in] Surface type flags
UINT_32 bpp, ///< [in] Bits per pixel
/**
****************************************************************************************************
-* CiAddrLib::ReadGbTileMode
+* CiLib::ReadGbTileMode
*
* @brief
* Convert GB_TILE_MODE HW value to ADDR_TILE_CONFIG.
* NA.
****************************************************************************************************
*/
-VOID CiAddrLib::ReadGbTileMode(
- UINT_32 regValue, ///< [in] GB_TILE_MODE register
- AddrTileConfig* pCfg ///< [out] output structure
+VOID CiLib::ReadGbTileMode(
+ UINT_32 regValue, ///< [in] GB_TILE_MODE register
+ TileConfig* pCfg ///< [out] output structure
) const
{
GB_TILE_MODE gbTileMode;
/**
****************************************************************************************************
-* CiAddrLib::InitTileSettingTable
+* CiLib::InitTileSettingTable
*
* @brief
* Initialize the ADDR_TILE_CONFIG table.
* TRUE if tile table is correctly initialized
****************************************************************************************************
*/
-BOOL_32 CiAddrLib::InitTileSettingTable(
+BOOL_32 CiLib::InitTileSettingTable(
const UINT_32* pCfg, ///< [in] Pointer to table of tile configs
UINT_32 noOfEntries ///< [in] Numbe of entries in the table above
)
/**
****************************************************************************************************
-* CiAddrLib::ReadGbMacroTileCfg
+* CiLib::ReadGbMacroTileCfg
*
* @brief
* Convert GB_MACRO_TILE_CFG HW value to ADDR_TILE_CONFIG.
* NA.
****************************************************************************************************
*/
-VOID CiAddrLib::ReadGbMacroTileCfg(
+VOID CiLib::ReadGbMacroTileCfg(
UINT_32 regValue, ///< [in] GB_MACRO_TILE_MODE register
ADDR_TILEINFO* pCfg ///< [out] output structure
) const
/**
****************************************************************************************************
-* CiAddrLib::InitMacroTileCfgTable
+* CiLib::InitMacroTileCfgTable
*
* @brief
* Initialize the ADDR_MACRO_TILE_CONFIG table.
* TRUE if macro tile table is correctly initialized
****************************************************************************************************
*/
-BOOL_32 CiAddrLib::InitMacroTileCfgTable(
+BOOL_32 CiLib::InitMacroTileCfgTable(
const UINT_32* pCfg, ///< [in] Pointer to table of tile configs
UINT_32 noOfMacroEntries ///< [in] Numbe of entries in the table above
)
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeMacroModeIndex
+* CiLib::HwlComputeMacroModeIndex
*
* @brief
* Computes macro tile mode index
* TRUE if macro tile table is correctly initialized
****************************************************************************************************
*/
-INT_32 CiAddrLib::HwlComputeMacroModeIndex(
+INT_32 CiLib::HwlComputeMacroModeIndex(
INT_32 tileIndex, ///< [in] Tile mode index
ADDR_SURFACE_FLAGS flags, ///< [in] Surface flags
UINT_32 bpp, ///< [in] Bit per pixel
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeTileDataWidthAndHeightLinear
+* CiLib::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 CiAddrLib::HwlComputeTileDataWidthAndHeightLinear(
+VOID CiLib::HwlComputeTileDataWidthAndHeightLinear(
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight, ///< [out] macro tile height
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* CiAddrLib::HwlComputeMetadataNibbleAddress
+* CiLib::HwlComputeMetadataNibbleAddress
*
* @brief
* calculate meta data address based on input information
*
****************************************************************************************************
*/
-UINT_64 CiAddrLib::HwlComputeMetadataNibbleAddress(
+UINT_64 CiLib::HwlComputeMetadataNibbleAddress(
UINT_64 uncompressedDataByteAddress,
UINT_64 dataBaseByteAddress,
UINT_64 metadataBaseByteAddress,
UINT_32 lsb = pipeBits + pipeInterleaveBits;
UINT_32 msb = bankBits - 1 + lsb;
- UINT_64 bankDataBits = AddrGetBits(offset, msb, lsb);
+ UINT_64 bankDataBits = GetBits(offset, msb, lsb);
///--------------------------------------------------------------------------------------------
/// Save pipe data bits
lsb = pipeInterleaveBits;
msb = pipeBits - 1 + lsb;
- UINT_64 pipeDataBits = AddrGetBits(offset, msb, lsb);
+ UINT_64 pipeDataBits = GetBits(offset, msb, lsb);
///--------------------------------------------------------------------------------------------
/// Remove pipe and bank bits
lsb = pipeInterleaveBits;
msb = dataMacrotileBits - 1;
- UINT_64 offsetWithoutPipeBankBits = AddrRemoveBits(offset, msb, lsb);
+ UINT_64 offsetWithoutPipeBankBits = RemoveBits(offset, msb, lsb);
ADDR_ASSERT((0 != blockByteSize));
UINT_64 blockInBankpipe = offsetWithoutPipeBankBits / blockByteSize;
}
msb = bankBits - 1 + lsb;
- UINT_64 blockInBankpipeWithBankBits = AddrInsertBits(blockInBankpipe, bankDataBits, msb, lsb);
+ UINT_64 blockInBankpipeWithBankBits = InsertBits(blockInBankpipe, bankDataBits, msb, lsb);
/// NOTE *2 because we are converting to Nibble address in this step
UINT_64 metaAddressInPipe = blockInBankpipeWithBankBits * 2 * metadataBitSize / 8;
///--------------------------------------------------------------------------------------------
lsb = pipeInterleaveBits + 1; ///<+1 due to Nibble address now gives interleave bits extra lsb.
msb = pipeBits - 1 + lsb;
- UINT_64 metadataAddress = AddrInsertBits(metaAddressInPipe, pipeDataBits, msb, lsb);
+ UINT_64 metadataAddress = InsertBits(metaAddressInPipe, pipeDataBits, msb, lsb);
return metadataAddress;
}
/**
****************************************************************************************************
-* CiAddrLib::HwlPadDimensions
+* CiLib::HwlPadDimensions
*
* @brief
* Helper function to pad dimensions
*
****************************************************************************************************
*/
-VOID CiAddrLib::HwlPadDimensions(
+VOID CiLib::HwlPadDimensions(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* CiAddrLib::HwlGetMaxAlignments
+* CiLib::HwlGetMaxAlignments
*
* @brief
* Gets maximum alignments
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE CiAddrLib::HwlGetMaxAlignments(
+ADDR_E_RETURNCODE CiLib::HwlGetMaxAlignments(
ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure
) const
{
return ADDR_OK;
}
-
+} // V1
+} // Addr
/**
****************************************************************************************************
* @file ciaddrlib.h
-* @brief Contains the CiAddrLib class definition.
+* @brief Contains the CiLib class definition.
****************************************************************************************************
*/
#include "addrlib1.h"
#include "siaddrlib.h"
+namespace Addr
+{
+namespace V1
+{
+
/**
****************************************************************************************************
* @brief CI specific settings structure.
* function set.
****************************************************************************************************
*/
-class CiAddrLib : public SiAddrLib
+class CiLib : public SiLib
{
public:
- /// Creates CiAddrLib object
- static AddrLib* CreateObj(const AddrClient* pClient)
+ /// Creates CiLib object
+ static Addr::Lib* CreateObj(const Client* pClient)
{
- return new(pClient) CiAddrLib(pClient);
+ return new(pClient) CiLib(pClient);
}
private:
- CiAddrLib(const AddrClient* pClient);
- virtual ~CiAddrLib();
+ CiLib(const Client* pClient);
+ virtual ~CiLib();
protected:
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut);
- virtual AddrChipFamily HwlConvertChipFamily(
+ virtual ChipFamily HwlConvertChipFamily(
UINT_32 uChipFamily, UINT_32 uChipRevision);
virtual BOOL_32 HwlInitGlobalParams(
ADDR_TILEINFO* pTileInfo, AddrTileMode* pTileMode = NULL, AddrTileType* pTileType = NULL
) const;
- // Sub-hwl interface - defined in EgBasedAddrLib
+ // Sub-hwl interface - defined in EgBasedLib
virtual VOID HwlSetupTileInfo(
AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
private:
VOID ReadGbTileMode(
- UINT_32 regValue, AddrTileConfig* pCfg) const;
+ UINT_32 regValue, TileConfig* pCfg) const;
VOID ReadGbMacroTileCfg(
UINT_32 regValue, ADDR_TILEINFO* pCfg) const;
CIChipSettings m_settings;
};
+} // V1
+} // Addr
+
#endif
/**
****************************************************************************************************
* @file egbaddrlib.cpp
-* @brief Contains the EgBasedAddrLib class implementation
+* @brief Contains the EgBasedLib class implementation
****************************************************************************************************
*/
#include "egbaddrlib.h"
+namespace Addr
+{
+namespace V1
+{
+
/**
****************************************************************************************************
-* EgBasedAddrLib::EgBasedAddrLib
+* EgBasedLib::EgBasedLib
*
* @brief
* Constructor
*
****************************************************************************************************
*/
-EgBasedAddrLib::EgBasedAddrLib(const AddrClient* pClient) :
- AddrLib1(pClient),
+EgBasedLib::EgBasedLib(const Client* pClient) :
+ Lib(pClient),
m_ranks(0),
m_logicalBanks(0),
m_bankInterleave(1)
/**
****************************************************************************************************
-* EgBasedAddrLib::~EgBasedAddrLib
+* EgBasedLib::~EgBasedLib
*
* @brief
* Destructor
****************************************************************************************************
*/
-EgBasedAddrLib::~EgBasedAddrLib()
+EgBasedLib::~EgBasedLib()
{
}
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeSurfaceInfo
+* EgBasedLib::DispatchComputeSurfaceInfo
*
* @brief
* Compute surface sizes include padded pitch,height,slices,total size in bytes,
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::DispatchComputeSurfaceInfo(
+BOOL_32 EgBasedLib::DispatchComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceInfoLinear
+* EgBasedLib::ComputeSurfaceInfoLinear
*
* @brief
* Compute linear surface sizes include padded pitch, height, slices, total size in
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoLinear(
+BOOL_32 EgBasedLib::ComputeSurfaceInfoLinear(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure
UINT_32 padDims ///< [in] Dimensions to padd
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceInfoMicroTiled
+* EgBasedLib::ComputeSurfaceInfoMicroTiled
*
* @brief
* Compute 1D/Micro Tiled surface sizes include padded pitch, height, slices, total
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMicroTiled(
+BOOL_32 EgBasedLib::ComputeSurfaceInfoMicroTiled(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure
UINT_32 padDims, ///< [in] Dimensions to padd
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceInfoMacroTiled
+* EgBasedLib::ComputeSurfaceInfoMacroTiled
*
* @brief
* Compute 2D/macro tiled surface sizes include padded pitch, height, slices, total
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMacroTiled(
+BOOL_32 EgBasedLib::ComputeSurfaceInfoMacroTiled(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut, ///< [out] Output structure
UINT_32 padDims, ///< [in] Dimensions to padd
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceAlignmentsLinear
+* EgBasedLib::ComputeSurfaceAlignmentsLinear
*
* @brief
* Compute linear surface alignment, calculation results are returned through
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsLinear(
+BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsLinear(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled
+* EgBasedLib::ComputeSurfaceAlignmentsMicroTiled
*
* @brief
* Compute 1D tiled surface alignment, calculation results are returned through
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMicroTiled(
+BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsMicroTiled(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlReduceBankWidthHeight
+* EgBasedLib::HwlReduceBankWidthHeight
*
* @brief
* Additional checks, reduce bankHeight/bankWidth if needed and possible
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::HwlReduceBankWidthHeight(
+BOOL_32 EgBasedLib::HwlReduceBankWidthHeight(
UINT_32 tileSize, ///< [in] tile size
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled
+* EgBasedLib::ComputeSurfaceAlignmentsMacroTiled
*
* @brief
* Compute 2D tiled surface alignment, calculation results are returned through
* TRUE if no error occurs
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::ComputeSurfaceAlignmentsMacroTiled(
+BOOL_32 EgBasedLib::ComputeSurfaceAlignmentsMacroTiled(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::SanityCheckMacroTiled
+* EgBasedLib::SanityCheckMacroTiled
*
* @brief
* Check if macro-tiled parameters are valid
* TRUE if valid
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::SanityCheckMacroTiled(
+BOOL_32 EgBasedLib::SanityCheckMacroTiled(
ADDR_TILEINFO* pTileInfo ///< [in] macro-tiled parameters
) const
{
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceMipLevelTileMode
+* EgBasedLib::ComputeSurfaceMipLevelTileMode
*
* @brief
* Compute valid tile mode for surface mipmap sub-levels
* Suitable tile mode
****************************************************************************************************
*/
-AddrTileMode EgBasedAddrLib::ComputeSurfaceMipLevelTileMode(
+AddrTileMode EgBasedLib::ComputeSurfaceMipLevelTileMode(
AddrTileMode baseTileMode, ///< [in] base tile mode
UINT_32 bpp, ///< [in] bits per pixels
UINT_32 pitch, ///< [in] current level pitch
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlDegradeBaseLevel
+* EgBasedLib::HwlDegradeBaseLevel
* @brief
* Check if degrade is needed for base level
* @return
* TRUE if degrade is suggested
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::HwlDegradeBaseLevel(
+BOOL_32 EgBasedLib::HwlDegradeBaseLevel(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const
{
BOOL_32 degrade = FALSE;
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlDegradeThickTileMode
+* EgBasedLib::HwlDegradeThickTileMode
*
* @brief
* Degrades valid tile mode for thick modes if needed
* Suitable tile mode
****************************************************************************************************
*/
-AddrTileMode EgBasedAddrLib::HwlDegradeThickTileMode(
+AddrTileMode EgBasedLib::HwlDegradeThickTileMode(
AddrTileMode baseTileMode, ///< [in] base tile mode
UINT_32 numSlices, ///< [in] current number of slices
UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord
+* EgBasedLib::DispatchComputeSurfaceAddrFromCoord
*
* @brief
* Compute surface address from given coord (x, y, slice,sample)
* Address in bytes
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord(
+UINT_64 EgBasedLib::DispatchComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeMacroTileEquation
+* EgBasedLib::ComputeMacroTileEquation
*
* @brief
* Computes the address equation in macro tile
* If equation can be computed
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::ComputeMacroTileEquation(
+ADDR_E_RETURNCODE EgBasedLib::ComputeMacroTileEquation(
UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel
AddrTileMode tileMode, ///< [in] tile mode
AddrTileType microTileType, ///< [in] micro tiling type
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled
+* EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled
*
* @brief
* Computes the surface address and bit position from a
* The byte address
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMacroTiled(
+UINT_64 EgBasedLib::ComputeSurfaceAddrFromCoordMacroTiled(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled
+* EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled
*
* @brief
* Computes the surface address and bit position from a coordinate for 1D tilied
* The byte address
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::ComputeSurfaceAddrFromCoordMicroTiled(
+UINT_64 EgBasedLib::ComputeSurfaceAddrFromCoordMicroTiled(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputePixelCoordFromOffset
+* EgBasedLib::HwlComputePixelCoordFromOffset
*
* @brief
* Compute pixel coordinate from offset inside a micro tile
* N/A
****************************************************************************************************
*/
-VOID EgBasedAddrLib::HwlComputePixelCoordFromOffset(
+VOID EgBasedLib::HwlComputePixelCoordFromOffset(
UINT_32 offset, ///< [in] offset inside micro tile in bits
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 numSamples, ///< [in] number of samples
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddrDispatch
+* EgBasedLib::DispatchComputeSurfaceCoordFromAddrDispatch
*
* @brief
* Compute (x,y,slice,sample) coordinates from surface address
* N/A
****************************************************************************************************
*/
-VOID EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddr(
+VOID EgBasedLib::DispatchComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled
+* EgBasedLib::ComputeSurfaceCoordFromAddrMacroTiled
*
* @brief
* Compute surface coordinates from address for macro tiled surface
* N/A
****************************************************************************************************
*/
-VOID EgBasedAddrLib::ComputeSurfaceCoordFromAddrMacroTiled(
+VOID EgBasedLib::ComputeSurfaceCoordFromAddrMacroTiled(
UINT_64 addr, ///< [in] byte address
UINT_32 bitPosition, ///< [in] bit position
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSurfaceCoord2DFromBankPipe
+* EgBasedLib::ComputeSurfaceCoord2DFromBankPipe
*
* @brief
* Compute surface x,y coordinates from bank/pipe info
* N/A
****************************************************************************************************
*/
-VOID EgBasedAddrLib::ComputeSurfaceCoord2DFromBankPipe(
+VOID EgBasedLib::ComputeSurfaceCoord2DFromBankPipe(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlExtractBankPipeSwizzle
+* EgBasedLib::HwlExtractBankPipeSwizzle
* @brief
-* Entry of EgBasedAddrLib ExtractBankPipeSwizzle
+* Entry of EgBasedLib ExtractBankPipeSwizzle
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlExtractBankPipeSwizzle(
+ADDR_E_RETURNCODE EgBasedLib::HwlExtractBankPipeSwizzle(
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlCombineBankPipeSwizzle
+* EgBasedLib::HwlCombineBankPipeSwizzle
* @brief
* Combine bank/pipe swizzle
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlCombineBankPipeSwizzle(
+ADDR_E_RETURNCODE EgBasedLib::HwlCombineBankPipeSwizzle(
UINT_32 bankSwizzle, ///< [in] bank swizzle
UINT_32 pipeSwizzle, ///< [in] pipe swizzle
ADDR_TILEINFO* pTileInfo, ///< [in] tile info
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeBaseSwizzle
+* EgBasedLib::HwlComputeBaseSwizzle
* @brief
* Compute base swizzle
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeBaseSwizzle(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeBaseSwizzle(
const ADDR_COMPUTE_BASE_SWIZZLE_INPUT* pIn,
ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT* pOut
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ExtractBankPipeSwizzle
+* EgBasedLib::ExtractBankPipeSwizzle
* @brief
* Extract bank/pipe swizzle from base256b
* @return
* N/A
****************************************************************************************************
*/
-VOID EgBasedAddrLib::ExtractBankPipeSwizzle(
+VOID EgBasedLib::ExtractBankPipeSwizzle(
UINT_32 base256b, ///< [in] input base256b register value
ADDR_TILEINFO* pTileInfo, ///< [in] 2D tile parameters. Client must provide all data
UINT_32* pBankSwizzle, ///< [out] bank swizzle
/**
****************************************************************************************************
-* EgBasedAddrLib::GetBankPipeSwizzle
+* EgBasedLib::GetBankPipeSwizzle
* @brief
* Combine bank/pipe swizzle
* @return
* Base256b bits (only filled bank/pipe bits)
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::GetBankPipeSwizzle(
+UINT_32 EgBasedLib::GetBankPipeSwizzle(
UINT_32 bankSwizzle, ///< [in] bank swizzle
UINT_32 pipeSwizzle, ///< [in] pipe swizzle
UINT_64 baseAddr, ///< [in] base address
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeSliceTileSwizzle
+* EgBasedLib::ComputeSliceTileSwizzle
* @brief
* Compute cubemap/3d texture faces/slices tile swizzle
* @return
* Tile swizzle
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeSliceTileSwizzle(
+UINT_32 EgBasedLib::ComputeSliceTileSwizzle(
AddrTileMode tileMode, ///< [in] Tile mode
UINT_32 baseSwizzle, ///< [in] Base swizzle
UINT_32 slice, ///< [in] Slice index, Cubemap face index, 0 means +X
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeQbStereoRightSwizzle
+* EgBasedLib::HwlComputeQbStereoRightSwizzle
*
* @brief
* Compute right eye swizzle
* swizzle
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::HwlComputeQbStereoRightSwizzle(
+UINT_32 EgBasedLib::HwlComputeQbStereoRightSwizzle(
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pInfo ///< [in] Surface info, must be valid
) const
{
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeBankFromCoord
+* EgBasedLib::ComputeBankFromCoord
*
* @brief
* Compute bank number from coordinates
* Bank number
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeBankFromCoord(
+UINT_32 EgBasedLib::ComputeBankFromCoord(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeBankFromAddr
+* EgBasedLib::ComputeBankFromAddr
*
* @brief
* Compute the bank number from an address
* Bank number
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeBankFromAddr(
+UINT_32 EgBasedLib::ComputeBankFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 numBanks, ///< [in] number of banks
UINT_32 numPipes ///< [in] number of pipes
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputePipeRotation
+* EgBasedLib::ComputePipeRotation
*
* @brief
* Compute pipe rotation value
* Pipe rotation
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputePipeRotation(
+UINT_32 EgBasedLib::ComputePipeRotation(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 numPipes ///< [in] number of pipes
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeBankRotation
+* EgBasedLib::ComputeBankRotation
*
* @brief
* Compute bank rotation value
* Bank rotation
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeBankRotation(
+UINT_32 EgBasedLib::ComputeBankRotation(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 numBanks, ///< [in] number of banks
UINT_32 numPipes ///< [in] number of pipes
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeHtileBytes
+* EgBasedLib::ComputeHtileBytes
*
* @brief
* Compute htile size in bytes
* Htile size in bytes
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::ComputeHtileBytes(
+UINT_64 EgBasedLib::ComputeHtileBytes(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeFmaskInfo
+* EgBasedLib::DispatchComputeFmaskInfo
*
* @brief
* Compute fmask sizes include padded pitch, height, slices, total size in bytes,
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::DispatchComputeFmaskInfo(
+ADDR_E_RETURNCODE EgBasedLib::DispatchComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut) ///< [out] output structure
{
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlFmaskSurfaceInfo
+* EgBasedLib::HwlFmaskSurfaceInfo
* @brief
-* Entry of EgBasedAddrLib ComputeFmaskInfo
+* Entry of EgBasedLib ComputeFmaskInfo
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskInfo(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pOut ///< [out] output structure
)
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeFmaskAddrFromCoord
+* EgBasedLib::HwlComputeFmaskAddrFromCoord
* @brief
-* Entry of EgBasedAddrLib ComputeFmaskAddrFromCoord
+* Entry of EgBasedLib ComputeFmaskAddrFromCoord
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskAddrFromCoord(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeFmaskCoordFromAddr
+* EgBasedLib::HwlComputeFmaskCoordFromAddr
* @brief
-* Entry of EgBasedAddrLib ComputeFmaskCoordFromAddr
+* Entry of EgBasedLib ComputeFmaskCoordFromAddr
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeFmaskCoordFromAddr(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
#if ADDR_AM_BUILD
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord
+* EgBasedLib::DispatchComputeFmaskAddrFromCoord
*
* @brief
* Computes the FMASK address and bit position from a coordinate.
* The byte address
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::DispatchComputeFmaskAddrFromCoord(
+UINT_64 EgBasedLib::DispatchComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled
+* EgBasedLib::ComputeFmaskAddrFromCoordMicroTiled
*
* @brief
* Computes the FMASK address and bit position from a coordinate for 1D tilied (micro
* The byte address
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled(
+UINT_64 EgBasedLib::ComputeFmaskAddrFromCoordMicroTiled(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled
+* EgBasedLib::ComputeFmaskAddrFromCoordMacroTiled
*
* @brief
* Computes the FMASK address and bit position from a coordinate for 2D tilied (macro
* The byte address
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled(
+UINT_64 EgBasedLib::ComputeFmaskAddrFromCoordMacroTiled(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled
+* EgBasedLib::ComputeFmaskCoordFromAddrMicroTiled
*
* @brief
* Compute (x,y,slice,sample,plane) coordinates from fmask address
*
****************************************************************************************************
*/
-VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled(
+VOID EgBasedLib::ComputeFmaskCoordFromAddrMicroTiled(
UINT_64 addr, ///< [in] byte address
UINT_32 bitPosition,///< [in] bit position
UINT_32 pitch, ///< [in] pitch in pixels
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled
+* EgBasedLib::ComputeFmaskCoordFromAddrMacroTiled
*
* @brief
* Compute (x,y,slice,sample,plane) coordinates from
*
****************************************************************************************************
*/
-VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled(
+VOID EgBasedLib::ComputeFmaskCoordFromAddrMacroTiled(
UINT_64 addr, ///< [in] byte address
UINT_32 bitPosition,///< [in] bit position
UINT_32 pitch, ///< [in] pitch in pixels
/**
****************************************************************************************************
-* EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr
+* EgBasedLib::DispatchComputeFmaskCoordFromAddr
*
* @brief
* Compute (x,y,slice,sample,plane) coordinates from
*
****************************************************************************************************
*/
-VOID EgBasedAddrLib::DispatchComputeFmaskCoordFromAddr(
+VOID EgBasedLib::DispatchComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples
+* EgBasedLib::ComputeFmaskNumPlanesFromNumSamples
*
* @brief
* Compute fmask number of planes from number of samples
* Number of planes
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeFmaskNumPlanesFromNumSamples(
+UINT_32 EgBasedLib::ComputeFmaskNumPlanesFromNumSamples(
UINT_32 numSamples) ///< [in] number of samples
{
UINT_32 numPlanes;
/**
****************************************************************************************************
-* EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples
+* EgBasedLib::ComputeFmaskResolvedBppFromNumSamples
*
* @brief
* Compute resolved fmask effective bpp based on number of samples
* bpp
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::ComputeFmaskResolvedBppFromNumSamples(
+UINT_32 EgBasedLib::ComputeFmaskResolvedBppFromNumSamples(
UINT_32 numSamples) ///< number of samples
{
UINT_32 bpp;
/**
****************************************************************************************************
-* EgBasedAddrLib::IsTileInfoAllZero
+* EgBasedLib::IsTileInfoAllZero
*
* @brief
* Return TRUE if all field are zero
* Since NULL input is consider to be all zero
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::IsTileInfoAllZero(
+BOOL_32 EgBasedLib::IsTileInfoAllZero(
ADDR_TILEINFO* pTileInfo)
{
BOOL_32 allZero = TRUE;
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlTileInfoEqual
+* EgBasedLib::HwlTileInfoEqual
*
* @brief
* Return TRUE if all field are equal
* Only takes care of current HWL's data
****************************************************************************************************
*/
-BOOL_32 EgBasedAddrLib::HwlTileInfoEqual(
+BOOL_32 EgBasedLib::HwlTileInfoEqual(
const ADDR_TILEINFO* pLeft, ///<[in] Left compare operand
const ADDR_TILEINFO* pRight ///<[in] Right compare operand
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlConvertTileInfoToHW
+* EgBasedLib::HwlConvertTileInfoToHW
* @brief
-* Entry of EgBasedAddrLib ConvertTileInfoToHW
+* Entry of EgBasedLib ConvertTileInfoToHW
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlConvertTileInfoToHW(
+ADDR_E_RETURNCODE EgBasedLib::HwlConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeSurfaceInfo
+* EgBasedLib::HwlComputeSurfaceInfo
* @brief
-* Entry of EgBasedAddrLib ComputeSurfaceInfo
+* Entry of EgBasedLib ComputeSurfaceInfo
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceInfo(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeSurfaceAddrFromCoord
+* EgBasedLib::HwlComputeSurfaceAddrFromCoord
* @brief
-* Entry of EgBasedAddrLib ComputeSurfaceAddrFromCoord
+* Entry of EgBasedLib ComputeSurfaceAddrFromCoord
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceAddrFromCoord(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeSurfaceCoordFromAddr
+* EgBasedLib::HwlComputeSurfaceCoordFromAddr
* @brief
-* Entry of EgBasedAddrLib ComputeSurfaceCoordFromAddr
+* Entry of EgBasedLib ComputeSurfaceCoordFromAddr
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceCoordFromAddr(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeSliceTileSwizzle
+* EgBasedLib::HwlComputeSliceTileSwizzle
* @brief
-* Entry of EgBasedAddrLib ComputeSurfaceCoordFromAddr
+* Entry of EgBasedLib ComputeSurfaceCoordFromAddr
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSliceTileSwizzle(
+ADDR_E_RETURNCODE EgBasedLib::HwlComputeSliceTileSwizzle(
const ADDR_COMPUTE_SLICESWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SLICESWIZZLE_OUTPUT* pOut ///< [out] output structure
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeHtileBpp
+* EgBasedLib::HwlComputeHtileBpp
*
* @brief
* Compute htile bpp
* Htile bpp
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::HwlComputeHtileBpp(
+UINT_32 EgBasedLib::HwlComputeHtileBpp(
BOOL_32 isWidth8, ///< [in] TRUE if block width is 8
BOOL_32 isHeight8 ///< [in] TRUE if block height is 8
) const
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlComputeHtileBaseAlign
+* EgBasedLib::HwlComputeHtileBaseAlign
*
* @brief
* Compute htile base alignment
* Htile base alignment
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::HwlComputeHtileBaseAlign(
+UINT_32 EgBasedLib::HwlComputeHtileBaseAlign(
BOOL_32 isTcCompatible, ///< [in] if TC compatible
BOOL_32 isLinear, ///< [in] if it is linear mode
ADDR_TILEINFO* pTileInfo ///< [in] Tile info
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled
+* EgBasedLib::HwlGetPitchAlignmentMicroTiled
*
* @brief
* Compute 1D tiled surface pitch alignment, calculation results are returned through
* pitch alignment
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled(
+UINT_32 EgBasedLib::HwlGetPitchAlignmentMicroTiled(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled
+* EgBasedLib::HwlGetSizeAdjustmentMicroTiled
*
* @brief
* Adjust 1D tiled surface pitch and slice size
* Logical slice size in bytes
****************************************************************************************************
*/
-UINT_64 EgBasedAddrLib::HwlGetSizeAdjustmentMicroTiled(
+UINT_64 EgBasedLib::HwlGetSizeAdjustmentMicroTiled(
UINT_32 thickness, ///< [in] thickness
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* EgBasedAddrLib::HwlStereoCheckRightOffsetPadding
+* EgBasedLib::HwlStereoCheckRightOffsetPadding
*
* @brief
* check if the height needs extra padding for stereo right eye offset, to avoid swizzling
*
****************************************************************************************************
*/
-UINT_32 EgBasedAddrLib::HwlStereoCheckRightOffsetPadding(
+UINT_32 EgBasedLib::HwlStereoCheckRightOffsetPadding(
ADDR_TILEINFO* pTileInfo ///< Tiling info
) const
{
return stereoHeightAlign;
}
+} // V1
+} // Addr
/**
****************************************************************************************************
* @file egbaddrlib.h
-* @brief Contains the EgBasedAddrLib class definition.
+* @brief Contains the EgBasedLib class definition.
****************************************************************************************************
*/
#include "addrlib1.h"
-
+namespace Addr
+{
+namespace V1
+{
/// Structures for functions
struct CoordFromBankPipe
{
* @note Abstract class
****************************************************************************************************
*/
-class EgBasedAddrLib : public AddrLib1
+class EgBasedLib : public Lib
{
protected:
- EgBasedAddrLib(const AddrClient* pClient);
- virtual ~EgBasedAddrLib();
+ EgBasedLib(const Client* pClient);
+ virtual ~EgBasedLib();
public:
UINT_32 m_bankInterleave; ///< Bank interleave, as a multiple of pipe interleave size
};
+} // V1
+} // Addr
+
#endif
/**
****************************************************************************************************
* @file siaddrlib.cpp
-* @brief Contains the implementation for the SiAddrLib class.
+* @brief Contains the implementation for the SiLib class.
****************************************************************************************************
*/
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
+namespace Addr
+{
/**
****************************************************************************************************
-* AddrSiHwlInit
+* SiHwlInit
*
* @brief
-* Creates an SiAddrLib object.
+* Creates an SiLib object.
*
* @return
-* Returns an SiAddrLib object pointer.
+* Returns an SiLib object pointer.
****************************************************************************************************
*/
-AddrLib* AddrSIHwlInit(const AddrClient* pClient)
+Lib* SiHwlInit(const Client* pClient)
{
- return SiAddrLib::CreateObj(pClient);
+ return V1::SiLib::CreateObj(pClient);
}
+namespace V1
+{
+
/**
****************************************************************************************************
-* SiAddrLib::SiAddrLib
+* SiLib::SiLib
*
* @brief
* Constructor
*
****************************************************************************************************
*/
-SiAddrLib::SiAddrLib(const AddrClient* pClient) :
- EgBasedAddrLib(pClient),
+SiLib::SiLib(const Client* pClient)
+ :
+ EgBasedLib(pClient),
m_noOfEntries(0),
m_numEquations(0)
{
/**
****************************************************************************************************
-* SiAddrLib::~SiAddrLib
+* SiLib::~SiLib
*
* @brief
* Destructor
****************************************************************************************************
*/
-SiAddrLib::~SiAddrLib()
+SiLib::~SiLib()
{
}
/**
****************************************************************************************************
-* SiAddrLib::HwlGetPipes
+* SiLib::HwlGetPipes
*
* @brief
* Get number pipes
* num pipes
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlGetPipes(
+UINT_32 SiLib::HwlGetPipes(
const ADDR_TILEINFO* pTileInfo ///< [in] Tile info
) const
{
/**
****************************************************************************************************
-* SiAddrLib::GetPipePerSurf
+* SiLib::GetPipePerSurf
* @brief
* get pipe num base on inputing tileinfo->pipeconfig
* @return
* pipe number
****************************************************************************************************
*/
-UINT_32 SiAddrLib::GetPipePerSurf(
+UINT_32 SiLib::GetPipePerSurf(
AddrPipeCfg pipeConfig ///< [in] pipe config
) const
{
/**
****************************************************************************************************
-* SiAddrLib::ComputeBankEquation
+* SiLib::ComputeBankEquation
*
* @brief
* Compute bank equation
* If equation can be computed
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::ComputeBankEquation(
+ADDR_E_RETURNCODE SiLib::ComputeBankEquation(
UINT_32 log2BytesPP, ///< [in] log2 of bytes per pixel
UINT_32 threshX, ///< [in] threshold for x channel
UINT_32 threshY, ///< [in] threshold for y channel
/**
****************************************************************************************************
-* SiAddrLib::ComputePipeEquation
+* SiLib::ComputePipeEquation
*
* @brief
* Compute pipe equation
* If equation can be computed
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::ComputePipeEquation(
+ADDR_E_RETURNCODE SiLib::ComputePipeEquation(
UINT_32 log2BytesPP, ///< [in] Log2 of bytes per pixel
UINT_32 threshX, ///< [in] Threshold for X channel
UINT_32 threshY, ///< [in] Threshold for Y channel
/**
****************************************************************************************************
-* SiAddrLib::ComputePipeFromCoord
+* SiLib::ComputePipeFromCoord
*
* @brief
* Compute pipe number from coordinates
* Pipe number
****************************************************************************************************
*/
-UINT_32 SiAddrLib::ComputePipeFromCoord(
+UINT_32 SiLib::ComputePipeFromCoord(
UINT_32 x, ///< [in] x coordinate
UINT_32 y, ///< [in] y coordinate
UINT_32 slice, ///< [in] slice index
/**
****************************************************************************************************
-* SiAddrLib::ComputeTileCoordFromPipeAndElemIdx
+* SiLib::ComputeTileCoordFromPipeAndElemIdx
*
* @brief
* Compute (x,y) of a tile within a macro tile from address
* Pipe number
****************************************************************************************************
*/
-VOID SiAddrLib::ComputeTileCoordFromPipeAndElemIdx(
+VOID SiLib::ComputeTileCoordFromPipeAndElemIdx(
UINT_32 elemIdx, ///< [in] per pipe element index within a macro tile
UINT_32 pipe, ///< [in] pipe index
AddrPipeCfg pipeCfg, ///< [in] pipe config
/**
****************************************************************************************************
-* SiAddrLib::TileCoordToMaskElementIndex
+* SiLib::TileCoordToMaskElementIndex
*
* @brief
* Compute element index from coordinates in tiles
* Element index
****************************************************************************************************
*/
-UINT_32 SiAddrLib::TileCoordToMaskElementIndex(
+UINT_32 SiLib::TileCoordToMaskElementIndex(
UINT_32 tx, ///< [in] x coord, in Tiles
UINT_32 ty, ///< [in] y coord, in Tiles
AddrPipeCfg pipeConfig, ///< [in] pipe config
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeTileDataWidthAndHeightLinear
+* SiLib::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 SiAddrLib::HwlComputeTileDataWidthAndHeightLinear(
+VOID SiLib::HwlComputeTileDataWidthAndHeightLinear(
UINT_32* pMacroWidth, ///< [out] macro tile width
UINT_32* pMacroHeight, ///< [out] macro tile height
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeHtileBytes
+* SiLib::HwlComputeHtileBytes
*
* @brief
* Compute htile size in bytes
* Htile size in bytes
****************************************************************************************************
*/
-UINT_64 SiAddrLib::HwlComputeHtileBytes(
+UINT_64 SiLib::HwlComputeHtileBytes(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 bpp, ///< [in] bits per pixel
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeXmaskAddrFromCoord
+* SiLib::HwlComputeXmaskAddrFromCoord
*
* @brief
* Compute address from coordinates for htile/cmask
* Byte address
****************************************************************************************************
*/
-UINT_64 SiAddrLib::HwlComputeXmaskAddrFromCoord(
+UINT_64 SiLib::HwlComputeXmaskAddrFromCoord(
UINT_32 pitch, ///< [in] pitch
UINT_32 height, ///< [in] height
UINT_32 x, ///< [in] x coord
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeXmaskCoordFromAddr
+* SiLib::HwlComputeXmaskCoordFromAddr
*
* @brief
* Compute the coord from an address of a cmask/htile
* This method is reused by htile, so rename to Xmask
****************************************************************************************************
*/
-VOID SiAddrLib::HwlComputeXmaskCoordFromAddr(
+VOID SiLib::HwlComputeXmaskCoordFromAddr(
UINT_64 addr, ///< [in] address
UINT_32 bitPosition, ///< [in] bitPosition in a byte
UINT_32 pitch, ///< [in] pitch
/**
****************************************************************************************************
-* SiAddrLib::HwlGetPitchAlignmentLinear
+* SiLib::HwlGetPitchAlignmentLinear
* @brief
* Get pitch alignment
* @return
* pitch alignment
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlGetPitchAlignmentLinear(
+UINT_32 SiLib::HwlGetPitchAlignmentLinear(
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags ///< [in] surface flags
) const
/**
****************************************************************************************************
-* SiAddrLib::HwlGetSizeAdjustmentLinear
+* SiLib::HwlGetSizeAdjustmentLinear
*
* @brief
* Adjust linear surface pitch and slice size
* Logical slice size in bytes
****************************************************************************************************
*/
-UINT_64 SiAddrLib::HwlGetSizeAdjustmentLinear(
+UINT_64 SiLib::HwlGetSizeAdjustmentLinear(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
UINT_32 numSamples, ///< [in] number of samples
/**
****************************************************************************************************
-* SiAddrLib::HwlPreHandleBaseLvl3xPitch
+* SiLib::HwlPreHandleBaseLvl3xPitch
*
* @brief
* Pre-handler of 3x pitch (96 bit) adjustment
* Expected pitch
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch(
+UINT_32 SiLib::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
// do here
if (pIn->flags.pow2Pad == FALSE)
{
- AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
+ Addr::V1::Lib::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
}
else
{
/**
****************************************************************************************************
-* SiAddrLib::HwlPostHandleBaseLvl3xPitch
+* SiLib::HwlPostHandleBaseLvl3xPitch
*
* @brief
* Post-handler of 3x pitch adjustment
* Expected pitch
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch(
+UINT_32 SiLib::HwlPostHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
// From SI, the pitch is expanded 3x first, then padded to pow2, so no special handler here
if (pIn->flags.pow2Pad == FALSE)
{
- AddrLib1::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
+ Addr::V1::Lib::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
}
return expPitch;
/**
****************************************************************************************************
-* SiAddrLib::HwlGetPitchAlignmentMicroTiled
+* SiLib::HwlGetPitchAlignmentMicroTiled
*
* @brief
* Compute 1D tiled surface pitch alignment
* pitch alignment
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlGetPitchAlignmentMicroTiled(
+UINT_32 SiLib::HwlGetPitchAlignmentMicroTiled(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
if (flags.qbStereo)
{
- pitchAlign = EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled(tileMode,bpp,flags,numSamples);
+ pitchAlign = EgBasedLib::HwlGetPitchAlignmentMicroTiled(tileMode,bpp,flags,numSamples);
}
else
{
/**
****************************************************************************************************
-* SiAddrLib::HwlGetSizeAdjustmentMicroTiled
+* SiLib::HwlGetSizeAdjustmentMicroTiled
*
* @brief
* Adjust 1D tiled surface pitch and slice size
* Logical slice size in bytes
****************************************************************************************************
*/
-UINT_64 SiAddrLib::HwlGetSizeAdjustmentMicroTiled(
+UINT_64 SiLib::HwlGetSizeAdjustmentMicroTiled(
UINT_32 thickness, ///< [in] thickness
UINT_32 bpp, ///< [in] bits per pixel
ADDR_SURFACE_FLAGS flags, ///< [in] surface flags
/**
****************************************************************************************************
-* SiAddrLib::HwlConvertChipFamily
+* SiLib::HwlConvertChipFamily
*
* @brief
-* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision
+* Convert familyID defined in atiid.h to ChipFamily and set m_chipFamily/m_chipRevision
* @return
-* AddrChipFamily
+* ChipFamily
****************************************************************************************************
*/
-AddrChipFamily SiAddrLib::HwlConvertChipFamily(
+ChipFamily SiLib::HwlConvertChipFamily(
UINT_32 uChipFamily, ///< [in] chip family defined in atiih.h
UINT_32 uChipRevision) ///< [in] chip revision defined in "asic_family"_id.h
{
- AddrChipFamily family = ADDR_CHIP_FAMILY_SI;
+ ChipFamily family = ADDR_CHIP_FAMILY_SI;
switch (uChipFamily)
{
/**
****************************************************************************************************
-* SiAddrLib::HwlSetupTileInfo
+* SiLib::HwlSetupTileInfo
*
* @brief
* Setup default value of tile info for SI
****************************************************************************************************
*/
-VOID SiAddrLib::HwlSetupTileInfo(
+VOID SiLib::HwlSetupTileInfo(
AddrTileMode tileMode, ///< [in] Tile mode
ADDR_SURFACE_FLAGS flags, ///< [in] Surface type flags
UINT_32 bpp, ///< [in] Bits per pixel
/**
****************************************************************************************************
-* SiAddrLib::DecodeGbRegs
+* SiLib::DecodeGbRegs
*
* @brief
* Decodes GB_ADDR_CONFIG and noOfBanks/noOfRanks
*
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::DecodeGbRegs(
+BOOL_32 SiLib::DecodeGbRegs(
const ADDR_REGISTER_VALUE* pRegValue) ///< [in] create input
{
GB_ADDR_CONFIG reg;
/**
****************************************************************************************************
-* SiAddrLib::HwlInitGlobalParams
+* SiLib::HwlInitGlobalParams
*
* @brief
* Initializes global parameters
*
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::HwlInitGlobalParams(
+BOOL_32 SiLib::HwlInitGlobalParams(
const ADDR_CREATE_INPUT* pCreateIn) ///< [in] create input
{
BOOL_32 valid = TRUE;
/**
****************************************************************************************************
-* SiAddrLib::HwlConvertTileInfoToHW
+* SiLib::HwlConvertTileInfoToHW
* @brief
* Entry of si's ConvertTileInfoToHW
* @return
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::HwlConvertTileInfoToHW(
+ADDR_E_RETURNCODE SiLib::HwlConvertTileInfoToHW(
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] input structure
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut ///< [out] output structure
) const
{
ADDR_E_RETURNCODE retCode = ADDR_OK;
- retCode = EgBasedAddrLib::HwlConvertTileInfoToHW(pIn, pOut);
+ retCode = EgBasedLib::HwlConvertTileInfoToHW(pIn, pOut);
if (retCode == ADDR_OK)
{
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe
+* SiLib::HwlComputeXmaskCoordYFrom8Pipe
*
* @brief
* Compute the Y coord which will be added to Xmask Y
* Y coord
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlComputeXmaskCoordYFrom8Pipe(
+UINT_32 SiLib::HwlComputeXmaskCoordYFrom8Pipe(
UINT_32 pipe, ///< [in] pipe id
UINT_32 x ///< [in] tile coord x, which is original x coord / 8
) const
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe
+* SiLib::HwlComputeSurfaceCoord2DFromBankPipe
*
* @brief
* Compute surface x,y coordinates from bank/pipe info
* N/A
****************************************************************************************************
*/
-VOID SiAddrLib::HwlComputeSurfaceCoord2DFromBankPipe(
+VOID SiLib::HwlComputeSurfaceCoord2DFromBankPipe(
AddrTileMode tileMode, ///< [in] tile mode
UINT_32* pX, ///< [in/out] x coordinate
UINT_32* pY, ///< [in/out] y coordinate
/**
****************************************************************************************************
-* SiAddrLib::HwlPreAdjustBank
+* SiLib::HwlPreAdjustBank
*
* @brief
* Adjust bank before calculating address acoording to bank/pipe
* Adjusted bank
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlPreAdjustBank(
+UINT_32 SiLib::HwlPreAdjustBank(
UINT_32 tileX, ///< [in] x coordinate in unit of tile
UINT_32 bank, ///< [in] bank
ADDR_TILEINFO* pTileInfo ///< [in] tile info
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeSurfaceInfo
+* SiLib::HwlComputeSurfaceInfo
*
* @brief
* Entry of si's ComputeSurfaceInfo
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::HwlComputeSurfaceInfo(
+ADDR_E_RETURNCODE SiLib::HwlComputeSurfaceInfo(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] output structure
) const
{
pOut->tileIndex = pIn->tileIndex;
- ADDR_E_RETURNCODE retCode = EgBasedAddrLib::HwlComputeSurfaceInfo(pIn, pOut);
+ ADDR_E_RETURNCODE retCode = EgBasedLib::HwlComputeSurfaceInfo(pIn, pOut);
UINT_32 tileIndex = static_cast<UINT_32>(pOut->tileIndex);
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeMipLevel
+* SiLib::HwlComputeMipLevel
* @brief
* Compute MipLevel info (including level 0)
* @return
* TRUE if HWL's handled
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::HwlComputeMipLevel(
+BOOL_32 SiLib::HwlComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
// Note: Don't check expand 3x formats(96 bit) as the basePitch is not pow2 even if
// we explicity set pow2Pad flag. The 3x base pitch is padded to pow2 but after being
// divided by expandX factor (3) - to program texture pitch, the basePitch is never pow2.
- if (AddrElemLib::IsExpand3x(pIn->format) == FALSE)
+ if (ElemLib::IsExpand3x(pIn->format) == FALSE)
{
// Sublevel pitches are generated from base level pitch instead of width on SI
// If pow2Pad is 0, we don't assert - as this is not really used for a mip chain
/**
****************************************************************************************************
-* SiAddrLib::HwlCheckLastMacroTiledLvl
+* SiLib::HwlCheckLastMacroTiledLvl
*
* @brief
* Sets pOut->last2DLevel to TRUE if it is
*
****************************************************************************************************
*/
-VOID SiAddrLib::HwlCheckLastMacroTiledLvl(
+VOID SiLib::HwlCheckLastMacroTiledLvl(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] Input structure
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [in/out] Output structure (used as input, too)
) const
nextHeight = pOut->height >> 1;
// Special format such as FMT_1 and FMT_32_32_32 can be linear only so we consider block
// compressed foramts
- if (AddrElemLib::IsBlockCompressed(pIn->format))
+ if (ElemLib::IsBlockCompressed(pIn->format))
{
nextHeight = (nextHeight + 3) / 4;
}
/**
****************************************************************************************************
-* SiAddrLib::HwlDegradeThickTileMode
+* SiLib::HwlDegradeThickTileMode
*
* @brief
* Degrades valid tile mode for thick modes if needed
* Suitable tile mode
****************************************************************************************************
*/
-AddrTileMode SiAddrLib::HwlDegradeThickTileMode(
+AddrTileMode SiLib::HwlDegradeThickTileMode(
AddrTileMode baseTileMode, ///< [in] base tile mode
UINT_32 numSlices, ///< [in] current number of slices
UINT_32* pBytesPerTile ///< [in/out] pointer to bytes per slice
) const
{
- return EgBasedAddrLib::HwlDegradeThickTileMode(baseTileMode, numSlices, pBytesPerTile);
+ return EgBasedLib::HwlDegradeThickTileMode(baseTileMode, numSlices, pBytesPerTile);
}
/**
****************************************************************************************************
-* SiAddrLib::HwlTileInfoEqual
+* SiLib::HwlTileInfoEqual
*
* @brief
* Return TRUE if all field are equal
* Only takes care of current HWL's data
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::HwlTileInfoEqual(
+BOOL_32 SiLib::HwlTileInfoEqual(
const ADDR_TILEINFO* pLeft, ///<[in] Left compare operand
const ADDR_TILEINFO* pRight ///<[in] Right compare operand
) const
if (pLeft->pipeConfig == pRight->pipeConfig)
{
- equal = EgBasedAddrLib::HwlTileInfoEqual(pLeft, pRight);
+ equal = EgBasedLib::HwlTileInfoEqual(pLeft, pRight);
}
return equal;
/**
****************************************************************************************************
-* SiAddrLib::GetTileSettings
+* SiLib::GetTileSettings
*
* @brief
* Get tile setting infos by index.
* Tile setting info.
****************************************************************************************************
*/
-const AddrTileConfig* SiAddrLib::GetTileSetting(
+const TileConfig* SiLib::GetTileSetting(
UINT_32 index ///< [in] Tile index
) const
{
/**
****************************************************************************************************
-* SiAddrLib::HwlPostCheckTileIndex
+* SiLib::HwlPostCheckTileIndex
*
* @brief
* Map a tile setting to index if curIndex is invalid, otherwise check if curIndex matches
* Tile index.
****************************************************************************************************
*/
-INT_32 SiAddrLib::HwlPostCheckTileIndex(
+INT_32 SiLib::HwlPostCheckTileIndex(
const ADDR_TILEINFO* pInfo, ///< [in] Tile Info
AddrTileMode mode, ///< [in] Tile mode
AddrTileType type, ///< [in] Tile type
/**
****************************************************************************************************
-* SiAddrLib::HwlSetupTileCfg
+* SiLib::HwlSetupTileCfg
*
* @brief
* Map tile index to tile setting.
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::HwlSetupTileCfg(
+ADDR_E_RETURNCODE SiLib::HwlSetupTileCfg(
UINT_32 bpp, ///< [in] Bits per pixel
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
}
else
{
- const AddrTileConfig* pCfgTable = GetTileSetting(index);
+ const TileConfig* pCfgTable = GetTileSetting(index);
if (pInfo)
{
/**
****************************************************************************************************
-* SiAddrLib::ReadGbTileMode
+* SiLib::ReadGbTileMode
*
* @brief
-* Convert GB_TILE_MODE HW value to ADDR_TILE_CONFIG.
+* Convert GB_TILE_MODE HW value to TileConfig.
* @return
* NA.
****************************************************************************************************
*/
-VOID SiAddrLib::ReadGbTileMode(
- UINT_32 regValue, ///< [in] GB_TILE_MODE register
- AddrTileConfig* pCfg ///< [out] output structure
+VOID SiLib::ReadGbTileMode(
+ UINT_32 regValue, ///< [in] GB_TILE_MODE register
+ TileConfig* pCfg ///< [out] output structure
) const
{
GB_TILE_MODE gbTileMode;
/**
****************************************************************************************************
-* SiAddrLib::InitTileSettingTable
+* SiLib::InitTileSettingTable
*
* @brief
* Initialize the ADDR_TILE_CONFIG table.
* TRUE if tile table is correctly initialized
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::InitTileSettingTable(
+BOOL_32 SiLib::InitTileSettingTable(
const UINT_32* pCfg, ///< [in] Pointer to table of tile configs
UINT_32 noOfEntries ///< [in] Numbe of entries in the table above
)
/**
****************************************************************************************************
-* SiAddrLib::HwlGetTileIndex
+* SiLib::HwlGetTileIndex
*
* @brief
* Return the virtual/real index for given mode/type/info
* ADDR_OK if successful.
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::HwlGetTileIndex(
+ADDR_E_RETURNCODE SiLib::HwlGetTileIndex(
const ADDR_GET_TILEINDEX_INPUT* pIn,
ADDR_GET_TILEINDEX_OUTPUT* pOut) const
{
/**
****************************************************************************************************
-* SiAddrLib::HwlFmaskPreThunkSurfInfo
+* SiLib::HwlFmaskPreThunkSurfInfo
*
* @brief
* Some preparation before thunking a ComputeSurfaceInfo call for Fmask
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-VOID SiAddrLib::HwlFmaskPreThunkSurfInfo(
+VOID SiLib::HwlFmaskPreThunkSurfInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn, ///< [in] Input of fmask info
const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut, ///< [in] Output of fmask info
ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn, ///< [out] Input of thunked surface info
/**
****************************************************************************************************
-* SiAddrLib::HwlFmaskPostThunkSurfInfo
+* SiLib::HwlFmaskPostThunkSurfInfo
*
* @brief
* Copy hwl extra field after calling thunked ComputeSurfaceInfo
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-VOID SiAddrLib::HwlFmaskPostThunkSurfInfo(
+VOID SiLib::HwlFmaskPostThunkSurfInfo(
const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut, ///< [in] Output of surface info
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut ///< [out] Output of fmask info
) const
/**
****************************************************************************************************
-* SiAddrLib::HwlComputeFmaskBits
+* SiLib::HwlComputeFmaskBits
* @brief
* Computes fmask bits
* @return
* Fmask bits
****************************************************************************************************
*/
-UINT_32 SiAddrLib::HwlComputeFmaskBits(
+UINT_32 SiLib::HwlComputeFmaskBits(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
UINT_32* pNumSamples
) const
/**
****************************************************************************************************
-* SiAddrLib::HwlOverrideTileMode
+* SiLib::HwlOverrideTileMode
*
* @brief
* Override tile modes (for PRT only, avoid client passes in an invalid PRT mode for SI.
*
****************************************************************************************************
*/
-void SiAddrLib::HwlOverrideTileMode(
+VOID SiLib::HwlOverrideTileMode(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure
) const
{
/**
****************************************************************************************************
-* SiAddrLib::HwlSelectTileMode
+* SiLib::HwlSelectTileMode
*
* @brief
* Select tile modes.
*
****************************************************************************************************
*/
-VOID SiAddrLib::HwlSelectTileMode(
+VOID SiLib::HwlSelectTileMode(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pInOut ///< [in/out] input output structure
) const
{
/**
****************************************************************************************************
-* SiAddrLib::HwlGetMaxAlignments
+* SiLib::HwlGetMaxAlignments
*
* @brief
* Gets maximum alignments
* ADDR_E_RETURNCODE
****************************************************************************************************
*/
-ADDR_E_RETURNCODE SiAddrLib::HwlGetMaxAlignments(
+ADDR_E_RETURNCODE SiLib::HwlGetMaxAlignments(
ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure
) const
{
/**
****************************************************************************************************
-* SiAddrLib::InitEquationTable
+* SiLib::InitEquationTable
*
* @brief
* Initialize Equation table.
* N/A
****************************************************************************************************
*/
-VOID SiAddrLib::InitEquationTable()
+VOID SiLib::InitEquationTable()
{
ADDR_EQUATION_KEY equationKeyTable[EquationTableSize];
memset(equationKeyTable, 0, sizeof(equationKeyTable));
{
UINT_32 equationIndex = ADDR_INVALID_EQUATION_INDEX;
- AddrTileConfig tileConfig = m_tileTable[tileIndex];
+ TileConfig tileConfig = m_tileTable[tileIndex];
ADDR_SURFACE_FLAGS flags = {{0}};
/**
****************************************************************************************************
-* SiAddrLib::IsEquationSupported
+* SiLib::IsEquationSupported
*
* @brief
* Check if it is supported for given bpp and tile config to generate a equation.
* TRUE if supported
****************************************************************************************************
*/
-BOOL_32 SiAddrLib::IsEquationSupported(
+BOOL_32 SiLib::IsEquationSupported(
UINT_32 bpp, ///< Bits per pixel
- AddrTileConfig tileConfig, ///< Tile config
+ TileConfig tileConfig, ///< Tile config
INT_32 tileIndex ///< Tile index
) const
{
if ((supported == TRUE) && (m_chipFamily == ADDR_CHIP_FAMILY_SI))
{
- // Please refer to SiAddrLib::HwlSetupTileInfo for PRT tile index selecting
+ // Please refer to SiLib::HwlSetupTileInfo for PRT tile index selecting
// Tile index 3, 6, 21-25 are for PRT single sample
if (tileIndex == 3)
{
return supported;
}
-
+} // V1
+} // Addr
/**
****************************************************************************************************
* @file siaddrlib.h
-* @brief Contains the R800AddrLib class definition.
+* @brief Contains the R800Lib class definition.
****************************************************************************************************
*/
#include "addrlib1.h"
#include "egbaddrlib.h"
+namespace Addr
+{
+namespace V1
+{
+
/**
****************************************************************************************************
* @brief Describes the information in tile mode table
****************************************************************************************************
*/
-struct AddrTileConfig
+struct TileConfig
{
AddrTileMode mode;
AddrTileType type;
* function set.
****************************************************************************************************
*/
-class SiAddrLib : public EgBasedAddrLib
+class SiLib : public EgBasedLib
{
public:
- /// Creates SIAddrLib object
- static AddrLib* CreateObj(const AddrClient* pClient)
+ /// Creates SiLib object
+ static Addr::Lib* CreateObj(const Client* pClient)
{
- return new(pClient) SiAddrLib(pClient);
+ return new(pClient) SiLib(pClient);
}
protected:
- SiAddrLib(const AddrClient* pClient);
- virtual ~SiAddrLib();
+ SiLib(const Client* pClient);
+ virtual ~SiLib();
// Hwl interface - defined in AddrLib1
virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
virtual BOOL_32 HwlComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
- virtual AddrChipFamily HwlConvertChipFamily(
+ virtual ChipFamily HwlConvertChipFamily(
UINT_32 uChipFamily, UINT_32 uChipRevision);
virtual BOOL_32 HwlInitGlobalParams(
virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
UINT_32 pipe, UINT_32 x) const;
- // Sub-hwl interface - defined in EgBasedAddrLib
+ // Sub-hwl interface - defined in EgBasedLib
virtual VOID HwlSetupTileInfo(
AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
// Check if it is supported for given bpp and tile config to generate an equation
BOOL_32 IsEquationSupported(
- UINT_32 bpp, AddrTileConfig tileConfig, INT_32 tileIndex) const;
+ UINT_32 bpp, TileConfig tileConfig, INT_32 tileIndex) const;
// Protected non-virtual functions
VOID ComputeTileCoordFromPipeAndElemIdx(
BOOL_32 DecodeGbRegs(
const ADDR_REGISTER_VALUE* pRegValue);
- const AddrTileConfig* GetTileSetting(
+ const TileConfig* GetTileSetting(
UINT_32 index) const;
// Initialize equation table
VOID InitEquationTable();
static const UINT_32 TileTableSize = 32;
- AddrTileConfig m_tileTable[TileTableSize];
+ TileConfig m_tileTable[TileTableSize];
UINT_32 m_noOfEntries;
// Max number of bpp (8bpp/16bpp/32bpp/64bpp/128bpp)
UINT_32 GetPipePerSurf(AddrPipeCfg pipeConfig) const;
- VOID ReadGbTileMode(
- UINT_32 regValue, AddrTileConfig* pCfg) const;
- BOOL_32 InitTileSettingTable(
- const UINT_32 *pSetting, UINT_32 noOfEntries);
+ VOID ReadGbTileMode(UINT_32 regValue, TileConfig* pCfg) const;
+ BOOL_32 InitTileSettingTable(const UINT_32 *pSetting, UINT_32 noOfEntries);
SIChipSettings m_settings;
};
+} // V1
+} // Addr
+
#endif