From d897fdad49f3ce73374c3c8508203602af4cab26 Mon Sep 17 00:00:00 2001 From: oga Date: Sun, 17 Aug 2008 19:21:36 +0000 Subject: [PATCH] Kill the infobufs and markbufs calls. Nothing uses them. --- sys/dev/pci/drm/drmP.h | 2 - sys/dev/pci/drm/drm_bufs.c | 82 -------------------------------------- sys/dev/pci/drm/drm_drv.c | 4 +- 3 files changed, 2 insertions(+), 86 deletions(-) diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index c823dbba9d7..bac31c95c5a 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -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 *); diff --git a/sys/dev/pci/drm/drm_bufs.c b/sys/dev/pci/drm/drm_bufs.c index b14d2faa437..054415854d1 100644 --- a/sys/dev/pci/drm/drm_bufs.c +++ b/sys/dev/pci/drm/drm_bufs.c @@ -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) { diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index d5ae2dc4993..8b6a448e6f7 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -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), -- 2.20.1