[Intel-gfx] [PATCH 4/6] drm/i915: Add bannable context parameter

Chris Wilson chris at chris-wilson.co.uk
Tue Nov 15 16:31:42 UTC 2016


On Tue, Nov 15, 2016 at 04:36:34PM +0200, Mika Kuoppala wrote:
> Now when driver has per context scoring of 'hanging badness'
> and also subsequent hangs during short windows are allowed,
> if there is progress made in between, it does not make sense
> to expose a ban timing window as a context parameter anymore.
> 
> Let the scoring be the sole indicator for ban policy and substitute
> ban period context parameter as a boolean to get/set context
> bannable property.
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>

> @@ -1156,6 +1153,14 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,
>  				ctx->flags &= ~CONTEXT_NO_ERROR_CAPTURE;
>  		}
>  		break;
> +	case I915_CONTEXT_PARAM_BANNABLE:
> +		if (args->size)
> +			ret = -EINVAL;
> +		else if (!capable(CAP_SYS_ADMIN))

You can allow non-root to opt into being banned.

else if (!capable(CAP_SYS_ADMIN) && !args->value)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list