<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 15, 2017 at 5:18 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, Jun 13, 2017 at 05:50:00PM +0300, Topi Pohjolainen wrote:<br>
> 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_blit.h | 13 +++++++++++++<br>
>  1 file changed, 13 insertions(+)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_blit.h b/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
> index 2604417e2d..5e4d1f5eb4 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
> @@ -28,6 +28,19 @@<br>
><br>
>  #include "brw_context.h"<br>
><br>
> +static inline unsigned<br>
> +isl_tiling_to_bufmgr_tiling(<wbr>enum isl_tiling tiling)<br>
> +{<br>
> +   if (tiling == ISL_TILING_X)<br>
> +      return I915_TILING_X;<br>
> +<br>
> +   if (tiling == ISL_TILING_Y0)<br>
<br>
</span>I actually just read the patch where this function is used. Don't we<br>
also need to return I915_TILING_Y for ISL_TILING_W? Maybe Jason can<br>
confirm.<span class="gmail-"><br></span></blockquote><div><br></div><div>I'd rather the function not lie... Also, most places in the driver today that do W-tiling use I915_TILING_NONE.  Yes, I915_TILING_NONE is sort of LINEAR but you could also interpret it as LINEAR || UNKNOWN.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
> +      return I915_TILING_Y;<br>
> +<br>
> +   /* All other are unknown to buffer allocator. */<br>
<br>
</span>It would seem that we'd like to assert for unexpected values instead of<br>
failing silently.<br><div class="gmail-HOEnZb"><div class="gmail-h5"></div></div></blockquote><div><br></div><div>I just pulled up my version:<br><br><a href="https://cgit.freedesktop.org/~jekstrand/mesa/commit/?h=wip/i965-ccs-mod-v3&id=6133059904aeaa7bd6d4ee364014f491f59083e2">https://cgit.freedesktop.org/~jekstrand/mesa/commit/?h=wip/i965-ccs-mod-v3&id=6133059904aeaa7bd6d4ee364014f491f59083e2</a><br><br></div><div>and I went with I915_TILING_NONE there.  The reason I did so was so that you could call<br></div><div><br></div><div>brw_bo_alloc_tiled(brw, name, surf.size, isl_tiling_to_i915_tiling(surf.tiling), surf.row_pitch, 0);<br><br></div><div>without having to worry about isl_tiling_to_i915_tiling asserting on you.<br><br>The only two things that the tiling is used for are scanout and fenced maps.  Even when we enable things like Yf scan-out, we'll probably do it through modifiers and not set_tiling.  At that point, the only thing that the I915_TILING parameters are actually needed for is doing fenced GTT maps (which detile on the fly).  Since you can't do a fenced map of anything other than X and Y-tiled,  I don't think we'll ever need to add I915_TILING parameters for the others because you can't do a fenced (GTT) map of a Yf, Ys, or W-tiled buffer anyway.<br><br>On the other hand, when used in something such as the blit code, 
asserting is probably the right thing to do.  One option would be to add
 a little alloc_bo_for_isl_surf helper which knows to map everything 
other than X and Y to LINEAR and make the general function assert.<br><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">
> +   return I915_TILING_NONE;<br>
> +}<br>
> +<br>
>  bool<br>
>  intelEmitCopyBlit(struct brw_context *brw,<br>
>                    GLuint cpp,<br>
> --<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>
</div></div></blockquote></div><br></div></div>