Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Red Hat Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice shall be included in |
| 12 | * all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | * |
| 22 | */ |
| 23 | |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 24 | #include <nvif/client.h> |
| 25 | #include <nvif/driver.h> |
| 26 | #include <nvif/ioctl.h> |
Ben Skeggs | fdb751e | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 27 | #include <nvif/class.h> |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 28 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 29 | #include "nouveau_drm.h" |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 30 | #include "nouveau_dma.h" |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 31 | #include "nouveau_gem.h" |
| 32 | #include "nouveau_chan.h" |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 33 | #include "nouveau_abi16.h" |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 34 | |
| 35 | struct nouveau_abi16 * |
| 36 | nouveau_abi16_get(struct drm_file *file_priv, struct drm_device *dev) |
| 37 | { |
| 38 | struct nouveau_cli *cli = nouveau_cli(file_priv); |
| 39 | mutex_lock(&cli->mutex); |
| 40 | if (!cli->abi16) { |
| 41 | struct nouveau_abi16 *abi16; |
| 42 | cli->abi16 = abi16 = kzalloc(sizeof(*abi16), GFP_KERNEL); |
| 43 | if (cli->abi16) { |
Ben Skeggs | 586491e | 2014-08-10 04:10:24 +1000 | [diff] [blame] | 44 | struct nv_device_v0 args = { |
| 45 | .device = ~0ULL, |
| 46 | }; |
| 47 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 48 | INIT_LIST_HEAD(&abi16->channels); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 49 | |
| 50 | /* allocate device object targeting client's default |
| 51 | * device (ie. the one that belongs to the fd it |
| 52 | * opened) |
| 53 | */ |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 54 | if (nvif_device_init(&cli->base.object, |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 55 | NOUVEAU_ABI16_DEVICE, NV_DEVICE, |
Ben Skeggs | 586491e | 2014-08-10 04:10:24 +1000 | [diff] [blame] | 56 | &args, sizeof(args), |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 57 | &abi16->device) == 0) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 58 | return cli->abi16; |
| 59 | |
| 60 | kfree(cli->abi16); |
| 61 | cli->abi16 = NULL; |
| 62 | } |
| 63 | |
| 64 | mutex_unlock(&cli->mutex); |
| 65 | } |
| 66 | return cli->abi16; |
| 67 | } |
| 68 | |
| 69 | int |
| 70 | nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret) |
| 71 | { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 72 | struct nouveau_cli *cli = (void *)abi16->device.object.client; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 73 | mutex_unlock(&cli->mutex); |
| 74 | return ret; |
| 75 | } |
| 76 | |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 77 | s32 |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 78 | nouveau_abi16_swclass(struct nouveau_drm *drm) |
| 79 | { |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 80 | switch (drm->device.info.family) { |
| 81 | case NV_DEVICE_INFO_V0_TNT: |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 82 | return NVIF_IOCTL_NEW_V0_SW_NV04; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 83 | case NV_DEVICE_INFO_V0_CELSIUS: |
| 84 | case NV_DEVICE_INFO_V0_KELVIN: |
| 85 | case NV_DEVICE_INFO_V0_RANKINE: |
| 86 | case NV_DEVICE_INFO_V0_CURIE: |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 87 | return NVIF_IOCTL_NEW_V0_SW_NV10; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 88 | case NV_DEVICE_INFO_V0_TESLA: |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 89 | return NVIF_IOCTL_NEW_V0_SW_NV50; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 90 | case NV_DEVICE_INFO_V0_FERMI: |
| 91 | case NV_DEVICE_INFO_V0_KEPLER: |
| 92 | case NV_DEVICE_INFO_V0_MAXWELL: |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 93 | return NVIF_IOCTL_NEW_V0_SW_GF100; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | return 0x0000; |
| 97 | } |
| 98 | |
| 99 | static void |
| 100 | nouveau_abi16_ntfy_fini(struct nouveau_abi16_chan *chan, |
| 101 | struct nouveau_abi16_ntfy *ntfy) |
| 102 | { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 103 | nvif_object_fini(&ntfy->object); |
Ben Skeggs | be83cd4 | 2015-01-14 15:36:34 +1000 | [diff] [blame] | 104 | nvkm_mm_free(&chan->heap, &ntfy->node); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 105 | list_del(&ntfy->head); |
| 106 | kfree(ntfy); |
| 107 | } |
| 108 | |
| 109 | static void |
| 110 | nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, |
| 111 | struct nouveau_abi16_chan *chan) |
| 112 | { |
| 113 | struct nouveau_abi16_ntfy *ntfy, *temp; |
| 114 | |
Marcin Slusarz | 2b77c1c | 2013-03-03 18:58:45 +0100 | [diff] [blame] | 115 | /* wait for all activity to stop before releasing notify object, which |
| 116 | * may be still in use */ |
| 117 | if (chan->chan && chan->ntfy) |
| 118 | nouveau_channel_idle(chan->chan); |
| 119 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 120 | /* cleanup notifier state */ |
| 121 | list_for_each_entry_safe(ntfy, temp, &chan->notifiers, head) { |
| 122 | nouveau_abi16_ntfy_fini(chan, ntfy); |
| 123 | } |
| 124 | |
| 125 | if (chan->ntfy) { |
| 126 | nouveau_bo_vma_del(chan->ntfy, &chan->ntfy_vma); |
Maarten Lankhorst | 198c14a | 2013-06-27 13:38:20 +0200 | [diff] [blame] | 127 | nouveau_bo_unpin(chan->ntfy); |
David Herrmann | 55fb74a | 2013-10-02 10:15:17 +0200 | [diff] [blame] | 128 | drm_gem_object_unreference_unlocked(&chan->ntfy->gem); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | if (chan->heap.block_size) |
Ben Skeggs | be83cd4 | 2015-01-14 15:36:34 +1000 | [diff] [blame] | 132 | nvkm_mm_fini(&chan->heap); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 133 | |
| 134 | /* destroy channel object, all children will be killed too */ |
| 135 | if (chan->chan) { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 136 | abi16->handles &= ~(1ULL << (chan->chan->user.handle & 0xffff)); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 137 | nouveau_channel_del(&chan->chan); |
| 138 | } |
| 139 | |
| 140 | list_del(&chan->head); |
| 141 | kfree(chan); |
| 142 | } |
| 143 | |
| 144 | void |
| 145 | nouveau_abi16_fini(struct nouveau_abi16 *abi16) |
| 146 | { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 147 | struct nouveau_cli *cli = (void *)abi16->device.object.client; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 148 | struct nouveau_abi16_chan *chan, *temp; |
| 149 | |
| 150 | /* cleanup channels */ |
| 151 | list_for_each_entry_safe(chan, temp, &abi16->channels, head) { |
| 152 | nouveau_abi16_chan_fini(abi16, chan); |
| 153 | } |
| 154 | |
| 155 | /* destroy the device object */ |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 156 | nvif_device_fini(&abi16->device); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 157 | |
| 158 | kfree(cli->abi16); |
| 159 | cli->abi16 = NULL; |
| 160 | } |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 161 | |
| 162 | int |
| 163 | nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) |
| 164 | { |
Ben Skeggs | fa2bade | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 165 | struct nouveau_cli *cli = nouveau_cli(file_priv); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 166 | struct nouveau_drm *drm = nouveau_drm(dev); |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 167 | struct nvif_device *device = &drm->device; |
Ben Skeggs | be83cd4 | 2015-01-14 15:36:34 +1000 | [diff] [blame] | 168 | struct nvkm_gr *gr = nvxx_gr(device); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 169 | struct drm_nouveau_getparam *getparam = data; |
| 170 | |
| 171 | switch (getparam->param) { |
| 172 | case NOUVEAU_GETPARAM_CHIPSET_ID: |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 173 | getparam->value = device->info.chipset; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 174 | break; |
| 175 | case NOUVEAU_GETPARAM_PCI_VENDOR: |
Ben Skeggs | 989aa5b | 2015-01-12 12:33:37 +1000 | [diff] [blame] | 176 | if (nv_device_is_pci(nvxx_device(device))) |
Alexandre Courbot | 420b946 | 2014-02-17 15:17:26 +0900 | [diff] [blame] | 177 | getparam->value = dev->pdev->vendor; |
| 178 | else |
| 179 | getparam->value = 0; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 180 | break; |
| 181 | case NOUVEAU_GETPARAM_PCI_DEVICE: |
Ben Skeggs | 989aa5b | 2015-01-12 12:33:37 +1000 | [diff] [blame] | 182 | if (nv_device_is_pci(nvxx_device(device))) |
Alexandre Courbot | 420b946 | 2014-02-17 15:17:26 +0900 | [diff] [blame] | 183 | getparam->value = dev->pdev->device; |
| 184 | else |
| 185 | getparam->value = 0; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 186 | break; |
| 187 | case NOUVEAU_GETPARAM_BUS_TYPE: |
Ben Skeggs | 989aa5b | 2015-01-12 12:33:37 +1000 | [diff] [blame] | 188 | if (!nv_device_is_pci(nvxx_device(device))) |
Alexandre Courbot | 420b946 | 2014-02-17 15:17:26 +0900 | [diff] [blame] | 189 | getparam->value = 3; |
| 190 | else |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 191 | if (drm_pci_device_is_agp(dev)) |
| 192 | getparam->value = 0; |
| 193 | else |
| 194 | if (!pci_is_pcie(dev->pdev)) |
| 195 | getparam->value = 1; |
| 196 | else |
| 197 | getparam->value = 2; |
| 198 | break; |
| 199 | case NOUVEAU_GETPARAM_FB_SIZE: |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 200 | getparam->value = drm->gem.vram_available; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 201 | break; |
| 202 | case NOUVEAU_GETPARAM_AGP_SIZE: |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 203 | getparam->value = drm->gem.gart_available; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 204 | break; |
| 205 | case NOUVEAU_GETPARAM_VM_VRAM_BASE: |
| 206 | getparam->value = 0; /* deprecated */ |
| 207 | break; |
| 208 | case NOUVEAU_GETPARAM_PTIMER_TIME: |
Ben Skeggs | 56f67dc | 2015-08-20 14:54:10 +1000 | [diff] [blame] | 209 | getparam->value = nvif_device_time(device); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 210 | break; |
| 211 | case NOUVEAU_GETPARAM_HAS_BO_USAGE: |
| 212 | getparam->value = 1; |
| 213 | break; |
| 214 | case NOUVEAU_GETPARAM_HAS_PAGEFLIP: |
| 215 | getparam->value = 1; |
| 216 | break; |
| 217 | case NOUVEAU_GETPARAM_GRAPH_UNITS: |
Ben Skeggs | b8bf04e | 2015-01-14 12:02:28 +1000 | [diff] [blame] | 218 | getparam->value = gr->units ? gr->units(gr) : 0; |
Christoph Bumiller | 7e22e71 | 2013-03-27 22:16:54 +0100 | [diff] [blame] | 219 | break; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 220 | default: |
Ben Skeggs | 9ad97ed | 2015-08-20 14:54:13 +1000 | [diff] [blame] | 221 | NV_PRINTK(dbg, cli, "unknown parameter %lld\n", getparam->param); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 222 | return -EINVAL; |
| 223 | } |
| 224 | |
| 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | int |
| 229 | nouveau_abi16_ioctl_setparam(ABI16_IOCTL_ARGS) |
| 230 | { |
| 231 | return -EINVAL; |
| 232 | } |
| 233 | |
| 234 | int |
| 235 | nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) |
| 236 | { |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 237 | struct drm_nouveau_channel_alloc *init = data; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 238 | struct nouveau_cli *cli = nouveau_cli(file_priv); |
| 239 | struct nouveau_drm *drm = nouveau_drm(dev); |
| 240 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
| 241 | struct nouveau_abi16_chan *chan; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 242 | struct nvif_device *device; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 243 | int ret; |
| 244 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 245 | if (unlikely(!abi16)) |
| 246 | return -ENOMEM; |
Marcin Slusarz | bf7e438 | 2012-11-11 20:00:09 +0100 | [diff] [blame] | 247 | |
| 248 | if (!drm->channel) |
| 249 | return nouveau_abi16_put(abi16, -ENODEV); |
| 250 | |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 251 | device = &abi16->device; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 252 | |
Ben Skeggs | 4946980 | 2012-11-22 13:43:55 +1000 | [diff] [blame] | 253 | /* hack to allow channel engine type specification on kepler */ |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 254 | if (device->info.family >= NV_DEVICE_INFO_V0_KEPLER) { |
Ben Skeggs | 4946980 | 2012-11-22 13:43:55 +1000 | [diff] [blame] | 255 | if (init->fb_ctxdma_handle != ~0) |
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 256 | init->fb_ctxdma_handle = KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_GR; |
Ben Skeggs | 4946980 | 2012-11-22 13:43:55 +1000 | [diff] [blame] | 257 | else |
| 258 | init->fb_ctxdma_handle = init->tt_ctxdma_handle; |
| 259 | |
| 260 | /* allow flips to be executed if this is a graphics channel */ |
| 261 | init->tt_ctxdma_handle = 0; |
Ben Skeggs | bbf8906 | 2014-08-10 04:10:25 +1000 | [diff] [blame] | 262 | if (init->fb_ctxdma_handle == KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_GR) |
Ben Skeggs | 4946980 | 2012-11-22 13:43:55 +1000 | [diff] [blame] | 263 | init->tt_ctxdma_handle = 1; |
| 264 | } |
| 265 | |
| 266 | if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0) |
| 267 | return nouveau_abi16_put(abi16, -EINVAL); |
| 268 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 269 | /* allocate "abi16 channel" data and make up a handle for it */ |
Ilia Mirkin | 73970c4 | 2014-02-09 15:51:24 -0500 | [diff] [blame] | 270 | init->channel = __ffs64(~abi16->handles); |
| 271 | if (~abi16->handles == 0) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 272 | return nouveau_abi16_put(abi16, -ENOSPC); |
| 273 | |
| 274 | chan = kzalloc(sizeof(*chan), GFP_KERNEL); |
| 275 | if (!chan) |
| 276 | return nouveau_abi16_put(abi16, -ENOMEM); |
| 277 | |
| 278 | INIT_LIST_HEAD(&chan->notifiers); |
| 279 | list_add(&chan->head, &abi16->channels); |
Ilia Mirkin | ef98c1f | 2014-02-09 15:51:25 -0500 | [diff] [blame] | 280 | abi16->handles |= (1ULL << init->channel); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 281 | |
| 282 | /* create channel object and initialise dma and fence management */ |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 283 | ret = nouveau_channel_new(drm, device, |
| 284 | NOUVEAU_ABI16_CHAN(init->channel), |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 285 | init->fb_ctxdma_handle, |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 286 | init->tt_ctxdma_handle, &chan->chan); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 287 | if (ret) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 288 | goto done; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 289 | |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 290 | if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 291 | init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM | |
| 292 | NOUVEAU_GEM_DOMAIN_GART; |
| 293 | else |
| 294 | if (chan->chan->push.buffer->bo.mem.mem_type == TTM_PL_VRAM) |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 295 | init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_VRAM; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 296 | else |
| 297 | init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 298 | |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 299 | if (device->info.family < NV_DEVICE_INFO_V0_CELSIUS) { |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 300 | init->subchan[0].handle = 0x00000000; |
| 301 | init->subchan[0].grclass = 0x0000; |
Ben Skeggs | f45f55c | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 302 | init->subchan[1].handle = chan->chan->nvsw.handle; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 303 | init->subchan[1].grclass = 0x506e; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 304 | init->nr_subchan = 2; |
| 305 | } |
| 306 | |
| 307 | /* Named memory object area */ |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 308 | ret = nouveau_gem_new(dev, PAGE_SIZE, 0, NOUVEAU_GEM_DOMAIN_GART, |
| 309 | 0, 0, &chan->ntfy); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 310 | if (ret == 0) |
Ben Skeggs | ad76b3f | 2014-11-10 11:24:27 +1000 | [diff] [blame] | 311 | ret = nouveau_bo_pin(chan->ntfy, TTM_PL_FLAG_TT, false); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 312 | if (ret) |
| 313 | goto done; |
| 314 | |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 315 | if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { |
Ben Skeggs | 0ad7286 | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 316 | ret = nouveau_bo_vma_add(chan->ntfy, cli->vm, |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 317 | &chan->ntfy_vma); |
| 318 | if (ret) |
| 319 | goto done; |
| 320 | } |
| 321 | |
David Herrmann | 55fb74a | 2013-10-02 10:15:17 +0200 | [diff] [blame] | 322 | ret = drm_gem_handle_create(file_priv, &chan->ntfy->gem, |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 323 | &init->notifier_handle); |
| 324 | if (ret) |
| 325 | goto done; |
| 326 | |
Ben Skeggs | be83cd4 | 2015-01-14 15:36:34 +1000 | [diff] [blame] | 327 | ret = nvkm_mm_init(&chan->heap, 0, PAGE_SIZE, 1); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 328 | done: |
| 329 | if (ret) |
| 330 | nouveau_abi16_chan_fini(abi16, chan); |
| 331 | return nouveau_abi16_put(abi16, ret); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 332 | } |
| 333 | |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 334 | static struct nouveau_abi16_chan * |
| 335 | nouveau_abi16_chan(struct nouveau_abi16 *abi16, int channel) |
| 336 | { |
| 337 | struct nouveau_abi16_chan *chan; |
| 338 | |
| 339 | list_for_each_entry(chan, &abi16->channels, head) { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 340 | if (chan->chan->user.handle == NOUVEAU_ABI16_CHAN(channel)) |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 341 | return chan; |
| 342 | } |
| 343 | |
| 344 | return NULL; |
| 345 | } |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 346 | |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 347 | int |
| 348 | nouveau_abi16_ioctl_channel_free(ABI16_IOCTL_ARGS) |
| 349 | { |
| 350 | struct drm_nouveau_channel_free *req = data; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 351 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
| 352 | struct nouveau_abi16_chan *chan; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 353 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 354 | if (unlikely(!abi16)) |
| 355 | return -ENOMEM; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 356 | |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 357 | chan = nouveau_abi16_chan(abi16, req->channel); |
| 358 | if (!chan) |
| 359 | return nouveau_abi16_put(abi16, -ENOENT); |
| 360 | nouveau_abi16_chan_fini(abi16, chan); |
| 361 | return nouveau_abi16_put(abi16, 0); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | int |
| 365 | nouveau_abi16_ioctl_grobj_alloc(ABI16_IOCTL_ARGS) |
| 366 | { |
| 367 | struct drm_nouveau_grobj_alloc *init = data; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 368 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 369 | struct nouveau_abi16_chan *chan; |
| 370 | struct nouveau_abi16_ntfy *ntfy; |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 371 | struct nvif_client *client; |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 372 | struct nvif_sclass *sclass; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 373 | s32 oclass = 0; |
| 374 | int ret, i; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 375 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 376 | if (unlikely(!abi16)) |
| 377 | return -ENOMEM; |
| 378 | |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 379 | if (init->handle == ~0) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 380 | return nouveau_abi16_put(abi16, -EINVAL); |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 381 | client = abi16->device.object.client; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 382 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 383 | chan = nouveau_abi16_chan(abi16, init->channel); |
| 384 | if (!chan) |
| 385 | return nouveau_abi16_put(abi16, -ENOENT); |
| 386 | |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 387 | ret = nvif_object_sclass_get(&chan->chan->user, &sclass); |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 388 | if (ret < 0) |
| 389 | return nouveau_abi16_put(abi16, ret); |
| 390 | |
| 391 | if ((init->class & 0x00ff) == 0x006e) { |
| 392 | /* nvsw: compatibility with older 0x*6e class identifier */ |
| 393 | for (i = 0; !oclass && i < ret; i++) { |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 394 | switch (sclass[i].oclass) { |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 395 | case NVIF_IOCTL_NEW_V0_SW_NV04: |
| 396 | case NVIF_IOCTL_NEW_V0_SW_NV10: |
| 397 | case NVIF_IOCTL_NEW_V0_SW_NV50: |
| 398 | case NVIF_IOCTL_NEW_V0_SW_GF100: |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 399 | oclass = sclass[i].oclass; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 400 | break; |
| 401 | default: |
| 402 | break; |
| 403 | } |
| 404 | } |
| 405 | } else |
| 406 | if ((init->class & 0x00ff) == 0x00b1) { |
| 407 | /* msvld: compatibility with incorrect version exposure */ |
| 408 | for (i = 0; i < ret; i++) { |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 409 | if ((sclass[i].oclass & 0x00ff) == 0x00b1) { |
| 410 | oclass = sclass[i].oclass; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 411 | break; |
| 412 | } |
| 413 | } |
| 414 | } else |
| 415 | if ((init->class & 0x00ff) == 0x00b2) { /* mspdec */ |
| 416 | /* mspdec: compatibility with incorrect version exposure */ |
| 417 | for (i = 0; i < ret; i++) { |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 418 | if ((sclass[i].oclass & 0x00ff) == 0x00b2) { |
| 419 | oclass = sclass[i].oclass; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 420 | break; |
| 421 | } |
| 422 | } |
| 423 | } else |
| 424 | if ((init->class & 0x00ff) == 0x00b3) { /* msppp */ |
| 425 | /* msppp: compatibility with incorrect version exposure */ |
| 426 | for (i = 0; i < ret; i++) { |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 427 | if ((sclass[i].oclass & 0x00ff) == 0x00b3) { |
| 428 | oclass = sclass[i].oclass; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 429 | break; |
| 430 | } |
| 431 | } |
| 432 | } else { |
| 433 | oclass = init->class; |
| 434 | } |
| 435 | |
Ben Skeggs | 41a6340 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 436 | nvif_object_sclass_put(&sclass); |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 437 | if (!oclass) |
| 438 | return nouveau_abi16_put(abi16, -EINVAL); |
| 439 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 440 | ntfy = kzalloc(sizeof(*ntfy), GFP_KERNEL); |
| 441 | if (!ntfy) |
| 442 | return nouveau_abi16_put(abi16, -ENOMEM); |
| 443 | |
| 444 | list_add(&ntfy->head, &chan->notifiers); |
| 445 | |
| 446 | client->route = NVDRM_OBJECT_ABI16; |
Ben Skeggs | f58ddf9 | 2015-08-20 14:54:16 +1000 | [diff] [blame] | 447 | ret = nvif_object_init(&chan->chan->user, init->handle, oclass, |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 448 | NULL, 0, &ntfy->object); |
| 449 | client->route = NVDRM_OBJECT_NVIF; |
| 450 | |
| 451 | if (ret) |
| 452 | nouveau_abi16_ntfy_fini(chan, ntfy); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 453 | return nouveau_abi16_put(abi16, ret); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | int |
| 457 | nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) |
| 458 | { |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 459 | struct drm_nouveau_notifierobj_alloc *info = data; |
| 460 | struct nouveau_drm *drm = nouveau_drm(dev); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 461 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 462 | struct nouveau_abi16_chan *chan; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 463 | struct nouveau_abi16_ntfy *ntfy; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 464 | struct nvif_device *device = &abi16->device; |
Ben Skeggs | 3bdda04 | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 465 | struct nvif_client *client; |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 466 | struct nv_dma_v0 args = {}; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 467 | int ret; |
| 468 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 469 | if (unlikely(!abi16)) |
| 470 | return -ENOMEM; |
| 471 | |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 472 | /* completely unnecessary for these chipsets... */ |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 473 | if (unlikely(device->info.family >= NV_DEVICE_INFO_V0_FERMI)) |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 474 | return nouveau_abi16_put(abi16, -EINVAL); |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 475 | client = abi16->device.object.client; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 476 | |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 477 | chan = nouveau_abi16_chan(abi16, info->channel); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 478 | if (!chan) |
| 479 | return nouveau_abi16_put(abi16, -ENOENT); |
| 480 | |
| 481 | ntfy = kzalloc(sizeof(*ntfy), GFP_KERNEL); |
| 482 | if (!ntfy) |
| 483 | return nouveau_abi16_put(abi16, -ENOMEM); |
| 484 | |
| 485 | list_add(&ntfy->head, &chan->notifiers); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 486 | |
Ben Skeggs | be83cd4 | 2015-01-14 15:36:34 +1000 | [diff] [blame] | 487 | ret = nvkm_mm_head(&chan->heap, 0, 1, info->size, info->size, 1, |
| 488 | &ntfy->node); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 489 | if (ret) |
| 490 | goto done; |
| 491 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 492 | args.start = ntfy->node->offset; |
| 493 | args.limit = ntfy->node->offset + ntfy->node->length - 1; |
Ben Skeggs | 967e7bd | 2014-08-10 04:10:22 +1000 | [diff] [blame] | 494 | if (device->info.family >= NV_DEVICE_INFO_V0_TESLA) { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 495 | args.target = NV_DMA_V0_TARGET_VM; |
| 496 | args.access = NV_DMA_V0_ACCESS_VM; |
| 497 | args.start += chan->ntfy_vma.offset; |
| 498 | args.limit += chan->ntfy_vma.offset; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 499 | } else |
| 500 | if (drm->agp.stat == ENABLED) { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 501 | args.target = NV_DMA_V0_TARGET_AGP; |
| 502 | args.access = NV_DMA_V0_ACCESS_RDWR; |
| 503 | args.start += drm->agp.base + chan->ntfy->bo.offset; |
| 504 | args.limit += drm->agp.base + chan->ntfy->bo.offset; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 505 | } else { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 506 | args.target = NV_DMA_V0_TARGET_VM; |
| 507 | args.access = NV_DMA_V0_ACCESS_RDWR; |
| 508 | args.start += chan->ntfy->bo.offset; |
| 509 | args.limit += chan->ntfy->bo.offset; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 510 | } |
| 511 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 512 | client->route = NVDRM_OBJECT_ABI16; |
| 513 | client->super = true; |
| 514 | ret = nvif_object_init(&chan->chan->user, info->handle, |
| 515 | NV_DMA_IN_MEMORY, &args, sizeof(args), |
| 516 | &ntfy->object); |
Ben Skeggs | 3bdda04 | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 517 | client->super = false; |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 518 | client->route = NVDRM_OBJECT_NVIF; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 519 | if (ret) |
| 520 | goto done; |
| 521 | |
Bob Gleitsmann | c1ccaa6 | 2014-01-06 08:59:07 +1000 | [diff] [blame] | 522 | info->offset = ntfy->node->offset; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 523 | done: |
| 524 | if (ret) |
| 525 | nouveau_abi16_ntfy_fini(chan, ntfy); |
| 526 | return nouveau_abi16_put(abi16, ret); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 527 | } |
| 528 | |
| 529 | int |
| 530 | nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS) |
| 531 | { |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 532 | struct drm_nouveau_gpuobj_free *fini = data; |
| 533 | struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev); |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 534 | struct nouveau_abi16_chan *chan; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 535 | struct nouveau_abi16_ntfy *ntfy; |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 536 | int ret = -ENOENT; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 537 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 538 | if (unlikely(!abi16)) |
| 539 | return -ENOMEM; |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 540 | |
Ben Skeggs | a4e610b | 2014-08-10 04:10:23 +1000 | [diff] [blame] | 541 | chan = nouveau_abi16_chan(abi16, fini->channel); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 542 | if (!chan) |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 543 | return nouveau_abi16_put(abi16, -EINVAL); |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 544 | |
| 545 | /* synchronize with the user channel and destroy the gpu object */ |
| 546 | nouveau_channel_idle(chan->chan); |
| 547 | |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 548 | list_for_each_entry(ntfy, &chan->notifiers, head) { |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 549 | if (ntfy->object.handle == fini->handle) { |
| 550 | nouveau_abi16_ntfy_fini(chan, ntfy); |
| 551 | ret = 0; |
Ben Skeggs | ebb945a | 2012-07-20 08:17:34 +1000 | [diff] [blame] | 552 | break; |
| 553 | } |
| 554 | } |
| 555 | |
Ben Skeggs | a01ca78 | 2015-08-20 14:54:15 +1000 | [diff] [blame] | 556 | return nouveau_abi16_put(abi16, ret); |
Ben Skeggs | 2a259a3 | 2012-05-08 10:24:27 +1000 | [diff] [blame] | 557 | } |