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

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/s3v/s3v_dri.h

  • Committer: Bazaar Package Importer
  • Author(s): Morten Kjeldgaard
  • Date: 2008-05-06 16:19:15 UTC
  • Revision ID: james.westby@ubuntu.com-20080506161915-uynz7nftmfixu6bq
Tags: upstream-7.0.3
ImportĀ upstreamĀ versionĀ 7.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Author: Max Lingua <sunmax@libero.it>
 
3
 */
 
4
 
 
5
#ifndef _S3V_DRI
 
6
#define _S3V_DRI
 
7
 
 
8
#include "s3v_common.h"
 
9
 
 
10
#define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */
 
11
 
 
12
typedef struct
 
13
{
 
14
   int deviceID;
 
15
   int width;
 
16
   int height;
 
17
   int mem;
 
18
   int cpp;
 
19
   int bitsPerPixel;
 
20
 
 
21
   int fbOffset;
 
22
   int fbStride;
 
23
 
 
24
   int logTextureGranularity;
 
25
   int textureOffset; 
 
26
 
 
27
   drm_handle_t regs;
 
28
   drmSize regsSize;
 
29
 
 
30
   unsigned int sarea_priv_offset;
 
31
/*
 
32
   drmAddress regsMap;
 
33
 
 
34
   drmSize textureSize;
 
35
   drm_handle_t textures;
 
36
*/
 
37
 
 
38
#if 0
 
39
   drm_handle_t agp_buffers;
 
40
   drmSize agp_buf_size;
 
41
#endif
 
42
 
 
43
/*
 
44
   drmBufMapPtr drmBufs;
 
45
   int irq;
 
46
   unsigned int sarea_priv_offset;
 
47
*/
 
48
 
 
49
/* FIXME: cleanup ! */
 
50
 
 
51
   drmSize            registerSize; /* == S3V_MMIO_REGSIZE */
 
52
   drm_handle_t       registerHandle;
 
53
 
 
54
   drmSize            pciSize;
 
55
   drm_handle_t       pciMemHandle;
 
56
 
 
57
   drmSize            frontSize;    /* == videoRambytes */
 
58
/* drm_handle_t       frontHandle; */
 
59
   unsigned long      frontOffset;  /* == fbOffset */
 
60
   int                frontPitch;
 
61
/* unsigned char      *front; */
 
62
 
 
63
   unsigned int       bufferSize; /* size of depth/back buffer */
 
64
 
 
65
   drmSize            backSize;
 
66
/* drm_handle_t       backHandle; */
 
67
   unsigned long      backOffset;
 
68
   int                backPitch;
 
69
/* unsigned char      *back; */
 
70
 
 
71
   drmSize            depthSize;
 
72
/* drm_handle_t       depthHandle; */
 
73
   unsigned long      depthOffset;
 
74
   int                depthPitch;
 
75
/* unsigned char      *depth; */
 
76
 
 
77
   drmSize            texSize;
 
78
/* drm_handle_t       texHandle; */
 
79
   unsigned long      texOffset;
 
80
   int                texPitch;
 
81
/* unsigned char      *tex; */
 
82
 
 
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 */
 
90
 
 
91
} S3VDRIRec, *S3VDRIPtr;
 
92
 
 
93
/* WARNING: Do not change the SAREA structure without changing the kernel
 
94
 * as well */
 
95
 
 
96
typedef struct {
 
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;
 
101
 
 
102
typedef struct {
 
103
   unsigned int nbox;
 
104
   drm_clip_rect_t boxes[S3V_NR_SAREA_CLIPRECTS];
 
105
   
 
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.
 
111
    *
 
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.  
 
120
    */
 
121
   S3VTexRegionRec texList[S3V_NR_TEX_REGIONS+1]; /* Last elt is sentinal */
 
122
   
 
123
   int texAge;             /* last time texture was uploaded */
 
124
   
 
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;     /*  */
 
128
   
 
129
   int ctxOwner;           /* last context to upload state */
 
130
} S3VSAREARec, *S3VSAREAPtr;
 
131
 
 
132
typedef struct {
 
133
  /* Nothing here yet */
 
134
  int dummy;
 
135
} S3VConfigPrivRec, *S3VConfigPrivPtr;
 
136
 
 
137
typedef struct {
 
138
  /* Nothing here yet */
 
139
  int dummy;
 
140
} S3VDRIContextRec, *S3VDRIContextPtr;
 
141
 
 
142
 
 
143
#endif