<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 13, 2017 at 12:11 PM, 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/<wbr>intel_mipmap_tree.c | 27 +++++++++++++++++++++++----<br>
1 file changed, 23 insertions(+), 4 deletions(-)<br>
<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 a2d4fa9d92..c513a69a5c 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>
@@ -1344,9 +1344,19 @@ uint32_t<br>
intel_miptree_get_aligned_<wbr>offset(const struct intel_mipmap_tree *mt,<br>
uint32_t x, uint32_t y)<br>
{<br>
- int cpp = mt->cpp;<br>
- uint32_t pitch = mt->pitch;<br>
- uint32_t tiling = mt->tiling;<br>
+ int cpp;<br>
+ uint32_t pitch;<br>
+ uint32_t tiling;<br>
+<br>
+ if (mt->surf.size > 0) {<br>
+ cpp = isl_format_get_layout(mt-><wbr>surf.format)->bpb / 8;<br>
+ pitch = mt->surf.row_pitch;<br>
+ tiling = isl_tiling_to_bufmgr_tiling(<wbr>mt->surf.tiling);<br>
+ } else {<br>
+ cpp = mt->cpp;<br>
+ pitch = mt->pitch;<br>
+ tiling = mt->tiling;<br>
+ }<br>
<br>
switch (tiling) {<br>
default:<br>
@@ -1382,8 +1392,17 @@ intel_miptree_get_tile_<wbr>offsets(const struct intel_mipmap_tree *mt,<br>
{<br>
uint32_t x, y;<br>
uint32_t mask_x, mask_y;<br>
+ uint32_t cpp, tiling;<br>
+<br>
+ if (mt->surf.size > 0) {<br>
+ cpp = isl_format_get_layout(mt-><wbr>surf.format)->bpb / 8;<br>
+ tiling = isl_tiling_to_bufmgr_tiling(<wbr>mt->surf.tiling);<br>
+ } else {<br>
+ cpp = mt->cpp;<br>
+ tiling = mt->tiling;<br>
+ }<br>
<br>
- intel_get_tile_masks(mt-><wbr>tiling, mt->cpp, &mask_x, &mask_y);<br>
+ intel_get_tile_masks(tiling, cpp, &mask_x, &mask_y);<br>
intel_miptree_get_image_<wbr>offset(mt, level, slice, &x, &y);<br></blockquote><div><br></div><div>This references the mapping table. However, I don't think your create_surface function actually fills it out for ISL-based miptrees. Did I miss something?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
*tile_x = x & mask_x;<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>