radeonsi: use r600_resource() typecast helper
[mesa.git] / src / gallium / drivers / radeonsi / si_pipe.c
index 327dd7c4242f1ae010af87b43367c40af91586e6..c5ee9f4b7b230777b9e4fb08f9162357b52eae98 100644 (file)
@@ -29,6 +29,7 @@
 #include "sid.h"
 
 #include "radeon/radeon_uvd.h"
+#include "util/disk_cache.h"
 #include "util/hash_table.h"
 #include "util/u_log.h"
 #include "util/u_memory.h"
@@ -90,7 +91,6 @@ static const struct debug_named_value debug_options[] = {
        { "nodccclear", DBG(NO_DCC_CLEAR), "Disable DCC fast clear." },
        { "nodccfb", DBG(NO_DCC_FB), "Disable separate DCC on the main framebuffer" },
        { "nodccmsaa", DBG(NO_DCC_MSAA), "Disable DCC for MSAA" },
-       { "dccmsaa", DBG(DCC_MSAA), "Enable DCC for MSAA" },
        { "nofmask", DBG(NO_FMASK), "Disable MSAA compression" },
 
        /* Tests: */
@@ -367,9 +367,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        if (sctx->chip_class == CIK ||
            sctx->chip_class == VI ||
            sctx->chip_class == GFX9) {
-               sctx->eop_bug_scratch = (struct r600_resource*)
-                                         pipe_buffer_create(&sscreen->b, 0, PIPE_USAGE_DEFAULT,
-                                                            16 * sscreen->info.num_render_backends);
+               sctx->eop_bug_scratch = r600_resource(
+                       pipe_buffer_create(&sscreen->b, 0, PIPE_USAGE_DEFAULT,
+                                          16 * sscreen->info.num_render_backends));
                if (!sctx->eop_bug_scratch)
                        goto fail;
        }
@@ -438,10 +438,10 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        if (!sctx->border_color_table)
                goto fail;
 
-       sctx->border_color_buffer = (struct r600_resource*)
+       sctx->border_color_buffer = r600_resource(
                pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT,
                                   SI_MAX_BORDER_COLORS *
-                                  sizeof(*sctx->border_color_table));
+                                  sizeof(*sctx->border_color_table)));
        if (!sctx->border_color_buffer)
                goto fail;
 
@@ -472,11 +472,11 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        sctx->blitter->draw_rectangle = si_draw_rectangle;
        sctx->blitter->skip_viewport_restore = true;
 
-       sctx->sample_mask.sample_mask = 0xffff;
+       sctx->sample_mask = 0xffff;
 
        if (sctx->chip_class >= GFX9) {
-               sctx->wait_mem_scratch = (struct r600_resource*)
-                       pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT, 4);
+               sctx->wait_mem_scratch = r600_resource(
+                       pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT, 4));
                if (!sctx->wait_mem_scratch)
                        goto fail;
 
@@ -497,8 +497,8 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
         * if NUM_RECORDS == 0). We need to use a dummy buffer instead. */
        if (sctx->chip_class == CIK) {
                sctx->null_const_buf.buffer =
-                       si_aligned_buffer_create(screen,
-                                                SI_RESOURCE_FLAG_32BIT,
+                       pipe_aligned_buffer_create(screen,
+                                                  SI_RESOURCE_FLAG_32BIT,
                                                   PIPE_USAGE_DEFAULT, 16,
                                                   sctx->screen->info.tcc_cache_line_size);
                if (!sctx->null_const_buf.buffer)
@@ -984,9 +984,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
        }
 
        sscreen->dcc_msaa_allowed =
-               !(sscreen->debug_flags & DBG(NO_DCC_MSAA)) &&
-               (sscreen->debug_flags & DBG(DCC_MSAA) ||
-                sscreen->info.chip_class == VI);
+               !(sscreen->debug_flags & DBG(NO_DCC_MSAA));
 
        sscreen->cpdma_prefetch_writes_memory = sscreen->info.chip_class <= VI;