[Mesa-dev] [PATCH] anv: Properly initialize device->slice_hash.

Jason Ekstrand jason at jlekstrand.net
Thu Aug 15 16:01:19 UTC 2019


On Thu, Aug 15, 2019 at 10:48 AM Rafael Antognolli <
rafael.antognolli at intel.com> wrote:

> On Wed, Aug 14, 2019 at 10:05:34PM -0500, Jason Ekstrand wrote:
> > I take it this happens when subslices_delta == 0 and we take the early
> return?
>
> Yes, exactly, in that case device->slice_hash is not initialized. I can
> add this to the commit message to make it more clear.
>

That'd be nice.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>


> > On Wed, Aug 14, 2019 at 5:45 PM Rafael Antognolli <
> rafael.antognolli at intel.com>
> > wrote:
> >
> >     I failed to initialize it on the other cases in GEN11 and it was
> causing
> >     a segfault when going through anv_DestroyDevice, if compiled with
> >     valgrind.
> >
> >     Fixes: 7bc022b4bbc ("anv/gen11: Emit SLICE_HASH_TABLE when pipes are
> >                         unbalanced.)
> >     ---
> >      src/intel/vulkan/genX_state.c | 4 ++--
> >      1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >     diff --git a/src/intel/vulkan/genX_state.c
> b/src/intel/vulkan/genX_state.c
> >     index de8b753dd34..3bf4890b4a4 100644
> >     --- a/src/intel/vulkan/genX_state.c
> >     +++ b/src/intel/vulkan/genX_state.c
> >     @@ -92,6 +92,8 @@ static void
> >      genX(emit_slice_hashing_state)(struct anv_device *device,
> >                                     struct anv_batch *batch)
> >      {
> >     +   device->slice_hash = (struct anv_state) { 0 };
> >     +
> >      #if GEN_GEN == 11
> >         const unsigned *ppipe_subslices = device->info.ppipe_subslices;
> >         int subslices_delta = ppipe_subslices[0] - ppipe_subslices[1];
> >     @@ -156,8 +158,6 @@ genX(emit_slice_hashing_state)(struct anv_device
> >     *device,
> >         anv_batch_emit(batch, GENX(3DSTATE_3D_MODE), mode) {
> >            mode.SliceHashingTableEnable = true;
> >         }
> >     -#else
> >     -   device->slice_hash = (struct anv_state) { 0 };
> >      #endif
> >      }
> >
> >     --
> >     2.21.0
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190815/dad2c6b4/attachment.html>


More information about the mesa-dev mailing list