[Intel-gfx] [PATCH] drm/i915: Remove setparam ioctl

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Sep 30 06:40:35 PDT 2015


On Wed, Sep 30, 2015 at 10:46:59AM +0200, Daniel Vetter wrote:
> This was only used for the ums+gem combo, so ripe for removal now that
> we only have kms code left.
> 
> v2: Drop fence_reg_start since it's now unused, noticed by Ville.
> 
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>

lgtm
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c   |  1 -
>  drivers/gpu/drm/i915/i915_dma.c       | 33 ++-------------------------------
>  drivers/gpu/drm/i915/i915_drv.h       |  1 -
>  drivers/gpu/drm/i915/i915_gem_fence.c |  2 +-
>  4 files changed, 3 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 879771766973..84c7b6b294ee 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -952,7 +952,6 @@ static int i915_gem_fence_regs_info(struct seq_file *m, void *data)
>  	if (ret)
>  		return ret;
>  
> -	seq_printf(m, "Reserved fences = %d\n", dev_priv->fence_reg_start);
>  	seq_printf(m, "Total fences = %d\n", dev_priv->num_fence_regs);
>  	for (i = 0; i < dev_priv->num_fence_regs; i++) {
>  		struct drm_i915_gem_object *obj = dev_priv->fence_regs[i].obj;
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index b0b07be4e325..0fd2be7207cf 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -76,7 +76,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  		value = 1;
>  		break;
>  	case I915_PARAM_NUM_FENCES_AVAIL:
> -		value = dev_priv->num_fence_regs - dev_priv->fence_reg_start;
> +		value = dev_priv->num_fence_regs;
>  		break;
>  	case I915_PARAM_HAS_OVERLAY:
>  		value = dev_priv->overlay ? 1 : 0;
> @@ -184,35 +184,6 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  	return 0;
>  }
>  
> -static int i915_setparam(struct drm_device *dev, void *data,
> -			 struct drm_file *file_priv)
> -{
> -	struct drm_i915_private *dev_priv = dev->dev_private;
> -	drm_i915_setparam_t *param = data;
> -
> -	switch (param->param) {
> -	case I915_SETPARAM_USE_MI_BATCHBUFFER_START:
> -	case I915_SETPARAM_TEX_LRU_LOG_GRANULARITY:
> -	case I915_SETPARAM_ALLOW_BATCHBUFFER:
> -		/* Reject all old ums/dri params. */
> -		return -ENODEV;
> -
> -	case I915_SETPARAM_NUM_USED_FENCES:
> -		if (param->value > dev_priv->num_fence_regs ||
> -		    param->value < 0)
> -			return -EINVAL;
> -		/* Userspace can use first N regs */
> -		dev_priv->fence_reg_start = param->value;
> -		break;
> -	default:
> -		DRM_DEBUG_DRIVER("unknown parameter %d\n",
> -					param->param);
> -		return -EINVAL;
> -	}
> -
> -	return 0;
> -}
> -
>  static int i915_get_bridge_dev(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1247,7 +1218,7 @@ const struct drm_ioctl_desc i915_ioctls[] = {
>  	DRM_IOCTL_DEF_DRV(I915_IRQ_EMIT, drm_noop, DRM_AUTH),
>  	DRM_IOCTL_DEF_DRV(I915_IRQ_WAIT, drm_noop, DRM_AUTH),
>  	DRM_IOCTL_DEF_DRV(I915_GETPARAM, i915_getparam, DRM_AUTH|DRM_RENDER_ALLOW),
> -	DRM_IOCTL_DEF_DRV(I915_SETPARAM, i915_setparam, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> +	DRM_IOCTL_DEF_DRV(I915_SETPARAM, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
>  	DRM_IOCTL_DEF_DRV(I915_ALLOC, drm_noop, DRM_AUTH),
>  	DRM_IOCTL_DEF_DRV(I915_FREE, drm_noop, DRM_AUTH),
>  	DRM_IOCTL_DEF_DRV(I915_INIT_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 2b5d587220aa..7c0eb9da2478 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1802,7 +1802,6 @@ struct drm_i915_private {
>  	struct mutex pps_mutex;
>  
>  	struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */
> -	int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
>  	int num_fence_regs; /* 8 on pre-965, 16 otherwise */
>  
>  	unsigned int fsb_freq, mem_freq, is_ddr3;
> diff --git a/drivers/gpu/drm/i915/i915_gem_fence.c b/drivers/gpu/drm/i915/i915_gem_fence.c
> index 6077dffb318a..ab80f7370ab7 100644
> --- a/drivers/gpu/drm/i915/i915_gem_fence.c
> +++ b/drivers/gpu/drm/i915/i915_gem_fence.c
> @@ -322,7 +322,7 @@ i915_find_fence_reg(struct drm_device *dev)
>  
>  	/* First try to find a free reg */
>  	avail = NULL;
> -	for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) {
> +	for (i = 0; i < dev_priv->num_fence_regs; i++) {
>  		reg = &dev_priv->fence_regs[i];
>  		if (!reg->obj)
>  			return reg;
> -- 
> 2.5.1

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list