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 *);
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)
{
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),