diff --git a/src/gallium/drivers/panfrost/pan_device.h b/src/gallium/drivers/panfrost/pan_device.h index 2478ead9e06..ad629f15f06 100644 --- a/src/gallium/drivers/panfrost/pan_device.h +++ b/src/gallium/drivers/panfrost/pan_device.h @@ -229,6 +229,7 @@ pan_is_bifrost(const struct panfrost_device *dev) static inline uint64_t pan_gpu_time_to_ns(struct panfrost_device *dev, uint64_t gpu_time) { + assert(dev->kmod.props.timestamp_frequency > 0); return (gpu_time * NSEC_PER_SEC) / dev->kmod.props.timestamp_frequency; } diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 01a5a04dee7..af6c935ea6a 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -576,7 +576,8 @@ panfrost_init_screen_caps(struct panfrost_screen *screen) dev->kmod.props.gpu_can_query_timestamp && dev->kmod.props.timestamp_frequency != 0; - caps->timer_resolution = pan_gpu_time_to_ns(dev, 1); + if (caps->query_timestamp) + caps->timer_resolution = pan_gpu_time_to_ns(dev, 1); /* The hardware requires element alignment for data conversion to work * as expected. If data conversion is not required, this restriction is