[Mesa-dev] [PATCH 4/6] i965/gen7: Don't allocate hiz miptree structure

Kenneth Graunke kenneth at whitecape.org
Fri Jul 4 00:36:31 PDT 2014


On Wednesday, July 02, 2014 12:33:16 PM Jordan Justen wrote:
> On Wed, Jul 2, 2014 at 5:39 AM, Pohjolainen, Topi
> <topi.pohjolainen at intel.com> wrote:
> > On Tue, Jul 01, 2014 at 04:53:06PM -0700, Jordan Justen wrote:
> >> We now skip allocating a hiz miptree for gen7. Instead, we calculate
> >> the required hiz buffer parameters and allocate a bo directly.
> >>
> >> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> >> ---
> >>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 67 
++++++++++++++++++++++++++-
> >>  1 file changed, 65 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> >> index 8719c29..b308b0c 100644
> >> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> >> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> >> @@ -823,7 +823,10 @@ intel_miptree_release(struct intel_mipmap_tree **mt)
> >>        drm_intel_bo_unreference((*mt)->bo);
> >>        intel_miptree_release(&(*mt)->stencil_mt);
> >>        if ((*mt)->hiz_buf) {
> >> -         intel_miptree_release(&(*mt)->hiz_buf->mt);
> >> +         if ((*mt)->hiz_buf->mt)
> >> +            intel_miptree_release(&(*mt)->hiz_buf->mt);
> >> +         else
> >> +            drm_intel_bo_unreference((*mt)->hiz_buf->bo);
> >>           free((*mt)->hiz_buf);
> >>        }
> >>        intel_miptree_release(&(*mt)->mcs_mt);
> >> @@ -1375,6 +1378,61 @@ intel_miptree_level_enable_hiz(struct brw_context 
*brw,
> >>
> >>
> >>  static struct intel_miptree_aux_buffer *
> >> +intel_hiz_buf_create(struct brw_context *brw,
> >> +                     struct intel_mipmap_tree *mt)
> >> +{
> >> +   unsigned hz_width, hz_height;
> >> +   unsigned H0, h0, h1, Z0;
> >> +   const unsigned j = 8;
> >
> > This could read 'vertical_align' instead of 'j'.
> 
> I wanted to stick with the 'j' terminology from the docs. Although,
> I'm not consistent about sticking with the docs, so how about a v2
> where I'm more consistent about that?

I tend to prefer the more descriptive name as well.  How about:

const unsigned vertical_align = 8; /* 'j' in the docs */

In other places, we've called this align_h, which I hate (is 'h' height or 
horizontal?)

But, it's up to you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140704/f5a64e36/attachment-0001.sig>


More information about the mesa-dev mailing list