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