panfrost,panvk: Enable shader_realtime_clock on panthor 1.6

shader_realtime_clock requires a newer kernel version in order to enable
GLB_COUNTER_EN this change adds a check on this kernel functionality.

Remove GL_EXT_shader_realtime_clock from extensions as this now depends
on kernel version.

Fixes: e9c2c324 ("panvk: enable VK_KHR_shader_clock")
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37915>
This commit is contained in:
Ashley Smith 2025-10-16 14:22:17 +01:00 committed by Marge Bot
parent 7130127e2a
commit 5681fabdc2
6 changed files with 13 additions and 3 deletions

View file

@ -729,7 +729,8 @@ panfrost_init_screen_caps(struct panfrost_screen *screen)
caps->shader_clock = dev->arch >= 6 &&
dev->kmod.props.gpu_can_query_timestamp;
caps->shader_realtime_clock = dev->arch >= 6 &&
dev->kmod.props.gpu_can_query_timestamp;
dev->kmod.props.gpu_can_query_timestamp &&
dev->kmod.props.timestamp_device_coherent;
/* pixel_local_storage is initially for valhall and bifrost only */
caps->shader_pixel_local_storage_fast_size =

View file

@ -46,7 +46,6 @@ GL_EXT_shader_implicit_conversions
GL_EXT_shader_integer_mix
GL_EXT_shader_io_blocks
GL_EXT_shader_pixel_local_storage
GL_EXT_shader_realtime_clock
GL_EXT_shadow_samplers
GL_EXT_sRGB
GL_EXT_sRGB_write_control

View file

@ -205,6 +205,9 @@ struct pan_kmod_dev_props {
/* Support cycle count and timestamp propagation as job requirement */
bool gpu_can_query_timestamp;
/* Cycle counter and timestamp device coherent propogation is enabled */
bool timestamp_device_coherent;
/* GPU Timestamp frequency */
uint64_t timestamp_frequency;

View file

@ -211,6 +211,9 @@ panfrost_dev_query_props(const struct pan_kmod_dev *dev,
fd, DRM_PANFROST_PARAM_SYSTEM_TIMESTAMP_FREQUENCY, true, 0);
}
/* Device coherent timestamps are always enabled on panfrost */
props->timestamp_device_coherent = true;
/* Support for priorities was added in panfrost 1.5, assumes default
* priority as medium if the param doesn't exist. */
uint64_t prios =

View file

@ -286,6 +286,10 @@ panthor_dev_query_props(const struct pan_kmod_dev *dev,
panthor_dev->props.group_priorities.allowed_mask),
};
if (dev->driver.version.major > 1 || dev->driver.version.minor >= 6) {
props->timestamp_device_coherent = true;
}
static_assert(sizeof(props->texture_features) ==
sizeof(panthor_dev->props.gpu.texture_features),
"Mismatch in texture_features array size");

View file

@ -493,7 +493,7 @@ panvk_per_arch(get_physical_device_features)(
/* VK_KHR_shader_clock */
.shaderSubgroupClock = device->kmod.props.gpu_can_query_timestamp,
.shaderDeviceClock = device->kmod.props.gpu_can_query_timestamp,
.shaderDeviceClock = device->kmod.props.timestamp_device_coherent,
/* VK_KHR_shader_quad_control */
.shaderQuadControl = true,