Allow *_dri.so to build in Mesa tree with the 'linux-dri' target.
[mesa.git] / src / mesa / drivers / dri / unichrome / via_screen.h
1 /*
2 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef _VIAINIT_H
26 #define _VIAINIT_H
27
28 #include <sys/time.h>
29 #include "dri_util.h"
30 #include "via_dri.h"
31
32 typedef struct {
33 viaRegion regs;
34 viaRegion agp;
35 int deviceID;
36 int width;
37 int height;
38 int mem;
39
40 int cpp;
41 int bitsPerPixel;
42 int bytesPerPixel;
43 int fbFormat;
44 int fbOffset;
45 int fbSize;
46 #ifdef USE_XINERAMA
47 Bool drixinerama;
48 #endif
49
50 int fbStride;
51
52 int backOffset;
53 int depthOffset;
54
55 int backPitch;
56 int backPitchBits;
57
58 int textureOffset;
59 int textureSize;
60 int logTextureGranularity;
61
62 drmAddress reg;
63 drmAddress agpLinearStart;
64 GLuint* agpBase;
65
66 __DRIscreenPrivate *driScrnPriv;
67 drmBufMapPtr bufs;
68 unsigned int sareaPrivOffset;
69 /*=* John Sheng [2003.12.9] Tuxracer & VQ *=*/
70 int VQEnable;
71 } viaScreenPrivate;
72
73 extern GLboolean
74 viaCreateContext(const __GLcontextModes *mesaVis,
75 __DRIcontextPrivate *driContextPriv,
76 void *sharedContextPrivate);
77
78 extern void
79 viaDestroyContext(__DRIcontextPrivate *driContextPriv);
80
81 extern GLboolean
82 viaUnbindContext(__DRIcontextPrivate *driContextPriv);
83
84 extern GLboolean
85 viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
86 __DRIdrawablePrivate *driDrawPriv,
87 __DRIdrawablePrivate *driReadPriv);
88
89 extern void
90 viaSwapBuffers(__DRIdrawablePrivate *drawablePrivate);
91
92 #endif