1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
Index: xf86-video-openchrome-0.2.904/src/via_drm.h
===================================================================
--- xf86-video-openchrome-0.2.904/src/via_drm.h (revision 415)
+++ xf86-video-openchrome-0.2.904/src/via_drm.h (revision 839)
@@ -17,5 +17,5 @@
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) OR COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
@@ -25,4 +25,6 @@
#define _VIA_DRM_H_
+#include "drm.h"
+
/* WARNING: These defines must be the same as what the Xserver uses.
* if you change them, you must change the defines in the Xserver.
@@ -32,14 +34,12 @@
#define _VIA_DEFINES_
-#if !defined(__KERNEL__) && !defined(_KERNEL)
#include "via_drmclient.h"
-#endif
-
-#define VIA_NR_SAREA_CLIPRECTS 8
+
+#define VIA_NR_SAREA_CLIPRECTS 8
#define VIA_NR_XVMC_PORTS 10
#define VIA_NR_XVMC_LOCKS 5
#define VIA_MAX_CACHELINE_SIZE 64
#define XVMCLOCKPTR(saPriv,lockNo) \
- ((volatile drm_hw_lock_t *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
+ ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
(VIA_MAX_CACHELINE_SIZE - 1)) & \
~(VIA_MAX_CACHELINE_SIZE - 1)) + \
@@ -108,25 +108,24 @@
#define VIA_DEPTH 0x4
#define VIA_STENCIL 0x8
-
#define VIA_MEM_VIDEO 0 /* matches drm constant */
#define VIA_MEM_AGP 1 /* matches drm constant */
-#define VIA_MEM_SYSTEM 2
+#define VIA_MEM_SYSTEM 2
#define VIA_MEM_MIXED 3
#define VIA_MEM_UNKNOWN 4
typedef struct {
- uint32_t offset;
- uint32_t size;
+ __u32 offset;
+ __u32 size;
} drm_via_agp_t;
typedef struct {
- uint32_t offset;
- uint32_t size;
+ __u32 offset;
+ __u32 size;
} drm_via_fb_t;
typedef struct {
- uint32_t context;
- uint32_t type;
- uint32_t size;
+ __u32 context;
+ __u32 type;
+ __u32 size;
unsigned long index;
unsigned long offset;
@@ -150,7 +149,7 @@
VIA_FUTEX_WAKE = 0X01
} func;
- uint32_t ms;
- uint32_t lock;
- uint32_t val;
+ __u32 ms;
+ __u32 lock;
+ __u32 val;
} drm_via_futex_t;
@@ -159,5 +158,5 @@
VIA_INIT_DMA = 0x01,
VIA_CLEANUP_DMA = 0x02,
- VIA_DMA_INITIALIZED = 0x03
+ VIA_DMA_INITIALIZED = 0x03
} func;
@@ -168,5 +167,5 @@
typedef struct _drm_via_cmdbuffer {
- char __user *buf;
+ char *buf;
unsigned long size;
} drm_via_cmdbuffer_t;
@@ -184,5 +183,5 @@
unsigned int dirty;
unsigned int nbox;
- drm_clip_rect_t boxes[VIA_NR_SAREA_CLIPRECTS];
+ struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
int texAge; /* last time texture was uploaded */
@@ -200,10 +199,9 @@
unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
- unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
+ unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
/* Used by the 3d driver only at this point, for pageflipping:
*/
-
- unsigned int pfCurrentOffset;
+ unsigned int pfCurrentOffset;
} drm_via_sarea_t;
@@ -214,5 +212,5 @@
} func;
int wait;
- uint32_t size;
+ __u32 size;
} drm_via_cmdbuf_size_t;
@@ -226,17 +224,19 @@
#define VIA_IRQ_FLAGS_MASK 0xF0000000
-enum drm_via_irqs{drm_via_irq_hqv0 = 0,
- drm_via_irq_hqv1,
- drm_via_irq_dma0_dd,
- drm_via_irq_dma0_td,
- drm_via_irq_dma1_dd,
- drm_via_irq_dma1_td,
- drm_via_irq_num};
-
-struct drm_via_wait_irq_request{
+enum drm_via_irqs {
+ drm_via_irq_hqv0 = 0,
+ drm_via_irq_hqv1,
+ drm_via_irq_dma0_dd,
+ drm_via_irq_dma0_td,
+ drm_via_irq_dma1_dd,
+ drm_via_irq_dma1_td,
+ drm_via_irq_num
+};
+
+struct drm_via_wait_irq_request {
unsigned irq;
via_irq_seq_type_t type;
- uint32_t sequence;
- uint32_t signal;
+ __u32 sequence;
+ __u32 signal;
};
@@ -246,25 +246,30 @@
} drm_via_irqwait_t;
-typedef struct drm_via_blitsync {
- uint32_t sync_handle;
+typedef struct drm_via_blitsync {
+ __u32 sync_handle;
unsigned engine;
} drm_via_blitsync_t;
+/* - * Below,"flags" is currently unused but will be used for possible future
+ * extensions like kernel space bounce buffers for bad alignments and
+ * blit engine busy-wait polling for better latency in the absence of
+ * interrupts.
+ */
+
typedef struct drm_via_dmablit {
- uint32_t num_lines;
- uint32_t line_length;
-
- uint32_t fb_addr;
- uint32_t fb_stride;
-
- unsigned char *mem_addr;
- uint32_t mem_stride;
-
- int bounce_buffer;
- int to_fb;
-
- drm_via_blitsync_t sync;
+ __u32 num_lines;
+ __u32 line_length;
+
+ __u32 fb_addr;
+ __u32 fb_stride;
+
+ unsigned char *mem_addr;
+ __u32 mem_stride;
+
+ __u32 flags;
+ int to_fb;
+
+ drm_via_blitsync_t sync;
} drm_via_dmablit_t;
-
#endif /* _VIA_DRM_H_ */
|