gallium/radeon: unify checking streamout enable state
authorMarek Olšák <marek.olsak@amd.com>
Thu, 7 Apr 2016 01:24:06 +0000 (03:24 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 12 Apr 2016 12:29:47 +0000 (14:29 +0200)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_streamout.c
src/gallium/drivers/radeonsi/si_state_draw.c

index df41d3f028d13ee55db127480f6986749ccfc0f0..82babeba7cbb5393f024cfe6825d65d5cc750c97 100644 (file)
@@ -1841,8 +1841,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
                        ia_switch_on_eop = true;
                }
 
-               if (rctx->b.streamout.streamout_enabled ||
-                   rctx->b.streamout.prims_gen_query_enabled)
+               if (r600_get_strmout_en(&rctx->b))
                        partial_vs_wave = true;
 
                radeon_set_context_reg(cs, CM_R_028AA8_IA_MULTI_VGT_PARAM,
@@ -2018,7 +2017,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
            rctx->b.family == CHIP_RV635) {
                /* if we have gs shader or streamout
                   we need to do a wait idle after every draw */
-               if (rctx->gs_shader || rctx->b.streamout.streamout_enabled) {
+               if (rctx->gs_shader || r600_get_strmout_en(&rctx->b)) {
                        radeon_set_config_reg(cs, R_008040_WAIT_UNTIL, S_008040_WAIT_3D_IDLE(1));
                }
        }
index 062c3193947b35148955470b41520dd9fd2d887a..7da773686073e60c3f441b7223a895871d3ee14c 100644 (file)
@@ -639,6 +639,12 @@ r600_resource_reference(struct r600_resource **ptr, struct r600_resource *res)
                                (struct pipe_resource *)res);
 }
 
+static inline bool r600_get_strmout_en(struct r600_common_context *rctx)
+{
+       return rctx->streamout.streamout_enabled ||
+              rctx->streamout.prims_gen_query_enabled;
+}
+
 static inline unsigned r600_tex_aniso_filter(unsigned filter)
 {
        if (filter <= 1)   return 0;
index e977ed9fa10d128ba2cea4b3271f87fc4578c48d..fc9ec4859f6a152abbd69e1081b2563e1eb9e256 100644 (file)
@@ -311,12 +311,6 @@ void r600_emit_streamout_end(struct r600_common_context *rctx)
  * are no buffers bound.
  */
 
-static bool r600_get_strmout_en(struct r600_common_context *rctx)
-{
-       return rctx->streamout.streamout_enabled ||
-              rctx->streamout.prims_gen_query_enabled;
-}
-
 static void r600_emit_streamout_enable(struct r600_common_context *rctx,
                                       struct r600_atom *atom)
 {
index ece0c6ddcf67643f22756eae616f5c35b91948f1..105c5fb9850d6ea1192f2f1daefa0268cf837581 100644 (file)
@@ -892,8 +892,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
        if ((sctx->b.family == CHIP_HAWAII ||
             sctx->b.family == CHIP_TONGA ||
             sctx->b.family == CHIP_FIJI) &&
-           (sctx->b.streamout.streamout_enabled ||
-            sctx->b.streamout.prims_gen_query_enabled)) {
+           r600_get_strmout_en(&sctx->b)) {
                sctx->b.flags |= SI_CONTEXT_VGT_STREAMOUT_SYNC;
        }