summaryrefslogtreecommitdiffstats
path: root/src/amd/addrlib
diff options
context:
space:
mode:
authorRoy Zhan <[email protected]>2016-01-10 07:56:11 -0500
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commitca88f832224fdf069a7d2c4337d543dd246ed3b9 (patch)
treecb49e770ebc83554170cac447df40e5a7e4210ab /src/amd/addrlib
parentc867a2b22268eadb9cf1a899fae0736adcbab7bc (diff)
amdgpu/addrlib: support non-power2 height alignment (for linear surface)
Diffstat (limited to 'src/amd/addrlib')
-rw-r--r--src/amd/addrlib/core/addrlib1.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp
index 040891c431c..34e286e4dd3 100644
--- a/src/amd/addrlib/core/addrlib1.cpp
+++ b/src/amd/addrlib/core/addrlib1.cpp
@@ -3278,7 +3278,16 @@ VOID Lib::PadDimensions(
if (padDims > 1)
{
- *pHeight = PowTwoAlign((*pHeight), heightAlign);
+ if (IsPow2(heightAlign))
+ {
+ *pHeight = PowTwoAlign((*pHeight), heightAlign);
+ }
+ else
+ {
+ *pHeight += heightAlign - 1;
+ *pHeight /= heightAlign;
+ *pHeight *= heightAlign;
+ }
}
if (padDims > 2 || thickness > 1)