summaryrefslogtreecommitdiffstats
path: root/src/amd/addrlib/core
diff options
context:
space:
mode:
authorXavi Zhang <[email protected]>2014-08-20 04:46:51 -0400
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commitb5d8120a07802bd14e2031642fb426838a71d31b (patch)
tree976ee83763c81b2c4281f211902552720ac7474a /src/amd/addrlib/core
parent3c3d620cf39ba1755da4faced426739ef653734b (diff)
amdgpu/addrlib: Add GetMaxAlignments
Diffstat (limited to 'src/amd/addrlib/core')
-rw-r--r--src/amd/addrlib/core/addrlib.cpp33
-rw-r--r--src/amd/addrlib/core/addrlib.h6
2 files changed, 39 insertions, 0 deletions
diff --git a/src/amd/addrlib/core/addrlib.cpp b/src/amd/addrlib/core/addrlib.cpp
index b92568ec183..4804b0d79d9 100644
--- a/src/amd/addrlib/core/addrlib.cpp
+++ b/src/amd/addrlib/core/addrlib.cpp
@@ -1872,6 +1872,39 @@ ADDR_E_RETURNCODE AddrLib::ComputeCmaskCoordFromAddr(
/**
***************************************************************************************************
+* AddrLib::GetMaxAlignments
+*
+* @brief
+* Gets maximum alignments
+*
+* @return
+* ADDR_E_RETURNCODE
+***************************************************************************************************
+*/
+ADDR_E_RETURNCODE AddrLib::GetMaxAlignments(
+ ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut ///< [out] output structure
+ ) const
+{
+ ADDR_E_RETURNCODE returnCode = ADDR_OK;
+
+ if (GetFillSizeFieldsFlags() == TRUE)
+ {
+ if (pOut->size != sizeof(ADDR_GET_MAX_ALINGMENTS_OUTPUT))
+ {
+ returnCode = ADDR_PARAMSIZEMISMATCH;
+ }
+ }
+
+ if (returnCode == ADDR_OK)
+ {
+ returnCode = HwlGetMaxAlignments(pOut);
+ }
+
+ return returnCode;
+}
+
+/**
+***************************************************************************************************
* AddrLib::ComputeTileDataWidthAndHeight
*
* @brief
diff --git a/src/amd/addrlib/core/addrlib.h b/src/amd/addrlib/core/addrlib.h
index d693fd2bcbf..3221120f8f7 100644
--- a/src/amd/addrlib/core/addrlib.h
+++ b/src/amd/addrlib/core/addrlib.h
@@ -312,6 +312,8 @@ public:
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);
@@ -419,6 +421,10 @@ protected:
{
return ADDR_NOTSUPPORTED;
}
+
+ /// Pure virtual function to get max alignments
+ virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const = 0;
+
// Compute attributes
// HTILE