Support linear format in i965.
[mesa.git] / src / mesa / drivers / dri / i965 / intel_screen.h
1 /**************************************************************************
2 *
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
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
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef _INTEL_INIT_H_
29 #define _INTEL_INIT_H_
30
31 #include <sys/time.h>
32 #include "dri_util.h"
33 #include "xmlconfig.h"
34 #include "i830_common.h"
35
36 /* XXX: change name or eliminate to avoid conflict with "struct
37 * intel_region"!!!
38 */
39 typedef struct {
40 drm_handle_t handle;
41 drmSize size; /* region size in bytes */
42 char *map; /* memory map */
43 int offset; /* from start of video mem, in bytes */
44 int pitch; /* row stride, in pixels */
45 unsigned int tiled;
46 } intelRegion;
47
48 typedef struct
49 {
50 intelRegion front;
51 intelRegion back;
52 intelRegion rotated;
53 intelRegion depth;
54 intelRegion tex;
55
56 int deviceID;
57 int width;
58 int height;
59 int mem; /* unused */
60
61 int cpp; /* for front and back buffers */
62 int fbFormat;
63
64 int logTextureGranularity;
65
66 __DRIscreenPrivate *driScrnPriv;
67 unsigned int sarea_priv_offset;
68
69 int drmMinor;
70
71 int irq_active;
72 int allow_batchbuffer;
73
74 /* struct matrix23 rotMatrix; */
75
76 int current_rotation; /* 0, 90, 180 or 270 */
77 int rotatedWidth, rotatedHeight;
78
79 /**
80 * Configuration cache with default values for all contexts
81 */
82 driOptionCache optionCache;
83 } intelScreenPrivate;
84
85
86 extern GLboolean
87 intelMapScreenRegions(__DRIscreenPrivate *sPriv);
88
89 extern void
90 intelUnmapScreenRegions(intelScreenPrivate *intelScreen);
91
92 extern void
93 intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
94 volatile drmI830Sarea *sarea);
95
96 extern void
97 intelDestroyContext(__DRIcontextPrivate *driContextPriv);
98
99 extern GLboolean
100 intelUnbindContext(__DRIcontextPrivate *driContextPriv);
101
102 extern GLboolean
103 intelMakeCurrent(__DRIcontextPrivate *driContextPriv,
104 __DRIdrawablePrivate *driDrawPriv,
105 __DRIdrawablePrivate *driReadPriv);
106
107 extern void
108 intelSwapBuffers(__DRIdrawablePrivate *dPriv);
109
110 extern void
111 intelCopySubBuffer( __DRIdrawablePrivate *dPriv,
112 int x, int y, int w, int h );
113
114 #endif