radeonsi: release saved resources in si_retile_dcc
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 9 Jan 2020 13:32:11 +0000 (14:32 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 10 Jan 2020 07:41:19 +0000 (08:41 +0100)
Fixes: 1f21396431a ("radeonsi: add support for displayable DCC for multi-RB chips")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2330
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_compute_blit.c

index 8d4f3bab5d75055ff970e83d1536a8404dd5933d..4d6c29ab43eeae64cfbfa7730457643c631b95de 100644 (file)
@@ -564,6 +564,10 @@ void si_retile_dcc(struct si_context *sctx, struct si_texture *tex)
        /* Restore states. */
        ctx->bind_compute_state(ctx, saved_cs);
        ctx->set_shader_images(ctx, PIPE_SHADER_COMPUTE, 0, 3, saved_img);
+
+       for (unsigned i = 0; i < 3; i++) {
+               pipe_resource_reference(&saved_img[i].resource, NULL);
+       }
 }
 
 /* Expand FMASK to make it identity, so that image stores can ignore it. */