From ca88f832224fdf069a7d2c4337d543dd246ed3b9 Mon Sep 17 00:00:00 2001 From: Roy Zhan Date: Sun, 10 Jan 2016 07:56:11 -0500 Subject: [PATCH] amdgpu/addrlib: support non-power2 height alignment (for linear surface) --- src/amd/addrlib/core/addrlib1.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) -- 2.30.2