diff --git a/.pick_status.json b/.pick_status.json index 04a0ac4a52e..18b467690ad 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -554,7 +554,7 @@ "description": "panfrost: avoid potential divide by 0 calculating timer_resolution", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "205669e3a93a373fee2f4d0c8994b62c9faa371f", "notes": null 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 726ddbe5a13..ae8a5e1bbb9 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -668,7 +668,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