i965: Don't store qpitch / 4 as mt->qpitch for compressed surfaces.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 23 Jan 2014 00:48:03 +0000 (16:48 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 26 Jan 2014 03:20:17 +0000 (19:20 -0800)
commit07149f0252c52b4ac58b6df4e307fd786b49b490
tree6297c643f9e7af9347f63403991a047b6ae529c3
parenta487b4d0e3dfdf21d9604d4e36c65c5113c4ce7a
i965: Don't store qpitch / 4 as mt->qpitch for compressed surfaces.

Broadwell requires software to specify QPitch in a bunch of packets,
so we decided to store it in the miptree.  However, when I did that
refactoring, I missed a subtlety: the hardware expects QPitch to be
"in units of rows in the uncompressed surface".

This is the value we originally compute.  However, for compressed
surfaces, we then divided it by 4 (the block height), to obtain the
physical layout.  This is no longer the QPitch Broadwell expects.

So, store the original undivided value in mt->qpitch, but continue to
use the divided value in brw_miptree_layout_texture_array().  For
non-Broadwell platforms, this should have no impact at all.

Helps fix Piglit's "getteximage-targets S3TC CUBE" test on Broadwell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_tex_layout.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h