[Mesa-dev] [PATCH] i965: "Fix" aux offsets

Jordan Justen jordan.l.justen at intel.com
Thu Nov 17 00:26:49 UTC 2016


On 2016-11-16 11:25:32, Jason Ekstrand wrote:
>    On Tue, Nov 15, 2016 at 5:35 PM, Ben Widawsky
>    <benjamin.widawsky at intel.com> wrote:
> 
>      From: Ben Widawsky <ben at bwidawsk.net>
> 
>      When 1 BO is used for aux data, it needs to point to the correct offset,
>      which will not be the BOs offset but instead an offset from the BOs
>      offset. Since today there are always multiple BOs for aux, this doesn't
>      actually change anything.
> 
>      Cc: Jason Ekstrand <jason at jlekstrand.net>
>      Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
>      ---
>       src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 +++--
>       1 file changed, 3 insertions(+), 2 deletions(-)
> 
>      diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>      b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>      index 4c2d11d..0cf9181 100644
>      --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>      +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
>      @@ -152,10 +152,11 @@ brw_emit_surface_state(struct brw_context *brw,
>             if (mt->mcs_buf) {
>                assert(mt->mcs_buf->offset == 0);
>                aux_bo = mt->mcs_buf->bo;
>      -         aux_offset = mt->mcs_buf->bo->offset64;
>      +         aux_offset = mt->mcs_buf->bo->offset64 + mt->mcs_buf->offset;
>             } else {
>                aux_bo = mt->hiz_buf->aux_base.bo;
>      -         aux_offset = mt->hiz_buf->aux_base.bo->offset64;
>      +         aux_offset = mt->hiz_buf->aux_base.bo->offset64 +
>      +                      mt->hiz_buf->mt->offset;
> 
>    Ugh... hiz is messed up... Sadly, hiz_buf->mt may not always exist so we
>    can't add it unconditionally here.  Yes, that's stupid.

Could mt->hiz_buf->aux_base.offset be used instead?

By the way, my patches made both intel_mipmap_tree::mcs_buf and
intel_mipmap_tree::hiz_buf be of type intel_miptree_aux_buffer. There
was no intel_miptree_hiz_buffer struct.

I had added 'struct intel_mipmap_tree *mt' to intel_miptree_aux_buffer
to cover the gen6 hiz case, but otherwise that field would be NULL.

Then we could drop the intel_miptree_hiz_buffer type and treat the mcs
and hiz buffers more uniformly as 'aux buffers'. (Both being of type
intel_miptree_aux_buffer.)

Then again, isl will change all of this entirely...

-Jordan


More information about the mesa-dev mailing list