intel/perf: fix performance counters availability after glFinish
Currently Linux kernel gathers performance counters at fixed intervals (~5-10ms), so if application uses AMD_performance_monitor extension and immediately after glFinish() asks GL driver for HW performance counter values it might not get any data (values == 0). Fix this by moving the "read counters from kernel" code from "is query ready" to "get counter values" callback with a loop around it. Unfortunately it means that the "read counters from kernel" code can spin for up to 10ms. Ideally kernel should gather performance counters whenever we ask it for counter values, but for now we have deal with what we have. Signed-off-by:Marcin Ślusarz <marcin.slusarz@intel.com> Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by:
Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <mesa/mesa!5788>
- src/gallium/drivers/iris/iris_monitor.c 1 addition, 1 deletionsrc/gallium/drivers/iris/iris_monitor.c
- src/gallium/drivers/iris/iris_performance_query.c 2 additions, 1 deletionsrc/gallium/drivers/iris/iris_performance_query.c
- src/intel/perf/gen_perf_query.c 14 additions, 13 deletionssrc/intel/perf/gen_perf_query.c
- src/intel/perf/gen_perf_query.h 1 addition, 0 deletionssrc/intel/perf/gen_perf_query.h
- src/mesa/drivers/dri/i965/brw_performance_query.c 1 addition, 1 deletionsrc/mesa/drivers/dri/i965/brw_performance_query.c