Merge branch 'gallium-0.1' into gallium-0.2
[mesa.git] / src / gallium / winsys / drm / intel / egl / intel_context.h
1 /**************************************************************************
2 *
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef INTEL_CONTEXT_H
29 #define INTEL_CONTEXT_H
30
31 #include "pipe/p_debug.h"
32 #include "intel_be_context.h"
33
34
35 struct st_context;
36 struct egl_drm_device;
37 struct egl_drm_context;
38 struct egl_drm_frontbuffer;
39
40
41 /**
42 * Intel rendering context, contains a state tracker and intel-specific info.
43 */
44 struct intel_context
45 {
46 struct intel_be_context base;
47
48 struct st_context *st;
49
50 struct intel_device *intel_device;
51
52 /* new egl stuff */
53 struct egl_drm_device *egl_device;
54 struct egl_drm_context *egl_context;
55 struct egl_drm_drawable *egl_drawable;
56 };
57
58
59
60 /**
61 * Intel framebuffer.
62 */
63 struct intel_framebuffer
64 {
65 struct st_framebuffer *stfb;
66
67 struct intel_device *device;
68 struct _DriBufferObject *front_buffer;
69 struct egl_drm_frontbuffer *front;
70 };
71
72
73
74
75 /* These are functions now:
76 */
77 void LOCK_HARDWARE( struct intel_context *intel );
78 void UNLOCK_HARDWARE( struct intel_context *intel );
79
80 extern char *__progname;
81
82
83
84 /* ================================================================
85 * Debugging:
86 */
87 #ifdef DEBUG
88 extern int __intel_debug;
89
90 #define DEBUG_SWAP 0x1
91 #define DEBUG_LOCK 0x2
92 #define DEBUG_IOCTL 0x4
93 #define DEBUG_BATCH 0x8
94
95 #define DBG(flag, ...) do { \
96 if (__intel_debug & (DEBUG_##flag)) \
97 printf(__VA_ARGS__); \
98 } while(0)
99
100 #else
101 #define DBG(flag, ...)
102 #endif
103
104
105 #define PCI_CHIP_845_G 0x2562
106 #define PCI_CHIP_I830_M 0x3577
107 #define PCI_CHIP_I855_GM 0x3582
108 #define PCI_CHIP_I865_G 0x2572
109 #define PCI_CHIP_I915_G 0x2582
110 #define PCI_CHIP_I915_GM 0x2592
111 #define PCI_CHIP_I945_G 0x2772
112 #define PCI_CHIP_I945_GM 0x27A2
113 #define PCI_CHIP_I945_GME 0x27AE
114 #define PCI_CHIP_G33_G 0x29C2
115 #define PCI_CHIP_Q35_G 0x29B2
116 #define PCI_CHIP_Q33_G 0x29D2
117
118 #endif