diff options
author | Roy Zhan <roy.zhan@amd.com> | 2016-01-10 07:56:11 -0500 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2017-03-30 14:44:33 +0200 |
commit | ca88f832224fdf069a7d2c4337d543dd246ed3b9 (patch) | |
tree | cb49e770ebc83554170cac447df40e5a7e4210ab /src/amd/addrlib | |
parent | c867a2b22268eadb9cf1a899fae0736adcbab7bc (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.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/amd/addrlib/core/addrlib1.cpp b/src/amd/addrlib/core/addrlib1.cpp index 040891c431..34e286e4dd 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) |