[Intel-gfx] [PATCH 7/7] drm/i915: add i915_get_reset_stats_ioctl

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 3 17:14:31 CEST 2013


On Wed, Jul 03, 2013 at 05:22:12PM +0300, Mika Kuoppala wrote:
>  int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 33cb973..0d4e3a8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1350,3 +1350,37 @@ int i915_reg_read_ioctl(struct drm_device *dev,
>  
>  	return 0;
>  }
> +
> +int i915_get_reset_stats_ioctl(struct drm_device *dev,
> +			       void *data, struct drm_file *file)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct drm_i915_reset_stats *args = data;
> +	struct i915_ctx_hang_stats *hs;
> +	int ret;
> +
> +	if (args->ctx_id == 0 && !capable(CAP_SYS_ADMIN))
> +		return -EPERM;

When per-file default contexts land, there will not be any global
information leak and so we can drop the capability check here.

Ben, will we be informing userspace about the ABI change?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list