#include "isl_gen7.h"
#include "isl_priv.h"
+static bool
+gen7_format_needs_valign2(const struct isl_device *dev,
+ enum isl_format format)
+{
+ assert(ISL_DEV_GEN(dev) == 7);
+
+ /* From the Ivybridge PRM (2012-05-31), Volume 4, Part 1, Section 2.12.1,
+ * RENDER_SURFACE_STATE Surface Vertical Alignment:
+ *
+ * - Value of 1 [VALIGN_4] is not supported for format YCRCB_NORMAL
+ * (0x182), YCRCB_SWAPUVY (0x183), YCRCB_SWAPUV (0x18f), YCRCB_SWAPY
+ * (0x190)
+ *
+ * - VALIGN_4 is not supported for surface format R32G32B32_FLOAT.
+ */
+ return isl_format_is_yuv(format) ||
+ format == ISL_FORMAT_R32G32B32_FLOAT;
+}
+
bool
isl_gen7_choose_msaa_layout(const struct isl_device *dev,
const struct isl_surf_init_info *info,
* surfaces with RGBA8I, RGBA16I and RGBA32I.
*/
+ /* Multisampling requires vertical alignment of four. */
+ if (info->samples > 1 && gen7_format_needs_valign2(dev, info->format))
+ return false;
+
/* More obvious restrictions */
if (isl_surf_usage_is_display(info->usage))
return false;
return true;
}
-static bool
-gen7_format_needs_valign2(const struct isl_device *dev,
- enum isl_format format)
-{
- assert(ISL_DEV_GEN(dev) == 7);
-
- /* From the Ivybridge PRM (2012-05-31), Volume 4, Part 1, Section 2.12.1,
- * RENDER_SURFACE_STATE Surface Vertical Alignment:
- *
- * - Value of 1 [VALIGN_4] is not supported for format YCRCB_NORMAL
- * (0x182), YCRCB_SWAPUVY (0x183), YCRCB_SWAPUV (0x18f), YCRCB_SWAPY
- * (0x190)
- *
- * - VALIGN_4 is not supported for surface format R32G32B32_FLOAT.
- */
- return isl_format_is_yuv(format) ||
- format == ISL_FORMAT_R32G32B32_FLOAT;
-}
-
/**
* @brief Filter out tiling flags that are incompatible with the surface.
*