patch to import Jon Smirl's work from Bitkeeper
[mesa.git] / src / glx / mini / sarea.h
1 /**
2 * \file sarea.h
3 * \brief SAREA definitions.
4 *
5 * The SAREA is a memory region is shared by the DRM device, the X server and
6 * the clients.
7 *
8 * This file defines its layout in user space.
9 *
10 * \author Kevin E. Martin <kevin@precisioninsight.com>
11 * \author Jens Owen <jens@tungstengraphics.com>
12 * \author Rickard E. (Rik) Faith <faith@valinux.com>
13 */
14
15 /*
16 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
17 * Copyright 2000 VA Linux Systems, Inc.
18 * All Rights Reserved.
19 *
20 * Permission is hereby granted, free of charge, to any person obtaining a
21 * copy of this software and associated documentation files (the
22 * "Software"), to deal in the Software without restriction, including
23 * without limitation the rights to use, copy, modify, merge, publish,
24 * distribute, sub license, and/or sell copies of the Software, and to
25 * permit persons to whom the Software is furnished to do so, subject to
26 * the following conditions:
27 *
28 * The above copyright notice and this permission notice (including the
29 * next paragraph) shall be included in all copies or substantial portions
30 * of the Software.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
33 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
35 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
36 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 */
40
41 #ifndef _SAREA_H_
42 #define _SAREA_H_
43
44 #include "xf86drm.h"
45
46 /* SAREA area needs to be at least a page */
47 #if defined(__alpha__)
48 #define SAREA_MAX 0x2000
49 #elif defined(__ia64__)
50 #define SAREA_MAX 0x10000 /* 64kB */
51 #else
52 /* Intel 830M driver needs at least 8k SAREA */
53 #define SAREA_MAX 0x2000
54 #endif
55
56 #define SAREA_MAX_DRAWABLES 256
57
58 #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
59
60 /**
61 * \brief SAREA per drawable information.
62 *
63 * \sa _XF86DRISAREA.
64 */
65 typedef struct _XF86DRISAREADrawable {
66 unsigned int stamp;
67 unsigned int flags;
68 } XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
69
70 /**
71 * \brief SAREA frame information.
72 *
73 * \sa _XF86DRISAREA.
74 */
75 typedef struct _XF86DRISAREAFrame {
76 unsigned int x;
77 unsigned int y;
78 unsigned int width;
79 unsigned int height;
80 unsigned int fullscreen;
81 } XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
82
83 /**
84 * \brief SAREA definition.
85 */
86 typedef struct _XF86DRISAREA {
87 /** first thing is always the DRM locking structure */
88 drmLock lock;
89 /** \todo Use readers/writer lock for drawable_lock */
90 drmLock drawable_lock;
91 XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
92 XF86DRISAREAFrameRec frame;
93 drmContext dummy_context;
94 } XF86DRISAREARec, *XF86DRISAREAPtr;
95
96 #endif