diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2016-10-17 08:43:50 -0700 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2016-10-21 15:28:59 -0700 |
commit | 124c8a69fd9c7a0c41585fcf42b13d2584ec87f3 (patch) | |
tree | 466b52149ee19d5ab69efe25843de94f15e78c73 | |
parent | 3645be82f6456b5e7de45c819f96a59e1437932a (diff) |
i965: Set up a second "fake" miptree for aux CCS_Eimage_ccs_alloc
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 95a1b9f82a..7f9760288b 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -218,6 +218,9 @@ intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw, if (mt->disable_aux_buffers) return false; + if (mt->is_scanout) + return false; + /* This function applies only to non-multisampled render targets. */ if (mt->num_samples > 1) return false; @@ -801,6 +804,7 @@ intel_miptree_create(struct brw_context *brw, * resolves. */ const bool lossless_compression_disabled = INTEL_DEBUG & DEBUG_NO_RBC; + assert(!mt->is_scanout); const bool is_lossless_compressed = unlikely(!lossless_compression_disabled) && brw->gen >= 9 && !mt->is_scanout && @@ -876,15 +880,39 @@ intel_miptree_create_for_image(struct brw_context *intel, uint32_t height, uint32_t pitch) { - return intel_miptree_create_for_bo(intel, - image->bo, - format, - offset, - width, - height, - 1, - pitch, - MIPTREE_LAYOUT_DISABLE_AUX); + struct intel_mipmap_tree *mt; + mt = intel_miptree_create_for_bo(intel, + image->bo, + format, + offset, + width, + height, + 1, + pitch, + MIPTREE_LAYOUT_DISABLE_AUX); + + if (!intel_tiling_supports_non_msrt_mcs(intel, mt->tiling)) + return mt; + + assert(image->aux_offset[0]); + assert(mt->num_samples == 1); + assert(mt->last_level < 2); + offset += image->aux_offset[0]; + + /* Width and height shouldn't actually matter because at this point we know + * it's not an MSRT image, and we've already allocated the BOs. + */ + height = DIV_ROUND_UP(height, 4); + mt->mcs_mt = intel_miptree_create_for_bo(intel, + image->bo, + format, + offset, + width, + height, + 1, + pitch, + MIPTREE_LAYOUT_DISABLE_AUX); + return mt; } /** @@ -1045,7 +1073,8 @@ intel_miptree_release(struct intel_mipmap_tree **mt) drm_intel_bo_unreference((*mt)->hiz_buf->bo); free((*mt)->hiz_buf); } - intel_miptree_release(&(*mt)->mcs_mt); + if (!(*mt)->is_scanout) + intel_miptree_release(&(*mt)->mcs_mt); intel_resolve_map_clear(&(*mt)->hiz_map); intel_miptree_release(&(*mt)->plane[0]); |