ac/surface/gfx9: let addrlib choose the preferred swizzle kind
[mesa.git] / src / amd / addrlib / r800 / ciaddrlib.h
index 7fa6b75e8643d24011c446ab2174014a19c1b6e5..28c19f060318cf6ca4d5543866844fb3835b5e92 100644 (file)
@@ -42,37 +42,6 @@ namespace Addr
 namespace V1
 {
 
-/**
-****************************************************************************************************
-* @brief CI specific settings structure.
-****************************************************************************************************
-*/
-struct CIChipSettings
-{
-    struct
-    {
-        UINT_32 isSeaIsland : 1;
-        UINT_32 isBonaire   : 1;
-        UINT_32 isKaveri    : 1;
-        UINT_32 isSpectre   : 1;
-        UINT_32 isSpooky    : 1;
-        UINT_32 isKalindi   : 1;
-        // Hawaii is GFXIP 7.2
-        UINT_32 isHawaii    : 1;
-
-        // VI
-        UINT_32 isVolcanicIslands : 1;
-        UINT_32 isIceland         : 1;
-        UINT_32 isTonga           : 1;
-        UINT_32 isFiji            : 1;
-        UINT_32 isPolaris10       : 1;
-        UINT_32 isPolaris11       : 1;
-        UINT_32 isPolaris12       : 1;
-        // VI fusion (Carrizo)
-        UINT_32 isCarrizo         : 1;
-    };
-};
-
 /**
 ****************************************************************************************************
 * @brief This class is the CI specific address library
@@ -168,7 +137,9 @@ protected:
         const ADDR_COMPUTE_HTILE_ADDRFROMCOORD_INPUT*  pIn,
         ADDR_COMPUTE_HTILE_ADDRFROMCOORD_OUTPUT*       pOut) const;
 
-    virtual ADDR_E_RETURNCODE HwlGetMaxAlignments(ADDR_GET_MAX_ALINGMENTS_OUTPUT* pOut) const;
+    virtual UINT_32 HwlComputeMaxBaseAlignments() const;
+
+    virtual UINT_32 HwlComputeMaxMetaBaseAlignments() const;
 
     virtual VOID HwlPadDimensions(
         AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags,
@@ -177,9 +148,7 @@ protected:
 
     virtual VOID HwlComputeSurfaceAlignmentsMacroTiled(
         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,
-        UINT_32* pMacroTileWidth, UINT_32* pMacroTileHeight) const;
+        UINT_32 mipLevel, UINT_32 numSamples, ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
 
 private:
     VOID ReadGbTileMode(
@@ -206,12 +175,22 @@ private:
         UINT_32 numOfBanks,
         UINT_32 numOfSamplesPerSplit) const;
 
+    BOOL_32 DepthStencilTileCfgMatch(
+        const ADDR_COMPUTE_SURFACE_INFO_INPUT*  pIn,
+        ADDR_COMPUTE_SURFACE_INFO_OUTPUT*       pOut) const;
+
+    BOOL_32 CheckTcCompatibility(const ADDR_TILEINFO* pTileInfo, UINT_32 bpp, AddrTileMode tileMode,
+                                 AddrTileType tileType, const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+
     static const UINT_32    MacroTileTableSize = 16;
+    static const UINT_32    PrtMacroModeOffset = MacroTileTableSize / 2;
+    static const INT_32     MinDepth2DThinIndex = 0;
+    static const INT_32     MaxDepth2DThinIndex = 4;
+    static const INT_32     Depth1DThinIndex = 5;
+
     ADDR_TILEINFO           m_macroTileTable[MacroTileTableSize];
     UINT_32                 m_noOfMacroEntries;
     BOOL_32                 m_allowNonDispThickModes;
-
-    CIChipSettings          m_settings;
 };
 
 } // V1