Replace drmHandle, drmContext, drmDrawable, drmMagic and related types with
[mesa.git] / src / mesa / drivers / dri / i810 / server / i810_dri.h
1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v 1.10 2002/12/10 01:27:04 dawes Exp $ */
2
3 #ifndef _I810_DRI_
4 #define _I810_DRI_
5
6 #include "xf86drm.h"
7 #include "i810_common.h"
8
9 #define I810_MAX_DRAWABLES 256
10
11 typedef struct {
12 drm_handle_t regs;
13 drmSize regsSize;
14 drmAddress regsMap;
15
16 drmSize backbufferSize;
17 drm_handle_t backbuffer;
18
19 drmSize depthbufferSize;
20 drm_handle_t depthbuffer;
21
22 drm_handle_t textures;
23 int textureSize;
24
25 drm_handle_t agp_buffers;
26 drmSize agp_buf_size;
27
28 int deviceID;
29 int width;
30 int height;
31 int mem;
32 int cpp;
33 int bitsPerPixel;
34 int fbOffset;
35 int fbStride;
36
37 int backOffset;
38 int depthOffset;
39
40 int auxPitch;
41 int auxPitchBits;
42
43 int logTextureGranularity;
44 int textureOffset;
45
46 /* For non-dma direct rendering.
47 */
48 int ringOffset;
49 int ringSize;
50
51 drmBufMapPtr drmBufs;
52 int irq;
53 unsigned int sarea_priv_offset;
54
55 } I810DRIRec, *I810DRIPtr;
56
57 /* WARNING: Do not change the SAREA structure without changing the kernel
58 * as well */
59
60 #define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
61 #define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
62 #define I810_UPLOAD_CTX 0x4
63 #define I810_UPLOAD_BUFFERS 0x8
64 #define I810_UPLOAD_TEX0 0x10
65 #define I810_UPLOAD_TEX1 0x20
66 #define I810_UPLOAD_CLIPRECTS 0x40
67
68 typedef struct {
69 unsigned char next, prev; /* indices to form a circular LRU */
70 unsigned char in_use; /* owned by a client, or free? */
71 int age; /* tracked by clients to update local LRU's */
72 } I810TexRegionRec, *I810TexRegionPtr;
73
74 typedef struct {
75 unsigned int ContextState[I810_CTX_SETUP_SIZE];
76 unsigned int BufferState[I810_DEST_SETUP_SIZE];
77 unsigned int TexState[2][I810_TEX_SETUP_SIZE];
78 unsigned int dirty;
79
80 unsigned int nbox;
81 drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS];
82
83 /* Maintain an LRU of contiguous regions of texture space. If
84 * you think you own a region of texture memory, and it has an
85 * age different to the one you set, then you are mistaken and
86 * it has been stolen by another client. If global texAge
87 * hasn't changed, there is no need to walk the list.
88 *
89 * These regions can be used as a proxy for the fine-grained
90 * texture information of other clients - by maintaining them
91 * in the same lru which is used to age their own textures,
92 * clients have an approximate lru for the whole of global
93 * texture space, and can make informed decisions as to which
94 * areas to kick out. There is no need to choose whether to
95 * kick out your own texture or someone else's - simply eject
96 * them all in LRU order.
97 */
98
99 drmTextureRegion texList[I810_NR_TEX_REGIONS + 1];
100
101 /* Last elt is sentinal */
102 int texAge; /* last time texture was uploaded */
103
104 int last_enqueue; /* last time a buffer was enqueued */
105 int last_dispatch; /* age of the most recently dispatched buffer */
106 int last_quiescent; /* */
107
108 int ctxOwner; /* last context to upload state */
109
110 int vertex_prim;
111
112 int pf_enabled; /* is pageflipping allowed? */
113 int pf_active; /* is pageflipping active right now? */
114 int pf_current_page; /* which buffer is being displayed? */
115
116
117 } I810SAREARec, *I810SAREAPtr;
118
119 typedef struct {
120 /* Nothing here yet */
121 int dummy;
122 } I810ConfigPrivRec, *I810ConfigPrivPtr;
123
124 typedef struct {
125 /* Nothing here yet */
126 int dummy;
127 } I810DRIContextRec, *I810DRIContextPtr;
128
129 #endif