Re: [Mesa-dev] [PATCH 04/15] i965: Prepare up/downsampling for isl based miptrees

2017-06-15 Thread Jason Ekstrand
On Wed, Jun 14, 2017 at 4:08 PM, Nanley Chery  wrote:

> On Tue, Jun 13, 2017 at 05:50:02PM +0300, Topi Pohjolainen wrote:
> > Signed-off-by: Topi Pohjolainen 
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 46
> ++-
> >  1 file changed, 38 insertions(+), 8 deletions(-)
> >
> Patches 2-4 are
> Reviewed-by: Nanley Chery 
>
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index 78a223a7f3..061860cdf6 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -2800,27 +2800,57 @@ intel_miptree_updownsample(struct brw_context
> *brw,
> > struct intel_mipmap_tree *src,
> > struct intel_mipmap_tree *dst)
> >  {
> > +   unsigned src_w, src_h, dst_w, dst_h;
> > +
> > +   if (src->surf.size > 0) {
> > +  src_w = src->surf.logical_level0_px.width;
> > +  src_h = src->surf.logical_level0_px.height;
> > +   } else {
> > +  src_w = src->logical_width0;
> > +  src_h = src->logical_height0;
> > +   }
> > +
> > +   if (dst->surf.size > 0) {
> > +  dst_w = dst->surf.logical_level0_px.width;
> > +  dst_h = dst->surf.logical_level0_px.height;
> > +   } else {
> > +  dst_w = dst->logical_width0;
> > +  dst_h = dst->logical_height0;
> > +   }
> > +
> > brw_blorp_blit_miptrees(brw,
> > src, 0 /* level */, 0 /* layer */,
> > src->format, SWIZZLE_XYZW,
> > dst, 0 /* level */, 0 /* layer */,
> dst->format,
> > -   0, 0,
> > -   src->logical_width0, src->logical_height0,
> > -   0, 0,
> > -   dst->logical_width0, dst->logical_height0,
> > +   0, 0, src_w, src_h,
> > +   0, 0, dst_w, dst_h,
> > GL_NEAREST, false, false /*mirror x, y*/,
> > false, false);
> >
> > if (src->stencil_mt) {
> > +  if (src->stencil_mt->surf.size > 0) {
> > + src_w = src->stencil_mt->surf.logical_level0_px.width;
> > + src_h = src->stencil_mt->surf.logical_level0_px.height;
> > +  } else {
> > + src_w = src->stencil_mt->logical_width0;
> > + src_h = src->stencil_mt->logical_height0;
> > +  }
> > +
> > +  if (dst->stencil_mt->surf.size > 0) {
> > + dst_w = dst->stencil_mt->surf.logical_level0_px.width;
> > + dst_h = dst->stencil_mt->surf.logical_level0_px.height;
> > +  } else {
> > + dst_w = dst->stencil_mt->logical_width0;
> > + dst_h = dst->stencil_mt->logical_height0;
> > +  }
>

This would be way easier if it were just

if (src->stencil_mt)
   intel_miptree_updownsample(brw, src->stencil_mt, dst->stencil_mt);

Oh, well.  That can be a refactor for another day if you'd like.

> +
> >brw_blorp_blit_miptrees(brw,
> >src->stencil_mt, 0 /* level */, 0 /*
> layer */,
> >src->stencil_mt->format, SWIZZLE_XYZW,
> >dst->stencil_mt, 0 /* level */, 0 /*
> layer */,
> >dst->stencil_mt->format,
> > -  0, 0,
> > -  src->logical_width0, src->logical_height0,
> > -  0, 0,
> > -  dst->logical_width0, dst->logical_height0,
> > +  0, 0, src_w, src_h,
> > +  0, 0, dst_w, dst_h,
> >GL_NEAREST, false, false /*mirror x, y*/,
> >false, false /* decode/encode srgb */);
> > }
> > --
> > 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 mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 04/15] i965: Prepare up/downsampling for isl based miptrees

2017-06-14 Thread Nanley Chery
On Tue, Jun 13, 2017 at 05:50:02PM +0300, Topi Pohjolainen wrote:
> Signed-off-by: Topi Pohjolainen 
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 46 
> ++-
>  1 file changed, 38 insertions(+), 8 deletions(-)
> 
Patches 2-4 are
Reviewed-by: Nanley Chery 

> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 78a223a7f3..061860cdf6 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2800,27 +2800,57 @@ intel_miptree_updownsample(struct brw_context *brw,
> struct intel_mipmap_tree *src,
> struct intel_mipmap_tree *dst)
>  {
> +   unsigned src_w, src_h, dst_w, dst_h;
> +
> +   if (src->surf.size > 0) {
> +  src_w = src->surf.logical_level0_px.width;
> +  src_h = src->surf.logical_level0_px.height;
> +   } else {
> +  src_w = src->logical_width0;
> +  src_h = src->logical_height0;
> +   }
> +
> +   if (dst->surf.size > 0) {
> +  dst_w = dst->surf.logical_level0_px.width;
> +  dst_h = dst->surf.logical_level0_px.height;
> +   } else {
> +  dst_w = dst->logical_width0;
> +  dst_h = dst->logical_height0;
> +   }
> +
> brw_blorp_blit_miptrees(brw,
> src, 0 /* level */, 0 /* layer */,
> src->format, SWIZZLE_XYZW,
> dst, 0 /* level */, 0 /* layer */, dst->format,
> -   0, 0,
> -   src->logical_width0, src->logical_height0,
> -   0, 0,
> -   dst->logical_width0, dst->logical_height0,
> +   0, 0, src_w, src_h,
> +   0, 0, dst_w, dst_h,
> GL_NEAREST, false, false /*mirror x, y*/,
> false, false);
>  
> if (src->stencil_mt) {
> +  if (src->stencil_mt->surf.size > 0) {
> + src_w = src->stencil_mt->surf.logical_level0_px.width;
> + src_h = src->stencil_mt->surf.logical_level0_px.height;
> +  } else {
> + src_w = src->stencil_mt->logical_width0;
> + src_h = src->stencil_mt->logical_height0;
> +  }
> +
> +  if (dst->stencil_mt->surf.size > 0) {
> + dst_w = dst->stencil_mt->surf.logical_level0_px.width;
> + dst_h = dst->stencil_mt->surf.logical_level0_px.height;
> +  } else {
> + dst_w = dst->stencil_mt->logical_width0;
> + dst_h = dst->stencil_mt->logical_height0;
> +  }
> +
>brw_blorp_blit_miptrees(brw,
>src->stencil_mt, 0 /* level */, 0 /* layer */,
>src->stencil_mt->format, SWIZZLE_XYZW,
>dst->stencil_mt, 0 /* level */, 0 /* layer */,
>dst->stencil_mt->format,
> -  0, 0,
> -  src->logical_width0, src->logical_height0,
> -  0, 0,
> -  dst->logical_width0, dst->logical_height0,
> +  0, 0, src_w, src_h,
> +  0, 0, dst_w, dst_h,
>GL_NEAREST, false, false /*mirror x, y*/,
>false, false /* decode/encode srgb */);
> }
> -- 
> 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