From: Marcin Ślusarz Date: Mon, 15 Jun 2020 12:26:26 +0000 (+0200) Subject: iris: return max counter value for AMD_performance_monitor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00d3b13837c5edd299dc40cbd84505c8d1d5927f;p=mesa.git iris: return max counter value for AMD_performance_monitor glGetPerfMonitorCounterInfoAMD(..., ..., GL_COUNTER_RANGE_AMD, ...) returned NAN (binary representation of uint64_t(-1) as float) as a max value. Fixes: 0fd4359733e6 ("iris/perf: implement routines to return counter info") Signed-off-by: Marcin Ślusarz Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c index c4194052def..a8409607c7a 100644 --- a/src/gallium/drivers/iris/iris_monitor.c +++ b/src/gallium/drivers/iris/iris_monitor.c @@ -72,16 +72,17 @@ iris_get_monitor_info(struct pipe_screen *pscreen, unsigned index, case GEN_PERF_COUNTER_DATA_TYPE_BOOL32: case GEN_PERF_COUNTER_DATA_TYPE_UINT32: info->type = PIPE_DRIVER_QUERY_TYPE_UINT; - info->max_value.u32 = 0; + assert(counter->raw_max <= UINT32_MAX); + info->max_value.u32 = (uint32_t)counter->raw_max; break; case GEN_PERF_COUNTER_DATA_TYPE_UINT64: info->type = PIPE_DRIVER_QUERY_TYPE_UINT64; - info->max_value.u64 = 0; + info->max_value.u64 = counter->raw_max; break; case GEN_PERF_COUNTER_DATA_TYPE_FLOAT: case GEN_PERF_COUNTER_DATA_TYPE_DOUBLE: info->type = PIPE_DRIVER_QUERY_TYPE_FLOAT; - info->max_value.u64 = -1; + info->max_value.f = counter->raw_max; break; default: assert(false);