<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 11, 2017 at 5:55 PM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@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: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
src/intel/isl/isl_surface_<wbr>state.c | 38 ++++++++++++++++++++++++++++++<wbr>+++++---<br>
1 file changed, 35 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/isl/isl_surface_<wbr>state.c b/src/intel/isl/isl_surface_<wbr>state.c<br>
index b9093cc951..54e48eb5da 100644<br>
--- a/src/intel/isl/isl_surface_<wbr>state.c<br>
+++ b/src/intel/isl/isl_surface_<wbr>state.c<br>
@@ -498,11 +498,14 @@ isl_genX(surf_fill_state_s)(<wbr>const struct isl_device *dev, void *state,<br>
assert(info->y_offset_sa % y_div == 0);<br>
s.XOffset = info->x_offset_sa / x_div;<br>
s.YOffset = info->y_offset_sa / y_div;<br>
-#else<br>
- assert(info->x_offset_sa == 0);<br>
- assert(info->y_offset_sa == 0);<br>
#endif<br>
<br>
+ /* If Auxiliary Surface Mode is not AUX_NONE, this field must be zero. */<br>
+ if ((GEN_GEN == 4 && !GEN_IS_G4X) || info->aux_usage != ISL_AUX_USAGE_NONE) {<br>
+ assert(info->x_offset_sa == 0);<br>
+ assert(info->y_offset_sa == 0);<br></blockquote><div><br></div><div>I believe we already handle this higher up.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ }<br>
+<br>
#if GEN_GEN >= 7<br>
if (info->aux_surf && info->aux_usage != ISL_AUX_USAGE_NONE) {<br>
struct isl_tile_info tile_info;<br>
@@ -520,6 +523,26 @@ isl_genX(surf_fill_state_s)(<wbr>const struct isl_device *dev, void *state,<br>
s.AuxiliarySurfaceQPitch =<br>
isl_surf_get_array_pitch_sa_<wbr>rows(info->aux_surf) >> 2;<br>
s.AuxiliarySurfaceBaseAddress = info->aux_address;<br>
+<br>
+ if (info->aux_usage == ISL_AUX_USAGE_HIZ) {<br>
+ /* The number of samples must be 1 */<br>
+ assert(info->surf->samples == 1);<br>
+<br>
+ /* The dimension must not be 3D */<br>
+ assert(info->surf->dim != ISL_SURF_DIM_3D);<br>
+<br>
+ /* The format must be one of the following: */<br>
+ switch (info->view->format) {<br></blockquote><div><br></div><div>How about<br><br></div><div>assert(info->view->format == ISL_FORMAT_R32_FLOT ||<br></div><div> info->view->format...<br><br></div><div>Mostly cosmatic. Doesn't really matter.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ case ISL_FORMAT_R32_FLOAT:<br>
+ case ISL_FORMAT_R24_UNORM_X8_<wbr>TYPELESS:<br>
+ case ISL_FORMAT_R16_UNORM:<br>
+ break;<br>
+ default:<br>
+ assert(!"Incompatible HiZ Sampling format");<br>
+ break;<br>
+ }<br>
+ }<br>
+<br>
s.AuxiliarySurfaceMode = isl_to_gen_aux_mode[info->aux_<wbr>usage];<br>
#else<br>
assert(info->aux_usage == ISL_AUX_USAGE_MCS ||<br>
@@ -548,6 +571,15 @@ isl_genX(surf_fill_state_s)(<wbr>const struct isl_device *dev, void *state,<br>
s.SamplerL2BypassModeDisable = true;<br>
break;<br>
default:<br>
+ /* From the SKL PRM, Programming Note under Sampler Output Channel<br>
+ * Mapping:<br>
+ *<br>
+ * If a surface has an associated HiZ Auxilliary surface, the<br>
+ * Sampler L2 Bypass Mode Disable field in the RENDER_SURFACE_STATE<br>
+ * must be set.<br>
+ */<br>
+ if (GEN_GEN >= 9 && info->aux_usage == ISL_AUX_USAGE_HIZ)<br>
+ s.SamplerL2BypassModeDisable = true;<br>
break;<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<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>