Lines Matching +full:dev +full:- +full:handle

1 /*-
28 #include <dev/drm2/drmP.h>
29 #include <dev/drm2/drm.h>
74 u32 date; /**< User-space buffer to hold date */
76 u32 desc; /**< User-space buffer to hold desc */
79 static int compat_drm_version(struct drm_device *dev, void *data, in compat_drm_version() argument
86 version.name_len = v32->name_len; in compat_drm_version()
87 version.name = (void *)(unsigned long)v32->name; in compat_drm_version()
88 version.date_len = v32->date_len; in compat_drm_version()
89 version.date = (void *)(unsigned long)v32->date; in compat_drm_version()
90 version.desc_len = v32->desc_len; in compat_drm_version()
91 version.desc = (void *)(unsigned long)v32->desc; in compat_drm_version()
93 err = drm_version(dev, (void *)&version, file_priv); in compat_drm_version()
97 v32->version_major = version.version_major; in compat_drm_version()
98 v32->version_minor = version.version_minor; in compat_drm_version()
99 v32->version_patchlevel = version.version_patchlevel; in compat_drm_version()
100 v32->name_len = version.name_len; in compat_drm_version()
101 v32->date_len = version.date_len; in compat_drm_version()
102 v32->desc_len = version.desc_len; in compat_drm_version()
112 static int compat_drm_getunique(struct drm_device *dev, void *data, in compat_drm_getunique() argument
119 u.unique_len = uq32->unique_len; in compat_drm_getunique()
120 u.unique = (void *)(unsigned long)uq32->unique; in compat_drm_getunique()
122 err = drm_getunique(dev, (void *)&u, file_priv); in compat_drm_getunique()
126 uq32->unique_len = u.unique_len; in compat_drm_getunique()
131 static int compat_drm_setunique(struct drm_device *dev, void *data, in compat_drm_setunique() argument
137 u.unique_len = uq32->unique_len; in compat_drm_setunique()
138 u.unique = (void *)(unsigned long)uq32->unique; in compat_drm_setunique()
140 return drm_setunique(dev, (void *)&u, file_priv); in compat_drm_setunique()
148 u32 handle; /**< User-space: "Handle" to pass to mmap() */ member
152 static int compat_drm_getmap(struct drm_device *dev, void *data, in compat_drm_getmap() argument
158 void *handle; in compat_drm_getmap() local
160 map.offset = (unsigned long)m32->offset; in compat_drm_getmap()
162 err = drm_getmap(dev, (void *)&map, file_priv); in compat_drm_getmap()
166 m32->offset = map.offset; in compat_drm_getmap()
167 m32->size = map.size; in compat_drm_getmap()
168 m32->type = map.type; in compat_drm_getmap()
169 m32->flags = map.flags; in compat_drm_getmap()
170 handle = map.handle; in compat_drm_getmap()
171 m32->mtrr = map.mtrr; in compat_drm_getmap()
173 m32->handle = (unsigned long)handle; in compat_drm_getmap()
179 static int compat_drm_addmap(struct drm_device *dev, void *data, in compat_drm_addmap() argument
185 void *handle; in compat_drm_addmap() local
187 map.offset = (unsigned long)m32->offset; in compat_drm_addmap()
188 map.size = (unsigned long)m32->size; in compat_drm_addmap()
189 map.type = m32->type; in compat_drm_addmap()
190 map.flags = m32->flags; in compat_drm_addmap()
192 err = drm_addmap_ioctl(dev, (void *)&map, file_priv); in compat_drm_addmap()
196 m32->offset = map.offset; in compat_drm_addmap()
197 m32->mtrr = map.mtrr; in compat_drm_addmap()
198 handle = map.handle; in compat_drm_addmap()
200 m32->handle = (unsigned long)handle; in compat_drm_addmap()
201 if (m32->handle != (unsigned long)handle) in compat_drm_addmap()
202 DRM_DEBUG("compat_drm_addmap truncated handle" in compat_drm_addmap()
204 handle, m32->type, m32->offset); in compat_drm_addmap()
209 static int compat_drm_rmmap(struct drm_device *dev, void *data, in compat_drm_rmmap() argument
215 map.handle = (void *)(unsigned long)m32->handle; in compat_drm_rmmap()
217 return drm_rmmap_ioctl(dev, (void *)&map, file_priv); in compat_drm_rmmap()
229 static int compat_drm_getclient(struct drm_device *dev, void *data, in compat_drm_getclient() argument
236 client.idx = c32->idx; in compat_drm_getclient()
238 err = drm_getclient(dev, (void *)&client, file_priv); in compat_drm_getclient()
242 c32->idx = client.idx; in compat_drm_getclient()
243 c32->auth = client.auth; in compat_drm_getclient()
244 c32->pid = client.pid; in compat_drm_getclient()
245 c32->uid = client.uid; in compat_drm_getclient()
246 c32->magic = client.magic; in compat_drm_getclient()
247 c32->iocs = client.iocs; in compat_drm_getclient()
260 static int compat_drm_getstats(struct drm_device *dev, void *data, in compat_drm_getstats() argument
267 err = drm_getstats(dev, (void *)&stats, file_priv); in compat_drm_getstats()
271 s32->count = stats.count; in compat_drm_getstats()
273 s32->data[i].value = stats.data[i].value; in compat_drm_getstats()
274 s32->data[i].type = stats.data[i].type; in compat_drm_getstats()
289 static int compat_drm_addbufs(struct drm_device *dev, void *data, in compat_drm_addbufs() argument
296 buf.count = b32->count; in compat_drm_addbufs()
297 buf.size = b32->size; in compat_drm_addbufs()
298 buf.low_mark = b32->low_mark; in compat_drm_addbufs()
299 buf.high_mark = b32->high_mark; in compat_drm_addbufs()
300 buf.flags = b32->flags; in compat_drm_addbufs()
301 buf.agp_start = (unsigned long)b32->agp_start; in compat_drm_addbufs()
303 err = drm_addbufs(dev, (void *)&buf, file_priv); in compat_drm_addbufs()
307 b32->count = buf.count; in compat_drm_addbufs()
308 b32->size = buf.size; in compat_drm_addbufs()
309 b32->low_mark = buf.low_mark; in compat_drm_addbufs()
310 b32->high_mark = buf.high_mark; in compat_drm_addbufs()
311 b32->flags = buf.flags; in compat_drm_addbufs()
312 b32->agp_start = buf.agp_start; in compat_drm_addbufs()
317 static int compat_drm_markbufs(struct drm_device *dev, void *data, in compat_drm_markbufs() argument
323 buf.size = b32->size; in compat_drm_markbufs()
324 buf.low_mark = b32->low_mark; in compat_drm_markbufs()
325 buf.high_mark = b32->high_mark; in compat_drm_markbufs()
327 return drm_markbufs(dev, (void *)&buf, file_priv); in compat_drm_markbufs()
335 static int compat_drm_infobufs(struct drm_device *dev, void *data, in compat_drm_infobufs() argument
346 count = req32->count; in compat_drm_infobufs()
347 to = (drm_buf_desc32_t *)(unsigned long)req32->list; in compat_drm_infobufs()
354 return -ENOMEM; in compat_drm_infobufs()
357 request->count = count; in compat_drm_infobufs()
358 request->list = list; in compat_drm_infobufs()
360 err = drm_infobufs(dev, (void *)request, file_priv); in compat_drm_infobufs()
364 actual = request->count; in compat_drm_infobufs()
374 req32->count = actual; in compat_drm_infobufs()
388 u32 virtual; /**< Mmap'd area in user-virtual */
392 static int compat_drm_mapbufs(struct drm_device *dev, void *data, in compat_drm_mapbufs() argument
403 count = req32->count; in compat_drm_mapbufs()
404 list32 = (void *)(unsigned long)req32->list; in compat_drm_mapbufs()
407 return -EINVAL; in compat_drm_mapbufs()
411 return -ENOMEM; in compat_drm_mapbufs()
414 request->count = count; in compat_drm_mapbufs()
415 request->list = list; in compat_drm_mapbufs()
417 err = drm_mapbufs(dev, (void *)request, file_priv); in compat_drm_mapbufs()
421 actual = request->count; in compat_drm_mapbufs()
430 req32->count = actual; in compat_drm_mapbufs()
431 req32->virtual = (unsigned long)request->virtual; in compat_drm_mapbufs()
441 static int compat_drm_freebufs(struct drm_device *dev, void *data, in compat_drm_freebufs() argument
447 request.count = req32->count; in compat_drm_freebufs()
448 request.list = (int *)(unsigned long)req32->list; in compat_drm_freebufs()
450 return drm_freebufs(dev, (void *)&request, file_priv); in compat_drm_freebufs()
455 u32 handle; /**< Handle of map */ member
458 static int compat_drm_setsareactx(struct drm_device *dev, void *data, in compat_drm_setsareactx() argument
464 request.ctx_id = req32->ctx_id; in compat_drm_setsareactx()
465 request.handle = (void *)(unsigned long)req32->handle; in compat_drm_setsareactx()
467 return drm_setsareactx(dev, (void *)&request, file_priv); in compat_drm_setsareactx()
470 static int compat_drm_getsareactx(struct drm_device *dev, void *data, in compat_drm_getsareactx() argument
477 request.ctx_id = req32->ctx_id; in compat_drm_getsareactx()
479 err = drm_getsareactx(dev, (void *)&request, file_priv); in compat_drm_getsareactx()
483 req32->handle = (unsigned long)request.handle; in compat_drm_getsareactx()
493 static int compat_drm_resctx(struct drm_device *dev, void *data, in compat_drm_resctx() argument
500 res.count = res32->count; in compat_drm_resctx()
501 res.contexts = (struct drm_ctx __user *)(unsigned long)res32->contexts; in compat_drm_resctx()
503 err = drm_resctx(dev, (void *)&res, file_priv); in compat_drm_resctx()
507 res32->count = res.count; in compat_drm_resctx()
513 int context; /**< Context handle */
525 static int compat_drm_dma(struct drm_device *dev, void *data, in compat_drm_dma() argument
532 if (!dev->driver->dma_ioctl) { in compat_drm_dma()
534 return -EINVAL; in compat_drm_dma()
537 d.context = d32->context; in compat_drm_dma()
538 d.send_count = d32->send_count; in compat_drm_dma()
539 d.send_indices = (int *)(unsigned long)d32->send_indices; in compat_drm_dma()
540 d.send_sizes = (int *)(unsigned long)d32->send_sizes; in compat_drm_dma()
541 d.flags = d32->flags; in compat_drm_dma()
542 d.request_count = d32->request_count; in compat_drm_dma()
543 d.request_indices = (int *)(unsigned long)d32->request_indices; in compat_drm_dma()
544 d.request_sizes = (int *)(unsigned long)d32->request_sizes; in compat_drm_dma()
546 err = dev->driver->dma_ioctl(dev, (void *)&d, file_priv); in compat_drm_dma()
550 d32->request_size = d.request_size; in compat_drm_dma()
551 d32->granted_count = d.granted_count; in compat_drm_dma()
561 static int compat_drm_agp_enable(struct drm_device *dev, void *data, in compat_drm_agp_enable() argument
567 mode.mode = m32->mode; in compat_drm_agp_enable()
569 return drm_agp_enable_ioctl(dev, (void *)&mode, file_priv); in compat_drm_agp_enable()
586 static int compat_drm_agp_info(struct drm_device *dev, void *data, in compat_drm_agp_info() argument
593 err = drm_agp_info_ioctl(dev, (void *)&info, file_priv); in compat_drm_agp_info()
597 i32->agp_version_major = info.agp_version_major; in compat_drm_agp_info()
598 i32->agp_version_minor = info.agp_version_minor; in compat_drm_agp_info()
599 i32->mode = info.mode; in compat_drm_agp_info()
600 i32->aperture_base = info.aperture_base; in compat_drm_agp_info()
601 i32->aperture_size = info.aperture_size; in compat_drm_agp_info()
602 i32->memory_allowed = info.memory_allowed; in compat_drm_agp_info()
603 i32->memory_used = info.memory_used; in compat_drm_agp_info()
604 i32->id_vendor = info.id_vendor; in compat_drm_agp_info()
605 i32->id_device = info.id_device; in compat_drm_agp_info()
611 u32 size; /**< In bytes -- will round to page boundary */
612 u32 handle; /**< Used for binding / unbinding */ member
617 static int compat_drm_agp_alloc(struct drm_device *dev, void *data, in compat_drm_agp_alloc() argument
624 request.size = req32->size; in compat_drm_agp_alloc()
625 request.type = req32->type; in compat_drm_agp_alloc()
627 err = drm_agp_alloc_ioctl(dev, (void *)&request, file_priv); in compat_drm_agp_alloc()
631 req32->handle = request.handle; in compat_drm_agp_alloc()
632 req32->physical = request.physical; in compat_drm_agp_alloc()
637 static int compat_drm_agp_free(struct drm_device *dev, void *data, in compat_drm_agp_free() argument
643 request.handle = req32->handle; in compat_drm_agp_free()
645 return drm_agp_free_ioctl(dev, (void *)&request, file_priv); in compat_drm_agp_free()
649 u32 handle; /**< From drm_agp_buffer */ member
650 u32 offset; /**< In bytes -- will round to page boundary */
653 static int compat_drm_agp_bind(struct drm_device *dev, void *data, in compat_drm_agp_bind() argument
659 request.handle = req32->handle; in compat_drm_agp_bind()
660 request.offset = req32->offset; in compat_drm_agp_bind()
662 return drm_agp_bind_ioctl(dev, (void *)&request, file_priv); in compat_drm_agp_bind()
665 static int compat_drm_agp_unbind(struct drm_device *dev, void *data, in compat_drm_agp_unbind() argument
671 request.handle = req32->handle; in compat_drm_agp_unbind()
673 return drm_agp_unbind_ioctl(dev, (void *)&request, file_priv); in compat_drm_agp_unbind()
678 u32 size; /**< In bytes -- will round to page boundary */
679 u32 handle; /**< Used for mapping / unmapping */ member
682 static int compat_drm_sg_alloc(struct drm_device *dev, void *data, in compat_drm_sg_alloc() argument
689 request.size = (unsigned long)req32->size; in compat_drm_sg_alloc()
691 err = drm_sg_alloc_ioctl(dev, (void *)&request, file_priv); in compat_drm_sg_alloc()
695 /* XXX not sure about the handle conversion here... */ in compat_drm_sg_alloc()
696 req32->handle = (unsigned long)request.handle >> PAGE_SHIFT; in compat_drm_sg_alloc()
701 static int compat_drm_sg_free(struct drm_device *dev, void *data, in compat_drm_sg_free() argument
707 request.handle = (unsigned long)req32->handle << PAGE_SHIFT; in compat_drm_sg_free()
709 return drm_sg_free(dev, (void *)&request, file_priv); in compat_drm_sg_free()
714 drm_drawable_t handle; member
717 /* 64-bit version has a 32-bit pad here */
740 static int compat_drm_wait_vblank(struct drm_device *dev, void *data, in compat_drm_wait_vblank() argument
747 request.request.type = req32->request.type; in compat_drm_wait_vblank()
748 request.request.sequence = req32->request.sequence; in compat_drm_wait_vblank()
749 request.request.signal = req32->request.signal; in compat_drm_wait_vblank()
751 err = drm_wait_vblank(dev, (void *)&request, file_priv); in compat_drm_wait_vblank()
755 req32->reply.type = request.reply.type; in compat_drm_wait_vblank()
756 req32->reply.sequence = request.reply.sequence; in compat_drm_wait_vblank()
757 req32->reply.tval_sec = request.reply.tval_sec; in compat_drm_wait_vblank()
758 req32->reply.tval_usec = request.reply.tval_usec; in compat_drm_wait_vblank()