radeonsi: add has_draw_indirect_multi flag
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 29 Jul 2016 16:59:11 +0000 (17:59 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 8 Aug 2016 10:53:06 +0000 (12:53 +0200)
Prefer to use DRAW_(INDEX)_INDIRECT_MULTI when available in the firmware.

Versions for SI and CI already added as provided by the firmware team, but
keep in mind that they won't currently be used since the radeon kernel module
has no interface to query the firmware version.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index e33823dcede7e3f455a7a1ed0220ebd928deb272..ffeeda3f2a355ef25a6c5594d30c9e2633aae226 100644 (file)
@@ -785,6 +785,18 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
                sscreen->b.chip_class >= VI &&
                sscreen->b.info.max_se >= 2;
 
+       sscreen->has_draw_indirect_multi =
+               (sscreen->b.family >= CHIP_POLARIS10) ||
+               (sscreen->b.chip_class == VI &&
+                sscreen->b.info.pfp_fw_version >= 121 &&
+                sscreen->b.info.me_fw_version >= 87) ||
+               (sscreen->b.chip_class == CIK &&
+                sscreen->b.info.pfp_fw_version >= 211 &&
+                sscreen->b.info.me_fw_version >= 173) ||
+               (sscreen->b.chip_class == SI &&
+                sscreen->b.info.pfp_fw_version >= 121 &&
+                sscreen->b.info.me_fw_version >= 87);
+
        sscreen->b.has_cp_dma = true;
        sscreen->b.has_streamout = true;
        pipe_mutex_init(sscreen->shader_parts_mutex);
index 55f8965d2d4b1293e7a4cde1f987c13947cb3e4d..9e6bd78711bb5ffe96386a0d4f23757db6a85ef1 100644 (file)
@@ -85,6 +85,7 @@ struct si_screen {
        unsigned                        gs_table_depth;
        unsigned                        tess_offchip_block_dw_size;
        bool                            has_distributed_tess;
+       bool                            has_draw_indirect_multi;
 
        /* Whether shaders are monolithic (1-part) or separate (3-part). */
        bool                            use_monolithic_shaders;
index 8f26f8cc41004b0d9b18ef2ee61314b4c6644115..a60723d225d1e083f3d6bb5e5c7ca618823afaaf 100644 (file)
@@ -634,7 +634,7 @@ static void si_emit_draw_packets(struct si_context *sctx,
                        radeon_emit(cs, index_max_size);
                }
 
-               if (sctx->b.family < CHIP_POLARIS10) {
+               if (!sctx->screen->has_draw_indirect_multi) {
                        radeon_emit(cs, PKT3(info->indexed ? PKT3_DRAW_INDEX_INDIRECT
                                                           : PKT3_DRAW_INDIRECT,
                                             3, render_cond_bit));