Tizen 2.0 Release
[profile/ivi/osmesa.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 #include "xmlconfig.h"
32
33 typedef struct {
34     viaRegion regs;
35     viaRegion agp;
36     int deviceID;
37     int width;
38     int height;
39     int mem;
40
41     int cpp;                    
42     int bitsPerPixel;
43     int bytesPerPixel;
44     int fbFormat;
45     int fbOffset;
46     int fbSize;
47     
48     int fbStride;
49
50     int backOffset;
51     int depthOffset;
52
53     int backPitch;
54     int backPitchBits;
55
56     int textureOffset;
57     int textureSize;
58     int logTextureGranularity;
59     
60     drmAddress reg;
61     drmAddress agpLinearStart;
62     GLuint agpBase;
63
64     __DRIscreen *driScrnPriv;
65     drmBufMapPtr bufs;
66     unsigned int sareaPrivOffset;
67     /*=* John Sheng [2003.12.9] Tuxracer & VQ *=*/
68     int VQEnable;
69     int irqEnabled;
70
71     /* Configuration cache with default values for all contexts */
72     driOptionCache optionCache;
73
74     const __DRIextension *extensions[5];
75 } viaScreenPrivate;
76
77
78 extern GLboolean
79 viaCreateContext(gl_api api,
80                  const struct gl_config *mesaVis,
81                  __DRIcontext *driContextPriv,
82                  void *sharedContextPrivate);
83
84 extern void
85 viaDestroyContext(__DRIcontext *driContextPriv);
86
87 extern GLboolean
88 viaUnbindContext(__DRIcontext *driContextPriv);
89
90 extern GLboolean
91 viaMakeCurrent(__DRIcontext *driContextPriv,
92                __DRIdrawable *driDrawPriv,
93                __DRIdrawable *driReadPriv);
94
95 extern void
96 viaSwapBuffers(__DRIdrawable *drawablePrivate);
97
98 #endif