Tizen 2.0 Release
[profile/ivi/osmesa.git] / src / mesa / drivers / dri / mga / server / mga_dri.h
1
2 /*
3  * Copyright 2000 VA Linux Systems Inc., Fremont, California.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the next
14  * paragraph) shall be included in all copies or substantial portions of the
15  * Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES
21  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23  * OTHER DEALINGS IN THE SOFTWARE.
24  *
25  * Authors:
26  *   Keith Whitwell <keith@tungstengraphics.com>
27  *   Gareth Hughes <gareth@valinux.com>
28  */
29
30 #ifndef __MGA_DRI_H__
31 #define __MGA_DRI_H__
32
33 #include "xf86drm.h"
34 #include "drm.h"
35 #include "mga_drm.h"
36
37 #define MGA_DEFAULT_AGP_SIZE     64
38 #define MGA_DEFAULT_AGP_MODE     4
39 #define MGA_MAX_AGP_MODE         4
40
41 /* Buffer are aligned on 4096 byte boundaries.
42  */
43 #define MGA_BUFFER_ALIGN        0x00000fff
44
45 #ifdef __GNUC__
46 # define DEPRECATED  __attribute__ ((deprecated))
47 #else
48 # define DEPRECATED
49 #endif
50
51 #if 1
52 typedef struct _mgaDrmRegion {
53     drm_handle_t     handle;
54     unsigned int  offset;
55     drmSize       size;
56 } mgaDrmRegion, *mgaDrmRegionPtr;
57 #else
58 #define mgaDrmRegion drmRegion
59 #endif
60
61 typedef struct {
62    int chipset;
63    int width DEPRECATED;
64    int height DEPRECATED;
65    int mem DEPRECATED;
66    int cpp;
67
68    int agpMode;
69
70    unsigned int frontOffset;
71    unsigned int frontPitch;
72
73    unsigned int backOffset;
74    unsigned int backPitch;
75
76    unsigned int depthOffset;
77    unsigned int depthPitch;
78
79    unsigned int textureOffset;
80    unsigned int textureSize;
81    int logTextureGranularity DEPRECATED;
82
83    /* Allow calculation of setup dma addresses.
84     */
85    unsigned int agpBufferOffset DEPRECATED;
86
87    unsigned int agpTextureOffset;
88    unsigned int agpTextureSize;
89    int logAgpTextureGranularity DEPRECATED;
90
91    unsigned int mAccess DEPRECATED;
92
93    /**
94     * \name DRM memory regions.
95     *
96     * \todo
97     * Several of these fields are no longer used (and will never be used
98     * again) on the client-side.  None of them, except \c registers, are used
99     * on the server-side.  At some point when it is safe to do so (probably
100     * for the X.org 6.9 / 7.0 release), these fields should be removed.
101     */
102    /*@{*/
103    mgaDrmRegion registers;            /**< MMIO registers. */
104    mgaDrmRegion status DEPRECATED;    /**< No longer used on the client-side. */
105    mgaDrmRegion primary;              /**< Primary DMA region. */
106    mgaDrmRegion buffers DEPRECATED;   /**< No longer used on the client-side. */
107    /*@}*/
108
109    unsigned int sarea_priv_offset;
110 } MGADRIRec, *MGADRIPtr;
111
112 #endif