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