2 * Author: Max Lingua <sunmax@libero.it>
8 #include "s3v_common.h"
10 #define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */
24 int logTextureGranularity
;
30 unsigned int sarea_priv_offset
;
35 drm_handle_t textures;
39 drm_handle_t agp_buffers
;
46 unsigned int sarea_priv_offset;
49 /* FIXME: cleanup ! */
51 drmSize registerSize
; /* == S3V_MMIO_REGSIZE */
52 drm_handle_t registerHandle
;
55 drm_handle_t pciMemHandle
;
57 drmSize frontSize
; /* == videoRambytes */
58 /* drm_handle_t frontHandle; */
59 unsigned long frontOffset
; /* == fbOffset */
61 /* unsigned char *front; */
63 unsigned int bufferSize
; /* size of depth/back buffer */
66 /* drm_handle_t backHandle; */
67 unsigned long backOffset
;
69 /* unsigned char *back; */
72 /* drm_handle_t depthHandle; */
73 unsigned long depthOffset
;
75 /* unsigned char *depth; */
78 /* drm_handle_t texHandle; */
79 unsigned long texOffset
;
81 /* unsigned char *tex; */
83 drmSize dmaBufSize
; /* Size of buffers (in bytes) */
84 drm_handle_t dmaBufHandle
; /* Handle from drmAddMap */
85 unsigned long dmaBufOffset
; /* Offset/Start */
86 int dmaBufPitch
; /* Pitch */
87 unsigned char *dmaBuf
; /* Map */
88 int bufNumBufs
; /* Number of buffers */
89 drmBufMapPtr buffers
; /* Buffer map */
91 } S3VDRIRec
, *S3VDRIPtr
;
93 /* WARNING: Do not change the SAREA structure without changing the kernel
97 unsigned char next
, prev
; /* indices to form a circular LRU */
98 unsigned char in_use
; /* owned by a client, or free? */
99 int age
; /* tracked by clients to update local LRU's */
100 } S3VTexRegionRec
, *S3VTexRegionPtr
;
104 drm_clip_rect_t boxes
[S3V_NR_SAREA_CLIPRECTS
];
106 /* Maintain an LRU of contiguous regions of texture space. If
107 * you think you own a region of texture memory, and it has an
108 * age different to the one you set, then you are mistaken and
109 * it has been stolen by another client. If global texAge
110 * hasn't changed, there is no need to walk the list.
112 * These regions can be used as a proxy for the fine-grained
113 * texture information of other clients - by maintaining them
114 * in the same lru which is used to age their own textures,
115 * clients have an approximate lru for the whole of global
116 * texture space, and can make informed decisions as to which
117 * areas to kick out. There is no need to choose whether to
118 * kick out your own texture or someone else's - simply eject
119 * them all in LRU order.
121 S3VTexRegionRec texList
[S3V_NR_TEX_REGIONS
+1]; /* Last elt is sentinal */
123 int texAge
; /* last time texture was uploaded */
125 int last_enqueue
; /* last time a buffer was enqueued */
126 int last_dispatch
; /* age of the most recently dispatched buffer */
127 int last_quiescent
; /* */
129 int ctxOwner
; /* last context to upload state */
130 } S3VSAREARec
, *S3VSAREAPtr
;
133 /* Nothing here yet */
135 } S3VConfigPrivRec
, *S3VConfigPrivPtr
;
138 /* Nothing here yet */
140 } S3VDRIContextRec
, *S3VDRIContextPtr
;