Revert the move of lost_context setting to UNLOCK_HARDWARE that was done in the
[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 "drm.h"
44 #include "radeon_drm.h"
45
46 /* DRI Driver defaults */
47 #define RADEON_DEFAULT_CP_PIO_MODE RADEON_CSQ_PRIPIO_INDPIO
48 #define RADEON_DEFAULT_CP_BM_MODE RADEON_CSQ_PRIBM_INDBM
49 #define RADEON_DEFAULT_AGP_MODE 1
50 #define RADEON_DEFAULT_AGP_FAST_WRITE 0
51 #define RADEON_DEFAULT_AGP_SIZE 8 /* MB (must be 2^n and > 4MB) */
52 #define RADEON_DEFAULT_RING_SIZE 1 /* MB (must be page aligned) */
53 #define RADEON_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
54 #define RADEON_DEFAULT_AGP_TEX_SIZE 1 /* MB (must be page aligned) */
55 #define RADEON_DEFAULT_CP_TIMEOUT 10000 /* usecs */
56 #define RADEON_DEFAULT_PAGE_FLIP 0 /* page flipping diabled */
57 #define RADEON_BUFFER_ALIGN 0x00000fff
58
59 /**
60 * \brief Radeon DRI driver private data.
61 */
62 typedef struct {
63 /**
64 * \name DRI screen private data
65 */
66 /*@{*/
67 int deviceID; /**< \brief PCI device ID */
68 int width; /**< \brief width in pixels of display */
69 int height; /**< \brief height in scanlines of display */
70 int depth; /**< \brief depth of display (8, 15, 16, 24) */
71 int bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
72
73 int IsPCI; /**< \brief is current card a PCI card? */
74 int AGPMode; /**< \brief AGP mode */
75
76 int frontOffset; /**< \brief front buffer offset */
77 int frontPitch; /**< \brief front buffer pitch */
78 int backOffset; /**< \brief shared back buffer offset */
79 int backPitch; /**< \brief shared back buffer pitch */
80 int depthOffset; /**< \brief shared depth buffer offset */
81 int depthPitch; /**< \brief shared depth buffer pitch */
82 int textureOffset; /**< \brief start of texture data in frame buffer */
83 int textureSize; /**< \brief size of texture date */
84 int log2TexGran; /**< \brief log2 texture granularity */
85 /*@}*/
86
87 /**
88 * \name MMIO register data
89 */
90 /*@{*/
91 drm_handle_t registerHandle; /**< \brief MMIO register map size */
92 drmSize registerSize; /**< \brief MMIO register map handle */
93 /*@}*/
94
95 /**
96 * \name CP in-memory status information
97 */
98 /*@{*/
99 drm_handle_t statusHandle; /**< \brief status map handle */
100 drmSize statusSize; /**< \brief status map size */
101 /*@}*/
102
103 /**
104 * \name CP AGP Texture data
105 */
106 /*@{*/
107 drm_handle_t gartTexHandle; /**< \brief AGP texture area map handle */
108 drmSize gartTexMapSize; /**< \brief AGP texture area map size */
109 int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
110 int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
111 /*@}*/
112
113 unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
114 } RADEONDRIRec, *RADEONDRIPtr;
115
116 #endif