[Mesa-dev] [PATCH 013/140] amdgpu/addrlib: style changes and minor cleanups
Marek Olšák
maraeo at gmail.com
Mon Mar 20 22:42:23 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/amd/addrlib/addrinterface.cpp | 44 ++++++++++++++++++-------------------
src/amd/addrlib/addrinterface.h | 1 -
src/amd/addrlib/core/addrlib.cpp | 34 +++++++++++++---------------
src/amd/addrlib/core/addrlib.h | 11 ++++------
src/amd/addrlib/core/addrlib1.cpp | 7 +++---
src/amd/addrlib/r800/ciaddrlib.cpp | 1 +
src/amd/addrlib/r800/ciaddrlib.h | 4 ++--
src/amd/addrlib/r800/egbaddrlib.cpp | 26 ++++++++++++----------
src/amd/addrlib/r800/egbaddrlib.h | 12 +++++-----
src/amd/addrlib/r800/siaddrlib.cpp | 22 ++++++++++---------
src/amd/addrlib/r800/siaddrlib.h | 4 ++--
11 files changed, 82 insertions(+), 84 deletions(-)
diff --git a/src/amd/addrlib/addrinterface.cpp b/src/amd/addrlib/addrinterface.cpp
index fbc5e5f..8e6e7ea 100644
--- a/src/amd/addrlib/addrinterface.cpp
+++ b/src/amd/addrlib/addrinterface.cpp
@@ -68,21 +68,21 @@ ADDR_E_RETURNCODE ADDR_API AddrCreate(
* AddrDestroy
*
* @brief
* Destroy address lib object
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrDestroy(
- ADDR_HANDLE hLib) ///< [in] address lib handle
+ ADDR_HANDLE hLib) ///< address lib handle
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (hLib)
{
AddrLib* pLib = AddrLib::GetAddrLib(hLib);
pLib->Destroy();
}
else
{
@@ -103,21 +103,21 @@ ADDR_E_RETURNCODE ADDR_API AddrDestroy(
* AddrComputeSurfaceInfo
*
* @brief
* Calculate surface width/height/depth/alignments and suitable tiling mode
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceInfo(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceInfo(pIn, pOut);
@@ -137,21 +137,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceInfo(
* AddrComputeSurfaceAddrFromCoord
*
* @brief
* Compute surface address according to coordinates
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceAddrFromCoord(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceAddrFromCoord(pIn, pOut);
@@ -169,21 +169,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceAddrFromCoord(
* AddrComputeSurfaceCoordFromAddr
*
* @brief
* Compute coordinates according to surface address
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceCoordFromAddr(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeSurfaceCoordFromAddr(pIn, pOut);
@@ -207,21 +207,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeSurfaceCoordFromAddr(
* AddrComputeHtileInfo
*
* @brief
* Compute Htile pitch, height, base alignment and size in bytes
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileInfo(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
const ADDR_COMPUTE_HTILE_INFO_INPUT* pIn, ///< [in] Htile information
ADDR_COMPUTE_HTILE_INFO_OUTPUT* pOut) ///< [out] Htile pitch, height and size in bytes
{
AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileInfo(pIn, pOut);
@@ -239,21 +239,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileInfo(
* AddrComputeHtileAddrFromCoord
*
* @brief
* Compute Htile address according to coordinates (of depth buffer)
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileAddrFromCoord(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileAddrFromCoord(pIn, pOut);
@@ -272,21 +272,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileAddrFromCoord(
*
* @brief
* Compute coordinates within depth buffer (1st pixel of a micro tile) according to
* Htile address
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeHtileCoordFromAddr(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeHtileCoordFromAddr(pIn, pOut);
@@ -311,21 +311,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeHtileCoordFromAddr(
*
* @brief
* Compute Cmask pitch, height, base alignment and size in bytes from color buffer
* info
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskInfo(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
const ADDR_COMPUTE_CMASK_INFO_INPUT* pIn, ///< [in] Cmask pitch and height
ADDR_COMPUTE_CMASK_INFO_OUTPUT* pOut) ///< [out] Cmask pitch, height and size in bytes
{
AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskInfo(pIn, pOut);
@@ -343,21 +343,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskInfo(
* AddrComputeCmaskAddrFromCoord
*
* @brief
* Compute Cmask address according to coordinates (of MSAA color buffer)
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskAddrFromCoord(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskAddrFromCoord(pIn, pOut);
@@ -376,21 +376,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskAddrFromCoord(
*
* @brief
* Compute coordinates within color buffer (1st pixel of a micro tile) according to
* Cmask address
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskCoordFromAddr(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeCmaskCoordFromAddr(pIn, pOut);
@@ -414,21 +414,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeCmaskCoordFromAddr(
* AddrComputeFmaskInfo
*
* @brief
* Compute Fmask pitch/height/depth/alignments and size in bytes
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskInfo(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskInfo(pIn, pOut);
@@ -446,21 +446,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskInfo(
* AddrComputeFmaskAddrFromCoord
*
* @brief
* Compute Fmask address according to coordinates (x,y,slice,sample,plane)
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskAddrFromCoord(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskAddrFromCoord(pIn, pOut);
@@ -478,21 +478,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskAddrFromCoord(
* AddrComputeFmaskCoordFromAddr
*
* @brief
* Compute coordinates (x,y,slice,sample,plane) according to Fmask address
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskCoordFromAddr(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ComputeFmaskCoordFromAddr(pIn, pOut);
@@ -514,21 +514,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeFmaskCoordFromAddr(
/**
***************************************************************************************************
* AddrComputeDccInfo
*
* @brief
* Compute DCC key size, base alignment based on color surface size, tile info or tile index
*
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrComputeDccInfo(
- ADDR_HANDLE hLib, ///< [in] handle of addrlib
+ ADDR_HANDLE hLib, ///< handle of addrlib
const ADDR_COMPUTE_DCCINFO_INPUT* pIn, ///< [in] input
ADDR_COMPUTE_DCCINFO_OUTPUT* pOut) ///< [out] output
{
ADDR_E_RETURNCODE returnCode;
AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ComputeDccInfo(pIn, pOut);
@@ -624,21 +624,21 @@ BOOL_32 ADDR_API AddrUseCombinedSwizzle(ADDR_HANDLE hLib)
***************************************************************************************************
* AddrExtractBankPipeSwizzle
*
* @brief
* Extract Bank and Pipe swizzle from base256b
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrExtractBankPipeSwizzle(
- ADDR_HANDLE hLib, ///< [in] addrlib handle
+ ADDR_HANDLE hLib, ///< addrlib handle
const ADDR_EXTRACT_BANKPIPE_SWIZZLE_INPUT* pIn, ///< [in] input structure
ADDR_EXTRACT_BANKPIPE_SWIZZLE_OUTPUT* pOut) ///< [out] output structure
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
if (pLib != NULL)
{
returnCode = pLib->ExtractBankPipeSwizzle(pIn, pOut);
@@ -750,21 +750,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputeBaseSwizzle(
*
* @brief
* Convert a FLT_32 value to a depth/stencil pixel value
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
*
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API ElemFlt32ToDepthPixel(
- ADDR_HANDLE hLib, ///< [in] addrlib handle
+ ADDR_HANDLE hLib, ///< addrlib handle
const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn, ///< [in] per-component value
ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) ///< [out] final pixel value
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
AddrLib* pLib = AddrLib::GetAddrLib(hLib);
if (pLib != NULL)
{
pLib->Flt32ToDepthPixel(pIn, pOut);
@@ -783,21 +783,21 @@ ADDR_E_RETURNCODE ADDR_API ElemFlt32ToDepthPixel(
*
* @brief
* Convert a FLT_32 value to a red/green/blue/alpha pixel value
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
*
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API ElemFlt32ToColorPixel(
- ADDR_HANDLE hLib, ///< [in] addrlib handle
+ ADDR_HANDLE hLib, ///< addrlib handle
const ELEM_FLT32TOCOLORPIXEL_INPUT* pIn, ///< [in] format, surface number and swap value
ELEM_FLT32TOCOLORPIXEL_OUTPUT* pOut) ///< [out] final pixel value
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
AddrLib* pLib = AddrLib::GetAddrLib(hLib);
if (pLib != NULL)
{
pLib->Flt32ToColorPixel(pIn, pOut);
@@ -816,21 +816,21 @@ ADDR_E_RETURNCODE ADDR_API ElemFlt32ToColorPixel(
*
* @brief
* Helper function to check one format can be EXPORT_NUM,
* which is a register CB_COLOR_INFO.SURFACE_FORMAT.
* FP16 can be reported as EXPORT_NORM for rv770 in r600
* family
*
***************************************************************************************************
*/
BOOL_32 ADDR_API ElemGetExportNorm(
- ADDR_HANDLE hLib, ///< [in] addrlib handle
+ ADDR_HANDLE hLib, ///< addrlib handle
const ELEM_GETEXPORTNORM_INPUT* pIn) ///< [in] input structure
{
AddrLib* pLib = AddrLib::GetAddrLib(hLib);
BOOL_32 enabled = FALSE;
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
enabled = pLib->GetExportNorm(pIn);
@@ -850,21 +850,21 @@ BOOL_32 ADDR_API ElemGetExportNorm(
* AddrConvertTileInfoToHW
*
* @brief
* Convert tile info from real value to hardware register value
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileInfoToHW(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn, ///< [in] tile info with real value
ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) ///< [out] tile info with HW register value
{
AddrLib1* pLib = AddrLib1::GetAddrLib1(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileInfoToHW(pIn, pOut);
@@ -882,21 +882,21 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileInfoToHW(
* AddrConvertTileIndex
*
* @brief
* Convert tile index to tile mode/type/info
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileIndex(pIn, pOut);
@@ -914,21 +914,21 @@ ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex(
* AddrConvertTileIndex1
*
* @brief
* Convert tile index to tile mode/type/info
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrConvertTileIndex1(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
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);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->ConvertTileIndex1(pIn, pOut);
@@ -1011,21 +1011,21 @@ ADDR_E_RETURNCODE ADDR_API AddrComputePrtInfo(
* AddrGetMaxAlignments
*
* @brief
* Convert maximum alignments
*
* @return
* ADDR_OK if successful, otherwise an error code of ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE ADDR_API AddrGetMaxAlignments(
- ADDR_HANDLE hLib, ///< [in] address lib handle
+ ADDR_HANDLE hLib, ///< address lib handle
ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) ///< [out] output structure
{
AddrLib* pLib = AddrLib::GetAddrLib(hLib);
ADDR_E_RETURNCODE returnCode = ADDR_OK;
if (pLib != NULL)
{
returnCode = pLib->GetMaxAlignments(pOut);
}
diff --git a/src/amd/addrlib/addrinterface.h b/src/amd/addrlib/addrinterface.h
index c6c4684..8724866 100644
--- a/src/amd/addrlib/addrinterface.h
+++ b/src/amd/addrlib/addrinterface.h
@@ -279,21 +279,20 @@ typedef struct _ADDR_REGISTER_VALUE
UINT_32 noOfRanks; /// MC_ARB_RAMCFG.NOOFRANK
/// 0: 1
/// 1: 2
/// SI (R1000) registers-----------------------------------------
const UINT_32* pTileConfig; ///< Global tile setting tables
UINT_32 noOfEntries; ///< Number of entries in pTileConfig
///< CI registers-------------------------------------------------
const UINT_32* pMacroTileConfig; ///< Global macro tile mode table
UINT_32 noOfMacroEntries; ///< Number of entries in pMacroTileConfig
-
} ADDR_REGISTER_VALUE;
/**
***************************************************************************************************
* ADDR_CREATE_INPUT
*
* @brief
* Parameters use to create an AddrLib Object. Caller must provide all fields.
*
***************************************************************************************************
diff --git a/src/amd/addrlib/core/addrlib.cpp b/src/amd/addrlib/core/addrlib.cpp
index fbe7930..ec62f03 100644
--- a/src/amd/addrlib/core/addrlib.cpp
+++ b/src/amd/addrlib/core/addrlib.cpp
@@ -42,27 +42,27 @@ UINT_32 div64_32(UINT_64 n, UINT_32 base)
UINT_64 rem = n;
UINT_64 b = base;
UINT_64 res, d = 1;
UINT_32 high = rem >> 32;
res = 0;
if (high >= base)
{
high /= base;
res = (UINT_64) high << 32;
- rem -= (UINT_64) (high*base) << 32;
+ rem -= (UINT_64) (high * base) << 32;
}
- while ((INT_64)b > 0 && b < rem)
+ while (((INT_64)b > 0) && (b < rem))
{
- b = b+b;
- d = d+d;
+ b = b + b;
+ d = d + d;
}
do
{
if (rem >= b)
{
rem -= b;
res += d;
}
b >>= 1;
@@ -144,25 +144,25 @@ AddrLib::AddrLib(const AddrClient* pClient) :
* @brief
* Destructor for the AddrLib class
*
***************************************************************************************************
*/
AddrLib::~AddrLib()
{
if (m_pElemLib)
{
delete m_pElemLib;
+ m_pElemLib = NULL;
}
}
-
///////////////////////////////////////////////////////////////////////////////////////////////////
// Initialization/Helper
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
* AddrLib::Create
*
* @brief
* Creates and initializes AddrLib object.
@@ -214,21 +214,21 @@ ADDR_E_RETURNCODE AddrLib::Create(
ADDR_ASSERT_ALWAYS();
break;
}
break;
default:
ADDR_ASSERT_ALWAYS();
break;
}
}
- if ((pLib != NULL))
+ if (pLib != NULL)
{
BOOL_32 initValid;
// Pass createFlags to configFlags first since these flags may be overwritten
pLib->m_configFlags.noCubeMipSlicesPad = pCreateIn->createFlags.noCubeMipSlicesPad;
pLib->m_configFlags.fillSizeFields = pCreateIn->createFlags.fillSizeFields;
pLib->m_configFlags.useTileIndex = pCreateIn->createFlags.useTileIndex;
pLib->m_configFlags.useCombinedSwizzle = pCreateIn->createFlags.useCombinedSwizzle;
pLib->m_configFlags.checkLast2DLevel = pCreateIn->createFlags.checkLast2DLevel;
pLib->m_configFlags.useHtileSliceAlign = pCreateIn->createFlags.useHtileSliceAlign;
@@ -283,45 +283,43 @@ ADDR_E_RETURNCODE AddrLib::Create(
* @brief
* Convert familyID defined in atiid.h to AddrChipFamily and set m_chipFamily/m_chipRevision
* @return
* N/A
***************************************************************************************************
*/
VOID AddrLib::SetAddrChipFamily(
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_IVLD;
-
- family = HwlConvertChipFamily(uChipFamily, uChipRevision);
+ AddrChipFamily family = HwlConvertChipFamily(uChipFamily, uChipRevision);
ADDR_ASSERT(family != ADDR_CHIP_FAMILY_IVLD);
- m_chipFamily = family;
- m_chipRevision = uChipRevision;
+ m_chipFamily = family;
+ m_chipRevision = uChipRevision;
}
/**
***************************************************************************************************
* AddrLib::SetMinPitchAlignPixels
*
* @brief
* Set m_minPitchAlignPixels with input param
*
* @return
* N/A
***************************************************************************************************
*/
VOID AddrLib::SetMinPitchAlignPixels(
UINT_32 minPitchAlignPixels) ///< [in] minmum pitch alignment in pixels
{
- m_minPitchAlignPixels = (minPitchAlignPixels == 0)? 1 : minPitchAlignPixels;
+ m_minPitchAlignPixels = (minPitchAlignPixels == 0) ? 1 : minPitchAlignPixels;
}
/**
***************************************************************************************************
* AddrLib::GetAddrLib
*
* @brief
* Get AddrLib pointer
*
* @return
@@ -387,27 +385,28 @@ UINT_32 AddrLib::Bits2Number(
va_list bits_ptr;
va_start(bits_ptr, bitNum);
for(i = 0; i < bitNum; i++)
{
number |= va_arg(bits_ptr, UINT_32);
number <<= 1;
}
- number>>=1;
+ number >>= 1;
va_end(bits_ptr);
return number;
}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
// Element lib
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
***************************************************************************************************
* AddrLib::Flt32ToColorPixel
*
* @brief
@@ -426,23 +425,22 @@ ADDR_E_RETURNCODE AddrLib::Flt32ToDepthPixel(
{
if ((pIn->size != sizeof(ELEM_FLT32TODEPTHPIXEL_INPUT)) ||
(pOut->size != sizeof(ELEM_FLT32TODEPTHPIXEL_OUTPUT)))
{
returnCode = ADDR_PARAMSIZEMISMATCH;
}
}
if (returnCode == ADDR_OK)
{
- GetElemLib()->Flt32ToDepthPixel(pIn->format,
- pIn->comps,
- pOut->pPixel);
+ GetElemLib()->Flt32ToDepthPixel(pIn->format, pIn->comps, pOut->pPixel);
+
UINT_32 depthBase = 0;
UINT_32 stencilBase = 0;
UINT_32 depthBits = 0;
UINT_32 stencilBits = 0;
switch (pIn->format)
{
case ADDR_DEPTH_16:
depthBits = 16;
break;
@@ -543,18 +541,16 @@ BOOL_32 AddrLib::GetExportNorm(
if (GetFillSizeFieldsFlags() == TRUE)
{
if (pIn->size != sizeof(ELEM_GETEXPORTNORM_INPUT))
{
returnCode = ADDR_PARAMSIZEMISMATCH;
}
}
if (returnCode == ADDR_OK)
{
- enabled = GetElemLib()->PixGetExportNorm(pIn->format,
- pIn->num,
- pIn->swap);
+ enabled = GetElemLib()->PixGetExportNorm(pIn->format, pIn->num, pIn->swap);
}
return enabled;
}
diff --git a/src/amd/addrlib/core/addrlib.h b/src/amd/addrlib/core/addrlib.h
index 177aece..d1c5dd7 100644
--- a/src/amd/addrlib/core/addrlib.h
+++ b/src/amd/addrlib/core/addrlib.h
@@ -147,22 +147,21 @@ public:
static ADDR_E_RETURNCODE Create(
const ADDR_CREATE_INPUT* pCreateInfo, ADDR_CREATE_OUTPUT* pCreateOut);
/// Pair of Create
VOID Destroy()
{
delete this;
}
- static AddrLib* GetAddrLib(
- ADDR_HANDLE hLib);
+ static AddrLib* GetAddrLib(ADDR_HANDLE hLib);
/// Returns AddrLib version (from compiled binary instead include file)
UINT_32 GetVersion()
{
return m_version;
}
/// Returns asic chip family name defined by AddrLib
AddrChipFamily GetAddrChipFamily()
{
@@ -170,50 +169,48 @@ public:
}
ADDR_E_RETURNCODE Flt32ToDepthPixel(
const ELEM_FLT32TODEPTHPIXEL_INPUT* pIn,
ELEM_FLT32TODEPTHPIXEL_OUTPUT* pOut) const;
ADDR_E_RETURNCODE Flt32ToColorPixel(
const ELEM_FLT32TOCOLORPIXEL_INPUT* pIn,
ELEM_FLT32TOCOLORPIXEL_OUTPUT* pOut) const;
- BOOL_32 GetExportNorm(
- const ELEM_GETEXPORTNORM_INPUT* pIn) const;
+ BOOL_32 GetExportNorm(const ELEM_GETEXPORTNORM_INPUT* pIn) const;
ADDR_E_RETURNCODE GetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const;
protected:
AddrLib(); // Constructor is protected
AddrLib(const AddrClient* pClient);
/// Pure virtual function to get max alignments
virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0;
//
// Initialization
//
/// Pure Virtual function for Hwl computing internal global parameters from h/w registers
- virtual BOOL_32 HwlInitGlobalParams(
- const ADDR_CREATE_INPUT* pCreateIn) = 0;
+ virtual BOOL_32 HwlInitGlobalParams(const ADDR_CREATE_INPUT* pCreateIn) = 0;
/// Pure Virtual function for Hwl converting chip family
virtual AddrChipFamily HwlConvertChipFamily(UINT_32 uChipFamily, UINT_32 uChipRevision) = 0;
//
// Misc helper
//
static UINT_32 Bits2Number(UINT_32 bitNum,...);
static UINT_32 GetNumFragments(UINT_32 numSamples, UINT_32 numFrags)
{
- return numFrags != 0 ? numFrags : Max(1u, numSamples);
+ return (numFrags != 0) ? numFrags : Max(1u, numSamples);
}
/// Returns pointer of AddrElemLib
AddrElemLib* GetElemLib() const
{
return m_pElemLib;
}
/// Returns fillSizeFields flag
UINT_32 GetFillSizeFieldsFlags() const
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index 1fc8fd7..3252fd4 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -118,24 +118,24 @@ AddrLib1::~AddrLib1()
***************************************************************************************************
* AddrLib1::GetAddrLib1
*
* @brief
* Get AddrLib1 pointer
*
* @return
* An AddrLib1 class pointer
***************************************************************************************************
*/
-AddrLib1 * AddrLib1::GetAddrLib1(
+AddrLib1* AddrLib1::GetAddrLib1(
ADDR_HANDLE hLib) ///< [in] handle of ADDR_HANDLE
{
- AddrLib *pAddrLib = AddrLib::GetAddrLib(hLib);
+ AddrLib* pAddrLib = AddrLib::GetAddrLib(hLib);
if ((pAddrLib != NULL) &&
((pAddrLib->GetAddrChipFamily() == ADDR_CHIP_FAMILY_IVLD) ||
(pAddrLib->GetAddrChipFamily() > ADDR_CHIP_FAMILY_VI)))
{
// only valid and pre-VI AISC can use AddrLib1 function.
ADDR_ASSERT_ALWAYS();
hLib = NULL;
}
return static_cast<AddrLib1 *>(hLib);
}
@@ -3516,21 +3516,21 @@ ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo(
UINT_32 expandX = 1;
UINT_32 expandY = 1;
AddrElemMode elemMode;
UINT_32 bpp = GetElemLib()->GetBitsPerPixel(pIn->format,
&elemMode,
&expandX,
&expandY);
- if (bpp <8 || bpp == 24 || bpp == 48 || bpp == 96 )
+ if (bpp <8 || bpp == 24 || bpp == 48 || bpp == 96)
{
returnCode = ADDR_INVALIDPARAMS;
}
UINT_32 numFrags = pIn->numFrags;
ADDR_ASSERT(numFrags <= 8);
UINT_32 tileWidth = 0;
UINT_32 tileHeight = 0;
if (returnCode == ADDR_OK)
@@ -3617,10 +3617,11 @@ ADDR_E_RETURNCODE AddrLib1::ComputePrtInfo(
tileWidth = 4096;
}
}
}
pOut->prtTileWidth = tileWidth;
pOut->prtTileHeight = tileHeight;
return returnCode;
}
+
diff --git a/src/amd/addrlib/r800/ciaddrlib.cpp b/src/amd/addrlib/r800/ciaddrlib.cpp
index 1176ead..776c8b5 100644
--- a/src/amd/addrlib/r800/ciaddrlib.cpp
+++ b/src/amd/addrlib/r800/ciaddrlib.cpp
@@ -1852,10 +1852,11 @@ ADDR_E_RETURNCODE CiAddrLib::HwlGetMaxAlignments(
}
}
if (pOut != NULL)
{
pOut->baseAlign = maxBaseAlign;
}
return ADDR_OK;
}
+
diff --git a/src/amd/addrlib/r800/ciaddrlib.h b/src/amd/addrlib/r800/ciaddrlib.h
index 90d6c1b..92d8468 100644
--- a/src/amd/addrlib/r800/ciaddrlib.h
+++ b/src/amd/addrlib/r800/ciaddrlib.h
@@ -121,27 +121,27 @@ protected:
virtual VOID HwlSetupTileInfo(
AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
ADDR_TILEINFO* inputTileInfo, ADDR_TILEINFO* outputTileInfo,
AddrTileType inTileType, ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
virtual INT_32 HwlPostCheckTileIndex(
const ADDR_TILEINFO* pInfo, AddrTileMode mode, AddrTileType type,
INT curIndex = TileIndexInvalid) const;
- virtual VOID HwlFmaskPreThunkSurfInfo(
+ virtual VOID HwlFmaskPreThunkSurfInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn,
const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut,
ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut) const;
- virtual VOID HwlFmaskPostThunkSurfInfo(
+ virtual VOID HwlFmaskPostThunkSurfInfo(
const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut,
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut) const;
virtual AddrTileMode HwlDegradeThickTileMode(
AddrTileMode baseTileMode, UINT_32 numSlices, UINT_32* pBytesPerTile) const;
virtual BOOL_32 HwlOverrideTileMode(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
AddrTileMode* pTileMode,
AddrTileType* pTileType) const;
diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp
index b7c6995..03ae41f 100644
--- a/src/amd/addrlib/r800/egbaddrlib.cpp
+++ b/src/amd/addrlib/r800/egbaddrlib.cpp
@@ -539,21 +539,21 @@ BOOL_32 EgBasedAddrLib::ComputeSurfaceInfoMacroTiled(
// Compute the size of a slice.
//
bytesPerSlice = BITS_TO_BYTES(static_cast<UINT_64>(paddedPitch) *
paddedHeight * NextPow2(pIn->bpp) * numSamples);
pOut->pitch = paddedPitch;
// Put this check right here to workaround special mipmap cases which the original height
// is needed.
// The original height is pre-stored in pOut->height in PostComputeMipLevel and
// pOut->pitch is needed in HwlCheckLastMacroTiledLvl, too.
- if (m_configFlags.checkLast2DLevel && numSamples == 1) // Don't check MSAA
+ if (m_configFlags.checkLast2DLevel && (numSamples == 1)) // Don't check MSAA
{
// Set a TRUE in pOut if next Level is the first 1D sub level
HwlCheckLastMacroTiledLvl(pIn, pOut);
}
pOut->height = paddedHeight;
pOut->depth = expNumSlices;
pOut->surfSize = bytesPerSlice * expNumSlices;
@@ -758,21 +758,21 @@ BOOL_32 EgBasedAddrLib::HwlReduceBankWidthHeight(
}
stillGreater =
tileSize * pTileInfo->bankWidth * pTileInfo->bankHeight > m_rowSize;
}
}
valid = !stillGreater;
// Generate a warning if we still fail to meet this constraint
- if (!valid)
+ if (valid == FALSE)
{
ADDR_WARN(
0, ("TILE_SIZE(%d)*BANK_WIDTH(%d)*BANK_HEIGHT(%d) <= ROW_SIZE(%d)",
tileSize, pTileInfo->bankWidth, pTileInfo->bankHeight, m_rowSize));
}
}
return valid;
}
@@ -1297,21 +1297,21 @@ UINT_64 EgBasedAddrLib::DispatchComputeSurfaceAddrFromCoord(
{
if (numFrags != numSamples)
{
numSamples = numFrags;
ADDR_ASSERT(sample < numSamples);
}
/// @note
/// 128 bit/thick tiled surface doesn't support display tiling and
/// mipmap chain must have the same tileType, so please fill tileType correctly
- if (!IsLinear(pIn->tileMode))
+ if (IsLinear(pIn->tileMode) == FALSE)
{
if (bpp >= 128 || ComputeSurfaceThickness(tileMode) > 1)
{
ADDR_ASSERT(microTileType != ADDR_DISPLAYABLE);
}
}
}
switch (tileMode)
{
@@ -2044,21 +2044,21 @@ VOID EgBasedAddrLib::DispatchComputeSurfaceCoordFromAddr(
if (m_chipFamily >= ADDR_CHIP_FAMILY_NI)
{
if (numFrags != numSamples)
{
numSamples = numFrags;
}
/// @note
/// 128 bit/thick tiled surface doesn't support display tiling and
/// mipmap chain must have the same tileType, so please fill tileType correctly
- if (!IsLinear(pIn->tileMode))
+ if (IsLinear(pIn->tileMode) == FALSE)
{
if (bpp >= 128 || ComputeSurfaceThickness(tileMode) > 1)
{
ADDR_ASSERT(microTileType != ADDR_DISPLAYABLE);
}
}
}
switch (tileMode)
{
@@ -3371,21 +3371,21 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMicroTiled(
// 2xAA use the same layout as 4xAA
//
if (numSamples == 2)
{
numSamples = 4;
}
//
// Compute the number of planes.
//
- if (!resolved)
+ if (resolved == FALSE)
{
effectiveSamples = ComputeFmaskNumPlanesFromNumSamples(numSamples);
effectiveBpp = numSamples;
//
// Compute the address just like a color surface with numSamples bits per element and
// numPlanes samples.
//
addr = ComputeSurfaceAddrFromCoordMicroTiled(x,
y,
@@ -3483,21 +3483,21 @@ UINT_64 EgBasedAddrLib::ComputeFmaskAddrFromCoordMacroTiled(
// 2xAA use the same layout as 4xAA
//
if (numSamples == 2)
{
numSamples = 4;
}
//
// Compute the number of planes.
//
- if (!resolved)
+ if (resolved == FALSE)
{
effectiveSamples = ComputeFmaskNumPlanesFromNumSamples(numSamples);
effectiveBpp = numSamples;
//
// Compute the address just like a color surface with numSamples bits per element and
// numPlanes samples.
//
addr = ComputeSurfaceAddrFromCoordMacroTiled(x,
y,
@@ -3596,21 +3596,21 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMicroTiled(
{
UINT_32 effectiveBpp;
UINT_32 effectiveSamples;
// 2xAA use the same layout as 4xAA
if (numSamples == 2)
{
numSamples = 4;
}
- if (!resolved)
+ if (resolved == FALSE)
{
effectiveSamples = ComputeFmaskNumPlanesFromNumSamples(numSamples);
effectiveBpp = numSamples;
ComputeSurfaceCoordFromAddrMicroTiled(addr,
bitPosition,
effectiveBpp,
pitch,
height,
effectiveSamples,
@@ -3691,21 +3691,21 @@ VOID EgBasedAddrLib::ComputeFmaskCoordFromAddrMacroTiled(
// 2xAA use the same layout as 4xAA
if (numSamples == 2)
{
numSamples = 4;
}
//
// Compute the number of planes.
//
- if (!resolved)
+ if (resolved == FALSE)
{
effectiveSamples = ComputeFmaskNumPlanesFromNumSamples(numSamples);
effectiveBpp = numSamples;
ComputeSurfaceCoordFromAddrMacroTiled(addr,
bitPosition,
effectiveBpp,
pitch,
height,
effectiveSamples,
@@ -4288,21 +4288,21 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceInfo(
ADDR_TILEINFO tileInfo = {0};
if (retCode == ADDR_OK)
{
// Uses internal tile info if pOut does not have a valid pTileInfo
if (pOut->pTileInfo == NULL)
{
pOut->pTileInfo = &tileInfo;
}
- if (!DispatchComputeSurfaceInfo(pIn, pOut))
+ if (DispatchComputeSurfaceInfo(pIn, pOut) == FALSE)
{
retCode = ADDR_INVALIDPARAMS;
}
// Returns an index
pOut->tileIndex = HwlPostCheckTileIndex(pOut->pTileInfo,
pOut->tileMode,
pOut->tileType,
pOut->tileIndex);
@@ -4316,23 +4316,24 @@ ADDR_E_RETURNCODE EgBasedAddrLib::HwlComputeSurfaceInfo(
}
// Resets pTileInfo to NULL if the internal tile info is used
if (pOut->pTileInfo == &tileInfo)
{
#if DEBUG
// Client does not pass in a valid pTileInfo
if (IsMacroTiled(pOut->tileMode))
{
// If a valid index is returned, then no pTileInfo is okay
- ADDR_ASSERT(!m_configFlags.useTileIndex || pOut->tileIndex != TileIndexInvalid);
+ ADDR_ASSERT((m_configFlags.useTileIndex == FALSE) ||
+ (pOut->tileIndex != TileIndexInvalid));
- if (!IsTileInfoAllZero(pIn->pTileInfo))
+ if (IsTileInfoAllZero(pIn->pTileInfo) == FALSE)
{
// The initial value of pIn->pTileInfo is copied to tileInfo
// We do not expect any of these value to be changed nor any 0 of inputs
ADDR_ASSERT(tileInfo.banks == pIn->pTileInfo->banks);
ADDR_ASSERT(tileInfo.bankWidth == pIn->pTileInfo->bankWidth);
ADDR_ASSERT(tileInfo.bankHeight == pIn->pTileInfo->bankHeight);
ADDR_ASSERT(tileInfo.macroAspectRatio == pIn->pTileInfo->macroAspectRatio);
ADDR_ASSERT(tileInfo.tileSplitBytes == pIn->pTileInfo->tileSplitBytes);
}
}
@@ -4518,21 +4519,21 @@ UINT_32 EgBasedAddrLib::HwlGetPitchAlignmentMicroTiled(
UINT_32 microTilesPerPipeInterleave;
//
// Special workaround for depth/stencil buffer, use 8 bpp to meet larger requirement for
// stencil buffer since pitch alignment is related to bpp.
// For a depth only buffer do not set this.
//
// Note: this actually does not work for mipmap but mipmap depth texture is not really
// sampled with mipmap.
//
- if (flags.depth && !flags.noStencil)
+ if (flags.depth && (flags.noStencil == FALSE))
{
bpp = 8;
}
pixelsPerMicroTile = MicroTilePixels * microTileThickness;
pixelsPerPipeInterleave = BYTES_TO_BITS(m_pipeInterleaveBytes) / (bpp * numSamples);
microTilesPerPipeInterleave = pixelsPerPipeInterleave / pixelsPerMicroTile;
pitchAlign = Max(MicroTileWidth, microTilesPerPipeInterleave * MicroTileWidth);
@@ -4608,10 +4609,11 @@ UINT_32 EgBasedAddrLib::HwlStereoCheckRightOffsetPadding(
static const UINT_32 StereoAspectRatio = 2;
stereoHeightAlign = pTileInfo->banks *
pTileInfo->bankHeight *
MicroTileHeight /
StereoAspectRatio;
}
return stereoHeightAlign;
}
+
diff --git a/src/amd/addrlib/r800/egbaddrlib.h b/src/amd/addrlib/r800/egbaddrlib.h
index b8eabd8..d43eca8 100644
--- a/src/amd/addrlib/r800/egbaddrlib.h
+++ b/src/amd/addrlib/r800/egbaddrlib.h
@@ -142,21 +142,21 @@ protected:
virtual VOID HwlComputePixelCoordFromOffset(
UINT_32 offset, UINT_32 bpp, UINT_32 numSamples,
AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample,
AddrTileType microTileType, BOOL_32 isDepthSampleOrder) const;
/// Return Cmask block max
virtual BOOL_32 HwlGetMaxCmaskBlockMax() const
{
- return 16383; // 14 bits
+ return 0x3FFF; // 14 bits, 0n16383
}
// Sub-hwl interface
/// Pure virtual function to setup tile info (indices) if client requests to do so
virtual VOID HwlSetupTileInfo(
AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
ADDR_TILEINFO* inputTileInfo, ADDR_TILEINFO* outputTileInfo,
AddrTileType inTileType, ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const = 0;
@@ -318,71 +318,71 @@ private:
AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
UINT_32 mipLevel, UINT_32 numSamples,
ADDR_TILEINFO* pTileInfo,
UINT_32* pBaseAlign, UINT_32* pPitchAlign, UINT_32* pHeightAlign) const;
/// Surface addressing functions
UINT_64 DispatchComputeSurfaceAddrFromCoord(
const ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_INPUT* pIn,
ADDR_COMPUTE_SURFACE_ADDRFROMCOORD_OUTPUT* pOut) const;
- VOID DispatchComputeSurfaceCoordFromAddr(
+ VOID DispatchComputeSurfaceCoordFromAddr(
const ADDR_COMPUTE_SURFACE_COORDFROMADDR_INPUT* pIn,
ADDR_COMPUTE_SURFACE_COORDFROMADDR_OUTPUT* pOut) const;
UINT_64 ComputeSurfaceAddrFromCoordMicroTiled(
UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
AddrTileMode tileMode,
AddrTileType microTileType, BOOL_32 isDepthSampleOrder,
UINT_32* pBitPosition) const;
UINT_64 ComputeSurfaceAddrFromCoordMacroTiled(
UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
AddrTileMode tileMode,
AddrTileType microTileType, BOOL_32 ignoreSE, BOOL_32 isDepthSampleOrder,
UINT_32 pipeSwizzle, UINT_32 bankSwizzle,
ADDR_TILEINFO* pTileInfo,
UINT_32* pBitPosition) const;
- VOID ComputeSurfaceCoordFromAddrMacroTiled(
+ VOID ComputeSurfaceCoordFromAddrMacroTiled(
UINT_64 addr, UINT_32 bitPosition,
UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
AddrTileMode tileMode, UINT_32 tileBase, UINT_32 compBits,
AddrTileType microTileType, BOOL_32 ignoreSE, BOOL_32 isDepthSampleOrder,
UINT_32 pipeSwizzle, UINT_32 bankSwizzle,
ADDR_TILEINFO* pTileInfo,
UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample) const;
/// Fmask functions
UINT_64 DispatchComputeFmaskAddrFromCoord(
const ADDR_COMPUTE_FMASK_ADDRFROMCOORD_INPUT* pIn,
ADDR_COMPUTE_FMASK_ADDRFROMCOORD_OUTPUT* pOut) const;
- VOID DispatchComputeFmaskCoordFromAddr(
+ VOID DispatchComputeFmaskCoordFromAddr(
const ADDR_COMPUTE_FMASK_COORDFROMADDR_INPUT* pIn,
ADDR_COMPUTE_FMASK_COORDFROMADDR_OUTPUT* pOut) const;
// FMASK related methods - private
UINT_64 ComputeFmaskAddrFromCoordMicroTiled(
UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample, UINT_32 plane,
UINT_32 pitch, UINT_32 height, UINT_32 numSamples, AddrTileMode tileMode,
BOOL_32 resolved, UINT_32* pBitPosition) const;
- VOID ComputeFmaskCoordFromAddrMicroTiled(
+ VOID ComputeFmaskCoordFromAddrMicroTiled(
UINT_64 addr, UINT_32 bitPosition,
UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
AddrTileMode tileMode, BOOL_32 resolved,
UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample, UINT_32* pPlane) const;
- VOID ComputeFmaskCoordFromAddrMacroTiled(
+ VOID ComputeFmaskCoordFromAddrMacroTiled(
UINT_64 addr, UINT_32 bitPosition,
UINT_32 pitch, UINT_32 height, UINT_32 numSamples, AddrTileMode tileMode,
UINT_32 pipeSwizzle, UINT_32 bankSwizzle,
BOOL_32 ignoreSE,
ADDR_TILEINFO* pTileInfo,
BOOL_32 resolved,
UINT_32* pX, UINT_32* pY, UINT_32* pSlice, UINT_32* pSample, UINT_32* pPlane) const;
UINT_64 ComputeFmaskAddrFromCoordMacroTiled(
UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 sample, UINT_32 plane,
diff --git a/src/amd/addrlib/r800/siaddrlib.cpp b/src/amd/addrlib/r800/siaddrlib.cpp
index 2b7e9c9..869cc56 100644
--- a/src/amd/addrlib/r800/siaddrlib.cpp
+++ b/src/amd/addrlib/r800/siaddrlib.cpp
@@ -1245,21 +1245,21 @@ UINT_64 SiAddrLib::HwlGetSizeAdjustmentLinear(
*/
UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
{
ADDR_ASSERT(pIn->width == expPitch);
// From SI, if pow2Pad is 1 the pitch is expanded 3x first, then padded to pow2, so nothing to
// do here
- if (!pIn->flags.pow2Pad)
+ if (pIn->flags.pow2Pad == FALSE)
{
AddrLib1::HwlPreHandleBaseLvl3xPitch(pIn, expPitch);
}
else
{
ADDR_ASSERT(IsPow2(expPitch));
}
return expPitch;
}
@@ -1278,21 +1278,21 @@ UINT_32 SiAddrLib::HwlPreHandleBaseLvl3xPitch(
UINT_32 SiAddrLib::HwlPostHandleBaseLvl3xPitch(
const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ///< [in] input
UINT_32 expPitch ///< [in] pitch
) const
{
/**
* @note The pitch will be divided by 3 in the end so the value will look odd but h/w should
* be able to compute a correct pitch from it as h/w address library is doing the job.
*/
// From SI, the pitch is expanded 3x first, then padded to pow2, so no special handler here
- if (!pIn->flags.pow2Pad)
+ if (pIn->flags.pow2Pad == FALSE)
{
AddrLib1::HwlPostHandleBaseLvl3xPitch(pIn, expPitch);
}
return expPitch;
}
/**
***************************************************************************************************
* SiAddrLib::HwlGetPitchAlignmentMicroTiled
@@ -1371,21 +1371,21 @@ UINT_64 SiAddrLib::HwlGetSizeAdjustmentMicroTiled(
}
#if !ALT_TEST
//
// Special workaround for depth/stencil buffer, use 8 bpp to align depth buffer again since
// the stencil plane may have larger pitch if the slice size is smaller than base alignment.
//
// Note: this actually does not work for mipmap but mipmap depth texture is not really
// sampled with mipmap.
//
- if (flags.depth && !flags.noStencil)
+ if (flags.depth && (flags.noStencil == FALSE))
{
ADDR_ASSERT(numSamples == 1);
UINT_64 logicalSiceSizeStencil = static_cast<UINT_64>(pitch) * height; // 1 byte stencil
while ((logicalSiceSizeStencil % baseAlign) != 0)
{
pitch += pitchAlign; // Stencil plane's pitch alignment is the same as depth plane's
logicalSiceSizeStencil = static_cast<UINT_64>(pitch) * height;
@@ -1458,21 +1458,21 @@ VOID SiAddrLib::HwlSetupTileInfo(
ADDR_TILEINFO* pTileInfoOut, ///< [out] Tile info output
AddrTileType inTileType, ///< [in] Tile type
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut ///< [out] Output
) const
{
UINT_32 thickness = ComputeSurfaceThickness(tileMode);
ADDR_TILEINFO* pTileInfo = pTileInfoOut;
INT index = TileIndexInvalid;
// Fail-safe code
- if (!IsLinear(tileMode))
+ if (IsLinear(tileMode) == FALSE)
{
// 128 bpp/thick tiling must be non-displayable.
// Fmask reuse color buffer's entry but bank-height field can be from another entry
// To simplify the logic, fmask entry should be picked from non-displayable ones
if (bpp == 128 || thickness > 1 || flags.fmask || flags.prt)
{
inTileType = ADDR_NON_DISPLAYABLE;
}
if (flags.depth || flags.stencil)
@@ -2189,25 +2189,26 @@ ADDR_E_RETURNCODE SiAddrLib::HwlComputeSurfaceInfo(
BOOL_32 SiAddrLib::HwlComputeMipLevel(
ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn ///< [in/out] Input structure
) const
{
// basePitch is calculated from level 0 so we only check this for mipLevel > 0
if (pIn->mipLevel > 0)
{
// 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))
+ if (AddrElemLib::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
- ADDR_ASSERT(!pIn->flags.pow2Pad || ((pIn->basePitch != 0) && IsPow2(pIn->basePitch)));
+ ADDR_ASSERT((pIn->flags.pow2Pad == FALSE) ||
+ ((pIn->basePitch != 0) && IsPow2(pIn->basePitch)));
}
if (pIn->basePitch != 0)
{
pIn->width = Max(1u, pIn->basePitch >> pIn->mipLevel);
}
}
// pow2Pad is done in PostComputeMipLevel
@@ -2379,21 +2380,21 @@ INT_32 SiAddrLib::HwlPostCheckTileIndex(
else
{
BOOL_32 macroTiled = IsMacroTiled(mode);
// We need to find a new index if either of them is true
// 1. curIndex is invalid
// 2. tile mode is changed
// 3. tile info does not match for macro tiled
if ((index == TileIndexInvalid ||
(mode != m_tileTable[index].mode) ||
- (macroTiled && !HwlTileInfoEqual(pInfo, &m_tileTable[index].info))))
+ (macroTiled && (HwlTileInfoEqual(pInfo, &m_tileTable[index].info) == FALSE))))
{
for (index = 0; index < static_cast<INT_32>(m_noOfEntries); index++)
{
if (macroTiled)
{
// macro tile modes need all to match
if (HwlTileInfoEqual(pInfo, &m_tileTable[index].info) &&
(mode == m_tileTable[index].mode) &&
(type == m_tileTable[index].type))
{
@@ -2439,21 +2440,21 @@ INT_32 SiAddrLib::HwlPostCheckTileIndex(
* Map tile index to tile setting.
* @return
* ADDR_E_RETURNCODE
***************************************************************************************************
*/
ADDR_E_RETURNCODE SiAddrLib::HwlSetupTileCfg(
INT_32 index, ///< [in] Tile index
INT_32 macroModeIndex, ///< [in] Index in macro tile mode table(CI)
ADDR_TILEINFO* pInfo, ///< [out] Tile Info
AddrTileMode* pMode, ///< [out] Tile mode
- AddrTileType* pType ///< [out] Tile type
+ AddrTileType* pType ///< [out] Tile type
) const
{
ADDR_E_RETURNCODE returnCode = ADDR_OK;
// Global flag to control usage of tileIndex
if (UseTileIndex(index))
{
if (index == TileIndexLinearGeneral)
{
if (pMode)
@@ -2677,21 +2678,21 @@ UINT_32 SiAddrLib::HwlComputeFmaskBits(
) const
{
UINT_32 numSamples = pIn->numSamples;
UINT_32 numFrags = GetNumFragments(numSamples, pIn->numFrags);
UINT_32 bpp;
if (numFrags != numSamples) // EQAA
{
ADDR_ASSERT(numFrags <= 8);
- if (!pIn->resolved)
+ if (pIn->resolved == FALSE)
{
if (numFrags == 1)
{
bpp = 1;
numSamples = numSamples == 16 ? 16 : 8;
}
else if (numFrags == 2)
{
ADDR_ASSERT(numSamples >= 4);
@@ -2738,21 +2739,21 @@ UINT_32 SiAddrLib::HwlComputeFmaskBits(
{
ADDR_ASSERT(numSamples >= 16);
bpp = 16*4;
numSamples = 1;
}
}
}
else // Normal AA
{
- if (!pIn->resolved)
+ if (pIn->resolved == FALSE)
{
bpp = ComputeFmaskNumPlanesFromNumSamples(numSamples);
numSamples = numSamples == 2 ? 8 : numSamples;
}
else
{
// The same as 8XX
bpp = ComputeFmaskResolvedBppFromNumSamples(numSamples);
numSamples = 1; // 1x sample
}
@@ -2854,10 +2855,11 @@ ADDR_E_RETURNCODE SiAddrLib::HwlGetMaxAlignments(
}
}
if (pOut != NULL)
{
pOut->baseAlign = maxBaseAlign;
}
return ADDR_OK;
}
+
diff --git a/src/amd/addrlib/r800/siaddrlib.h b/src/amd/addrlib/r800/siaddrlib.h
index ba1d4b5..50373cc 100644
--- a/src/amd/addrlib/r800/siaddrlib.h
+++ b/src/amd/addrlib/r800/siaddrlib.h
@@ -198,27 +198,27 @@ protected:
BOOL_32 ignoreSE,
ADDR_TILEINFO* pTileInfo) const;
virtual UINT_32 HwlPreAdjustBank(
UINT_32 tileX, UINT_32 bank, ADDR_TILEINFO* pTileInfo) const;
virtual INT_32 HwlPostCheckTileIndex(
const ADDR_TILEINFO* pInfo, AddrTileMode mode, AddrTileType type,
INT curIndex = TileIndexInvalid) const;
- virtual VOID HwlFmaskPreThunkSurfInfo(
+ virtual VOID HwlFmaskPreThunkSurfInfo(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn,
const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut,
ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn,
ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut) const;
- virtual VOID HwlFmaskPostThunkSurfInfo(
+ virtual VOID HwlFmaskPostThunkSurfInfo(
const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut,
ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut) const;
virtual UINT_32 HwlComputeFmaskBits(
const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
UINT_32* pNumSamples) const;
virtual BOOL_32 HwlReduceBankWidthHeight(
UINT_32 tileSize, UINT_32 bpp, ADDR_SURFACE_FLAGS flags, UINT_32 numSamples,
UINT_32 bankHeightAlign, UINT_32 pipes,
--
2.7.4
More information about the mesa-dev
mailing list