[Mesa-dev] [PATCH] radeonsi: bugfix in performance counters

Marek Olšák maraeo at gmail.com
Sat May 13 19:32:32 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Note that this is not meant for master, because master doesn't need this
fix anymore.

Marek

On Sat, May 13, 2017 at 12:07 AM, Mauro Rossi <issor.oruam at gmail.com> wrote:

> 'if (regs->counters)' expression at line 623 is always true,
> spotted because of an error when building android-x86.
>
> 'if (regs->counters[idx])' is used instead.
>
> Fixes the following building error in Android:
>
> external/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c:617:14:
> error: address of array 'regs->counters' will always evaluate to 'true'
> [-Werror,-Wpointer-bool-conversion]
>                         if (regs->counters)
>                         ~~  ~~~~~~^~~~~~~~
>
> Fixes: ad22006 "radeonsi: implement AMD_performance_monitor for CIK+"
> ---
>  src/gallium/drivers/radeonsi/si_perfcounter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c
> b/src/gallium/drivers/radeonsi/si_perfcounter.c
> index 41dd52edb1..85b6e5c55a 100644
> --- a/src/gallium/drivers/radeonsi/si_perfcounter.c
> +++ b/src/gallium/drivers/radeonsi/si_perfcounter.c
> @@ -620,7 +620,7 @@ static void si_pc_emit_read(struct r600_common_context
> *ctx,
>                         reg_delta = -reg_delta;
>
>                 for (idx = 0; idx < count; ++idx) {
> -                       if (regs->counters)
> +                       if (regs->counters[idx])
>                                 reg = regs->counters[idx];
>
>                         radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170513/3c8c7cbb/attachment.html>


More information about the mesa-dev mailing list