[Mesa-dev] [PATCH 11/21] intel/isl: Use the depth field of phys_level0_sa for GEN4_2D 3D surfaces
Jason Ekstrand
jason at jlekstrand.net
Wed Feb 28 17:07:17 UTC 2018
On Wed, Feb 28, 2018 at 8:32 AM, Pohjolainen, Topi <
topi.pohjolainen at gmail.com> wrote:
> On Thu, Feb 22, 2018 at 11:06:51PM -0800, Jason Ekstrand wrote:
> > This makes things a tiny bit stickier in isl_calc_phys_total_extent_el
> > but will be worth it when we enable Yf and Ys.
> > ---
> > src/intel/isl/isl.c | 18 +++---------------
> > 1 file changed, 3 insertions(+), 15 deletions(-)
> >
> > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > index 68a92b8..d3efc76 100644
> > --- a/src/intel/isl/isl.c
> > +++ b/src/intel/isl/isl.c
> > @@ -827,21 +827,10 @@ isl_calc_phys_level0_extent_sa(const struct
> isl_device *dev,
> > unreachable("bad isl_dim_layout");
> >
> > case ISL_DIM_LAYOUT_GEN4_2D:
> > - assert(ISL_DEV_GEN(dev) >= 9);
> > -
>
> Why do we need to drop this assert?
>
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.
> > + case ISL_DIM_LAYOUT_GEN4_3D:
> > *phys_level0_sa = (struct isl_extent4d) {
> > .w = isl_align_npot(info->width, fmtl->bw),
> > .h = isl_align_npot(info->height, fmtl->bh),
> > - .d = 1,
> > - .a = info->depth,
> > - };
> > - break;
> > -
> > - case ISL_DIM_LAYOUT_GEN4_3D:
> > - assert(ISL_DEV_GEN(dev) < 9);
> > - *phys_level0_sa = (struct isl_extent4d) {
> > - .w = isl_align(info->width, fmtl->bw),
> > - .h = isl_align(info->height, fmtl->bh),
> > .d = info->depth,
> > .a = 1,
> > };
> > @@ -968,8 +957,6 @@ isl_calc_phys_slice0_extent_sa_gen4_2d(
> > {
> > const struct isl_format_layout *fmtl = isl_format_get_layout(info->
> format);
> >
> > - assert(phys_level0_sa->depth == 1);
> > -
> > if (info->levels == 1) {
> > /* Do not pad the surface to the image alignment. Instead, pad it
> only
> > * to the pixel format's block alignment.
> > @@ -1052,9 +1039,10 @@ isl_calc_phys_total_extent_el_gen4_2d(
> > image_align_sa,
> phys_level0_sa,
> > array_pitch_span,
> > &phys_slice0_sa);
> > + uint32_t array_len = MAX(phys_level0_sa->d, phys_level0_sa->a);
> > *phys_total_el = (struct isl_extent4d) {
> > .w = isl_assert_div(phys_slice0_sa.w, fmtl->bw),
> > - .h = *array_pitch_el_rows * (phys_level0_sa->array_len - 1) +
> > + .h = *array_pitch_el_rows * (array_len - 1) +
> > isl_assert_div(phys_slice0_sa.h, fmtl->bh),
> > .d = 1,
> > .a = 1,
> > --
> > 2.5.0.400.gff86faf
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180228/e11dcaef/attachment.html>
More information about the mesa-dev
mailing list