amdgpu/addrlib: Add flag to report if a surface can have dcc ram
authorFrans Gu <frans.gu@amd.com>
Tue, 23 Feb 2016 03:05:19 +0000 (22:05 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 Mar 2017 12:44:33 +0000 (14:44 +0200)
src/amd/addrlib/addrinterface.h
src/amd/addrlib/r800/ciaddrlib.cpp
src/amd/addrlib/r800/siaddrlib.h

index 55f3ebc3f43f37d2c374648540fb0b192ab33233..a2a36cd1173e82ef8c1749e072f3fb02876dede2 100644 (file)
@@ -609,7 +609,8 @@ typedef struct _ADDR_COMPUTE_SURFACE_INFO_OUTPUT
         UINT_32     last2DLevel  : 1;  ///< TRUE if this is the last 2D(3D) tiled
                                        ///< Only meaningful when create flag checkLast2DLevel is set
         UINT_32     tcCompatible : 1;  ///< If the surface can be shader compatible
-        UINT_32     reserved     :30;  ///< Reserved bits
+        UINT_32     dccUnsupport : 1;  ///< If the surface can support DCC compressed rendering
+        UINT_32     reserved     :29;  ///< Reserved bits
     };
 
     UINT_32         equationIndex;     ///< Equation index in the equation table;
index e5dfea2902b8278b7ae87dc0aa0c1b16a7002d55..ed7958d3223cc94f506a6ab7808aa816c6d32547 100644 (file)
@@ -1384,6 +1384,9 @@ VOID CiLib::HwlSetupTileInfo(
                                      tileInfo.bankWidth * tileInfo.bankHeight;
 
                     ADDR_ASSERT(macroTileBytes == PrtTileBytes);
+
+                    pOut->tcCompatible = FALSE;
+                    pOut->dccUnsupport = TRUE;
                 }
             }
         }
@@ -1396,10 +1399,30 @@ VOID CiLib::HwlSetupTileInfo(
 
         // pass tile type back for post tile index compute
         pOut->tileType = inTileType;
+
+        if (flags.depth || flags.stencil)
+        {
+            // tileSize = thickness * bpp * numSamples * 8 * 8 / 8
+            UINT_32 tileSize = thickness * bpp * numSamples * 8;
+
+            // Turn off tc compatible if row_size is smaller than tile size (tile split occurs).
+            if (m_rowSize < tileSize)
+            {
+                flags.tcCompatible = FALSE;
+                pOut->tcCompatible = FALSE;
+            }
+        }
+
+        UINT_32 numPipes = GetPipePerSurf(pTileInfo->pipeConfig);
+
+        if (m_pipes != numPipes)
+        {
+            pOut->dccUnsupport = TRUE;
+        }
     }
 
     // We only need to set up tile info if there is a valid index but macroModeIndex is invalid
-    if (index != TileIndexInvalid && macroModeIndex == TileIndexInvalid)
+    if ((index != TileIndexInvalid) && (macroModeIndex == TileIndexInvalid))
     {
         macroModeIndex = HwlComputeMacroModeIndex(index, flags, bpp, numSamples, pTileInfo);
 
index c40b5460b4f2a53d84ad2c11ebd0926ab73ce787..80c5cf4079f635c83179d1ce9d15e6c881e97cff 100644 (file)
@@ -277,6 +277,8 @@ protected:
     // Initialize equation table
     VOID InitEquationTable();
 
+    UINT_32 GetPipePerSurf(AddrPipeCfg pipeConfig) const;
+
     static const UINT_32    TileTableSize = 32;
     TileConfig          m_tileTable[TileTableSize];
     UINT_32                 m_noOfEntries;
@@ -297,8 +299,6 @@ protected:
 
 private:
 
-    UINT_32 GetPipePerSurf(AddrPipeCfg pipeConfig) const;
-
     VOID ReadGbTileMode(UINT_32 regValue, TileConfig* pCfg) const;
     BOOL_32 InitTileSettingTable(const UINT_32 *pSetting, UINT_32 noOfEntries);