Re: [Mesa-dev] [PATCH 15/22] i965/miptree: Prepare compressed offsets for isl based

2017-07-19 Thread Pohjolainen, Topi
On Tue, Jul 18, 2017 at 02:01:25PM -0700, Jason Ekstrand wrote:
> On Tue, Jul 18, 2017 at 1:46 AM, Topi Pohjolainen <
> topi.pohjolai...@gmail.com> wrote:
> 
> > Signed-off-by: Topi Pohjolainen 
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 +
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index a0b129adb4..1b8c0da80d 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -1462,6 +1462,15 @@ intel_miptree_get_image_offset(const struct
> > intel_mipmap_tree *mt,
> >isl_surf_get_image_offset_sa(&mt->surf, level, slice, z,
> > &x_offset_sa, &y_offset_sa);
> >
> > +  /* In case of compressed formats offsets are expected as blocks. */
> > +  if (mt->compressed) {
> > + const struct isl_format_layout *fmtl =
> > +isl_format_get_layout(mt->surf.format);
> > +
> > + x_offset_sa /= fmtl->bw;
> > + y_offset_sa /= fmtl->bh;
> > +  }
> >
> 
> I think what you probably want is to just to switch to
> isl_surf_get_image_offset_el()

Good call, thanks, changed locally.

> 
> --Jason
> 
> 
> > +
> >*x = x_offset_sa;
> >*y = y_offset_sa;
> >return;
> > --
> > 2.11.0
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 15/22] i965/miptree: Prepare compressed offsets for isl based

2017-07-18 Thread Jason Ekstrand
On Tue, Jul 18, 2017 at 1:46 AM, Topi Pohjolainen <
topi.pohjolai...@gmail.com> wrote:

> Signed-off-by: Topi Pohjolainen 
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index a0b129adb4..1b8c0da80d 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -1462,6 +1462,15 @@ intel_miptree_get_image_offset(const struct
> intel_mipmap_tree *mt,
>isl_surf_get_image_offset_sa(&mt->surf, level, slice, z,
> &x_offset_sa, &y_offset_sa);
>
> +  /* In case of compressed formats offsets are expected as blocks. */
> +  if (mt->compressed) {
> + const struct isl_format_layout *fmtl =
> +isl_format_get_layout(mt->surf.format);
> +
> + x_offset_sa /= fmtl->bw;
> + y_offset_sa /= fmtl->bh;
> +  }
>

I think what you probably want is to just to switch to
isl_surf_get_image_offset_el()

--Jason


> +
>*x = x_offset_sa;
>*y = y_offset_sa;
>return;
> --
> 2.11.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 15/22] i965/miptree: Prepare compressed offsets for isl based

2017-07-18 Thread Topi Pohjolainen
Signed-off-by: Topi Pohjolainen 
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index a0b129adb4..1b8c0da80d 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1462,6 +1462,15 @@ intel_miptree_get_image_offset(const struct 
intel_mipmap_tree *mt,
   isl_surf_get_image_offset_sa(&mt->surf, level, slice, z,
&x_offset_sa, &y_offset_sa);
 
+  /* In case of compressed formats offsets are expected as blocks. */
+  if (mt->compressed) {
+ const struct isl_format_layout *fmtl =
+isl_format_get_layout(mt->surf.format);
+
+ x_offset_sa /= fmtl->bw;
+ y_offset_sa /= fmtl->bh;
+  }
+
   *x = x_offset_sa;
   *y = y_offset_sa;
   return;
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev