~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i915tex/server/i830_common.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************
 
2
 
 
3
Copyright 2001 VA Linux Systems Inc., Fremont, California.
 
4
Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
 
5
 
 
6
All Rights Reserved.
 
7
 
 
8
Permission is hereby granted, free of charge, to any person obtaining a
 
9
copy of this software and associated documentation files (the "Software"),
 
10
to deal in the Software without restriction, including without limitation
 
11
on the rights to use, copy, modify, merge, publish, distribute, sub
 
12
license, and/or sell copies of the Software, and to permit persons to whom
 
13
the Software is furnished to do so, subject to the following conditions:
 
14
 
 
15
The above copyright notice and this permission notice (including the next
 
16
paragraph) shall be included in all copies or substantial portions of the
 
17
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 NON-INFRINGEMENT. IN NO EVENT SHALL
 
22
ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
 
23
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 
24
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 
25
USE OR OTHER DEALINGS IN THE SOFTWARE.
 
26
 
 
27
**************************************************************************/
 
28
 
 
29
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.1 2002/09/11 00:29:32 dawes Exp $ */
 
30
 
 
31
#ifndef _I830_COMMON_H_
 
32
#define _I830_COMMON_H_
 
33
 
 
34
 
 
35
#define I830_NR_TEX_REGIONS 255 /* maximum due to use of chars for next/prev */
 
36
#define I830_LOG_MIN_TEX_REGION_SIZE 14
 
37
 
 
38
 
 
39
/* Driver specific DRM command indices
 
40
 * NOTE: these are not OS specific, but they are driver specific
 
41
 */
 
42
#define DRM_I830_INIT                     0x00
 
43
#define DRM_I830_FLUSH                    0x01
 
44
#define DRM_I830_FLIP                     0x02
 
45
#define DRM_I830_BATCHBUFFER              0x03
 
46
#define DRM_I830_IRQ_EMIT                 0x04
 
47
#define DRM_I830_IRQ_WAIT                 0x05
 
48
#define DRM_I830_GETPARAM                 0x06
 
49
#define DRM_I830_SETPARAM                 0x07
 
50
#define DRM_I830_ALLOC                    0x08
 
51
#define DRM_I830_FREE                     0x09
 
52
#define DRM_I830_INIT_HEAP                0x0a
 
53
#define DRM_I830_CMDBUFFER                0x0b
 
54
#define DRM_I830_DESTROY_HEAP             0x0c
 
55
#define DRM_I830_SET_VBLANK_PIPE          0x0d
 
56
#define DRM_I830_GET_VBLANK_PIPE          0x0e
 
57
 
 
58
typedef struct {
 
59
   enum {
 
60
      I830_INIT_DMA = 0x01,
 
61
      I830_CLEANUP_DMA = 0x02,
 
62
      I830_RESUME_DMA = 0x03
 
63
   } func;
 
64
   unsigned int mmio_offset;
 
65
   int sarea_priv_offset;
 
66
   unsigned int ring_start;
 
67
   unsigned int ring_end;
 
68
   unsigned int ring_size;
 
69
   unsigned int front_offset;
 
70
   unsigned int back_offset;
 
71
   unsigned int depth_offset;
 
72
   unsigned int w;
 
73
   unsigned int h;
 
74
   unsigned int pitch;
 
75
   unsigned int pitch_bits;
 
76
   unsigned int back_pitch;
 
77
   unsigned int depth_pitch;
 
78
   unsigned int cpp;
 
79
   unsigned int chipset;
 
80
} drmI830Init;
 
81
 
 
82
typedef struct {
 
83
        drmTextureRegion texList[I830_NR_TEX_REGIONS+1];
 
84
        int last_upload;        /* last time texture was uploaded */
 
85
        int last_enqueue;       /* last time a buffer was enqueued */
 
86
        int last_dispatch;      /* age of the most recently dispatched buffer */
 
87
        int ctxOwner;           /* last context to upload state */
 
88
        int texAge;
 
89
        int pf_enabled;         /* is pageflipping allowed? */
 
90
        int pf_active;               
 
91
        int pf_current_page;    /* which buffer is being displayed? */
 
92
        int perf_boxes;         /* performance boxes to be displayed */   
 
93
        int width, height;      /* screen size in pixels */
 
94
 
 
95
        drm_handle_t front_handle;
 
96
        int front_offset;
 
97
        int front_size;
 
98
 
 
99
        drm_handle_t back_handle;
 
100
        int back_offset;
 
101
        int back_size;
 
102
 
 
103
        drm_handle_t depth_handle;
 
104
        int depth_offset;
 
105
        int depth_size;
 
106
 
 
107
        drm_handle_t tex_handle;
 
108
        int tex_offset;
 
109
        int tex_size;
 
110
        int log_tex_granularity;
 
111
        int pitch;
 
112
        int rotation;           /* 0, 90, 180 or 270 */
 
113
        int rotated_offset;
 
114
        int rotated_size;
 
115
        int rotated_pitch;
 
116
        int virtualX, virtualY;
 
117
 
 
118
        unsigned int front_tiled;
 
119
        unsigned int back_tiled;
 
120
        unsigned int depth_tiled;
 
121
        unsigned int rotated_tiled;
 
122
        unsigned int rotated2_tiled;
 
123
 
 
124
        int pipeA_x;
 
125
        int pipeA_y;
 
126
        int pipeA_w;
 
127
        int pipeA_h;
 
128
        int pipeB_x;
 
129
        int pipeB_y;
 
130
        int pipeB_w;
 
131
        int pipeB_h;
 
132
} drmI830Sarea;
 
133
 
 
134
/* Flags for perf_boxes
 
135
 */
 
136
#define I830_BOX_RING_EMPTY    0x1 /* populated by kernel */
 
137
#define I830_BOX_FLIP          0x2 /* populated by kernel */
 
138
#define I830_BOX_WAIT          0x4 /* populated by kernel & client */
 
139
#define I830_BOX_TEXTURE_LOAD  0x8 /* populated by kernel */
 
140
#define I830_BOX_LOST_CONTEXT  0x10 /* populated by client */
 
141
 
 
142
 
 
143
typedef struct {
 
144
        int start;              /* agp offset */
 
145
        int used;               /* nr bytes in use */
 
146
        int DR1;                /* hw flags for GFX_OP_DRAWRECT_INFO */
 
147
        int DR4;                /* window origin for GFX_OP_DRAWRECT_INFO*/
 
148
        int num_cliprects;      /* mulitpass with multiple cliprects? */
 
149
        drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
 
150
} drmI830BatchBuffer;
 
151
 
 
152
typedef struct {
 
153
        char *buf;              /* agp offset */
 
154
        int sz;                 /* nr bytes in use */
 
155
        int DR1;                /* hw flags for GFX_OP_DRAWRECT_INFO */
 
156
        int DR4;                /* window origin for GFX_OP_DRAWRECT_INFO*/
 
157
        int num_cliprects;      /* mulitpass with multiple cliprects? */
 
158
        drm_clip_rect_t *cliprects; /* pointer to userspace cliprects */
 
159
} drmI830CmdBuffer;
 
160
 
 
161
typedef struct {
 
162
        int *irq_seq;
 
163
} drmI830IrqEmit;
 
164
 
 
165
typedef struct {
 
166
        int irq_seq;
 
167
} drmI830IrqWait;
 
168
 
 
169
typedef struct {
 
170
        int param;
 
171
        int *value;
 
172
} drmI830GetParam;
 
173
 
 
174
#define I830_PARAM_IRQ_ACTIVE     1
 
175
#define I830_PARAM_ALLOW_BATCHBUFFER   2 
 
176
 
 
177
typedef struct {
 
178
        int param;
 
179
        int value;
 
180
} drmI830SetParam;
 
181
 
 
182
#define I830_SETPARAM_USE_MI_BATCHBUFFER_START  1
 
183
#define I830_SETPARAM_TEX_LRU_LOG_GRANULARITY   2
 
184
#define I830_SETPARAM_ALLOW_BATCHBUFFER         3
 
185
 
 
186
 
 
187
/* A memory manager for regions of shared memory:
 
188
 */
 
189
#define I830_MEM_REGION_AGP 1
 
190
 
 
191
typedef struct {
 
192
        int region;
 
193
        int alignment;
 
194
        int size;
 
195
        int *region_offset;     /* offset from start of fb or agp */
 
196
} drmI830MemAlloc;
 
197
 
 
198
typedef struct {
 
199
        int region;
 
200
        int region_offset;
 
201
} drmI830MemFree;
 
202
 
 
203
typedef struct {
 
204
        int region;
 
205
        int size;
 
206
        int start;      
 
207
} drmI830MemInitHeap;
 
208
 
 
209
typedef struct {
 
210
        int region;
 
211
} drmI830MemDestroyHeap;
 
212
 
 
213
#define DRM_I830_VBLANK_PIPE_A  1
 
214
#define DRM_I830_VBLANK_PIPE_B  2
 
215
 
 
216
typedef struct {
 
217
        int pipe;
 
218
} drmI830VBlankPipe;
 
219
 
 
220
#endif /* _I830_DRM_H_ */