Module: Mesa
Branch: master
Commit: 79f354441262622ea9b56d47dcbdc284f0eed6ad
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=79f354441262622ea9b56d47dcbdc284f0eed6ad

Author: Lionel Landwerlin <[email protected]>
Date:   Tue Oct  6 11:38:54 2020 +0300

intel/perf: fix crash when no perf queries are supported

Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: ec1fa1d51ff614 ("intel/perf: fix raw query kernel metric selection")
Reviewed-by: Marcin Ĺšlusarz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7024>

---

 src/intel/perf/gen_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index d9f20501512..b9fee6e4d4d 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -781,7 +781,7 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
          break;
       }
    }
-   if (perf->fallback_raw_oa_metric == 0)
+   if (perf->fallback_raw_oa_metric == 0 && perf->n_queries > 0)
       perf->fallback_raw_oa_metric = perf->queries[perf->n_queries - 
1].oa_metrics_set_id;
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to