radeonsi: fix Segmentation fault during vaapi enc test
authorJames Zhu <jzhums@gmail.com>
Mon, 6 Apr 2020 20:34:01 +0000 (20:34 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 8 Apr 2020 18:11:45 +0000 (18:11 +0000)
Fix Segmentation fault during vaapi enc test on Arcturus.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by Leo Liu <leo.liu@amd.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4472>

src/gallium/drivers/radeonsi/si_compute_blit.c

index 6e3b07c..0a81c68 100644 (file)
@@ -63,7 +63,8 @@ static void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_in
    sctx->flags |= SI_CONTEXT_STOP_PIPELINE_STATS;
    sctx->render_cond_force_off = true;
    /* Skip decompression to prevent infinite recursion. */
-   sctx->blitter->running = true;
+   if (sctx->blitter)
+      sctx->blitter->running = true;
 
    /* Dispatch compute. */
    sctx->b.launch_grid(&sctx->b, info);
@@ -72,7 +73,8 @@ static void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_in
    sctx->flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS;
    sctx->flags |= SI_CONTEXT_START_PIPELINE_STATS;
    sctx->render_cond_force_off = false;
-   sctx->blitter->running = false;
+   if (sctx->blitter)
+      sctx->blitter->running = false;
 }
 
 static void si_compute_clear_12bytes_buffer(struct si_context *sctx, struct pipe_resource *dst,