Skip to contentSkip to conversation

drm/panthor: Enable timestamp propogation

PATCH Superseded Ashley Smith 2 participants 2 messages Nov 19, 2025 – Nov 20, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panthor: Enable timestamp propogation

Set the GLB_COUNTER_EN bit to enable coherent propagation of GPU timestamp values to shader cores. This is a prerequisite for exposing device-coherent timestamp queries.

Bump the version to 1.6 so userspace can detect support.

---
 drivers/gpu/drm/panthor/panthor_drv.c | 3 ++-
 drivers/gpu/drm/panthor/panthor_fw.c  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_drv.c +2 -1
index d1d4c50da5bf..0b0ec3b978c6 100644
@@ -1604,6 +1604,7 @@ static void panthor_debugfs_init(struct drm_minor *minor)
  * - 1.3 - adds DRM_PANTHOR_GROUP_STATE_INNOCENT flag
  * - 1.4 - adds DRM_IOCTL_PANTHOR_BO_SET_LABEL ioctl
  * - 1.5 - adds DRM_PANTHOR_SET_USER_MMIO_OFFSET ioctl
+ * - 1.6 - enables GLB_COUNTER_EN
  */
 static const struct drm_driver panthor_drm_driver = {
 	.driver_features = DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ |
@@ -1617,7 +1618,7 @@ static const struct drm_driver panthor_drm_driver = {
 	.name = "panthor",
 	.desc = "Panthor DRM driver",
 	.major = 1,
-	.minor = 5,
+	.minor = 6,
 
 	.gem_create_object = panthor_gem_create_object,
 	.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
drivers/gpu/drm/panthor/panthor_fw.c +1 -0
index 38d87ab92eda..a02fb3afc2e1 100644
@@ -999,6 +999,7 @@ static void panthor_fw_init_global_iface(struct panthor_device *ptdev)
 	panthor_fw_update_reqs(glb_iface, req, GLB_IDLE_EN, GLB_IDLE_EN);
 	panthor_fw_toggle_reqs(glb_iface, req, ack,
 			       GLB_CFG_ALLOC_EN |
+			       GLB_COUNTER_EN |
 			       GLB_CFG_POWEROFF_TIMER |
 			       GLB_CFG_PROGRESS_TIMER);
 

base-commit: 92c49b3f4df8f9acfa95551ef38fc00c675319fd

Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 37 lines · Ashley Smith

Set the GLB_COUNTER_EN bit to enable coherent propagation of GPU timestamp values to shader cores. This is a prerequisite for exposing device-coherent timestamp queries.

Quoted 1 line

Bump the version to 1.6 so userspace can detect support.

---
 drivers/gpu/drm/panthor/panthor_drv.c | 3 ++-
 drivers/gpu/drm/panthor/panthor_fw.c  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panthor/panthor_drv.c +2 -1
index d1d4c50da5bf..0b0ec3b978c6 100644
@@ -1604,6 +1604,7 @@ static void panthor_debugfs_init(struct drm_minor *minor)
  * - 1.3 - adds DRM_PANTHOR_GROUP_STATE_INNOCENT flag
  * - 1.4 - adds DRM_IOCTL_PANTHOR_BO_SET_LABEL ioctl
  * - 1.5 - adds DRM_PANTHOR_SET_USER_MMIO_OFFSET ioctl
+ * - 1.6 - enables GLB_COUNTER_EN
  */
 static const struct drm_driver panthor_drm_driver = {
 	.driver_features = DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ |
@@ -1617,7 +1618,7 @@ static const struct drm_driver panthor_drm_driver = {
 	.name = "panthor",
 	.desc = "Panthor DRM driver",
 	.major = 1,
-	.minor = 5,
+	.minor = 6,
 
 	.gem_create_object = panthor_gem_create_object,
 	.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
drivers/gpu/drm/panthor/panthor_fw.c +0 -0
index 38d87ab92eda..a02fb3afc2e1 100644

drivers/gpu/drm/panthor/panthor_fw.c static void panthor_fw_init_global_iface(struct panthor_device *ptdev) · line 1004

Quoted 6 lines
drivers/gpu/drm/panthor/panthor_fw.c +1 -0
@@ -999,6 +999,7 @@ static void panthor_fw_init_global_iface(struct panthor_device *ptdev)
 	panthor_fw_update_reqs(glb_iface, req, GLB_IDLE_EN, GLB_IDLE_EN);
 	panthor_fw_toggle_reqs(glb_iface, req, ack,
 			       GLB_CFG_ALLOC_EN |
+			       GLB_COUNTER_EN |
 			       GLB_CFG_POWEROFF_TIMER |
 			       GLB_CFG_PROGRESS_TIMER);

This is definitely the wrong function. The COUNTER_ENABLE field isn't a toggle field. So '1' enables the counter propagation, '0' disables it. This code is toggling it so changing it from whatever default it started out at.

Testing on my Rock5B I see that it does seem to start at 0, so this is probably why it seemed to work. But you need to include this value in the panthor_fw_update_reqs() call instead.

Thanks,
Steve

Quoted 3 lines

base-commit: 92c49b3f4df8f9acfa95551ef38fc00c675319fd