summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-11-12 17:51:15 -0800
committerPaul Berry <[email protected]>2013-11-19 09:48:51 -0800
commit81b998ca48fc96753096f22949bf3785b7aa425c (patch)
tree235b388bc924ea60e84a1d4f74fe1a690b969423
parent6b40dd17cf844b9cc8d6b1a816d4e93cbf6decef (diff)
i965/gen7: Disallow Y tiling of renderable surfaces with valign of 2.
Gen7 does not allow render targets to have a vertical alignment of 2. So, when creating a surface, if its format is renderable, and its vertical alignment is 2, force it to use X tiling. Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 884ddefc5cc..292c3120b50 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -478,6 +478,23 @@ intel_miptree_choose_tiling(struct brw_context *brw,
if (brw->gen != 7 && mt->cpp >= 16)
return I915_TILING_X;
+ /* From the Ivy Bridge PRM, Vol4 Part1 2.12.2.1 (SURFACE_STATE for most
+ * messages), on p64, under the heading "Surface Vertical Alignment":
+ *
+ * This field must be set to VALIGN_4 for all tiled Y Render Target
+ * surfaces.
+ *
+ * So if the surface is renderable and uses a vertical alignment of 2,
+ * force it to be X tiled. This is somewhat conservative (it's possible
+ * that the client won't ever render to this surface), but it's difficult
+ * to know that ahead of time. And besides, since we use a vertical
+ * alignment of 4 as often as we can, this shouldn't happen very often.
+ */
+ if (brw->gen == 7 && mt->align_h == 2 &&
+ brw->format_supported_as_render_target[format]) {
+ return I915_TILING_X;
+ }
+
return I915_TILING_Y | I915_TILING_X;
}