summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2015-02-10 19:17:30 -0800
committerBen Widawsky <benjamin.widawsky@intel.com>2015-02-22 23:42:06 -0800
commit7d5f688d05fedae7ba7d8052c452e167cc2fac0d (patch)
treedf173ef09a8fb89a64c9c2a1dbaf805e1f37414d
parent6e62a52865787362ae1deb9dee80140d3a66c519 (diff)
i965: Kill y_or_x variable in miptree tiling selection
IMHO, intel_miptree_choose_tiling() is an unfortunate incarnation because it conflates what is permitted vs. what is desirable. This makes doing any sort of "fallback" operations after the fact somewhat kludgey. The original code basically says: "if we requested x XOR y-tiled, and the region > aperture; then try to x-tiled" Better would be: "if we *received* x OR y-tiled, and the region > aperture; then try to x-tiled" Optimally it is: "if we can use either x OR y-tiled and got y-tiled, and the region > aperture; then try x tiled" This patch actually addresses two potential issues: 1. As far as I can tell, drm_intel_gem_bo_alloc_tiled() which is invariably called, can potentially change the tiling type. Therefore, we shouldn't be checking the requested tiling type, but rather the granted tiling 2. The existing code can fall back to X-tiled even if choose_tiling said X-tiling was not okay. Neither of these are probably actually an issue, but this simply makes the code correct. The changes behavior originally introduced here: commit cbe24ff7c8d69a6d378d9c2cce2bc117517f4302 Author: Kenneth Graunke <kenneth@whitecape.org> Date: Wed Apr 10 13:49:16 2013 -0700 intel: Fall back to X-tiling when larger than estimated aperture size. Cc: Kenneth Graunke <kenneth@whitecape.org> Cc: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 0e3888f3fb..235f05ab60 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -630,10 +630,8 @@ intel_miptree_create(struct brw_context *brw,
uint32_t tiling = intel_miptree_choose_tiling(brw, format, width0,
num_samples, requested_tiling,
mt);
- bool y_or_x = false;
if (tiling == (I915_TILING_Y | I915_TILING_X)) {
- y_or_x = true;
mt->tiling = I915_TILING_Y;
} else {
mt->tiling = tiling;
@@ -652,7 +650,9 @@ intel_miptree_create(struct brw_context *brw,
* BLT engine to support it. The BLT paths can't currently handle Y-tiling,
* so we need to fall back to X.
*/
- if (y_or_x && mt->bo->size >= brw->max_gtt_map_object_size) {
+ if (mt->bo->size >= brw->max_gtt_map_object_size &&
+ mt->tiling == I915_TILING_Y &&
+ requested_tiling == INTEL_MIPTREE_TILING_ANY) {
perf_debug("%dx%d miptree larger than aperture; falling back to X-tiled\n",
mt->total_width, mt->total_height);