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