From: Roy Zhan Date: Sun, 10 Jan 2016 12:56:11 +0000 (-0500) Subject: amdgpu/addrlib: support non-power2 height alignment (for linear surface) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca88f832224fdf069a7d2c4337d543dd246ed3b9;p=mesa.git amdgpu/addrlib: support non-power2 height alignment (for linear surface) --- 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)