<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 16, 2017 at 1:13 AM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Gen8 and Gen9 are already more heavily constrained as one<br>
applies arrayed/mipmapped alignment even for non-arrayed and<br>
non-mipmapped.<br>
<br>
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/intel/isl/isl_gen7.c | 39 ++++++++++++++++++++++++++++++<wbr>+++++++++<br>
1 file changed, 39 insertions(+)<br>
<br>
diff --git a/src/intel/isl/isl_gen7.c b/src/intel/isl/isl_gen7.c<br>
index 18687b5..b1874c1 100644<br>
--- a/src/intel/isl/isl_gen7.c<br>
+++ b/src/intel/isl/isl_gen7.c<br>
@@ -403,6 +403,45 @@ isl_gen7_choose_image_<wbr>alignment_el(const struct isl_device *dev,<br>
/* IVB+ does not support combined depthstencil. */<br>
assert(!isl_surf_usage_is_<wbr>depth_and_stencil(info->usage)<wbr>);<br>
<br>
+ const struct isl_format_layout *fmtl = isl_format_get_layout(info-><wbr>format);<br>
+ if (fmtl->txc == ISL_TXC_CCS) {<br>
+ assert(tiling == ISL_TILING_CCS);<br>
+<br>
+ /*<br>
+ * IvyBrigde PRM Vol 2, Part 1, "11.7 MCS Buffer for Render Target(s)":<br>
+ *<br>
+ * The following table describes the RT alignment<br>
+ * Pixels Lines<br>
+ * TiledY RT CL<br>
+ * bpp<br>
+ * 32 8 4<br>
+ * 64 4 4<br>
+ * 128 2 4<br>
+ */<br></blockquote><div><br></div><div>This isn't quite correct... Yes, the table above describes the horizontal and vertical alignment of the single-sampled MCS on Ivy Bridge. However, ISL already takes care of this for us by its choice of block sizes. Each of the CCS formats is a "compressed" format with a block size that exactly matches the alignment given in the table. Since the alignment returned by this function is in units of *elements*, the correct value should be 1x1 for all CCS formats on gen7. For instance, GEN7_CCS_32BPP_Y is a compressed format with a block size of 8x4 pixels per element and a 1x1el alignment becomes 8x4px. Does that make sense? It's a bit subtle.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ switch (fmtl->format) {<br>
+ case ISL_FORMAT_GEN7_CCS_32BPP_X:<br>
+ *image_align_el = isl_extent3d(8, 4, 1);<br>
+ return;<br>
+ case ISL_FORMAT_GEN7_CCS_64BPP_X:<br>
+ *image_align_el = isl_extent3d(4, 4, 1);<br>
+ return;<br>
+ case ISL_FORMAT_GEN7_CCS_128BPP_X:<br>
+ *image_align_el = isl_extent3d(2, 4, 1);<br>
+ return;<br>
+ case ISL_FORMAT_GEN7_CCS_32BPP_Y:<br>
+ *image_align_el = isl_extent3d(8, 4, 1);<br>
+ return;<br>
+ case ISL_FORMAT_GEN7_CCS_64BPP_Y:<br>
+ *image_align_el = isl_extent3d(4, 4, 1);<br>
+ return;<br>
+ case ISL_FORMAT_GEN7_CCS_128BPP_Y:<br>
+ *image_align_el = isl_extent3d(2, 4, 1);<br>
+ return;<br>
+ default:<br>
+ unreachable("Invalid CCS format");<br>
+ }<br>
+ }<br>
+<br>
*image_align_el = (struct isl_extent3d) {<br>
.w = gen7_choose_halign_el(dev, info),<br>
.h = gen7_choose_valign_el(dev, info, tiling),<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>