Re: [Mesa-dev] [PATCH] ac: select the GFX ring when halting waves with UMR on GFX10

2019-07-08 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Sun, Jul 7, 2019 at 1:32 PM Samuel Pitoiset 
wrote:

> GFX10 has two rings, so UMR want to know which one to halt.
> Select the first one by default.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/common/ac_debug.c   | 9 ++---
>  src/amd/common/ac_debug.h   | 3 ++-
>  src/amd/vulkan/radv_debug.c | 3 ++-
>  src/gallium/drivers/radeonsi/si_debug.c | 2 +-
>  4 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
> index e4cb6a13a3a..1632106fdb9 100644
> --- a/src/amd/common/ac_debug.c
> +++ b/src/amd/common/ac_debug.c
> @@ -769,12 +769,15 @@ static int compare_wave(const void *p1, const void
> *p2)
>  }
>
>  /* Return wave information. "waves" should be a large enough array. */
> -unsigned ac_get_wave_info(struct ac_wave_info
> waves[AC_MAX_WAVES_PER_CHIP])
> +unsigned ac_get_wave_info(enum chip_class chip_class,
> + struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP])
>  {
> -   char line[2000];
> +   char line[2000], cmd[128];
> unsigned num_waves = 0;
>
> -   FILE *p = popen("umr -O halt_waves -wa", "r");
> +   sprintf(cmd, "umr -O halt_waves -wa %s", chip_class >= GFX10 ?
> "gfx_0.0.0" : "gfx");
> +
> +   FILE *p = popen(cmd, "r");
> if (!p)
> return 0;
>
> diff --git a/src/amd/common/ac_debug.h b/src/amd/common/ac_debug.h
> index 23343fe1304..0d5c1dd9eac 100644
> --- a/src/amd/common/ac_debug.h
> +++ b/src/amd/common/ac_debug.h
> @@ -64,6 +64,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw,
> const int *trace_ids,
>  bool ac_vm_fault_occured(enum chip_class chip_class,
>  uint64_t *old_dmesg_timestamp, uint64_t
> *out_addr);
>
> -unsigned ac_get_wave_info(struct ac_wave_info
> waves[AC_MAX_WAVES_PER_CHIP]);
> +unsigned ac_get_wave_info(enum chip_class chip_class,
> + struct ac_wave_info
> waves[AC_MAX_WAVES_PER_CHIP]);
>
>  #endif
> diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
> index 2f661c0208f..42296745543 100644
> --- a/src/amd/vulkan/radv_debug.c
> +++ b/src/amd/vulkan/radv_debug.c
> @@ -445,7 +445,8 @@ radv_dump_annotated_shaders(struct radv_pipeline
> *pipeline,
> VkShaderStageFlagBits active_stages, FILE *f)
>  {
> struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
> -   unsigned num_waves = ac_get_wave_info(waves);
> +   enum chip_class chip_class =
> pipeline->device->physical_device->rad_info.chip_class;
> +   unsigned num_waves = ac_get_wave_info(chip_class, waves);
>
> fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
> "\n\n", num_waves);
> diff --git a/src/gallium/drivers/radeonsi/si_debug.c
> b/src/gallium/drivers/radeonsi/si_debug.c
> index c9c78733099..8265159c0d0 100644
> --- a/src/gallium/drivers/radeonsi/si_debug.c
> +++ b/src/gallium/drivers/radeonsi/si_debug.c
> @@ -1080,7 +1080,7 @@ static void si_print_annotated_shader(struct
> si_shader *shader,
>  static void si_dump_annotated_shaders(struct si_context *sctx, FILE *f)
>  {
> struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
> -   unsigned num_waves = ac_get_wave_info(waves);
> +   unsigned num_waves = ac_get_wave_info(sctx->chip_class, waves);
>
> fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
> "\n\n", num_waves);
> --
> 2.22.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH] ac: select the GFX ring when halting waves with UMR on GFX10

2019-07-07 Thread Bas Nieuwenhuizen
r-b

On Sun, Jul 7, 2019 at 7:32 PM Samuel Pitoiset
 wrote:
>
> GFX10 has two rings, so UMR want to know which one to halt.
> Select the first one by default.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/common/ac_debug.c   | 9 ++---
>  src/amd/common/ac_debug.h   | 3 ++-
>  src/amd/vulkan/radv_debug.c | 3 ++-
>  src/gallium/drivers/radeonsi/si_debug.c | 2 +-
>  4 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
> index e4cb6a13a3a..1632106fdb9 100644
> --- a/src/amd/common/ac_debug.c
> +++ b/src/amd/common/ac_debug.c
> @@ -769,12 +769,15 @@ static int compare_wave(const void *p1, const void *p2)
>  }
>
>  /* Return wave information. "waves" should be a large enough array. */
> -unsigned ac_get_wave_info(struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP])
> +unsigned ac_get_wave_info(enum chip_class chip_class,
> + struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP])
>  {
> -   char line[2000];
> +   char line[2000], cmd[128];
> unsigned num_waves = 0;
>
> -   FILE *p = popen("umr -O halt_waves -wa", "r");
> +   sprintf(cmd, "umr -O halt_waves -wa %s", chip_class >= GFX10 ? 
> "gfx_0.0.0" : "gfx");
> +
> +   FILE *p = popen(cmd, "r");
> if (!p)
> return 0;
>
> diff --git a/src/amd/common/ac_debug.h b/src/amd/common/ac_debug.h
> index 23343fe1304..0d5c1dd9eac 100644
> --- a/src/amd/common/ac_debug.h
> +++ b/src/amd/common/ac_debug.h
> @@ -64,6 +64,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw, const 
> int *trace_ids,
>  bool ac_vm_fault_occured(enum chip_class chip_class,
>  uint64_t *old_dmesg_timestamp, uint64_t *out_addr);
>
> -unsigned ac_get_wave_info(struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]);
> +unsigned ac_get_wave_info(enum chip_class chip_class,
> + struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]);
>
>  #endif
> diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
> index 2f661c0208f..42296745543 100644
> --- a/src/amd/vulkan/radv_debug.c
> +++ b/src/amd/vulkan/radv_debug.c
> @@ -445,7 +445,8 @@ radv_dump_annotated_shaders(struct radv_pipeline 
> *pipeline,
> VkShaderStageFlagBits active_stages, FILE *f)
>  {
> struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
> -   unsigned num_waves = ac_get_wave_info(waves);
> +   enum chip_class chip_class = 
> pipeline->device->physical_device->rad_info.chip_class;
> +   unsigned num_waves = ac_get_wave_info(chip_class, waves);
>
> fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
> "\n\n", num_waves);
> diff --git a/src/gallium/drivers/radeonsi/si_debug.c 
> b/src/gallium/drivers/radeonsi/si_debug.c
> index c9c78733099..8265159c0d0 100644
> --- a/src/gallium/drivers/radeonsi/si_debug.c
> +++ b/src/gallium/drivers/radeonsi/si_debug.c
> @@ -1080,7 +1080,7 @@ static void si_print_annotated_shader(struct si_shader 
> *shader,
>  static void si_dump_annotated_shaders(struct si_context *sctx, FILE *f)
>  {
> struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
> -   unsigned num_waves = ac_get_wave_info(waves);
> +   unsigned num_waves = ac_get_wave_info(sctx->chip_class, waves);
>
> fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
> "\n\n", num_waves);
> --
> 2.22.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] ac: select the GFX ring when halting waves with UMR on GFX10

2019-07-07 Thread Samuel Pitoiset
GFX10 has two rings, so UMR want to know which one to halt.
Select the first one by default.

Signed-off-by: Samuel Pitoiset 
---
 src/amd/common/ac_debug.c   | 9 ++---
 src/amd/common/ac_debug.h   | 3 ++-
 src/amd/vulkan/radv_debug.c | 3 ++-
 src/gallium/drivers/radeonsi/si_debug.c | 2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
index e4cb6a13a3a..1632106fdb9 100644
--- a/src/amd/common/ac_debug.c
+++ b/src/amd/common/ac_debug.c
@@ -769,12 +769,15 @@ static int compare_wave(const void *p1, const void *p2)
 }
 
 /* Return wave information. "waves" should be a large enough array. */
-unsigned ac_get_wave_info(struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP])
+unsigned ac_get_wave_info(enum chip_class chip_class,
+ struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP])
 {
-   char line[2000];
+   char line[2000], cmd[128];
unsigned num_waves = 0;
 
-   FILE *p = popen("umr -O halt_waves -wa", "r");
+   sprintf(cmd, "umr -O halt_waves -wa %s", chip_class >= GFX10 ? 
"gfx_0.0.0" : "gfx");
+
+   FILE *p = popen(cmd, "r");
if (!p)
return 0;
 
diff --git a/src/amd/common/ac_debug.h b/src/amd/common/ac_debug.h
index 23343fe1304..0d5c1dd9eac 100644
--- a/src/amd/common/ac_debug.h
+++ b/src/amd/common/ac_debug.h
@@ -64,6 +64,7 @@ void ac_parse_ib(FILE *f, uint32_t *ib, int num_dw, const int 
*trace_ids,
 bool ac_vm_fault_occured(enum chip_class chip_class,
 uint64_t *old_dmesg_timestamp, uint64_t *out_addr);
 
-unsigned ac_get_wave_info(struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]);
+unsigned ac_get_wave_info(enum chip_class chip_class,
+ struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP]);
 
 #endif
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index 2f661c0208f..42296745543 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -445,7 +445,8 @@ radv_dump_annotated_shaders(struct radv_pipeline *pipeline,
VkShaderStageFlagBits active_stages, FILE *f)
 {
struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
-   unsigned num_waves = ac_get_wave_info(waves);
+   enum chip_class chip_class = 
pipeline->device->physical_device->rad_info.chip_class;
+   unsigned num_waves = ac_get_wave_info(chip_class, waves);
 
fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
"\n\n", num_waves);
diff --git a/src/gallium/drivers/radeonsi/si_debug.c 
b/src/gallium/drivers/radeonsi/si_debug.c
index c9c78733099..8265159c0d0 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -1080,7 +1080,7 @@ static void si_print_annotated_shader(struct si_shader 
*shader,
 static void si_dump_annotated_shaders(struct si_context *sctx, FILE *f)
 {
struct ac_wave_info waves[AC_MAX_WAVES_PER_CHIP];
-   unsigned num_waves = ac_get_wave_info(waves);
+   unsigned num_waves = ac_get_wave_info(sctx->chip_class, waves);
 
fprintf(f, COLOR_CYAN "The number of active waves = %u" COLOR_RESET
"\n\n", num_waves);
-- 
2.22.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev