summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-07-20 10:51:50 +0200
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commit48bf5d0800ef394879a5a229ac2ae5a15a4c75e5 (patch)
tree4dab5af28138779f2e5fff4b5fc6e9dea7e4ad05 /src/amd
parent33c25655c1f88657e69547dd4c3a43864ec84598 (diff)
amdgpu/addrlib: Fix the issue that tcCompatible HTILE slice size is not calculated correctly
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/addrlib/addrinterface.h2
-rw-r--r--src/amd/addrlib/core/addrlib1.cpp16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/amd/addrlib/addrinterface.h b/src/amd/addrlib/addrinterface.h
index 8506a45ae90..d2d6d94698e 100644
--- a/src/amd/addrlib/addrinterface.h
+++ b/src/amd/addrlib/addrinterface.h
@@ -906,6 +906,8 @@ typedef struct _ADDR_COMPUTE_HTILE_INFO_OUTPUT
UINT_32 macroWidth; ///< Macro width in pixels, actually squared cache shape
UINT_32 macroHeight; ///< Macro height in pixels
UINT_64 sliceSize; ///< Slice size, in bytes.
+ BOOL_32 sliceInterleaved; ///< Flag to indicate if different slice's htile is interleaved
+ /// Compute engine clear can't be used if htile is interleaved
} ADDR_COMPUTE_HTILE_INFO_OUTPUT;
/**
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index fb33145f88d..809bca23914 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -1295,6 +1295,22 @@ ADDR_E_RETURNCODE Lib::ComputeHtileInfo(
&pOut->macroHeight,
&pOut->sliceSize,
&pOut->baseAlign);
+
+ if (pIn->flags.tcCompatible && (pIn->numSlices > 1))
+ {
+ pOut->sliceSize = pIn->pitch * pIn->height * 4 / (8 * 8);
+
+ const UINT_32 align = HwlGetPipes(pIn->pTileInfo) * pIn->pTileInfo->banks * m_pipeInterleaveBytes;
+
+ if ((pOut->sliceSize % align) == 0)
+ {
+ pOut->sliceInterleaved = FALSE;
+ }
+ else
+ {
+ pOut->sliceInterleaved = TRUE;
+ }
+ }
}
}