r600g, radeonsi: fix primitives-generated query with disabled streamout

Buffers are disabled by VGT_STRMOUT_BUFFER_CONFIG, but the query only works
if VGT_STRMOUT_CONFIG.STREAMOUT_0_EN is enabled.

This moves VGT_STRMOUT_CONFIG to its own state. The register is set to 1
if either streamout or the primitives-generated query is enabled.

However, the primitives-emitted query is also incremented, so it's disabled
by setting VGT_STRMOUT_BUFFER_SIZE to 0 when there is no buffer bound.

This fixes piglit:
  ARB_transform_feedback2/counting with pause
  EXT_transform_feedback/primgen-query transform-feedback-disabled

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index a5d7571..e9218a2 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -152,6 +152,7 @@
 	uint64_t va;
 
 	r600_update_occlusion_query_state(ctx, query->type, 1);
+	r600_update_prims_generated_query_state(ctx, query->type, 1);
 	ctx->need_gfx_cs_space(&ctx->b, query->num_cs_dw * 2, TRUE);
 
 	/* Get a new query buffer if needed. */
@@ -284,6 +285,7 @@
 	}
 
 	r600_update_occlusion_query_state(ctx, query->type, -1);
+	r600_update_prims_generated_query_state(ctx, query->type, -1);
 }
 
 static void r600_emit_query_predication(struct r600_common_context *ctx, struct r600_query *query,