<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 28, 2018 at 8:32 AM, Pohjolainen, Topi <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"><span class="">On Thu, Feb 22, 2018 at 11:06:51PM -0800, Jason Ekstrand wrote:<br>
> This makes things a tiny bit stickier in isl_calc_phys_total_extent_el<br>
> but will be worth it when we enable Yf and Ys.<br>
> ---<br>
>  src/intel/isl/isl.c | 18 +++---------------<br>
>  1 file changed, 3 insertions(+), 15 deletions(-)<br>
><br>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
> index 68a92b8..d3efc76 100644<br>
> --- a/src/intel/isl/isl.c<br>
> +++ b/src/intel/isl/isl.c<br>
> @@ -827,21 +827,10 @@ isl_calc_phys_level0_extent_<wbr>sa(const struct isl_device *dev,<br>
>           unreachable("bad isl_dim_layout");<br>
><br>
>        case ISL_DIM_LAYOUT_GEN4_2D:<br>
> -         assert(ISL_DEV_GEN(dev) >= 9);<br>
> -<br>
<br>
</span>Why do we need to drop this assert?<br><div><div class="h5"></div></div></blockquote><div><br></div><div>I guess we don't have to.  I mostly did it because the two cases are merging and the following code will be correct on all gens.  We could just keep assert and let it fall through to the next case.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
> +      case ISL_DIM_LAYOUT_GEN4_3D:<br>
>           *phys_level0_sa = (struct isl_extent4d) {<br>
>              .w = isl_align_npot(info->width, fmtl->bw),<br>
>              .h = isl_align_npot(info->height, fmtl->bh),<br>
> -            .d = 1,<br>
> -            .a = info->depth,<br>
> -         };<br>
> -         break;<br>
> -<br>
> -      case ISL_DIM_LAYOUT_GEN4_3D:<br>
> -         assert(ISL_DEV_GEN(dev) < 9);<br>
> -         *phys_level0_sa = (struct isl_extent4d) {<br>
> -            .w = isl_align(info->width, fmtl->bw),<br>
> -            .h = isl_align(info->height, fmtl->bh),<br>
>              .d = info->depth,<br>
>              .a = 1,<br>
>           };<br>
> @@ -968,8 +957,6 @@ isl_calc_phys_slice0_extent_<wbr>sa_gen4_2d(<br>
>  {<br>
>     const struct isl_format_layout *fmtl = isl_format_get_layout(info-><wbr>format);<br>
><br>
> -   assert(phys_level0_sa->depth == 1);<br>
> -<br>
>     if (info->levels == 1) {<br>
>        /* Do not pad the surface to the image alignment. Instead, pad it only<br>
>         * to the pixel format's block alignment.<br>
> @@ -1052,9 +1039,10 @@ isl_calc_phys_total_extent_el_<wbr>gen4_2d(<br>
>                                             image_align_sa, phys_level0_sa,<br>
>                                             array_pitch_span,<br>
>                                             &phys_slice0_sa);<br>
> +   uint32_t array_len = MAX(phys_level0_sa->d, phys_level0_sa->a);<br>
>     *phys_total_el = (struct isl_extent4d) {<br>
>        .w = isl_assert_div(phys_slice0_sa.<wbr>w, fmtl->bw),<br>
> -      .h = *array_pitch_el_rows * (phys_level0_sa->array_len - 1) +<br>
> +      .h = *array_pitch_el_rows * (array_len - 1) +<br>
>             isl_assert_div(phys_slice0_sa.<wbr>h, fmtl->bh),<br>
>        .d = 1,<br>
>        .a = 1,<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> ______________________________<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>
</blockquote></div><br></div></div>