4 /* WARNING: These defines must be the same as what the Xserver uses.
5 * if you change them, you must change the defines in the Xserver.
8 /* Might one day want to support the client-side ringbuffer code again.
10 #ifndef _I810_DEFINES_
11 #define _I810_DEFINES_
13 #define I810_USE_BATCH 1
14 #define I810_DMA_BUF_ORDER 12
15 #define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
16 #define I810_DMA_BUF_NR 256
17 #define I810_NR_SAREA_CLIPRECTS 2
19 /* Each region is a minimum of 64k, and there are at most 64 of them.
22 #define I810_NR_TEX_REGIONS 64
23 #define I810_LOG_MIN_TEX_REGION_SIZE 16
26 typedef struct _drm_i810_init {
29 I810_CLEANUP_DMA = 0x02
33 int sarea_priv_offset;
34 unsigned long ring_start;
35 unsigned long ring_end;
36 unsigned long ring_size;
39 /* Warning: If you change the SAREA structure you must change the Xserver
40 * structure as well */
42 typedef struct _drm_i810_tex_region {
43 unsigned char next, prev; /* indices to form a circular LRU */
44 unsigned char in_use; /* owned by a client, or free? */
45 int age; /* tracked by clients to update local LRU's */
46 } drm_i810_tex_region_t;
48 typedef struct _drm_i810_sarea {
50 drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS];
52 /* Maintain an LRU of contiguous regions of texture space. If
53 * you think you own a region of texture memory, and it has an
54 * age different to the one you set, then you are mistaken and
55 * it has been stolen by another client. If global texAge
56 * hasn't changed, there is no need to walk the list.
58 * These regions can be used as a proxy for the fine-grained
59 * texture information of other clients - by maintaining them
60 * in the same lru which is used to age their own textures,
61 * clients have an approximate lru for the whole of global
62 * texture space, and can make informed decisions as to which
63 * areas to kick out. There is no need to choose whether to
64 * kick out your own texture or someone else's - simply eject
65 * them all in LRU order.
68 drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS+1];
69 /* Last elt is sentinal */
70 int texAge; /* last time texture was uploaded */
71 int last_enqueue; /* last time a buffer was enqueued */
72 int last_dispatch; /* age of the most recently dispatched buffer */
73 int last_quiescent; /* */
74 int ctxOwner; /* last context to upload state */
77 typedef struct _drm_i810_general {
82 /* These may be placeholders if we have more cliprects than
83 * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
84 * false, indicating that the buffer will be dispatched again with a
85 * new set of cliprects.
87 typedef struct _drm_i810_vertex {
88 int idx; /* buffer index */
89 int used; /* nr bytes in use */
90 int discard; /* client is finished with the buffer? */
93 #endif /* _I810_DRM_H_ */