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