[Intel-gfx] [RFC 14/44] drm/i915: Added getparam for GPU scheduler

Jesse Barnes jbarnes at virtuousgeek.org
Wed Jul 2 20:21:42 CEST 2014


On Thu, 26 Jun 2014 18:24:05 +0100
John.C.Harrison at Intel.com wrote:

> From: John Harrison <John.C.Harrison at Intel.com>
> 
> This is required by user land validation programs that need to know whether the
> scheduler is available for testing or not.
> ---
>  drivers/gpu/drm/i915/i915_dma.c |    3 +++
>  include/uapi/drm/i915_drm.h     |    1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 6c9ce82..1668316 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1035,6 +1035,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  		value = 0;
>  #endif
>  		break;
> +	case I915_PARAM_HAS_GPU_SCHEDULER:
> +		value = i915_scheduler_is_enabled(dev);
> +		break;
>  	default:
>  		DRM_DEBUG("Unknown parameter %d\n", param->param);
>  		return -EINVAL;
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index bf54c78..de6f603 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -341,6 +341,7 @@ typedef struct drm_i915_irq_wait {
>  #define I915_PARAM_HAS_WT     	 	 27
>  #define I915_PARAM_CMD_PARSER_VERSION	 28
>  #define I915_PARAM_HAS_NATIVE_SYNC	 30
> +#define I915_PARAM_HAS_GPU_SCHEDULER	 31
>  
>  typedef struct drm_i915_getparam {
>  	int param;

I guess we have plenty of getparam space available.  But another option
would be for tests to check for a debugfs file that dumps scheduler
info instead, and save the get params for non-debug applications.

Either way though:
Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list