<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 16, 2017 at 1:14 AM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 25 ++++++++++++-------------<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 6 ++++++<br>
2 files changed, 18 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
index 8ecbd0e..f511683 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -114,7 +114,7 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
uint32_t safe_aux_usage,<br>
unsigned *level,<br>
unsigned start_layer, unsigned num_layers,<br>
- struct isl_surf tmp_surfs[2])<br>
+ struct isl_surf tmp_surfs[1])<br>
{<br>
if (mt->msaa_layout == INTEL_MSAA_LAYOUT_UMS ||<br>
mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {<br>
@@ -172,12 +172,12 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
<br>
surf->aux_usage = intel_miptree_get_aux_isl_<wbr>usage(brw, mt);<br>
<br>
- struct isl_surf *aux_surf = &tmp_surfs[1];<br>
+ struct isl_surf *aux_surf = NULL;<br>
<br>
if (mt->mcs_buf)<br>
- *aux_surf = mt->mcs_buf->surf;<br>
- else<br>
- intel_miptree_get_aux_isl_<wbr>surf(brw, mt, surf->aux_usage, aux_surf);<br>
+ aux_surf = &mt->mcs_buf->surf;<br>
+ else if (mt->hiz_buf)<br>
+ aux_surf = &mt->hiz_buf->surf;<br>
<br>
if (surf->aux_usage != ISL_AUX_USAGE_NONE) {<br>
if (surf->aux_usage == ISL_AUX_USAGE_HIZ) {<br>
@@ -248,7 +248,6 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
* consulted. Otherwise surf->aux_surf is ignored and there is<br>
* no need to adjust it. See blorp_emit_depth_stencil_<wbr>config().<br>
*/<br>
- aux_surf->row_pitch = mt->hiz_buf->pitch;<br>
}<br>
}<br>
} else {<br>
@@ -389,12 +388,12 @@ brw_blorp_blit_miptrees(struct brw_context *brw,<br>
(1 << ISL_AUX_USAGE_CCS_D);<br>
}<br>
<br>
- struct isl_surf tmp_surfs[4];<br>
+ struct isl_surf tmp_surfs[2];<br>
struct blorp_surf src_surf, dst_surf;<br>
blorp_surf_for_miptree(brw, &src_surf, src_mt, false, src_usage_flags,<br>
&src_level, src_layer, 1, &tmp_surfs[0]);<br>
blorp_surf_for_miptree(brw, &dst_surf, dst_mt, true, dst_usage_flags,<br>
- &dst_level, dst_layer, 1, &tmp_surfs[2]);<br>
+ &dst_level, dst_layer, 1, &tmp_surfs[1]);<br>
<br>
struct isl_swizzle src_isl_swizzle = {<br>
.r = swizzle_to_scs(GET_SWZ(src_<wbr>swizzle, 0)),<br>
@@ -434,7 +433,7 @@ brw_blorp_copy_miptrees(struct brw_context *brw,<br>
dst_mt->num_samples, _mesa_get_format_name(dst_mt-><wbr>format), dst_mt,<br>
dst_level, dst_layer, dst_x, dst_y);<br>
<br>
- struct isl_surf tmp_surfs[4];<br>
+ struct isl_surf tmp_surfs[2];<br>
struct blorp_surf src_surf, dst_surf;<br>
blorp_surf_for_miptree(brw, &src_surf, src_mt, false,<br>
(1 << ISL_AUX_USAGE_MCS) |<br>
@@ -443,7 +442,7 @@ brw_blorp_copy_miptrees(struct brw_context *brw,<br>
blorp_surf_for_miptree(brw, &dst_surf, dst_mt, true,<br>
(1 << ISL_AUX_USAGE_MCS) |<br>
(1 << ISL_AUX_USAGE_CCS_E),<br>
- &dst_level, dst_layer, 1, &tmp_surfs[2]);<br>
+ &dst_level, dst_layer, 1, &tmp_surfs[1]);<br>
<br>
struct blorp_batch batch;<br>
blorp_batch_init(&brw->blorp, &batch, brw, 0);<br>
@@ -849,7 +848,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,<br>
const unsigned num_layers = fb->MaxNumLayers ? irb->layer_count : 1;<br>
<br>
/* We can't setup the blorp_surf until we've allocated the MCS above */<br>
- struct isl_surf isl_tmp[2];<br>
+ struct isl_surf isl_tmp[1];<br>
struct blorp_surf surf;<br>
unsigned level = irb->mt_level;<br>
blorp_surf_for_miptree(brw, &surf, irb->mt, true,<br>
@@ -936,7 +935,7 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt,<br>
<br>
const mesa_format format = _mesa_get_srgb_format_linear(<wbr>mt->format);<br>
<br>
- struct isl_surf isl_tmp[2];<br>
+ struct isl_surf isl_tmp[1];<br>
struct blorp_surf surf;<br>
blorp_surf_for_miptree(brw, &surf, mt, true,<br>
(1 << ISL_AUX_USAGE_CCS_E) |<br>
@@ -970,7 +969,7 @@ gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,<br>
{<br>
assert(intel_miptree_level_<wbr>has_hiz(mt, level));<br>
<br>
- struct isl_surf isl_tmp[2];<br>
+ struct isl_surf isl_tmp[1];<br>
struct blorp_surf surf;<br>
blorp_surf_for_miptree(brw, &surf, mt, true, (1 << ISL_AUX_USAGE_HIZ),<br>
&level, layer, 1, isl_tmp);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 09afe92..95a674b 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -1662,6 +1662,12 @@ intel_hiz_miptree_buf_create(<wbr>struct brw_context *brw,<br>
*/<br>
buf->qpitch = 0;<br>
<br>
+ /* Blorp depth state setup relies on ISL surface. Fortunately only<br>
+ * ::row_pitch gets consulted while the rest gets ignored.<br>
+ * See blorp_emit_depth_stencil_<wbr>config().<br>
+ */<br>
+ buf->surf.row_pitch = buf->pitch;<br></blockquote><div> </div>Hrm... I don't really like this but it's also just on gen6 and everything is lie there. I guess this is probably ok for now. I think we want to clean it up somehow eventually.<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
uint32_t tiling = I915_TILING_Y;<br>
unsigned long pitch;<br>
buf->bo = drm_intel_bo_alloc_tiled(brw-><wbr>bufmgr, "hiz",<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>