<div dir="ltr"><div>6-9 are<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 21, 2017 at 8:01 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">There is the same constraintg later on as assert in<br>
isl_gen7_choose_image_<wbr>alignment_el() so catch it earlier in order<br>
to return error instead of crash.<br>
<br>
Needed to avoid crashes with piglits on IVB and HSW:<br>
<br>
arb_internalformat_query2.<wbr>image_format_compatibility_<wbr>type pname checks<br>
arb_internalformat_query2.all internalformat_<x>_type pname checks<br>
arb_internalformat_query2.max dimensions related pname checks<br>
arb_copy_image.arb_copy_image-<wbr>formats --samples=2/4/6/8<br>
arb_texture_float.multisample-<wbr>fast-clear gl_arb_texture_float<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 | 42 +++++++++++++++++++++++-------<wbr>------------<br>
1 file changed, 23 insertions(+), 19 deletions(-)<br>
<br>
diff --git a/src/intel/isl/isl_gen7.c b/src/intel/isl/isl_gen7.c<br>
index ab47a7f622..24d411f51e 100644<br>
--- a/src/intel/isl/isl_gen7.c<br>
+++ b/src/intel/isl/isl_gen7.c<br>
@@ -24,6 +24,25 @@<br>
#include "isl_gen7.h"<br>
#include "isl_priv.h"<br>
<br>
+static bool<br>
+gen7_format_needs_valign2(<wbr>const struct isl_device *dev,<br>
+ enum isl_format format)<br>
+{<br>
+ assert(ISL_DEV_GEN(dev) == 7);<br>
+<br>
+ /* From the Ivybridge PRM (2012-05-31), Volume 4, Part 1, Section 2.12.1,<br>
+ * RENDER_SURFACE_STATE Surface Vertical Alignment:<br>
+ *<br>
+ * - Value of 1 [VALIGN_4] is not supported for format YCRCB_NORMAL<br>
+ * (0x182), YCRCB_SWAPUVY (0x183), YCRCB_SWAPUV (0x18f), YCRCB_SWAPY<br>
+ * (0x190)<br>
+ *<br>
+ * - VALIGN_4 is not supported for surface format R32G32B32_FLOAT.<br>
+ */<br>
+ return isl_format_is_yuv(format) ||<br>
+ format == ISL_FORMAT_R32G32B32_FLOAT;<br>
+}<br>
+<br>
bool<br>
isl_gen7_choose_msaa_layout(<wbr>const struct isl_device *dev,<br>
const struct isl_surf_init_info *info,<br>
@@ -81,6 +100,10 @@ isl_gen7_choose_msaa_layout(<wbr>const struct isl_device *dev,<br>
* surfaces with RGBA8I, RGBA16I and RGBA32I.<br>
*/<br>
<br>
+ /* Multisampling requires vertical alignment of four. */<br>
+ if (info->samples > 1 && gen7_format_needs_valign2(dev, info->format))<br>
+ return false;<br>
+<br>
/* More obvious restrictions */<br>
if (isl_surf_usage_is_display(<wbr>info->usage))<br>
return false;<br>
@@ -152,25 +175,6 @@ isl_gen7_choose_msaa_layout(<wbr>const struct isl_device *dev,<br>
return true;<br>
}<br>
<br>
-static bool<br>
-gen7_format_needs_valign2(<wbr>const struct isl_device *dev,<br>
- enum isl_format format)<br>
-{<br>
- assert(ISL_DEV_GEN(dev) == 7);<br>
-<br>
- /* From the Ivybridge PRM (2012-05-31), Volume 4, Part 1, Section 2.12.1,<br>
- * RENDER_SURFACE_STATE Surface Vertical Alignment:<br>
- *<br>
- * - Value of 1 [VALIGN_4] is not supported for format YCRCB_NORMAL<br>
- * (0x182), YCRCB_SWAPUVY (0x183), YCRCB_SWAPUV (0x18f), YCRCB_SWAPY<br>
- * (0x190)<br>
- *<br>
- * - VALIGN_4 is not supported for surface format R32G32B32_FLOAT.<br>
- */<br>
- return isl_format_is_yuv(format) ||<br>
- format == ISL_FORMAT_R32G32B32_FLOAT;<br>
-}<br>
-<br>
/**<br>
* @brief Filter out tiling flags that are incompatible with the surface.<br>
*<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<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>