xref: /OK3568_Linux_fs/kernel/include/uapi/drm/drm_sarea.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /**
2*4882a593Smuzhiyun  * \file drm_sarea.h
3*4882a593Smuzhiyun  * \brief SAREA definitions
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * \author Michel Dänzer <michel@daenzer.net>
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun /*
9*4882a593Smuzhiyun  * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
10*4882a593Smuzhiyun  * All Rights Reserved.
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
13*4882a593Smuzhiyun  * copy of this software and associated documentation files (the "Software"),
14*4882a593Smuzhiyun  * to deal in the Software without restriction, including without limitation
15*4882a593Smuzhiyun  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16*4882a593Smuzhiyun  * and/or sell copies of the Software, and to permit persons to whom the
17*4882a593Smuzhiyun  * Software is furnished to do so, subject to the following conditions:
18*4882a593Smuzhiyun  *
19*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the next
20*4882a593Smuzhiyun  * paragraph) shall be included in all copies or substantial portions of the
21*4882a593Smuzhiyun  * Software.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
26*4882a593Smuzhiyun  * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27*4882a593Smuzhiyun  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28*4882a593Smuzhiyun  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29*4882a593Smuzhiyun  * OTHER DEALINGS IN THE SOFTWARE.
30*4882a593Smuzhiyun  */
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #ifndef _DRM_SAREA_H_
33*4882a593Smuzhiyun #define _DRM_SAREA_H_
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun #include "drm.h"
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun #if defined(__cplusplus)
38*4882a593Smuzhiyun extern "C" {
39*4882a593Smuzhiyun #endif
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun /* SAREA area needs to be at least a page */
42*4882a593Smuzhiyun #if defined(__alpha__)
43*4882a593Smuzhiyun #define SAREA_MAX                       0x2000U
44*4882a593Smuzhiyun #elif defined(__mips__)
45*4882a593Smuzhiyun #define SAREA_MAX                       0x4000U
46*4882a593Smuzhiyun #elif defined(__ia64__)
47*4882a593Smuzhiyun #define SAREA_MAX                       0x10000U	/* 64kB */
48*4882a593Smuzhiyun #else
49*4882a593Smuzhiyun /* Intel 830M driver needs at least 8k SAREA */
50*4882a593Smuzhiyun #define SAREA_MAX                       0x2000U
51*4882a593Smuzhiyun #endif
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun /** Maximum number of drawables in the SAREA */
54*4882a593Smuzhiyun #define SAREA_MAX_DRAWABLES		256
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun #define SAREA_DRAWABLE_CLAIMED_ENTRY    0x80000000
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun /** SAREA drawable */
59*4882a593Smuzhiyun struct drm_sarea_drawable {
60*4882a593Smuzhiyun 	unsigned int stamp;
61*4882a593Smuzhiyun 	unsigned int flags;
62*4882a593Smuzhiyun };
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun /** SAREA frame */
65*4882a593Smuzhiyun struct drm_sarea_frame {
66*4882a593Smuzhiyun 	unsigned int x;
67*4882a593Smuzhiyun 	unsigned int y;
68*4882a593Smuzhiyun 	unsigned int width;
69*4882a593Smuzhiyun 	unsigned int height;
70*4882a593Smuzhiyun 	unsigned int fullscreen;
71*4882a593Smuzhiyun };
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun /** SAREA */
74*4882a593Smuzhiyun struct drm_sarea {
75*4882a593Smuzhiyun     /** first thing is always the DRM locking structure */
76*4882a593Smuzhiyun 	struct drm_hw_lock lock;
77*4882a593Smuzhiyun     /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
78*4882a593Smuzhiyun 	struct drm_hw_lock drawable_lock;
79*4882a593Smuzhiyun 	struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES];	/**< drawables */
80*4882a593Smuzhiyun 	struct drm_sarea_frame frame;	/**< frame */
81*4882a593Smuzhiyun 	drm_context_t dummy_context;
82*4882a593Smuzhiyun };
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun #ifndef __KERNEL__
85*4882a593Smuzhiyun typedef struct drm_sarea_drawable drm_sarea_drawable_t;
86*4882a593Smuzhiyun typedef struct drm_sarea_frame drm_sarea_frame_t;
87*4882a593Smuzhiyun typedef struct drm_sarea drm_sarea_t;
88*4882a593Smuzhiyun #endif
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun #if defined(__cplusplus)
91*4882a593Smuzhiyun }
92*4882a593Smuzhiyun #endif
93*4882a593Smuzhiyun 
94*4882a593Smuzhiyun #endif				/* _DRM_SAREA_H_ */
95