blob: 06cb16d75f4b7a183eeff404a5a1582507e3b983 [file] [log] [blame]
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +01001/*
2 * Copyright (C) 2015 Red Hat, Inc.
3 * All Rights Reserved.
4 *
5 * Authors:
6 * Dave Airlie
7 * Alon Levy
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28#include <drm/drmP.h>
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +010029#include <drm/virtgpu_drm.h>
Masahiro Yamadaff67a252017-04-24 13:50:34 +090030#include <drm/ttm/ttm_execbuf_util.h>
31
32#include "virtgpu_drv.h"
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +010033
34static void convert_to_hw_box(struct virtio_gpu_box *dst,
35 const struct drm_virtgpu_3d_box *src)
36{
37 dst->x = cpu_to_le32(src->x);
38 dst->y = cpu_to_le32(src->y);
39 dst->z = cpu_to_le32(src->z);
40 dst->w = cpu_to_le32(src->w);
41 dst->h = cpu_to_le32(src->h);
42 dst->d = cpu_to_le32(src->d);
43}
44
45static int virtio_gpu_map_ioctl(struct drm_device *dev, void *data,
46 struct drm_file *file_priv)
47{
48 struct virtio_gpu_device *vgdev = dev->dev_private;
49 struct drm_virtgpu_map *virtio_gpu_map = data;
50
51 return virtio_gpu_mode_dumb_mmap(file_priv, vgdev->ddev,
52 virtio_gpu_map->handle,
53 &virtio_gpu_map->offset);
54}
55
56static int virtio_gpu_object_list_validate(struct ww_acquire_ctx *ticket,
57 struct list_head *head)
58{
59 struct ttm_validate_buffer *buf;
60 struct ttm_buffer_object *bo;
61 struct virtio_gpu_object *qobj;
62 int ret;
63
64 ret = ttm_eu_reserve_buffers(ticket, head, true, NULL);
65 if (ret != 0)
66 return ret;
67
68 list_for_each_entry(buf, head, head) {
69 bo = buf->bo;
70 qobj = container_of(bo, struct virtio_gpu_object, tbo);
71 ret = ttm_bo_validate(bo, &qobj->placement, false, false);
72 if (ret) {
73 ttm_eu_backoff_reservation(ticket, head);
74 return ret;
75 }
76 }
77 return 0;
78}
79
80static void virtio_gpu_unref_list(struct list_head *head)
81{
82 struct ttm_validate_buffer *buf;
83 struct ttm_buffer_object *bo;
84 struct virtio_gpu_object *qobj;
85 list_for_each_entry(buf, head, head) {
86 bo = buf->bo;
87 qobj = container_of(bo, struct virtio_gpu_object, tbo);
88
89 drm_gem_object_unreference_unlocked(&qobj->gem_base);
90 }
91}
92
Gustavo Padovan5c32c3d2016-08-31 12:26:52 -040093/*
94 * Usage of execbuffer:
95 * Relocations need to take into account the full VIRTIO_GPUDrawable size.
96 * However, the command as passed from user space must *not* contain the initial
97 * VIRTIO_GPUReleaseInfo struct (first XXX bytes)
98 */
99static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100100 struct drm_file *drm_file)
101{
Gustavo Padovan5c32c3d2016-08-31 12:26:52 -0400102 struct drm_virtgpu_execbuffer *exbuf = data;
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100103 struct virtio_gpu_device *vgdev = dev->dev_private;
104 struct virtio_gpu_fpriv *vfpriv = drm_file->driver_priv;
105 struct drm_gem_object *gobj;
106 struct virtio_gpu_fence *fence;
107 struct virtio_gpu_object *qobj;
108 int ret;
109 uint32_t *bo_handles = NULL;
110 void __user *user_bo_handles = NULL;
111 struct list_head validate_list;
112 struct ttm_validate_buffer *buflist = NULL;
113 int i;
114 struct ww_acquire_ctx ticket;
115 void *buf;
116
117 if (vgdev->has_virgl_3d == false)
118 return -ENOSYS;
119
120 INIT_LIST_HEAD(&validate_list);
121 if (exbuf->num_bo_handles) {
122
123 bo_handles = drm_malloc_ab(exbuf->num_bo_handles,
124 sizeof(uint32_t));
125 buflist = drm_calloc_large(exbuf->num_bo_handles,
126 sizeof(struct ttm_validate_buffer));
127 if (!bo_handles || !buflist) {
128 drm_free_large(bo_handles);
129 drm_free_large(buflist);
130 return -ENOMEM;
131 }
132
133 user_bo_handles = (void __user *)(uintptr_t)exbuf->bo_handles;
134 if (copy_from_user(bo_handles, user_bo_handles,
135 exbuf->num_bo_handles * sizeof(uint32_t))) {
136 ret = -EFAULT;
137 drm_free_large(bo_handles);
138 drm_free_large(buflist);
139 return ret;
140 }
141
142 for (i = 0; i < exbuf->num_bo_handles; i++) {
Chris Wilsona8ad0bd2016-05-09 11:04:54 +0100143 gobj = drm_gem_object_lookup(drm_file, bo_handles[i]);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100144 if (!gobj) {
145 drm_free_large(bo_handles);
146 drm_free_large(buflist);
147 return -ENOENT;
148 }
149
150 qobj = gem_to_virtio_gpu_obj(gobj);
151 buflist[i].bo = &qobj->tbo;
152
153 list_add(&buflist[i].head, &validate_list);
154 }
155 drm_free_large(bo_handles);
156 }
157
158 ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
159 if (ret)
160 goto out_free;
161
Markus Elfring7ad61e62016-08-18 22:35:14 +0200162 buf = memdup_user((void __user *)(uintptr_t)exbuf->command,
163 exbuf->size);
164 if (IS_ERR(buf)) {
165 ret = PTR_ERR(buf);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100166 goto out_unresv;
167 }
168 virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
169 vfpriv->ctx_id, &fence);
170
171 ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f);
172
173 /* fence the command bo */
174 virtio_gpu_unref_list(&validate_list);
175 drm_free_large(buflist);
Chris Wilsonf54d1862016-10-25 13:00:45 +0100176 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100177 return 0;
178
179out_unresv:
180 ttm_eu_backoff_reservation(&ticket, &validate_list);
181out_free:
182 virtio_gpu_unref_list(&validate_list);
183 drm_free_large(buflist);
184 return ret;
185}
186
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100187static int virtio_gpu_getparam_ioctl(struct drm_device *dev, void *data,
188 struct drm_file *file_priv)
189{
190 struct virtio_gpu_device *vgdev = dev->dev_private;
191 struct drm_virtgpu_getparam *param = data;
192 int value;
193
194 switch (param->param) {
195 case VIRTGPU_PARAM_3D_FEATURES:
196 value = vgdev->has_virgl_3d == true ? 1 : 0;
197 break;
198 default:
199 return -EINVAL;
200 }
201 if (copy_to_user((void __user *)(unsigned long)param->value,
202 &value, sizeof(int))) {
203 return -EFAULT;
204 }
205 return 0;
206}
207
208static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
209 struct drm_file *file_priv)
210{
211 struct virtio_gpu_device *vgdev = dev->dev_private;
212 struct drm_virtgpu_resource_create *rc = data;
213 int ret;
214 uint32_t res_id;
215 struct virtio_gpu_object *qobj;
216 struct drm_gem_object *obj;
217 uint32_t handle = 0;
218 uint32_t size;
219 struct list_head validate_list;
220 struct ttm_validate_buffer mainbuf;
221 struct virtio_gpu_fence *fence = NULL;
222 struct ww_acquire_ctx ticket;
223 struct virtio_gpu_resource_create_3d rc_3d;
224
225 if (vgdev->has_virgl_3d == false) {
226 if (rc->depth > 1)
227 return -EINVAL;
228 if (rc->nr_samples > 1)
229 return -EINVAL;
230 if (rc->last_level > 1)
231 return -EINVAL;
232 if (rc->target != 2)
233 return -EINVAL;
234 if (rc->array_size > 1)
235 return -EINVAL;
236 }
237
238 INIT_LIST_HEAD(&validate_list);
239 memset(&mainbuf, 0, sizeof(struct ttm_validate_buffer));
240
241 virtio_gpu_resource_id_get(vgdev, &res_id);
242
243 size = rc->size;
244
245 /* allocate a single page size object */
246 if (size == 0)
247 size = PAGE_SIZE;
248
249 qobj = virtio_gpu_alloc_object(dev, size, false, false);
250 if (IS_ERR(qobj)) {
251 ret = PTR_ERR(qobj);
252 goto fail_id;
253 }
254 obj = &qobj->gem_base;
255
256 if (!vgdev->has_virgl_3d) {
257 virtio_gpu_cmd_create_resource(vgdev, res_id, rc->format,
258 rc->width, rc->height);
259
260 ret = virtio_gpu_object_attach(vgdev, qobj, res_id, NULL);
261 } else {
262 /* use a gem reference since unref list undoes them */
263 drm_gem_object_reference(&qobj->gem_base);
264 mainbuf.bo = &qobj->tbo;
265 list_add(&mainbuf.head, &validate_list);
266
267 ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
268 if (ret) {
269 DRM_DEBUG("failed to validate\n");
270 goto fail_unref;
271 }
272
273 rc_3d.resource_id = cpu_to_le32(res_id);
274 rc_3d.target = cpu_to_le32(rc->target);
275 rc_3d.format = cpu_to_le32(rc->format);
276 rc_3d.bind = cpu_to_le32(rc->bind);
277 rc_3d.width = cpu_to_le32(rc->width);
278 rc_3d.height = cpu_to_le32(rc->height);
279 rc_3d.depth = cpu_to_le32(rc->depth);
280 rc_3d.array_size = cpu_to_le32(rc->array_size);
281 rc_3d.last_level = cpu_to_le32(rc->last_level);
282 rc_3d.nr_samples = cpu_to_le32(rc->nr_samples);
283 rc_3d.flags = cpu_to_le32(rc->flags);
284
285 virtio_gpu_cmd_resource_create_3d(vgdev, &rc_3d, NULL);
286 ret = virtio_gpu_object_attach(vgdev, qobj, res_id, &fence);
287 if (ret) {
288 ttm_eu_backoff_reservation(&ticket, &validate_list);
289 goto fail_unref;
290 }
291 ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f);
292 }
293
294 qobj->hw_res_handle = res_id;
295
296 ret = drm_gem_handle_create(file_priv, obj, &handle);
297 if (ret) {
298
299 drm_gem_object_release(obj);
300 if (vgdev->has_virgl_3d) {
301 virtio_gpu_unref_list(&validate_list);
Chris Wilsonf54d1862016-10-25 13:00:45 +0100302 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100303 }
304 return ret;
305 }
306 drm_gem_object_unreference_unlocked(obj);
307
308 rc->res_handle = res_id; /* similiar to a VM address */
309 rc->bo_handle = handle;
310
311 if (vgdev->has_virgl_3d) {
312 virtio_gpu_unref_list(&validate_list);
Chris Wilsonf54d1862016-10-25 13:00:45 +0100313 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100314 }
315 return 0;
316fail_unref:
317 if (vgdev->has_virgl_3d) {
318 virtio_gpu_unref_list(&validate_list);
Chris Wilsonf54d1862016-10-25 13:00:45 +0100319 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100320 }
321//fail_obj:
322// drm_gem_object_handle_unreference_unlocked(obj);
323fail_id:
324 virtio_gpu_resource_id_put(vgdev, res_id);
325 return ret;
326}
327
328static int virtio_gpu_resource_info_ioctl(struct drm_device *dev, void *data,
329 struct drm_file *file_priv)
330{
331 struct drm_virtgpu_resource_info *ri = data;
332 struct drm_gem_object *gobj = NULL;
333 struct virtio_gpu_object *qobj = NULL;
334
Chris Wilsona8ad0bd2016-05-09 11:04:54 +0100335 gobj = drm_gem_object_lookup(file_priv, ri->bo_handle);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100336 if (gobj == NULL)
337 return -ENOENT;
338
339 qobj = gem_to_virtio_gpu_obj(gobj);
340
341 ri->size = qobj->gem_base.size;
342 ri->res_handle = qobj->hw_res_handle;
343 drm_gem_object_unreference_unlocked(gobj);
344 return 0;
345}
346
347static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev,
348 void *data,
349 struct drm_file *file)
350{
351 struct virtio_gpu_device *vgdev = dev->dev_private;
352 struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
353 struct drm_virtgpu_3d_transfer_from_host *args = data;
354 struct drm_gem_object *gobj = NULL;
355 struct virtio_gpu_object *qobj = NULL;
356 struct virtio_gpu_fence *fence;
357 int ret;
358 u32 offset = args->offset;
359 struct virtio_gpu_box box;
360
361 if (vgdev->has_virgl_3d == false)
362 return -ENOSYS;
363
Chris Wilsona8ad0bd2016-05-09 11:04:54 +0100364 gobj = drm_gem_object_lookup(file, args->bo_handle);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100365 if (gobj == NULL)
366 return -ENOENT;
367
368 qobj = gem_to_virtio_gpu_obj(gobj);
369
370 ret = virtio_gpu_object_reserve(qobj, false);
371 if (ret)
372 goto out;
373
374 ret = ttm_bo_validate(&qobj->tbo, &qobj->placement,
375 true, false);
376 if (unlikely(ret))
377 goto out_unres;
378
379 convert_to_hw_box(&box, &args->box);
380 virtio_gpu_cmd_transfer_from_host_3d
381 (vgdev, qobj->hw_res_handle,
382 vfpriv->ctx_id, offset, args->level,
383 &box, &fence);
384 reservation_object_add_excl_fence(qobj->tbo.resv,
385 &fence->f);
386
Chris Wilsonf54d1862016-10-25 13:00:45 +0100387 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100388out_unres:
389 virtio_gpu_object_unreserve(qobj);
390out:
391 drm_gem_object_unreference_unlocked(gobj);
392 return ret;
393}
394
395static int virtio_gpu_transfer_to_host_ioctl(struct drm_device *dev, void *data,
396 struct drm_file *file)
397{
398 struct virtio_gpu_device *vgdev = dev->dev_private;
399 struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
400 struct drm_virtgpu_3d_transfer_to_host *args = data;
401 struct drm_gem_object *gobj = NULL;
402 struct virtio_gpu_object *qobj = NULL;
403 struct virtio_gpu_fence *fence;
404 struct virtio_gpu_box box;
405 int ret;
406 u32 offset = args->offset;
407
Chris Wilsona8ad0bd2016-05-09 11:04:54 +0100408 gobj = drm_gem_object_lookup(file, args->bo_handle);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100409 if (gobj == NULL)
410 return -ENOENT;
411
412 qobj = gem_to_virtio_gpu_obj(gobj);
413
414 ret = virtio_gpu_object_reserve(qobj, false);
415 if (ret)
416 goto out;
417
418 ret = ttm_bo_validate(&qobj->tbo, &qobj->placement,
419 true, false);
420 if (unlikely(ret))
421 goto out_unres;
422
423 convert_to_hw_box(&box, &args->box);
424 if (!vgdev->has_virgl_3d) {
425 virtio_gpu_cmd_transfer_to_host_2d
426 (vgdev, qobj->hw_res_handle, offset,
427 box.w, box.h, box.x, box.y, NULL);
428 } else {
429 virtio_gpu_cmd_transfer_to_host_3d
430 (vgdev, qobj->hw_res_handle,
431 vfpriv ? vfpriv->ctx_id : 0, offset,
432 args->level, &box, &fence);
433 reservation_object_add_excl_fence(qobj->tbo.resv,
434 &fence->f);
Chris Wilsonf54d1862016-10-25 13:00:45 +0100435 dma_fence_put(&fence->f);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100436 }
437
438out_unres:
439 virtio_gpu_object_unreserve(qobj);
440out:
441 drm_gem_object_unreference_unlocked(gobj);
442 return ret;
443}
444
445static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data,
446 struct drm_file *file)
447{
448 struct drm_virtgpu_3d_wait *args = data;
449 struct drm_gem_object *gobj = NULL;
450 struct virtio_gpu_object *qobj = NULL;
451 int ret;
452 bool nowait = false;
453
Chris Wilsona8ad0bd2016-05-09 11:04:54 +0100454 gobj = drm_gem_object_lookup(file, args->handle);
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100455 if (gobj == NULL)
456 return -ENOENT;
457
458 qobj = gem_to_virtio_gpu_obj(gobj);
459
460 if (args->flags & VIRTGPU_WAIT_NOWAIT)
461 nowait = true;
462 ret = virtio_gpu_object_wait(qobj, nowait);
463
464 drm_gem_object_unreference_unlocked(gobj);
465 return ret;
466}
467
468static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
469 void *data, struct drm_file *file)
470{
471 struct virtio_gpu_device *vgdev = dev->dev_private;
472 struct drm_virtgpu_get_caps *args = data;
473 int size;
474 int i;
475 int found_valid = -1;
476 int ret;
477 struct virtio_gpu_drv_cap_cache *cache_ent;
478 void *ptr;
479 if (vgdev->num_capsets == 0)
480 return -ENOSYS;
481
482 spin_lock(&vgdev->display_info_lock);
483 for (i = 0; i < vgdev->num_capsets; i++) {
484 if (vgdev->capsets[i].id == args->cap_set_id) {
485 if (vgdev->capsets[i].max_version >= args->cap_set_ver) {
486 found_valid = i;
487 break;
488 }
489 }
490 }
491
492 if (found_valid == -1) {
493 spin_unlock(&vgdev->display_info_lock);
494 return -EINVAL;
495 }
496
497 size = vgdev->capsets[found_valid].max_size;
498 if (args->size > size) {
499 spin_unlock(&vgdev->display_info_lock);
500 return -EINVAL;
501 }
502
503 list_for_each_entry(cache_ent, &vgdev->cap_cache, head) {
504 if (cache_ent->id == args->cap_set_id &&
505 cache_ent->version == args->cap_set_ver) {
506 ptr = cache_ent->caps_cache;
507 spin_unlock(&vgdev->display_info_lock);
508 goto copy_exit;
509 }
510 }
511 spin_unlock(&vgdev->display_info_lock);
512
513 /* not in cache - need to talk to hw */
514 virtio_gpu_cmd_get_capset(vgdev, found_valid, args->cap_set_ver,
515 &cache_ent);
516
517 ret = wait_event_timeout(vgdev->resp_wq,
518 atomic_read(&cache_ent->is_valid), 5 * HZ);
519
520 ptr = cache_ent->caps_cache;
521
522copy_exit:
523 if (copy_to_user((void __user *)(unsigned long)args->addr, ptr, size))
524 return -EFAULT;
525
526 return 0;
527}
528
529struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS] = {
530 DRM_IOCTL_DEF_DRV(VIRTGPU_MAP, virtio_gpu_map_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000531 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100532
533 DRM_IOCTL_DEF_DRV(VIRTGPU_EXECBUFFER, virtio_gpu_execbuffer_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000534 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100535
536 DRM_IOCTL_DEF_DRV(VIRTGPU_GETPARAM, virtio_gpu_getparam_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000537 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100538
539 DRM_IOCTL_DEF_DRV(VIRTGPU_RESOURCE_CREATE,
540 virtio_gpu_resource_create_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000541 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100542
543 DRM_IOCTL_DEF_DRV(VIRTGPU_RESOURCE_INFO, virtio_gpu_resource_info_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000544 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100545
546 /* make transfer async to the main ring? - no sure, can we
547 thread these in the underlying GL */
548 DRM_IOCTL_DEF_DRV(VIRTGPU_TRANSFER_FROM_HOST,
549 virtio_gpu_transfer_from_host_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000550 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100551 DRM_IOCTL_DEF_DRV(VIRTGPU_TRANSFER_TO_HOST,
552 virtio_gpu_transfer_to_host_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000553 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100554
555 DRM_IOCTL_DEF_DRV(VIRTGPU_WAIT, virtio_gpu_wait_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000556 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100557
558 DRM_IOCTL_DEF_DRV(VIRTGPU_GET_CAPS, virtio_gpu_get_caps_ioctl,
Dave Airlief3380a32015-06-16 15:41:56 +1000559 DRM_AUTH|DRM_UNLOCKED|DRM_RENDER_ALLOW),
Gerd Hoffmann62fb7a52014-10-28 12:48:00 +0100560};