[Mesa-dev] [PATCH v2] radeonsi, r600g: Alias 'R600_DEBUG' with 'RADEON_DEBUG'

Vedran Miletić vedran at miletic.net
Mon Feb 20 15:36:47 UTC 2017


On 02/20/2017 11:15 AM, Edward O'Callaghan wrote:
> The name has become a little misleading now that it applies
> to both r600g and radeonsi.
> 
> V.2: Michel Dänzer - R600_DEBUG must continue to work.
> 
> Signed-off-by: Edward O'Callaghan <funfunctor at folklore1984.net>
> ---
>  src/gallium/drivers/r600/r600_pipe.c                   | 1 +
>  src/gallium/drivers/radeon/r600_pipe_common.c          | 2 ++
>  src/gallium/drivers/radeonsi/glsl_tests/amdgcn_glslc.c | 1 +
>  src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c          | 2 +-
>  src/gallium/winsys/radeon/drm/radeon_drm_winsys.c      | 4 +++-
>  5 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index 1803c26..f4ab0ee 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -641,6 +641,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
>  	}
>  
>  	rscreen->b.debug_flags |= debug_get_flags_option("R600_DEBUG", r600_debug_options, 0);
> +	rscreen->b.debug_flags |= debug_get_flags_option("RADEON_DEBUG", r600_debug_options, 0);
>  	if (debug_get_bool_option("R600_DEBUG_COMPUTE", FALSE))
>  		rscreen->b.debug_flags |= DBG_COMPUTE;
>  	if (debug_get_bool_option("R600_DUMP_SHADERS", FALSE))
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index 1781584..a372cd1 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -1257,7 +1257,9 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
>  	rscreen->ws = ws;
>  	rscreen->family = rscreen->info.family;
>  	rscreen->chip_class = rscreen->info.chip_class;
> +
>  	rscreen->debug_flags = debug_get_flags_option("R600_DEBUG", common_debug_options, 0);
> +	rscreen->debug_flags = debug_get_flags_option("RADEON_DEBUG", common_debug_options, 0);
>  
>  	slab_create_parent(&rscreen->pool_transfers, sizeof(struct r600_transfer), 64);
>  
> diff --git a/src/gallium/drivers/radeonsi/glsl_tests/amdgcn_glslc.c b/src/gallium/drivers/radeonsi/glsl_tests/amdgcn_glslc.c
> index 3f52188..947736b 100644
> --- a/src/gallium/drivers/radeonsi/glsl_tests/amdgcn_glslc.c
> +++ b/src/gallium/drivers/radeonsi/glsl_tests/amdgcn_glslc.c
> @@ -207,6 +207,7 @@ main(int argc, char **argv)
>      }
>  
>      addenv("R600_DEBUG", "precompile,vs,tcs,tes,gs,ps,cs,noir,notgsi");
> +    addenv("RADEON_DEBUG", "precompile,vs,tcs,tes,gs,ps,cs,noir,notgsi");
>  
>      create_gl_core_context();
>  
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> index 6511c48..f039843 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
> @@ -370,7 +370,7 @@ static bool do_winsys_init(struct amdgpu_winsys *ws, int fd)
>     if (ws->info.chip_class == SI)
>        ws->info.gfx_ib_pad_with_type2 = TRUE;
>  
> -   ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL;
> +   ws->check_vm = strstr(debug_get_option("RADEON_DEBUG", ""), "check_vm") != NULL;
>  
>     return true;
>  
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> index a39a7be..e070d29 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> @@ -526,7 +526,9 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
>  				      ws->accel_working2 < 3);
>      ws->info.tcc_cache_line_size = 64; /* TC L2 line size on GCN */
>  
> -    ws->check_vm = strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL;
> +    if ((strstr(debug_get_option("R600_DEBUG", ""), "check_vm") != NULL) ||
> +	(strstr(debug_get_option("RADEON_DEBUG", ""), "check_vm") != NULL))
> +		ws->check_vm = true;
>  
>      return true;
>  }
> 

NAK from me, but I respect the idea (after all, naming things is one of
the two hardest problems in CS). RADEON_DEBUG sounds way too generic
(does it apply to R300? maybe even R100?).

It was a good to use a different variable name when radeonsi was
starting to be developed (RADEONSI_DEBUG or so), but now we are where we
are.

Regards,
Vedran

-- 
Vedran Miletić
vedran.miletic.net


More information about the mesa-dev mailing list