summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/v3d/v3d_drv.c
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2025-07-11 12:18:31 -0300
committerMaíra Canal <mcanal@igalia.com>2025-07-17 11:17:27 -0300
commit5774b3cfdedb3624ef0d2c82cccbfd61bcb60fd5 (patch)
treea50bf85413cc51f4db1e7a7748aff587e435951d /drivers/gpu/drm/v3d/v3d_drv.c
parent2650bc4007c15e05f995f472b4fc89e793162bc4 (diff)
drm/v3d: Add parameter to retrieve the global number of GPU resets
The GL extension KHR_robustness uses the number of global and per-context GPU resets to learn about graphics resets that affect a GL context. This commit introduces a new V3D parameter to retrieve the global number of GPU resets that have happened since the driver was probed. To retrieve this information, user-space must use DRM_V3D_PARAM_GLOBAL_RESET_COUNTER. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://lore.kernel.org/r/20250711-v3d-reset-counter-v1-1-1ac73e9fca2d@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.c')
-rw-r--r--drivers/gpu/drm/v3d/v3d_drv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 5e997ae8bc9c..0f53ca746004 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -107,6 +107,11 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
case DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES:
args->value = !!v3d->gemfs;
return 0;
+ case DRM_V3D_PARAM_GLOBAL_RESET_COUNTER:
+ mutex_lock(&v3d->reset_lock);
+ args->value = v3d->reset_counter;
+ mutex_unlock(&v3d->reset_lock);
+ return 0;
default:
DRM_DEBUG("Unknown parameter %d\n", args->param);
return -EINVAL;