[Mesa-dev] [PATCH 1/1] radeonsi: Reorder checks in si_check_render_feedback

Jan Vesely jan.vesely at rutgers.edu
Thu Apr 5 21:12:55 UTC 2018


On Thu, 2018-04-05 at 16:56 -0400, Marek Olšák wrote:
> Even though I've already fixed the crash in master, I'd like to have this
> patch in master too.

I think that's a different crash.
I can still reproduce on c7dd59b06d93e6820189e2d1e087c0811707ee07:
Thread 1 "test-short" received signal SIGSEGV, Segmentation fault.
0x00007fffe4910350 in si_get_total_colormask (sctx=0x119ddb0) at si_pipe.h:1236
1236		if (sctx->queued.named.rasterizer->rasterizer_discard)
(gdb) p sctx->queued.named.rasterizer
$1 = (struct si_state_rasterizer *) 0x0

> 
> Reviewed-by: Marek Olšák <marek.olsak at amd.com>

thanks, pushed,
Jan

> 
> Marek
> 
> On Thu, Apr 5, 2018 at 4:49 PM, Jan Vesely <jan.vesely at rutgers.edu> wrote:
> 
> > si_get_total_colormask accesses NULL pointer on compute shaders
> > Fixes crashes on clover
> > Fixes: 0669dca9c00261849cee14d69fdea0a5e323c7f7 ("radeonsi: skip DCC
> > render feedback checking if color writes are disabled")
> > CC: Marek Olšák <marek.olsak at amd.com>
> > Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> > ---
> >  src/gallium/drivers/radeonsi/si_blit.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/
> > radeonsi/si_blit.c
> > index 40f512a682..35506dd74b 100644
> > --- a/src/gallium/drivers/radeonsi/si_blit.c
> > +++ b/src/gallium/drivers/radeonsi/si_blit.c
> > @@ -710,15 +710,15 @@ static void si_check_render_feedback_resident_images(struct
> > si_context *sctx)
> > 
> >  static void si_check_render_feedback(struct si_context *sctx)
> >  {
> > +       if (!sctx->need_check_render_feedback)
> > +               return;
> > +
> >         /* There is no render feedback if color writes are disabled.
> >          * (e.g. a pixel shader with image stores)
> >          */
> >         if (!si_get_total_colormask(sctx))
> >                 return;
> > 
> > -       if (!sctx->need_check_render_feedback)
> > -               return;
> > -
> >         for (int i = 0; i < SI_NUM_SHADERS; ++i) {
> >                 si_check_render_feedback_images(sctx, &sctx->images[i]);
> >                 si_check_render_feedback_textures(sctx,
> > &sctx->samplers[i]);
> > --
> > 2.14.3
> > 
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 484 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180405/1dcc2b2d/attachment.sig>


More information about the mesa-dev mailing list