<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 21, 2018 at 1:45 PM, Rafael Antognolli <span dir="ltr"><<a href="mailto:rafael.antognolli@intel.com" target="_blank">rafael.antognolli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The lower bits seem to have extra fields in every platform but gen8<br>
(even though we don't use them in gen9). So just go ahead and avoid<br>
using them for the address.<br>
<br>
Signed-off-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com">rafael.antognolli@intel.com</a>><br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
 src/intel/vulkan/anv_image.c | 30 +++++++++++++++++-------------<br>
 1 file changed, 17 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index a297cc47320..a0aee43bd21 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -1117,19 +1117,23 @@ anv_image_fill_surface_state(<wbr>struct anv_device *device,<br>
                           .x_offset_sa = tile_x_sa,<br>
                           .y_offset_sa = tile_y_sa);<br>
       state_inout->address = address + offset_B;<br>
-      if (device->info.gen >= 8) {<br>
-         state_inout->aux_address = aux_address;<br>
-      } else {<br>
-         /* On gen7 and prior, the bottom 12 bits of the MCS base address are<br>
-          * used to store other information.  This should be ok, however,<br>
-          * because surface buffer addresses are always 4K page alinged.<br>
-          */<br>
-         uint32_t *aux_addr_dw = state_inout->state.map +<br>
-                                 device->isl_dev.ss.aux_addr_<wbr>offset;<br>
-         assert((aux_address & 0xfff) == 0);<br>
-         assert(aux_address == (*aux_addr_dw & 0xfffff000));<br>
-         state_inout->aux_address = *aux_addr_dw;<br>
-      }<br>
+<br>
+      /* On gen7 and prior, the bottom 12 bits of the MCS base address are<br>
+       * used to store other information.  This should be ok, however,<br>
+       * because surface buffer addresses are always 4K page alinged.<br>
+       *<br>
+       * On gen9, the bottom 10 bits can be used, but we don't use them. On<br>
+       * gen10 the bit 10 needs to be used.<br>
+       *<br>
+       * Since the trend seems to be that we might end up using them anyway<br>
+       * (gen8 being the only exception), just always make sure they don't get<br>
+       * overriden by the address.<br></blockquote><div><br></div><div>You could say something a bit simpler like replacing the entire comment with:<br><br></div><div>With the exception of gen8, the bottom 12 bits of the MCS base address are used to store other information.  This should be ok, however, because the surface buffer addresses are always 4K page aligned.<br><br></div><div>If we're going to just handle it on all gens, I see no reson to have a huge discussion of the history.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+       */<br>
+      uint32_t *aux_addr_dw = state_inout->state.map +<br>
+         device->isl_dev.ss.aux_addr_<wbr>offset;<br></blockquote><div><br></div><div>I had to think about endianness to make sure you were getting the right 32 bits in the gen8+ case, but you are.  :-)<br><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+      assert((aux_address & 0xfff) == 0);<br>
+      assert(aux_address == (*aux_addr_dw & 0xfffff000));<br>
+      state_inout->aux_address = *aux_addr_dw;<br>
    }<br>
<br>
    anv_state_flush(device, state_inout->state);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<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>