drm_legacy.h revision 1.2.6.2 1 1.2.6.2 christos /* $NetBSD: drm_legacy.h,v 1.2.6.2 2019/06/10 22:07:57 christos Exp $ */
2 1.2.6.2 christos
3 1.2.6.2 christos #ifndef __DRM_LEGACY_H__
4 1.2.6.2 christos #define __DRM_LEGACY_H__
5 1.2.6.2 christos
6 1.2.6.2 christos /*
7 1.2.6.2 christos * Copyright (c) 2014 David Herrmann <dh.herrmann (at) gmail.com>
8 1.2.6.2 christos *
9 1.2.6.2 christos * Permission is hereby granted, free of charge, to any person obtaining a
10 1.2.6.2 christos * copy of this software and associated documentation files (the "Software"),
11 1.2.6.2 christos * to deal in the Software without restriction, including without limitation
12 1.2.6.2 christos * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 1.2.6.2 christos * and/or sell copies of the Software, and to permit persons to whom the
14 1.2.6.2 christos * Software is furnished to do so, subject to the following conditions:
15 1.2.6.2 christos *
16 1.2.6.2 christos * The above copyright notice and this permission notice shall be included in
17 1.2.6.2 christos * all copies or substantial portions of the Software.
18 1.2.6.2 christos *
19 1.2.6.2 christos * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 1.2.6.2 christos * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 1.2.6.2 christos * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 1.2.6.2 christos * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 1.2.6.2 christos * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 1.2.6.2 christos * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 1.2.6.2 christos * OTHER DEALINGS IN THE SOFTWARE.
26 1.2.6.2 christos */
27 1.2.6.2 christos
28 1.2.6.2 christos /*
29 1.2.6.2 christos * This file contains legacy interfaces that modern drm drivers
30 1.2.6.2 christos * should no longer be using. They cannot be removed as legacy
31 1.2.6.2 christos * drivers use them, and removing them are API breaks.
32 1.2.6.2 christos */
33 1.2.6.2 christos #include <linux/list.h>
34 1.2.6.2 christos #include <drm/drm_legacy.h>
35 1.2.6.2 christos
36 1.2.6.2 christos struct agp_memory;
37 1.2.6.2 christos struct drm_device;
38 1.2.6.2 christos struct drm_file;
39 1.2.6.2 christos
40 1.2.6.2 christos /*
41 1.2.6.2 christos * Generic DRM Contexts
42 1.2.6.2 christos */
43 1.2.6.2 christos
44 1.2.6.2 christos #define DRM_KERNEL_CONTEXT 0
45 1.2.6.2 christos #define DRM_RESERVED_CONTEXTS 1
46 1.2.6.2 christos
47 1.2.6.2 christos void drm_legacy_ctxbitmap_init(struct drm_device *dev);
48 1.2.6.2 christos void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
49 1.2.6.2 christos void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
50 1.2.6.2 christos void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
51 1.2.6.2 christos
52 1.2.6.2 christos int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
53 1.2.6.2 christos int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
54 1.2.6.2 christos int drm_legacy_getctx(struct drm_device *d, void *v, struct drm_file *f);
55 1.2.6.2 christos int drm_legacy_switchctx(struct drm_device *d, void *v, struct drm_file *f);
56 1.2.6.2 christos int drm_legacy_newctx(struct drm_device *d, void *v, struct drm_file *f);
57 1.2.6.2 christos int drm_legacy_rmctx(struct drm_device *d, void *v, struct drm_file *f);
58 1.2.6.2 christos
59 1.2.6.2 christos int drm_legacy_setsareactx(struct drm_device *d, void *v, struct drm_file *f);
60 1.2.6.2 christos int drm_legacy_getsareactx(struct drm_device *d, void *v, struct drm_file *f);
61 1.2.6.2 christos
62 1.2.6.2 christos /*
63 1.2.6.2 christos * Generic Buffer Management
64 1.2.6.2 christos */
65 1.2.6.2 christos
66 1.2.6.2 christos #define DRM_MAP_HASH_OFFSET 0x10000000
67 1.2.6.2 christos
68 1.2.6.2 christos int drm_legacy_addmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
69 1.2.6.2 christos int drm_legacy_rmmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
70 1.2.6.2 christos int drm_legacy_addbufs(struct drm_device *d, void *v, struct drm_file *f);
71 1.2.6.2 christos int drm_legacy_infobufs(struct drm_device *d, void *v, struct drm_file *f);
72 1.2.6.2 christos int drm_legacy_markbufs(struct drm_device *d, void *v, struct drm_file *f);
73 1.2.6.2 christos int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
74 1.2.6.2 christos int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
75 1.2.6.2 christos int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
76 1.2.6.2 christos
77 1.2.6.2 christos void drm_legacy_vma_flush(struct drm_device *d);
78 1.2.6.2 christos
79 1.2.6.2 christos /*
80 1.2.6.2 christos * AGP Support
81 1.2.6.2 christos */
82 1.2.6.2 christos
83 1.2.6.2 christos struct drm_agp_mem {
84 1.2.6.2 christos unsigned long handle;
85 1.2.6.2 christos struct agp_memory *memory;
86 1.2.6.2 christos unsigned long bound;
87 1.2.6.2 christos int pages;
88 1.2.6.2 christos struct list_head head;
89 1.2.6.2 christos };
90 1.2.6.2 christos
91 1.2.6.2 christos /*
92 1.2.6.2 christos * Generic Userspace Locking-API
93 1.2.6.2 christos */
94 1.2.6.2 christos
95 1.2.6.2 christos int drm_legacy_i_have_hw_lock(struct drm_device *d, struct drm_file *f);
96 1.2.6.2 christos int drm_legacy_lock(struct drm_device *d, void *v, struct drm_file *f);
97 1.2.6.2 christos int drm_legacy_unlock(struct drm_device *d, void *v, struct drm_file *f);
98 1.2.6.2 christos int drm_legacy_lock_free(struct drm_lock_data *lock, unsigned int ctx);
99 1.2.6.2 christos
100 1.2.6.2 christos /* DMA support */
101 1.2.6.2 christos int drm_legacy_dma_setup(struct drm_device *dev);
102 1.2.6.2 christos void drm_legacy_dma_takedown(struct drm_device *dev);
103 1.2.6.2 christos void drm_legacy_free_buffer(struct drm_device *dev,
104 1.2.6.2 christos struct drm_buf * buf);
105 1.2.6.2 christos void drm_legacy_reclaim_buffers(struct drm_device *dev,
106 1.2.6.2 christos struct drm_file *filp);
107 1.2.6.2 christos
108 1.2.6.2 christos /* Scatter Gather Support */
109 1.2.6.2 christos void drm_legacy_sg_cleanup(struct drm_device *dev);
110 1.2.6.2 christos int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
111 1.2.6.2 christos struct drm_file *file_priv);
112 1.2.6.2 christos int drm_legacy_sg_free(struct drm_device *dev, void *data,
113 1.2.6.2 christos struct drm_file *file_priv);
114 1.2.6.2 christos
115 1.2.6.2 christos #endif /* __DRM_LEGACY_H__ */
116