Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 1 | /************************************************************************** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 3 | * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA. |
| 4 | * All Rights Reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 7 | * copy of this software and associated documentation files (the |
| 8 | * "Software"), to deal in the Software without restriction, including |
| 9 | * without limitation the rights to use, copy, modify, merge, publish, |
| 10 | * distribute, sub license, and/or sell copies of the Software, and to |
| 11 | * permit persons to whom the Software is furnished to do so, subject to |
| 12 | * the following conditions: |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 13 | * |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 14 | * The above copyright notice and this permission notice (including the |
| 15 | * next paragraph) shall be included in all copies or substantial portions |
| 16 | * of the Software. |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 17 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
| 21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, |
| 22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 25 | * |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 26 | * |
| 27 | **************************************************************************/ |
| 28 | |
| 29 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | * Authors: |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 31 | * Thomas Hellström <thomas-at-tungstengraphics-dot-com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | */ |
| 33 | |
| 34 | #include "drmP.h" |
| 35 | #include "sis_drm.h" |
| 36 | #include "sis_drv.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 38 | #include <video/sisfb.h> |
| 39 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 40 | #define VIDEO_TYPE 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #define AGP_TYPE 1 |
| 42 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 43 | #define SIS_MM_ALIGN_SHIFT 4 |
| 44 | #define SIS_MM_ALIGN_MASK ( (1 << SIS_MM_ALIGN_SHIFT) - 1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 46 | #if defined(CONFIG_FB_SIS) |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 47 | /* fb management via fb device */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 49 | #define SIS_MM_ALIGN_SHIFT 0 |
| 50 | #define SIS_MM_ALIGN_MASK 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 52 | static void *sis_sman_mm_allocate(void *private, unsigned long size, |
| 53 | unsigned alignment) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | struct sis_memreq req; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 57 | req.size = size; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | sis_malloc(&req); |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 59 | if (req.size == 0) |
| 60 | return NULL; |
| 61 | else |
| 62 | return (void *)~req.offset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | } |
| 64 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 65 | static void sis_sman_mm_free(void *private, void *ref) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | { |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 67 | sis_free(~((unsigned long)ref)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 70 | static void sis_sman_mm_destroy(void *private) |
| 71 | { |
| 72 | ; |
| 73 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 75 | unsigned long sis_sman_mm_offset(void *private, void *ref) |
| 76 | { |
| 77 | return ~((unsigned long)ref); |
| 78 | } |
| 79 | |
| 80 | #endif |
| 81 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 82 | static int sis_fb_init(DRM_IOCTL_ARGS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | { |
| 84 | DRM_DEVICE; |
| 85 | drm_sis_private_t *dev_priv = dev->dev_private; |
| 86 | drm_sis_fb_t fb; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 87 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 89 | DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_fb_t __user *) data, sizeof(fb)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 91 | mutex_lock(&dev->struct_mutex); |
| 92 | #if defined(CONFIG_FB_SIS) |
| 93 | { |
| 94 | drm_sman_mm_t sman_mm; |
| 95 | sman_mm.private = (void *)0xFFFFFFFF; |
| 96 | sman_mm.allocate = sis_sman_mm_allocate; |
| 97 | sman_mm.free = sis_sman_mm_free; |
| 98 | sman_mm.destroy = sis_sman_mm_destroy; |
| 99 | sman_mm.offset = sis_sman_mm_offset; |
| 100 | ret = |
| 101 | drm_sman_set_manager(&dev_priv->sman, VIDEO_TYPE, &sman_mm); |
| 102 | } |
| 103 | #else |
| 104 | ret = drm_sman_set_range(&dev_priv->sman, VIDEO_TYPE, 0, |
| 105 | fb.size >> SIS_MM_ALIGN_SHIFT); |
| 106 | #endif |
| 107 | |
| 108 | if (ret) { |
| 109 | DRM_ERROR("VRAM memory manager initialisation error\n"); |
| 110 | mutex_unlock(&dev->struct_mutex); |
| 111 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 114 | dev_priv->vram_initialized = TRUE; |
| 115 | dev_priv->vram_offset = fb.offset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 117 | mutex_unlock(&dev->struct_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | DRM_DEBUG("offset = %u, size = %u", fb.offset, fb.size); |
| 119 | |
| 120 | return 0; |
| 121 | } |
| 122 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 123 | static int sis_drm_alloc(drm_device_t * dev, drm_file_t * priv, |
| 124 | unsigned long data, int pool) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | drm_sis_private_t *dev_priv = dev->dev_private; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 127 | drm_sis_mem_t __user *argp = (drm_sis_mem_t __user *) data; |
| 128 | drm_sis_mem_t mem; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | int retval = 0; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 130 | drm_memblock_item_t *item; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 132 | DRM_COPY_FROM_USER_IOCTL(mem, argp, sizeof(mem)); |
| 133 | |
| 134 | mutex_lock(&dev->struct_mutex); |
| 135 | |
| 136 | if (FALSE == ((pool == 0) ? dev_priv->vram_initialized : |
| 137 | dev_priv->agp_initialized)) { |
| 138 | DRM_ERROR |
| 139 | ("Attempt to allocate from uninitialized memory manager.\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | return DRM_ERR(EINVAL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | } |
| 142 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 143 | mem.size = (mem.size + SIS_MM_ALIGN_MASK) >> SIS_MM_ALIGN_SHIFT; |
| 144 | item = drm_sman_alloc(&dev_priv->sman, pool, mem.size, 0, |
| 145 | (unsigned long)priv); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 147 | mutex_unlock(&dev->struct_mutex); |
| 148 | if (item) { |
| 149 | mem.offset = ((pool == 0) ? |
| 150 | dev_priv->vram_offset : dev_priv->agp_offset) + |
| 151 | (item->mm-> |
| 152 | offset(item->mm, item->mm_info) << SIS_MM_ALIGN_SHIFT); |
| 153 | mem.free = item->user_hash.key; |
| 154 | mem.size = mem.size << SIS_MM_ALIGN_SHIFT; |
| 155 | } else { |
| 156 | mem.offset = 0; |
| 157 | mem.size = 0; |
| 158 | mem.free = 0; |
| 159 | retval = DRM_ERR(ENOMEM); |
| 160 | } |
| 161 | |
| 162 | DRM_COPY_TO_USER_IOCTL(argp, mem, sizeof(mem)); |
| 163 | |
| 164 | DRM_DEBUG("alloc %d, size = %d, offset = %d\n", pool, mem.size, |
| 165 | mem.offset); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | |
| 167 | return retval; |
| 168 | } |
| 169 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 170 | static int sis_drm_free(DRM_IOCTL_ARGS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | { |
| 172 | DRM_DEVICE; |
| 173 | drm_sis_private_t *dev_priv = dev->dev_private; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 174 | drm_sis_mem_t mem; |
| 175 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 177 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_sis_mem_t __user *) data, |
| 178 | sizeof(mem)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 180 | mutex_lock(&dev->struct_mutex); |
| 181 | ret = drm_sman_free_key(&dev_priv->sman, mem.free); |
| 182 | mutex_unlock(&dev->struct_mutex); |
| 183 | DRM_DEBUG("free = 0x%lx\n", mem.free); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 185 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 188 | static int sis_fb_alloc(DRM_IOCTL_ARGS) |
| 189 | { |
| 190 | DRM_DEVICE; |
| 191 | return sis_drm_alloc(dev, priv, data, VIDEO_TYPE); |
| 192 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 194 | static int sis_ioctl_agp_init(DRM_IOCTL_ARGS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 195 | { |
| 196 | DRM_DEVICE; |
| 197 | drm_sis_private_t *dev_priv = dev->dev_private; |
| 198 | drm_sis_agp_t agp; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 199 | int ret; |
| 200 | dev_priv = dev->dev_private; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 202 | DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_agp_t __user *) data, |
| 203 | sizeof(agp)); |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 204 | mutex_lock(&dev->struct_mutex); |
| 205 | ret = drm_sman_set_range(&dev_priv->sman, AGP_TYPE, 0, |
| 206 | agp.size >> SIS_MM_ALIGN_SHIFT); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 207 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 208 | if (ret) { |
| 209 | DRM_ERROR("AGP memory manager initialisation error\n"); |
| 210 | mutex_unlock(&dev->struct_mutex); |
| 211 | return ret; |
| 212 | } |
| 213 | |
| 214 | dev_priv->agp_initialized = TRUE; |
| 215 | dev_priv->agp_offset = agp.offset; |
| 216 | mutex_unlock(&dev->struct_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | |
| 218 | DRM_DEBUG("offset = %u, size = %u", agp.offset, agp.size); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | return 0; |
| 220 | } |
| 221 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 222 | static int sis_ioctl_agp_alloc(DRM_IOCTL_ARGS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | { |
| 224 | DRM_DEVICE; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 225 | |
| 226 | return sis_drm_alloc(dev, priv, data, AGP_TYPE); |
| 227 | } |
| 228 | |
| 229 | void sis_lastclose(struct drm_device *dev) |
| 230 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | drm_sis_private_t *dev_priv = dev->dev_private; |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 232 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 233 | if (!dev_priv) |
| 234 | return; |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 235 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 236 | mutex_lock(&dev->struct_mutex); |
| 237 | drm_sman_cleanup(&dev_priv->sman); |
| 238 | dev_priv->vram_initialized = FALSE; |
| 239 | dev_priv->agp_initialized = FALSE; |
| 240 | mutex_unlock(&dev->struct_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | } |
| 242 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 243 | void sis_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | drm_sis_private_t *dev_priv = dev->dev_private; |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 246 | drm_file_t *priv = filp->private_data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 248 | mutex_lock(&dev->struct_mutex); |
| 249 | if (drm_sman_owner_clean(&dev_priv->sman, (unsigned long)priv)) { |
| 250 | mutex_unlock(&dev->struct_mutex); |
| 251 | return; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 254 | if (dev->driver->dma_quiescent) { |
| 255 | dev->driver->dma_quiescent(dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | } |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 257 | |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 258 | drm_sman_owner_cleanup(&dev_priv->sman, (unsigned long)priv); |
| 259 | mutex_unlock(&dev->struct_mutex); |
| 260 | return; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | drm_ioctl_desc_t sis_ioctls[] = { |
Dave Airlie | a7a2cc3 | 2006-01-02 13:54:04 +1100 | [diff] [blame] | 264 | [DRM_IOCTL_NR(DRM_SIS_FB_ALLOC)] = {sis_fb_alloc, DRM_AUTH}, |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 265 | [DRM_IOCTL_NR(DRM_SIS_FB_FREE)] = {sis_drm_free, DRM_AUTH}, |
| 266 | [DRM_IOCTL_NR(DRM_SIS_AGP_INIT)] = |
| 267 | {sis_ioctl_agp_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY}, |
Dave Airlie | a7a2cc3 | 2006-01-02 13:54:04 +1100 | [diff] [blame] | 268 | [DRM_IOCTL_NR(DRM_SIS_AGP_ALLOC)] = {sis_ioctl_agp_alloc, DRM_AUTH}, |
Thomas Hellstrom | ce65a44 | 2006-08-07 22:03:22 +1000 | [diff] [blame^] | 269 | [DRM_IOCTL_NR(DRM_SIS_AGP_FREE)] = {sis_drm_free, DRM_AUTH}, |
| 270 | [DRM_IOCTL_NR(DRM_SIS_FB_INIT)] = |
| 271 | {sis_fb_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY} |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | }; |
| 273 | |
| 274 | int sis_max_ioctl = DRM_ARRAY_SIZE(sis_ioctls); |