[igt-dev] [PATCH i-g-t 1/3] lib/intel_bufops: Fix CCS plane width calculation
Imre Deak
imre.deak at intel.com
Sat May 1 01:50:42 UTC 2021
The CCS plane width calculation was correct only for 32bpp formats,
where a 64 byte CCS unit maps to a 4 tiles * 32 pixel width on the main
surface, but for other bpps the same CCS unit maps to a
(4 tiles * 128 bytes / (bpp/8 bytes/pixel)) width. Fix the width
calculation accordingly.
Signed-off-by: Imre Deak <imre.deak at intel.com>
---
lib/intel_bufops.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/intel_bufops.h b/lib/intel_bufops.h
index 1a3d86925..3dc059808 100644
--- a/lib/intel_bufops.h
+++ b/lib/intel_bufops.h
@@ -78,7 +78,7 @@ intel_buf_ccs_width(int gen, const struct intel_buf *buf)
* main surface.
*/
if (gen >= 12)
- return DIV_ROUND_UP(intel_buf_width(buf), 128) * 64;
+ return DIV_ROUND_UP(intel_buf_width(buf), 512 / (buf->bpp / 8)) * 64;
return DIV_ROUND_UP(intel_buf_width(buf), 1024) * 128;
}
--
2.27.0
More information about the igt-dev
mailing list