Refactor "class" texture environments to be implemented in terms of
[mesa.git] / src / mesa / drivers / dri / radeon / server / radeon_dri.h
1 /**
2 * \file server/radeon_dri.h
3 * \brief Radeon server-side structures.
4 *
5 * \author Kevin E. Martin <martin@xfree86.org>
6 * \author Rickard E. Faith <faith@valinux.com>
7 */
8
9 /*
10 * Copyright 2000 ATI Technologies Inc., Markham, Ontario,
11 * VA Linux Systems Inc., Fremont, California.
12 *
13 * All Rights Reserved.
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining
16 * a copy of this software and associated documentation files (the
17 * "Software"), to deal in the Software without restriction, including
18 * without limitation on the rights to use, copy, modify, merge,
19 * publish, distribute, sublicense, and/or sell copies of the Software,
20 * and to permit persons to whom the Software is furnished to do so,
21 * subject to the following conditions:
22 *
23 * The above copyright notice and this permission notice (including the
24 * next paragraph) shall be included in all copies or substantial
25 * portions of the Software.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
31 * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
32 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
34 * DEALINGS IN THE SOFTWARE.
35 */
36
37 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h,v 1.3 2002/04/24 16:20:40 martin Exp $ */
38
39 #ifndef _RADEON_DRI_
40 #define _RADEON_DRI_
41
42 #include "xf86drm.h"
43 #include "radeon_common.h"
44
45 /* DRI Driver defaults */
46 #define RADEON_DEFAULT_CP_PIO_MODE RADEON_CSQ_PRIPIO_INDPIO
47 #define RADEON_DEFAULT_CP_BM_MODE RADEON_CSQ_PRIBM_INDBM
48 #define RADEON_DEFAULT_AGP_MODE 1
49 #define RADEON_DEFAULT_AGP_FAST_WRITE 0
50 #define RADEON_DEFAULT_AGP_SIZE 8 /* MB (must be 2^n and > 4MB) */
51 #define RADEON_DEFAULT_RING_SIZE 1 /* MB (must be page aligned) */
52 #define RADEON_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
53 #define RADEON_DEFAULT_AGP_TEX_SIZE 1 /* MB (must be page aligned) */
54 #define RADEON_DEFAULT_CP_TIMEOUT 10000 /* usecs */
55 #define RADEON_BUFFER_ALIGN 0x00000fff
56
57 /**
58 * \brief Radeon DRI driver private data.
59 */
60 typedef struct {
61 /**
62 * \name DRI screen private data
63 */
64 /*@{*/
65 int deviceID; /**< \brief PCI device ID */
66 int width; /**< \brief width in pixels of display */
67 int height; /**< \brief height in scanlines of display */
68 int depth; /**< \brief depth of display (8, 15, 16, 24) */
69 int bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
70
71 int IsPCI; /**< \brief is current card a PCI card? */
72 int AGPMode; /**< \brief AGP mode */
73
74 int frontOffset; /**< \brief front buffer offset */
75 int frontPitch; /**< \brief front buffer pitch */
76 int backOffset; /**< \brief shared back buffer offset */
77 int backPitch; /**< \brief shared back buffer pitch */
78 int depthOffset; /**< \brief shared depth buffer offset */
79 int depthPitch; /**< \brief shared depth buffer pitch */
80 int textureOffset; /**< \brief start of texture data in frame buffer */
81 int textureSize; /**< \brief size of texture date */
82 int log2TexGran; /**< \brief log2 texture granularity */
83 /*@}*/
84
85 /**
86 * \name MMIO register data
87 */
88 /*@{*/
89 drmHandle registerHandle; /**< \brief MMIO register map size */
90 drmSize registerSize; /**< \brief MMIO register map handle */
91 /*@}*/
92
93 /**
94 * \name CP in-memory status information
95 */
96 /*@{*/
97 drmHandle statusHandle; /**< \brief status map handle */
98 drmSize statusSize; /**< \brief status map size */
99 /*@}*/
100
101 /**
102 * \name CP AGP Texture data
103 */
104 /*@{*/
105 drmHandle gartTexHandle; /**< \brief AGP texture area map handle */
106 drmSize gartTexMapSize; /**< \brief AGP texture area map size */
107 int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
108 int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
109 /*@}*/
110
111 unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
112 } RADEONDRIRec, *RADEONDRIPtr;
113
114 #endif