Kill the infobufs and markbufs calls. Nothing uses them.
authoroga <oga@openbsd.org>
Sun, 17 Aug 2008 19:21:36 +0000 (19:21 +0000)
committeroga <oga@openbsd.org>
Sun, 17 Aug 2008 19:21:36 +0000 (19:21 +0000)
sys/dev/pci/drm/drmP.h
sys/dev/pci/drm/drm_bufs.c
sys/dev/pci/drm/drm_drv.c

index c823dbb..bac31c9 100644 (file)
@@ -837,8 +837,6 @@ SPLAY_PROTOTYPE(drm_magic_tree, drm_magic_entry, node, drm_magic_cmp);
 int    drm_addmap_ioctl(struct drm_device *, void *, struct drm_file *);
 int    drm_rmmap_ioctl(struct drm_device *, void *, struct drm_file *);
 int    drm_addbufs_ioctl(struct drm_device *, void *, struct drm_file *);
-int    drm_infobufs(struct drm_device *, void *, struct drm_file *);
-int    drm_markbufs(struct drm_device *, void *, struct drm_file *);
 int    drm_freebufs(struct drm_device *, void *, struct drm_file *);
 int    drm_mapbufs(struct drm_device *, void *, struct drm_file *);
 
index b14d2fa..0544158 100644 (file)
@@ -945,88 +945,6 @@ drm_addbufs_ioctl(struct drm_device *dev, void *data,
        return err;
 }
 
-int
-drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
-{
-       drm_device_dma_t *dma = dev->dma;
-       drm_buf_info_t *request = data;
-       int i;
-       int count;
-       int retcode = 0;
-
-       DRM_SPINLOCK(&dev->dma_lock);
-       ++dev->buf_use;         /* Can't allocate more after this call */
-       DRM_SPINUNLOCK(&dev->dma_lock);
-
-       for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
-               if (dma->bufs[i].buf_count)
-                   ++count;
-       }
-
-       DRM_DEBUG("count = %d\n", count);
-
-       if (request->count >= count) {
-               for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
-                       if (dma->bufs[i].buf_count) {
-                               drm_buf_desc_t from;
-
-                               from.count = dma->bufs[i].buf_count;
-                               from.size = dma->bufs[i].buf_size;
-                               from.low_mark = dma->bufs[i].freelist.low_mark;
-                               from.high_mark =
-                                   dma->bufs[i].freelist.high_mark;
-
-                               if (DRM_COPY_TO_USER(&request->list[count],
-                                   &from, sizeof(drm_buf_desc_t)) != 0) {
-                                       retcode = EFAULT;
-                                       break;
-                               }
-
-                               DRM_DEBUG("%d %d %d %d %d\n", i,
-                                   dma->bufs[i].buf_count,
-                                   dma->bufs[i].buf_size,
-                                   dma->bufs[i].freelist.low_mark,
-                                   dma->bufs[i].freelist.high_mark);
-                               ++count;
-                       }
-               }
-       }
-       request->count = count;
-
-       return retcode;
-}
-
-int
-drm_markbufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
-{
-       drm_device_dma_t *dma = dev->dma;
-       drm_buf_desc_t *request = data;
-       int order;
-
-       DRM_DEBUG("%d, %d, %d\n", request->size, request->low_mark,
-           request->high_mark);
-       
-
-       order = drm_order(request->size);       
-       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER ||
-           request->low_mark < 0 || request->high_mark < 0) {
-               return EINVAL;
-       }
-
-       DRM_SPINLOCK(&dev->dma_lock);
-       if (request->low_mark > dma->bufs[order].buf_count ||
-           request->high_mark > dma->bufs[order].buf_count) {
-               DRM_SPINUNLOCK(&dev->dma_lock);
-               return EINVAL;
-       }
-
-       dma->bufs[order].freelist.low_mark  = request->low_mark;
-       dma->bufs[order].freelist.high_mark = request->high_mark;
-       DRM_SPINUNLOCK(&dev->dma_lock);
-
-       return 0;
-}
-
 int
 drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
index d5ae2dc..8b6a448 100644 (file)
@@ -104,8 +104,8 @@ static drm_ioctl_desc_t               drm_ioctls[256] = {
 
        DRM_IOCTL_DEF(DRM_IOCTL_ADD_BUFS, drm_addbufs_ioctl,
            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_IOCTL_DEF(DRM_IOCTL_MARK_BUFS, drm_markbufs, DRM_AUTH|DRM_MASTER),
-       DRM_IOCTL_DEF(DRM_IOCTL_INFO_BUFS, drm_infobufs, DRM_AUTH),
+       DRM_IOCTL_DEF(DRM_IOCTL_MARK_BUFS, drm_noop, DRM_AUTH|DRM_MASTER),
+       DRM_IOCTL_DEF(DRM_IOCTL_INFO_BUFS, drm_noop, DRM_AUTH),
        DRM_IOCTL_DEF(DRM_IOCTL_MAP_BUFS, drm_mapbufs, DRM_AUTH),
        DRM_IOCTL_DEF(DRM_IOCTL_FREE_BUFS, drm_freebufs, DRM_AUTH),
        DRM_IOCTL_DEF(DRM_IOCTL_DMA, drm_dma, DRM_AUTH),