Skip to content

Commit

Permalink
drm: replace drawable ioctl by noops
Browse files Browse the repository at this point in the history
The information supplied by userspace through these ioctls is only
accessible by dev->drw_idr. But there's no in-tree user of that.
Also userspace does not really care about return values of these ioctls,
either. Only hw/xfree86/dri/dri.c from the xserver actually checks the
return from adddraw and keeps on trying to create a kernel drawable
every time somebody creates a dri drawable. But since that's now a noop,
who cares.

Therefore it's safe to replace these three ioctls with noops and rip
out the implementation.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Daniel Vetter authored and Dave Airlie committed Aug 29, 2010
1 parent 4ac5ec4 commit 8f87919
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 221 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ccflags-y := -Iinclude/drm

drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
drm_context.o drm_dma.o drm_drawable.o \
drm_context.o drm_dma.o \
drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \
Expand Down
197 changes: 0 additions & 197 deletions drivers/gpu/drm/drm_drawable.c

This file was deleted.

8 changes: 3 additions & 5 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ static struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_NEW_CTX, drm_newctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_RES_CTX, drm_resctx, DRM_AUTH),

DRM_IOCTL_DEF(DRM_IOCTL_ADD_DRAW, drm_adddraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_RM_DRAW, drm_rmdraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_ADD_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_RM_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),

DRM_IOCTL_DEF(DRM_IOCTL_LOCK, drm_lock, DRM_AUTH),
DRM_IOCTL_DEF(DRM_IOCTL_UNLOCK, drm_unlock, DRM_AUTH),
Expand Down Expand Up @@ -127,7 +127,7 @@ static struct drm_ioctl_desc drm_ioctls[] = {

DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_modeset_ctl, 0),

DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_update_drawable_info, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),

DRM_IOCTL_DEF(DRM_IOCTL_GEM_CLOSE, drm_gem_close_ioctl, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GEM_FLINK, drm_gem_flink_ioctl, DRM_AUTH|DRM_UNLOCKED),
Expand Down Expand Up @@ -180,8 +180,6 @@ int drm_lastclose(struct drm_device * dev)

mutex_lock(&dev->struct_mutex);

/* Free drawable information memory */
drm_drawable_free_all(dev);
del_timer(&dev->timer);

/* Clear AGP information */
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,11 @@ int drm_fill_in_dev(struct drm_device *dev,
INIT_LIST_HEAD(&dev->vblank_event_list);

spin_lock_init(&dev->count_lock);
spin_lock_init(&dev->drw_lock);
spin_lock_init(&dev->event_lock);
init_timer(&dev->timer);
mutex_init(&dev->struct_mutex);
mutex_init(&dev->ctxlist_mutex);

idr_init(&dev->drw_idr);

if (drm_ht_create(&dev->map_hash, 12)) {
return -ENOMEM;
}
Expand Down
15 changes: 0 additions & 15 deletions include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -1037,12 +1037,6 @@ struct drm_device {
struct drm_minor *control; /**< Control node for card */
struct drm_minor *primary; /**< render type primary screen head */

/** \name Drawable information */
/*@{ */
spinlock_t drw_lock;
struct idr drw_idr;
/*@} */

struct drm_mode_config mode_config; /**< Current mode config */

/** \name GEM information */
Expand Down Expand Up @@ -1229,15 +1223,6 @@ extern int drm_setsareactx(struct drm_device *dev, void *data,
extern int drm_getsareactx(struct drm_device *dev, void *data,
struct drm_file *file_priv);

/* Drawable IOCTL support (drm_drawable.h) */
extern int drm_adddraw(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern int drm_rmdraw(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern int drm_update_drawable_info(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern void drm_drawable_free_all(struct drm_device *dev);

/* Authentication IOCTL support (drm_auth.h) */
extern int drm_getmagic(struct drm_device *dev, void *data,
struct drm_file *file_priv);
Expand Down

0 comments on commit 8f87919

Please sign in to comment.