summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-06-05 10:41:24 -0700
committerAnuj Phogat <[email protected]>2015-06-29 13:14:17 -0700
commit385cd3e0bed8113659f2db8976b677b090acc9d8 (patch)
treef35b9da82cc973c088903373139f016beb4711d3 /src/mesa
parentc9dbdc08b9de016ab3b076feac3df4c81009996e (diff)
i965: Make a helper function intel_miptree_release_levels()
Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_tex_layout.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 45bbf7e7d0f..fc7454b7ef7 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -804,6 +804,17 @@ intel_miptree_set_alignment(struct brw_context *brw,
}
}
+static void
+intel_miptree_release_levels(struct intel_mipmap_tree *mt)
+{
+ unsigned int level = 0;
+
+ for (level = mt->first_level; level <= mt->last_level; level++) {
+ free(mt->level[level].slice);
+ mt->level[level].slice = NULL;
+ }
+}
+
void
brw_miptree_layout(struct brw_context *brw,
struct intel_mipmap_tree *mt,
@@ -871,8 +882,6 @@ brw_miptree_layout(struct brw_context *brw,
mt->tiling = brw_miptree_choose_tiling(brw, requested, mt);
if (is_tr_mode_yf_ys_allowed) {
- unsigned int level = 0;
-
if (mt->tiling == I915_TILING_Y ||
mt->tiling == (I915_TILING_Y | I915_TILING_X) ||
mt->tr_mode == INTEL_MIPTREE_TRMODE_NONE) {
@@ -887,10 +896,7 @@ brw_miptree_layout(struct brw_context *brw,
/* Failed to use selected tr_mode. Free up the memory allocated
* for miptree levels in intel_miptree_total_width_height().
*/
- for (level = mt->first_level; level <= mt->last_level; level++) {
- free(mt->level[level].slice);
- mt->level[level].slice = NULL;
- }
+ intel_miptree_release_levels(mt);
}
i++;
}