Commit 0d49f303 authored by Daniel Vetter's avatar Daniel Vetter

drm: remove all control node code

With the ioctl and driver prep done, we can remove everything else.
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
Link: https://patchwork.freedesktop.org/patch/msgid/20180420065159.4531-4-daniel.vetter@ffwll.ch
parent 9e1de900
...@@ -99,8 +99,6 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, ...@@ -99,8 +99,6 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev,
return &dev->primary; return &dev->primary;
case DRM_MINOR_RENDER: case DRM_MINOR_RENDER:
return &dev->render; return &dev->render;
case DRM_MINOR_CONTROL:
return &dev->control;
default: default:
BUG(); BUG();
} }
...@@ -567,7 +565,6 @@ int drm_dev_init(struct drm_device *dev, ...@@ -567,7 +565,6 @@ int drm_dev_init(struct drm_device *dev,
err_minors: err_minors:
drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_PRIMARY);
drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_RENDER);
drm_minor_free(dev, DRM_MINOR_CONTROL);
drm_fs_inode_free(dev->anon_inode); drm_fs_inode_free(dev->anon_inode);
err_free: err_free:
mutex_destroy(&dev->master_mutex); mutex_destroy(&dev->master_mutex);
...@@ -603,7 +600,6 @@ void drm_dev_fini(struct drm_device *dev) ...@@ -603,7 +600,6 @@ void drm_dev_fini(struct drm_device *dev)
drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_PRIMARY);
drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_RENDER);
drm_minor_free(dev, DRM_MINOR_CONTROL);
mutex_destroy(&dev->master_mutex); mutex_destroy(&dev->master_mutex);
mutex_destroy(&dev->ctxlist_mutex); mutex_destroy(&dev->ctxlist_mutex);
...@@ -796,10 +792,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) ...@@ -796,10 +792,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
mutex_lock(&drm_global_mutex); mutex_lock(&drm_global_mutex);
ret = drm_minor_register(dev, DRM_MINOR_CONTROL);
if (ret)
goto err_minors;
ret = drm_minor_register(dev, DRM_MINOR_RENDER); ret = drm_minor_register(dev, DRM_MINOR_RENDER);
if (ret) if (ret)
goto err_minors; goto err_minors;
...@@ -837,7 +829,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) ...@@ -837,7 +829,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
remove_compat_control_link(dev); remove_compat_control_link(dev);
drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_RENDER);
drm_minor_unregister(dev, DRM_MINOR_CONTROL);
out_unlock: out_unlock:
mutex_unlock(&drm_global_mutex); mutex_unlock(&drm_global_mutex);
return ret; return ret;
...@@ -882,7 +873,6 @@ void drm_dev_unregister(struct drm_device *dev) ...@@ -882,7 +873,6 @@ void drm_dev_unregister(struct drm_device *dev)
remove_compat_control_link(dev); remove_compat_control_link(dev);
drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_RENDER);
drm_minor_unregister(dev, DRM_MINOR_CONTROL);
} }
EXPORT_SYMBOL(drm_dev_unregister); EXPORT_SYMBOL(drm_dev_unregister);
......
...@@ -484,8 +484,7 @@ int drm_mode_getfb(struct drm_device *dev, ...@@ -484,8 +484,7 @@ int drm_mode_getfb(struct drm_device *dev,
* backwards-compatibility reasons, we cannot make GET_FB() privileged, * backwards-compatibility reasons, we cannot make GET_FB() privileged,
* so just return an invalid handle for non-masters. * so just return an invalid handle for non-masters.
*/ */
if (!drm_is_current_master(file_priv) && !capable(CAP_SYS_ADMIN) && if (!drm_is_current_master(file_priv) && !capable(CAP_SYS_ADMIN)) {
!drm_is_control_client(file_priv)) {
r->handle = 0; r->handle = 0;
ret = 0; ret = 0;
goto out; goto out;
......
...@@ -510,13 +510,7 @@ int drm_ioctl_permit(u32 flags, struct drm_file *file_priv) ...@@ -510,13 +510,7 @@ int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
/* MASTER is only for master or control clients */ /* MASTER is only for master or control clients */
if (unlikely((flags & DRM_MASTER) && if (unlikely((flags & DRM_MASTER) &&
!drm_is_current_master(file_priv) && !drm_is_current_master(file_priv)))
!drm_is_control_client(file_priv)))
return -EACCES;
/* Control clients must be explicitly allowed */
if (unlikely(!(flags & DRM_CONTROL_ALLOW) &&
drm_is_control_client(file_priv)))
return -EACCES; return -EACCES;
/* Render clients must be explicitly allowed */ /* Render clients must be explicitly allowed */
......
...@@ -331,9 +331,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) ...@@ -331,9 +331,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor)
struct device *kdev; struct device *kdev;
int r; int r;
if (minor->type == DRM_MINOR_CONTROL) if (minor->type == DRM_MINOR_RENDER)
minor_str = "controlD%d";
else if (minor->type == DRM_MINOR_RENDER)
minor_str = "renderD%d"; minor_str = "renderD%d";
else else
minor_str = "card%d"; minor_str = "card%d";
......
...@@ -38,7 +38,6 @@ struct drm_device { ...@@ -38,7 +38,6 @@ struct drm_device {
struct device *dev; /**< Device structure of bus-device */ struct device *dev; /**< Device structure of bus-device */
struct drm_driver *driver; /**< DRM driver managing the device */ struct drm_driver *driver; /**< DRM driver managing the device */
void *dev_private; /**< DRM driver private data */ void *dev_private; /**< DRM driver private data */
struct drm_minor *control; /**< Control node */
struct drm_minor *primary; /**< Primary node */ struct drm_minor *primary; /**< Primary node */
struct drm_minor *render; /**< Render node */ struct drm_minor *render; /**< Render node */
bool registered; bool registered;
......
...@@ -49,7 +49,6 @@ struct device; ...@@ -49,7 +49,6 @@ struct device;
enum drm_minor_type { enum drm_minor_type {
DRM_MINOR_PRIMARY, DRM_MINOR_PRIMARY,
DRM_MINOR_CONTROL,
DRM_MINOR_RENDER, DRM_MINOR_RENDER,
}; };
...@@ -348,18 +347,6 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv) ...@@ -348,18 +347,6 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv)
return file_priv->minor->type == DRM_MINOR_RENDER; return file_priv->minor->type == DRM_MINOR_RENDER;
} }
/**
* drm_is_control_client - is this an open file of the control node
* @file_priv: DRM file
*
* Control nodes are deprecated and in the process of getting removed from the
* DRM userspace API. Do not ever use!
*/
static inline bool drm_is_control_client(const struct drm_file *file_priv)
{
return file_priv->minor->type == DRM_MINOR_CONTROL;
}
int drm_open(struct inode *inode, struct file *filp); int drm_open(struct inode *inode, struct file *filp);
ssize_t drm_read(struct file *filp, char __user *buffer, ssize_t drm_read(struct file *filp, char __user *buffer,
size_t count, loff_t *offset); size_t count, loff_t *offset);
......
...@@ -108,13 +108,6 @@ enum drm_ioctl_flags { ...@@ -108,13 +108,6 @@ enum drm_ioctl_flags {
* This is equivalent to callers with the SYSADMIN capability. * This is equivalent to callers with the SYSADMIN capability.
*/ */
DRM_ROOT_ONLY = BIT(2), DRM_ROOT_ONLY = BIT(2),
/**
* @DRM_CONTROL_ALLOW:
*
* Deprecated, do not use. Control nodes are in the process of getting
* removed.
*/
DRM_CONTROL_ALLOW = BIT(3),
/** /**
* @DRM_UNLOCKED: * @DRM_UNLOCKED:
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment