r200 driver, brought over by Jon Smirl
[mesa.git] / src / mesa / drivers / dri / r200 / r200_screen.h
1 /* $XFree86$ */
2 /**************************************************************************
3
4 Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
5
6 The Weather Channel (TM) funded Tungsten Graphics to develop the
7 initial release of the Radeon 8500 driver under the XFree86 license.
8 This notice must be preserved.
9
10 Permission is hereby granted, free of charge, to any person obtaining
11 a copy of this software and associated documentation files (the
12 "Software"), to deal in the Software without restriction, including
13 without limitation the rights to use, copy, modify, merge, publish,
14 distribute, sublicense, and/or sell copies of the Software, and to
15 permit persons to whom the Software is furnished to do so, subject to
16 the following conditions:
17
18 The above copyright notice and this permission notice (including the
19 next paragraph) shall be included in all copies or substantial
20 portions of the Software.
21
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
26 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 **************************************************************************/
31
32 /*
33 * Authors:
34 * Keith Whitwell <keith@tungstengraphics.com>
35 */
36
37 #ifndef __R200_SCREEN_H__
38 #define __R200_SCREEN_H__
39
40 #ifdef GLX_DIRECT_RENDERING
41
42 #include "dri_util.h"
43 #include "xf86drm.h"
44 #include "radeon_common.h"
45 #include "radeon_sarea.h"
46
47 typedef struct {
48 drmHandle handle; /* Handle to the DRM region */
49 drmSize size; /* Size of the DRM region */
50 drmAddress map; /* Mapping of the DRM region */
51 } r200RegionRec, *r200RegionPtr;
52
53 #define R200_CHIPSET_R200 1
54 #define R200_CHIPSET_MOBILITY 2
55
56
57 #define R200_NR_TEX_HEAPS 2
58
59 typedef struct {
60
61 int chipset;
62 int cpp;
63 int IsPCI; /* Current card is a PCI card */
64 int AGPMode;
65 unsigned int irq; /* IRQ number (0 means none) */
66
67 unsigned int frontOffset;
68 unsigned int frontPitch;
69 unsigned int backOffset;
70 unsigned int backPitch;
71
72 unsigned int depthOffset;
73 unsigned int depthPitch;
74
75 /* Shared texture data */
76 int numTexHeaps;
77 int texOffset[R200_NR_TEX_HEAPS];
78 int texSize[R200_NR_TEX_HEAPS];
79 int logTexGranularity[R200_NR_TEX_HEAPS];
80
81 r200RegionRec mmio;
82 r200RegionRec status;
83 r200RegionRec agpTextures;
84
85 drmBufMapPtr buffers;
86
87 __volatile__ CARD32 *scratch;
88
89 __DRIscreenPrivate *driScreen;
90 unsigned int sarea_priv_offset;
91 unsigned int agp_buffer_offset; /* offset in card memory space */
92 unsigned int agp_texture_offset; /* offset in card memory space */
93 unsigned int agp_base;
94
95 GLboolean drmSupportsCubeMaps; /* need radeon kernel module >=1.7 */
96 } r200ScreenRec, *r200ScreenPtr;
97
98 #endif
99 #endif /* __R200_SCREEN_H__ */