<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 20, 2017 at 10:33 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On 20/02/17 18:09, Jason Ekstrand wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
From: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><br>
<br>
v3 (Jason Ekstrand): Add a comment explaining why<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><br>
Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
---<br>
src/intel/isl/isl.c | 10 ++++++++++<br>
1 file changed, 10 insertions(+)<br>
<br>
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
index 1a47da5..6979063 100644<br>
--- a/src/intel/isl/isl.c<br>
+++ b/src/intel/isl/isl.c<br>
@@ -1417,6 +1417,16 @@ isl_surf_get_mcs_surf(const struct isl_device *dev,<br>
assert(surf->levels == 1);<br>
assert(surf->logical_level0_p<wbr>x.depth == 1);<br>
+ /* The "Auxiliary Surface Pitch" field in RENDER_SURFACE_STATE is only 9<br>
+ * bits which means the maximum pitch of a compression surface is 512<br>
+ * tiles or 64KB (since MCS is always Y-tiled). Since a 16x MCS buffer is<br>
+ * 64bpp, this gives us a maximum width of 8192 pixels. We can create<br>
+ * larger multisampled surfaces, we just can't compress them. For 2x, 4x,<br>
+ * and 8x, we have enough room for the full 16k supported by the hardware.<br>
+ */<br>
+ if (surf->samples == 16 && surf->width > 8192)<br>
+ return false;<br>
+<br>
</blockquote>
<br></div></div>
I was about to write something like this :<br>
<br>
struct isl_tile_info tile_info;<br>
isl_surf_get_tile_info(dev, surf, &tile_info);<br>
if ((surf->row_pitch / tile_info.phys_extent_B.width) > 512)<br>
return false;<br></blockquote><div><br></div><div>That would work too and it is a bit more general. However, ISL currently doesn't touch the isl_surf if creation fails. I wouldn't mind keeping that. Also, I like that the end result of the restriction is clearly spelled out with the old check. I can't say that I care all that much one way or the other so long as both the effect (16x 16k surfaces not working) and the reason (pitch) are documented.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb"><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
enum isl_format mcs_format;<br>
switch (surf->samples) {<br>
case 2: mcs_format = ISL_FORMAT_MCS_2X; break;<br>
</blockquote>
<br>
<br>
</div></div></blockquote></div><br></div></div>