ac: add rbplus_allowed to ac_gpu_info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 21 Aug 2019 09:32:25 +0000 (11:32 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 27 Aug 2019 06:04:41 +0000 (08:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_private.h
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index 3f3a236..49ad934 100644 (file)
@@ -457,6 +457,16 @@ bool ac_query_gpu_info(int fd, void *dev_p,
        info->has_rbplus = info->family == CHIP_STONEY ||
                           info->chip_class >= GFX9;
 
+       /* Some chips have RB+ registers, but don't support RB+. Those must
+        * always disable it.
+        */
+       info->rbplus_allowed = info->has_rbplus &&
+                              (info->family == CHIP_STONEY ||
+                               info->family == CHIP_VEGA12 ||
+                               info->family == CHIP_RAVEN ||
+                               info->family == CHIP_RAVEN2 ||
+                               info->family == CHIP_RENOIR);
+
        info->has_out_of_order_rast = info->chip_class >= GFX8 &&
                                      info->max_se >= 2;
 
index 0f80221..f676600 100644 (file)
@@ -62,6 +62,7 @@ struct radeon_info {
        bool                        has_distributed_tess;
        bool                        has_dcc_constant_encode;
        bool                        has_rbplus; /* if RB+ registers exist */
+       bool                        rbplus_allowed; /* if RB+ is allowed */
        bool                        has_load_ctx_reg_pkt;
        bool                        has_out_of_order_rast;
        bool                        cpdma_prefetch_writes_memory;
index 7031428..aed2e9f 100644 (file)
@@ -988,7 +988,7 @@ radv_emit_prefetch_L2(struct radv_cmd_buffer *cmd_buffer,
 static void
 radv_emit_rbplus_state(struct radv_cmd_buffer *cmd_buffer)
 {
-       if (!cmd_buffer->device->physical_device->rbplus_allowed)
+       if (!cmd_buffer->device->physical_device->rad_info.rbplus_allowed)
                return;
 
        struct radv_pipeline *pipeline = cmd_buffer->state.pipeline;
index ce487aa..265a7bd 100644 (file)
@@ -354,15 +354,6 @@ radv_physical_device_init(struct radv_physical_device *device,
        radv_get_driver_uuid(&device->driver_uuid);
        radv_get_device_uuid(&device->rad_info, &device->device_uuid);
 
-       if (device->rad_info.family == CHIP_STONEY ||
-           device->rad_info.chip_class >= GFX9) {
-               device->rbplus_allowed = device->rad_info.family == CHIP_STONEY ||
-                                        device->rad_info.family == CHIP_VEGA12 ||
-                                        device->rad_info.family == CHIP_RAVEN ||
-                                        device->rad_info.family == CHIP_RAVEN2 ||
-                                        device->rad_info.family == CHIP_RENOIR;
-       }
-
        device->out_of_order_rast_allowed = device->rad_info.has_out_of_order_rast &&
                                            !(device->instance->debug_flags & RADV_DEBUG_NO_OUT_OF_ORDER);
 
index 0a5d94f..ecd4edf 100644 (file)
@@ -4055,7 +4055,7 @@ radv_compute_db_shader_control(const struct radv_device *device,
                z_order = V_02880C_LATE_Z;
 
        bool disable_rbplus = device->physical_device->rad_info.has_rbplus &&
-                             !device->physical_device->rbplus_allowed;
+                             !device->physical_device->rad_info.rbplus_allowed;
 
        /* It shouldn't be needed to export gl_SampleMask when MSAA is disabled
         * but this appears to break Project Cars (DXVK). See
index b3d6d56..219495e 100644 (file)
@@ -280,8 +280,6 @@ struct radv_physical_device {
        int master_fd;
        struct wsi_device                       wsi_device;
 
-       bool rbplus_allowed; /* if RB+ is allowed */
-
        bool out_of_order_rast_allowed;
 
        /* Whether DCC should be enabled for MSAA textures. */
index fccf823..abb1823 100644 (file)
@@ -1173,20 +1173,6 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
         */
        sscreen->llvm_has_working_vgpr_indexing = sscreen->info.chip_class != GFX9;
 
-       /* Some chips have RB+ registers, but don't support RB+. Those must
-        * always disable it.
-        */
-       if (sscreen->info.family == CHIP_STONEY ||
-           sscreen->info.chip_class >= GFX9) {
-               sscreen->rbplus_allowed =
-                       !(sscreen->debug_flags & DBG(NO_RB_PLUS)) &&
-                       (sscreen->info.family == CHIP_STONEY ||
-                        sscreen->info.family == CHIP_VEGA12 ||
-                        sscreen->info.family == CHIP_RAVEN ||
-                        sscreen->info.family == CHIP_RAVEN2 ||
-                        sscreen->info.family == CHIP_RENOIR);
-       }
-
        sscreen->dcc_msaa_allowed =
                !(sscreen->debug_flags & DBG(NO_DCC_MSAA));
 
index b8dfb8a..6e69f17 100644 (file)
@@ -511,7 +511,6 @@ struct si_screen {
        /* Whether shaders are monolithic (1-part) or separate (3-part). */
        bool                            use_monolithic_shaders;
        bool                            record_llvm_ir;
-       bool                            rbplus_allowed; /* if RB+ is allowed */
        bool                            dcc_msaa_allowed;
 
        struct slab_parent_pool         pool_transfers;
index dcd6274..d957e76 100644 (file)
@@ -131,7 +131,7 @@ static void si_emit_cb_render_state(struct si_context *sctx)
        }
 
        /* RB+ register settings. */
-       if (sctx->screen->rbplus_allowed) {
+       if (sctx->screen->info.rbplus_allowed) {
                unsigned spi_shader_col_format =
                        sctx->ps_shader.cso ?
                        sctx->ps_shader.current->key.part.ps.epilog.spi_shader_col_format : 0;
@@ -640,7 +640,7 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
                color_control |= S_028808_MODE(V_028808_CB_DISABLE);
        }
 
-       if (sctx->screen->rbplus_allowed) {
+       if (sctx->screen->info.rbplus_allowed) {
                /* Disable RB+ blend optimizations for dual source blending.
                 * Vulkan does this.
                 */
@@ -1483,7 +1483,7 @@ static void si_emit_db_render_state(struct si_context *sctx)
                db_shader_control &= C_02880C_MASK_EXPORT_ENABLE;
 
        if (sctx->screen->info.has_rbplus &&
-           !sctx->screen->rbplus_allowed)
+           !sctx->screen->info.rbplus_allowed)
                db_shader_control |= S_02880C_DUAL_QUAD_DISABLE(1);
 
        radeon_opt_set_context_reg(sctx, R_02880C_DB_SHADER_CONTROL,
index 003d116..1c80a22 100644 (file)
@@ -3992,7 +3992,7 @@ bool si_update_shaders(struct si_context *sctx)
                        si_mark_atom_dirty(sctx, &sctx->atoms.s.spi_map);
                }
 
-               if (sctx->screen->rbplus_allowed &&
+               if (sctx->screen->info.rbplus_allowed &&
                    si_pm4_state_changed(sctx, ps) &&
                    (!old_ps ||
                     old_spi_shader_col_format !=