<div dir="ltr"><div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>I also pushed it because I need it for my little series to implement MCS in the Vulkan driver.<br><br></div>--Jason<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 5:31 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">v2: Instead of having the same block in isl_gen7,8,9.c add it<br>
once into isl.c::isl_choose_image_<wbr>alignment_el() instead.<br>
<br>
CC: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
<span class="">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
</span> src/intel/isl/isl.c | 17 ++++++++++++++++-<br>
1 file changed, 16 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
index 82ab68d..957ffd5 100644<br>
--- a/src/intel/isl/isl.c<br>
+++ b/src/intel/isl/isl.c<br>
@@ -480,7 +480,22 @@ isl_choose_image_alignment_el(<wbr>const struct isl_device *dev,<br>
enum isl_msaa_layout msaa_layout,<br>
struct isl_extent3d *image_align_el)<br>
{<br>
- if (info->format == ISL_FORMAT_HIZ) {<br>
+ const struct isl_format_layout *fmtl = isl_format_get_layout(info-><wbr>format);<br>
<span class="">+ if (fmtl->txc == ISL_TXC_MCS) {<br>
+ assert(tiling == ISL_TILING_Y0);<br>
+<br>
+ /*<br>
+ * IvyBrigde PRM Vol 2, Part 1, "11.7 MCS Buffer for Render Target(s)":<br>
+ *<br>
+ * Height, width, and layout of MCS buffer in this case must match with<br>
+ * Render Target height, width, and layout. MCS buffer is tiledY.<br>
+ *<br>
+ * To avoid wasting memory, choose the smallest alignment possible:<br>
+ * HALIGN_4 and VALIGN_4.<br>
+ */<br>
+ *image_align_el = isl_extent3d(4, 4, 1);<br>
+ return;<br>
</span>+ } else if (info->format == ISL_FORMAT_HIZ) {<br>
assert(ISL_DEV_GEN(dev) >= 6);<br>
/* HiZ surfaces are always aligned to 16x8 pixels in the primary surface<br>
* which works out to 2x2 HiZ elments.<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
</font></span></blockquote></div><br></div></div></div></div></div>