[Mesa-dev] [PATCH 1/7] gallium/radeon: move pipeline stat context flags to common code

eocallaghan at alterapraxis.com eocallaghan at alterapraxis.com
Sat Apr 9 12:11:27 UTC 2016


This series is,

Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>

This definitely makes for a good cleanup, I was wondering about all the 
manual stuff myself..

On 2016-04-09 09:12, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> ---
>  src/gallium/drivers/radeon/r600_pipe_common.h | 5 ++++-
>  src/gallium/drivers/radeonsi/si_pipe.h        | 3 ---
>  src/gallium/drivers/radeonsi/si_state.c       | 8 ++++----
>  src/gallium/drivers/radeonsi/si_state_draw.c  | 4 ++--
>  4 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h
> b/src/gallium/drivers/radeon/r600_pipe_common.h
> index 7da7736..57af0ff 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -50,7 +50,10 @@
>  #define R600_RESOURCE_FLAG_FORCE_TILING		(PIPE_RESOURCE_FLAG_DRV_PRIV 
> << 2)
> 
>  #define R600_CONTEXT_STREAMOUT_FLUSH		(1u << 0)
> -#define R600_CONTEXT_PRIVATE_FLAG		(1u << 1)
> +/* Pipeline & streamout query controls. */
> +#define R600_CONTEXT_START_PIPELINE_STATS	(1u << 1)
> +#define R600_CONTEXT_STOP_PIPELINE_STATS	(1u << 2)
> +#define R600_CONTEXT_PRIVATE_FLAG		(1u << 3)
> 
>  /* special primitive types */
>  #define R600_PRIM_RECTANGLE_LIST	PIPE_PRIM_MAX
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.h
> b/src/gallium/drivers/radeonsi/si_pipe.h
> index 8fcfcd2..f665c81 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.h
> +++ b/src/gallium/drivers/radeonsi/si_pipe.h
> @@ -66,9 +66,6 @@
>  /* Compute only. */
>  #define SI_CONTEXT_FLUSH_WITH_INV_L2	(R600_CONTEXT_PRIVATE_FLAG <<
> 13) /* TODO: merge with TC? */
>  #define SI_CONTEXT_FLAG_COMPUTE		(R600_CONTEXT_PRIVATE_FLAG << 14)
> -/* Pipeline & streamout query controls. */
> -#define SI_CONTEXT_START_PIPELINE_STATS	(R600_CONTEXT_PRIVATE_FLAG << 
> 15)
> -#define SI_CONTEXT_STOP_PIPELINE_STATS	(R600_CONTEXT_PRIVATE_FLAG << 
> 16)
> 
>  #define SI_CONTEXT_FLUSH_AND_INV_FRAMEBUFFER 
> (SI_CONTEXT_FLUSH_AND_INV_CB | \
>  					      SI_CONTEXT_FLUSH_AND_INV_CB_META | \
> diff --git a/src/gallium/drivers/radeonsi/si_state.c
> b/src/gallium/drivers/radeonsi/si_state.c
> index 0c46425..94130a9 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -1358,11 +1358,11 @@ static void si_set_active_query_state(struct
> pipe_context *ctx, boolean enable)
> 
>  	/* Pipeline stat & streamout queries. */
>  	if (enable) {
> -		sctx->b.flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS;
> -		sctx->b.flags |= SI_CONTEXT_START_PIPELINE_STATS;
> +		sctx->b.flags &= ~R600_CONTEXT_STOP_PIPELINE_STATS;
> +		sctx->b.flags |= R600_CONTEXT_START_PIPELINE_STATS;
>  	} else {
> -		sctx->b.flags &= ~SI_CONTEXT_START_PIPELINE_STATS;
> -		sctx->b.flags |= SI_CONTEXT_STOP_PIPELINE_STATS;
> +		sctx->b.flags &= ~R600_CONTEXT_START_PIPELINE_STATS;
> +		sctx->b.flags |= R600_CONTEXT_STOP_PIPELINE_STATS;
>  	}
> 
>  	/* Occlusion queries. */
> diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c
> b/src/gallium/drivers/radeonsi/si_state_draw.c
> index 105c5fb..40cad50 100644
> --- a/src/gallium/drivers/radeonsi/si_state_draw.c
> +++ b/src/gallium/drivers/radeonsi/si_state_draw.c
> @@ -722,11 +722,11 @@ void si_emit_cache_flush(struct si_context
> *si_ctx, struct r600_atom *atom)
>  		}
>  	}
> 
> -	if (sctx->flags & SI_CONTEXT_START_PIPELINE_STATS) {
> +	if (sctx->flags & R600_CONTEXT_START_PIPELINE_STATS) {
>  		radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
>  		radeon_emit(cs, EVENT_TYPE(V_028A90_PIPELINESTAT_START) |
>  			        EVENT_INDEX(0));
> -	} else if (sctx->flags & SI_CONTEXT_STOP_PIPELINE_STATS) {
> +	} else if (sctx->flags & R600_CONTEXT_STOP_PIPELINE_STATS) {
>  		radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
>  		radeon_emit(cs, EVENT_TYPE(V_028A90_PIPELINESTAT_STOP) |
>  			        EVENT_INDEX(0));



More information about the mesa-dev mailing list