Lindent of core build. Drivers checked for no binary diffs. A few files
[platform/upstream/libdrm.git] / linux-core / savage_drv.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 #ifndef __SAVAGE_DRV_H__
25 #define __SAVAGE_DRV_H__
26
27 /* these chip tags should match the ones in the 2D driver in savage_regs.h. */
28 enum savage_family {
29         S3_UNKNOWN = 0,
30         S3_SAVAGE3D,
31         S3_SAVAGE_MX,
32         S3_SAVAGE4,
33         S3_PROSAVAGE,
34         S3_TWISTER,
35         S3_PROSAVAGEDDR,
36         S3_SUPERSAVAGE,
37         S3_SAVAGE2000,
38         S3_LAST
39 };
40
41 extern int savage_preinit(drm_device_t * dev, unsigned long chipset);
42
43 #define S3_SAVAGE3D_SERIES(chip)  ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
44
45 #define S3_SAVAGE4_SERIES(chip)  ((chip==S3_SAVAGE4)            \
46                                   || (chip==S3_PROSAVAGE)       \
47                                   || (chip==S3_TWISTER)         \
48                                   || (chip==S3_PROSAVAGEDDR))
49
50 #define S3_SAVAGE_MOBILE_SERIES(chip)   ((chip==S3_SAVAGE_MX) || (chip==S3_SUPERSAVAGE))
51
52 #define S3_SAVAGE_SERIES(chip)    ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000))
53
54 #define S3_MOBILE_TWISTER_SERIES(chip)   ((chip==S3_TWISTER)    \
55                                           ||(chip==S3_PROSAVAGEDDR))
56
57 /* flags */
58 #define SAVAGE_IS_AGP 1
59
60 typedef struct drm_savage_private {
61         drm_savage_sarea_t *sarea_priv;
62
63         enum savage_family chipset;
64         unsigned flags;
65
66 } drm_savage_private_t;
67
68 #define SAVAGE_FB_SIZE_S3       0x01000000      /*  16MB */
69 #define SAVAGE_FB_SIZE_S4       0x02000000      /*  32MB */
70 #define SAVAGE_MMIO_SIZE        0x00080000      /* 512kB */
71 #define SAVAGE_APERTURE_OFFSET  0x02000000      /*  32MB */
72 #define SAVAGE_APERTURE_SIZE    0x05000000      /* 5 tiled surfaces, 16MB each */
73
74 #endif                          /* end #ifndef __SAVAGE_DRV_ */